Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
bc07fa77
Commit
bc07fa77
authored
Apr 21, 2022
by
Melledy
Browse files
Make sure SetEntityClientDataNotify is a valid proto before replaying it to the other players
parent
29f6d77e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerSetEntityClientDataNotify.java
View file @
bc07fa77
...
@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.recv;
...
@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.recv;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.GenshinPacket
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.SetEntityClientDataNotifyOuterClass.SetEntityClientDataNotify
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.game.GameSession
;
...
@@ -16,8 +17,11 @@ public class HandlerSetEntityClientDataNotify extends PacketHandler {
...
@@ -16,8 +17,11 @@ public class HandlerSetEntityClientDataNotify extends PacketHandler {
return
;
return
;
}
}
// Make sure packet is a valid proto before replaying it to the other players
SetEntityClientDataNotify
notif
=
SetEntityClientDataNotify
.
parseFrom
(
payload
);
GenshinPacket
packet
=
new
GenshinPacket
(
PacketOpcodes
.
SetEntityClientDataNotify
,
true
);
GenshinPacket
packet
=
new
GenshinPacket
(
PacketOpcodes
.
SetEntityClientDataNotify
,
true
);
packet
.
setData
(
payload
);
packet
.
setData
(
notif
);
session
.
getPlayer
().
getScene
().
broadcastPacketToOthers
(
session
.
getPlayer
(),
packet
);
session
.
getPlayer
().
getScene
().
broadcastPacketToOthers
(
session
.
getPlayer
(),
packet
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment