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
c67e324a
Commit
c67e324a
authored
Apr 29, 2022
by
LDA
Committed by
memetrollsXD
Apr 29, 2022
Browse files
Fix sitting in chairs
parent
2f39aff4
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/net/packet/PacketOpcodes.java
View file @
c67e324a
...
...
@@ -355,6 +355,8 @@ public class PacketOpcodes {
public
static
final
int
EvtAvatarSitDownNotify
=
392
;
public
static
final
int
EvtAvatarStandUpNotify
=
358
;
public
static
final
int
EvtAvatarUpdateFocusNotify
=
365
;
public
static
final
int
EvtAvatarLockChairReq
=
354
;
public
static
final
int
EvtAvatarLockChairRsp
=
335
;
public
static
final
int
EvtBeingHitNotify
=
360
;
public
static
final
int
EvtBeingHitsCombineNotify
=
381
;
public
static
final
int
EvtBulletDeactiveNotify
=
388
;
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarLockChairReq.java
0 → 100644
View file @
c67e324a
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.EvtAvatarLockChairReqOuterClass.EvtAvatarLockChairReq
;
import
emu.grasscutter.net.proto.PacketHeadOuterClass.PacketHead
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketEvtAvatarLockChairRsp
;
@Opcodes
(
PacketOpcodes
.
EvtAvatarLockChairReq
)
public
class
HandlerEvtAvatarLockChairReq
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
PacketHead
head
=
PacketHead
.
parseFrom
(
header
);
EvtAvatarLockChairReq
lockChairReq
=
EvtAvatarLockChairReq
.
parseFrom
(
payload
);
EntityAvatar
entityAvatar
=
session
.
getPlayer
().
getTeamManager
().
getCurrentAvatarEntity
();
session
.
send
(
new
PacketEvtAvatarLockChairRsp
(
head
.
getClientSequenceId
(),
entityAvatar
,
lockChairReq
));
}
}
src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarSitDownNotify.java
View file @
c67e324a
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.EvtAvatarSitDownNotifyOuterClass.EvtAvatarSitDownNotify
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketEvtAvatarSitDownNotify
;
...
...
@@ -14,7 +14,7 @@ public class HandlerEvtAvatarSitDownNotify extends PacketHandler {
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
EvtAvatarSitDownNotify
notify
=
EvtAvatarSitDownNotify
.
parseFrom
(
payload
);
session
.
send
(
new
PacketEvtAvatarSitDownNotify
(
notify
));
session
.
getPlayer
().
getScene
().
broadcastPacket
(
new
PacketEvtAvatarSitDownNotify
(
notify
));
}
}
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarStandUpNotify.java
0 → 100644
View file @
c67e324a
package
emu.grasscutter.server.packet.recv
;
import
emu.grasscutter.net.packet.Opcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.EvtAvatarStandUpNotifyOuterClass.EvtAvatarStandUpNotify
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketEvtAvatarStandUpNotify
;
@Opcodes
(
PacketOpcodes
.
EvtAvatarStandUpNotify
)
public
class
HandlerEvtAvatarStandUpNotify
extends
PacketHandler
{
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
EvtAvatarStandUpNotify
notify
=
EvtAvatarStandUpNotify
.
parseFrom
(
payload
);
session
.
getPlayer
().
getScene
().
broadcastPacket
(
new
PacketEvtAvatarStandUpNotify
(
notify
));
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarLockChairRsp.java
0 → 100644
View file @
c67e324a
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.game.entity.EntityAvatar
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.EvtAvatarLockChairReqOuterClass.EvtAvatarLockChairReq
;
import
emu.grasscutter.net.proto.EvtAvatarLockChairRspOuterClass.EvtAvatarLockChairRsp
;
import
emu.grasscutter.net.proto.RetcodeOuterClass
;
public
class
PacketEvtAvatarLockChairRsp
extends
BasePacket
{
public
PacketEvtAvatarLockChairRsp
(
int
clientSequence
,
EntityAvatar
entityAvatar
,
EvtAvatarLockChairReq
lockChairReq
)
{
super
(
PacketOpcodes
.
EvtAvatarLockChairRsp
);
EvtAvatarLockChairRsp
p
=
EvtAvatarLockChairRsp
.
newBuilder
()
.
setRetcode
(
RetcodeOuterClass
.
Retcode
.
RET_SUCC_VALUE
)
.
setEntityId
(
entityAvatar
.
getId
())
.
setPosition
(
lockChairReq
.
getPosition
())
.
setChairId
(
lockChairReq
.
getChairId
())
.
build
();
this
.
setData
(
p
);
}
}
src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarStandUpNotify.java
0 → 100644
View file @
c67e324a
package
emu.grasscutter.server.packet.send
;
import
emu.grasscutter.net.packet.BasePacket
;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.proto.EvtAvatarStandUpNotifyOuterClass.EvtAvatarStandUpNotify
;
public
class
PacketEvtAvatarStandUpNotify
extends
BasePacket
{
public
PacketEvtAvatarStandUpNotify
(
EvtAvatarStandUpNotify
notify
)
{
super
(
PacketOpcodes
.
EvtAvatarStandUpNotify
);
EvtAvatarStandUpNotify
proto
=
EvtAvatarStandUpNotify
.
newBuilder
()
.
setEntityId
(
notify
.
getEntityId
())
.
setDirection
(
notify
.
getDirection
())
.
setPerformID
(
notify
.
getPerformID
())
.
setChairId
(
notify
.
getChairId
())
.
build
();
this
.
setData
(
proto
);
}
}
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