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
ec3cdc04
Unverified
Commit
ec3cdc04
authored
Oct 12, 2022
by
hamusuke
Committed by
GitHub
Oct 12, 2022
Browse files
fix: Solar Isotoma Elevator doesn't work in multiplayer mode (#1848)
parent
ef55e551
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerUpdateAbilityCreatedMovingPlatformNotify.java
View file @
ec3cdc04
...
...
@@ -4,7 +4,6 @@ import emu.grasscutter.game.entity.platform.EntityPlatform;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.PacketHeadOuterClass
;
import
emu.grasscutter.net.proto.UpdateAbilityCreatedMovingPlatformNotifyOuterClass
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketPlatformStartRouteNotify
;
...
...
@@ -14,7 +13,6 @@ import emu.grasscutter.server.packet.send.PacketPlatformStopRouteNotify;
public
class
HandlerUpdateAbilityCreatedMovingPlatformNotify
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
var
sequence
=
PacketHeadOuterClass
.
PacketHead
.
parseFrom
(
header
).
getClientSequenceId
();
var
notify
=
UpdateAbilityCreatedMovingPlatformNotifyOuterClass
.
UpdateAbilityCreatedMovingPlatformNotify
.
parseFrom
(
payload
);
var
entity
=
session
.
getPlayer
().
getScene
().
getEntityById
(
notify
.
getEntityId
());
...
...
@@ -22,9 +20,11 @@ public class HandlerUpdateAbilityCreatedMovingPlatformNotify extends PacketHandl
return
;
}
var
scene
=
((
EntityPlatform
)
entity
).
getOwner
().
getScene
();
switch
(
notify
.
getOpType
())
{
case
OP_TYPE_ACTIVATE
->
s
ession
.
send
(
new
PacketPlatformStartRouteNotify
(
sequence
,
(
EntityPlatform
)
entity
,
s
ession
.
getPlayer
().
getS
cene
()
));
case
OP_TYPE_DEACTIVATE
->
s
ession
.
send
(
new
PacketPlatformStopRouteNotify
(
sequence
,
(
EntityPlatform
)
entity
,
s
ession
.
getPlayer
().
getS
cene
()
));
case
OP_TYPE_ACTIVATE
->
s
cene
.
broadcastPacket
(
new
PacketPlatformStartRouteNotify
((
EntityPlatform
)
entity
,
scene
));
case
OP_TYPE_DEACTIVATE
->
s
cene
.
broadcastPacket
(
new
PacketPlatformStopRouteNotify
((
EntityPlatform
)
entity
,
scene
));
}
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketPlatformStartRouteNotify.java
View file @
ec3cdc04
...
...
@@ -7,8 +7,8 @@ import emu.grasscutter.net.packet.PacketOpcodes;
import
emu.grasscutter.net.proto.PlatformStartRouteNotifyOuterClass
;
public
class
PacketPlatformStartRouteNotify
extends
BasePacket
{
public
PacketPlatformStartRouteNotify
(
int
clientSequence
,
EntityPlatform
entity
,
Scene
scene
)
{
super
(
PacketOpcodes
.
PlatformStartRouteNotify
,
clientSequence
);
public
PacketPlatformStartRouteNotify
(
EntityPlatform
entity
,
Scene
scene
)
{
super
(
PacketOpcodes
.
PlatformStartRouteNotify
);
var
notify
=
PlatformStartRouteNotifyOuterClass
.
PlatformStartRouteNotify
.
newBuilder
()
.
setEntityId
(
entity
.
getId
())
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlatformStopRouteNotify.java
View file @
ec3cdc04
...
...
@@ -7,8 +7,8 @@ import emu.grasscutter.net.packet.PacketOpcodes;
import
emu.grasscutter.net.proto.PlatformStopRouteNotifyOuterClass
;
public
class
PacketPlatformStopRouteNotify
extends
BasePacket
{
public
PacketPlatformStopRouteNotify
(
int
clientSequence
,
EntityPlatform
entity
,
Scene
scene
)
{
super
(
PacketOpcodes
.
PlatformStopRouteNotify
,
clientSequence
);
public
PacketPlatformStopRouteNotify
(
EntityPlatform
entity
,
Scene
scene
)
{
super
(
PacketOpcodes
.
PlatformStopRouteNotify
);
var
notify
=
PlatformStopRouteNotifyOuterClass
.
PlatformStopRouteNotify
.
newBuilder
()
.
setPlatform
(
entity
.
onStopRoute
())
...
...
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