mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 21:56:09 +00:00
Implemented sitting
This commit is contained in:
parent
12c6020b71
commit
3ca181e76d
@ -1034,6 +1034,8 @@ public class PacketOpcodes {
|
||||
public static final int ShowTemplateReminderNotify = 3164;
|
||||
public static final int SignInInfoReq = 2510;
|
||||
public static final int SignInInfoRsp = 2515;
|
||||
public static final int SitReq = 354;
|
||||
public static final int SitRsp = 335;
|
||||
public static final int SocialDataNotify = 4063;
|
||||
public static final int SpringUseReq = 1720;
|
||||
public static final int SpringUseRsp = 1727;
|
||||
@ -1208,5 +1210,4 @@ public class PacketOpcodes {
|
||||
public static final int WorldRoutineChangeNotify = 3548;
|
||||
public static final int WorldRoutineTypeCloseNotify = 3513;
|
||||
public static final int WorldRoutineTypeRefreshNotify = 3545;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import emu.grasscutter.net.packet.Opcodes;
|
||||
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;
|
||||
|
||||
@Opcodes(PacketOpcodes.EvtAvatarSitDownNotify)
|
||||
public class HandleEvtAvatarSitDownNotify extends PacketHandler {
|
||||
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||
EvtAvatarSitDownNotify notify = EvtAvatarSitDownNotify.parseFrom(payload);
|
||||
|
||||
session.send(new PacketEvtAvatarSitDownNotify(notify));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
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.SitReqOuterClass;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import emu.grasscutter.server.packet.send.PacketSitRsp;
|
||||
import emu.grasscutter.utils.Position;
|
||||
|
||||
@Opcodes(PacketOpcodes.SitReq)
|
||||
public class HandleSitReq extends PacketHandler {
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||
SitReqOuterClass.SitReq req = SitReqOuterClass.SitReq.parseFrom(payload);
|
||||
|
||||
float x = req.getPosition().getX();
|
||||
float y = req.getPosition().getY();
|
||||
float z = req.getPosition().getZ();
|
||||
|
||||
session.send(new PacketSitRsp(req.getChairId(), new Position(x, y, z), session.getPlayer().getTeamManager().getCurrentAvatarEntity().getId()));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.net.packet.GenshinPacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.EvtAvatarSitDownNotifyOuterClass.EvtAvatarSitDownNotify;
|
||||
|
||||
public class PacketEvtAvatarSitDownNotify extends GenshinPacket {
|
||||
|
||||
public PacketEvtAvatarSitDownNotify(EvtAvatarSitDownNotify notify) {
|
||||
super(PacketOpcodes.EvtAvatarSitDownNotify);
|
||||
|
||||
EvtAvatarSitDownNotify proto = EvtAvatarSitDownNotify.newBuilder()
|
||||
.setEntityId(notify.getEntityId())
|
||||
.setPosition(notify.getPosition())
|
||||
.setChairId(notify.getChairId())
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import emu.grasscutter.net.packet.GenshinPacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.SitRspOuterClass.SitRsp;
|
||||
import emu.grasscutter.utils.Position;
|
||||
|
||||
public class PacketSitRsp extends GenshinPacket {
|
||||
|
||||
public PacketSitRsp(long chairId, Position pos, int EntityId) {
|
||||
super(PacketOpcodes.SitRsp);
|
||||
|
||||
SitRsp proto = SitRsp.newBuilder()
|
||||
.setEntityId(EntityId)
|
||||
.setPosition(pos.toProto())
|
||||
.setChairId(chairId)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user