Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grasscutter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ziqian zhang
Grasscutter
Commits
3ede7523
Commit
3ede7523
authored
3 years ago
by
4Benj_
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Stop WindSeedClientNotify and PlayerLuaShellNotify from being sent (#582)
parent
2e685785
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/emu/grasscutter/net/packet/PacketOpcodes.java
+5
-0
5 additions, 0 deletions
src/main/java/emu/grasscutter/net/packet/PacketOpcodes.java
src/main/java/emu/grasscutter/server/game/GameSession.java
+6
-0
6 additions, 0 deletions
src/main/java/emu/grasscutter/server/game/GameSession.java
with
11 additions
and
0 deletions
src/main/java/emu/grasscutter/net/packet/PacketOpcodes.java
+
5
−
0
View file @
3ede7523
package
emu.grasscutter.net.packet
;
import
java.util.Arrays
;
import
java.util.List
;
public
class
PacketOpcodes
{
// Empty
public
static
final
int
NONE
=
0
;
...
...
@@ -1566,4 +1569,6 @@ public class PacketOpcodes {
public
static
final
int
UNKNOWN_43
=
8877
;
public
static
final
int
UNKNOWN_44
=
8983
;
public
static
final
int
UNKNOWN_45
=
943
;
public
static
final
List
<
Integer
>
BANNED_PACKETS
=
Arrays
.
asList
(
PacketOpcodes
.
WindSeedClientNotify
,
PacketOpcodes
.
PlayerLuaShellNotify
);
}
This diff is collapsed.
Click to expand it.
src/main/java/emu/grasscutter/server/game/GameSession.java
+
6
−
0
View file @
3ede7523
...
...
@@ -157,6 +157,12 @@ public class GameSession extends KcpChannel {
Grasscutter
.
getLogger
().
warn
(
"Tried to send packet with missing cmd id!"
);
return
;
}
// DO NOT REMOVE (unless we find a way to validate code before sending to client which I don't think we can)
// Stop WindSeedClientNotify from being sent for security purposes.
if
(
PacketOpcodes
.
BANNED_PACKETS
.
contains
(
packet
.
getOpcode
()))
{
return
;
}
// Header
if
(
packet
.
shouldBuildHeader
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment