Commit 3ede7523 authored by 4Benj_'s avatar 4Benj_ Committed by GitHub
Browse files

Stop WindSeedClientNotify and PlayerLuaShellNotify from being sent (#582)

parent 2e685785
package emu.grasscutter.net.packet; package emu.grasscutter.net.packet;
import java.util.Arrays;
import java.util.List;
public class PacketOpcodes { public class PacketOpcodes {
// Empty // Empty
public static final int NONE = 0; public static final int NONE = 0;
...@@ -1566,4 +1569,6 @@ public class PacketOpcodes { ...@@ -1566,4 +1569,6 @@ public class PacketOpcodes {
public static final int UNKNOWN_43 = 8877; public static final int UNKNOWN_43 = 8877;
public static final int UNKNOWN_44 = 8983; public static final int UNKNOWN_44 = 8983;
public static final int UNKNOWN_45 = 943; public static final int UNKNOWN_45 = 943;
public static final List<Integer> BANNED_PACKETS = Arrays.asList(PacketOpcodes.WindSeedClientNotify, PacketOpcodes.PlayerLuaShellNotify);
} }
...@@ -157,6 +157,12 @@ public class GameSession extends KcpChannel { ...@@ -157,6 +157,12 @@ public class GameSession extends KcpChannel {
Grasscutter.getLogger().warn("Tried to send packet with missing cmd id!"); Grasscutter.getLogger().warn("Tried to send packet with missing cmd id!");
return; 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 // Header
if (packet.shouldBuildHeader()) { if (packet.shouldBuildHeader()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment