Commit b9f7c657 authored by Benjamin Elsdon's avatar Benjamin Elsdon
Browse files

Merge remote-tracking branch 'upstream/development' into dev-mail

parents eb495807 782618cd
...@@ -5,6 +5,7 @@ import emu.grasscutter.net.packet.GenshinPacket; ...@@ -5,6 +5,7 @@ import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.GadgetInteractRspOuterClass.GadgetInteractRsp; import emu.grasscutter.net.proto.GadgetInteractRspOuterClass.GadgetInteractRsp;
import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType; import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketGadgetInteractRsp extends GenshinPacket { public class PacketGadgetInteractRsp extends GenshinPacket {
public PacketGadgetInteractRsp(EntityGadget gadget, InteractType interact) { public PacketGadgetInteractRsp(EntityGadget gadget, InteractType interact) {
...@@ -23,7 +24,7 @@ public class PacketGadgetInteractRsp extends GenshinPacket { ...@@ -23,7 +24,7 @@ public class PacketGadgetInteractRsp extends GenshinPacket {
super(PacketOpcodes.GadgetInteractRsp); super(PacketOpcodes.GadgetInteractRsp);
GadgetInteractRsp proto = GadgetInteractRsp.newBuilder() GadgetInteractRsp proto = GadgetInteractRsp.newBuilder()
.setRetcode(1) .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -3,13 +3,14 @@ package emu.grasscutter.server.packet.send; ...@@ -3,13 +3,14 @@ package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.GetAuthkeyRspOuterClass.GetAuthkeyRsp; import emu.grasscutter.net.proto.GetAuthkeyRspOuterClass.GetAuthkeyRsp;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketGetAuthkeyRsp extends GenshinPacket { public class PacketGetAuthkeyRsp extends GenshinPacket {
public PacketGetAuthkeyRsp() { public PacketGetAuthkeyRsp() {
super(PacketOpcodes.GetAuthkeyRsp); super(PacketOpcodes.GetAuthkeyRsp);
GetAuthkeyRsp proto = GetAuthkeyRsp.newBuilder().setRetcode(1).build(); GetAuthkeyRsp proto = GetAuthkeyRsp.newBuilder().setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE).build();
this.setData(proto); this.setData(proto);
} }
......
...@@ -9,6 +9,7 @@ import emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief; ...@@ -9,6 +9,7 @@ import emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief;
import emu.grasscutter.net.proto.FriendOnlineStateOuterClass.FriendOnlineState; import emu.grasscutter.net.proto.FriendOnlineStateOuterClass.FriendOnlineState;
import emu.grasscutter.net.proto.GetPlayerFriendListRspOuterClass.GetPlayerFriendListRsp; import emu.grasscutter.net.proto.GetPlayerFriendListRspOuterClass.GetPlayerFriendListRsp;
import emu.grasscutter.net.proto.HeadImageOuterClass.HeadImage; import emu.grasscutter.net.proto.HeadImageOuterClass.HeadImage;
import emu.grasscutter.net.proto.PlatformTypeOuterClass;
public class PacketGetPlayerFriendListRsp extends GenshinPacket { public class PacketGetPlayerFriendListRsp extends GenshinPacket {
...@@ -19,15 +20,15 @@ public class PacketGetPlayerFriendListRsp extends GenshinPacket { ...@@ -19,15 +20,15 @@ public class PacketGetPlayerFriendListRsp extends GenshinPacket {
.setUid(GenshinConstants.SERVER_CONSOLE_UID) .setUid(GenshinConstants.SERVER_CONSOLE_UID)
.setNickname("Server") .setNickname("Server")
.setLevel(1) .setLevel(1)
.setAvatar(HeadImage.newBuilder().setAvatarId(GenshinConstants.MAIN_CHARACTER_FEMALE)) .setAvatarId(HeadImage.newBuilder().setAvatarId(GenshinConstants.MAIN_CHARACTER_FEMALE).getAvatarId())
.setWorldLevel(0) .setWorldLevel(0)
.setSignature("") .setSignature("")
.setLastActiveTime((int) (System.currentTimeMillis() / 1000f)) .setLastActiveTime((int) (System.currentTimeMillis() / 1000f))
.setNameCardId(210001) .setNameCardId(210001)
.setOnlineState(FriendOnlineState.FRIEND_ONLINE) .setOnlineState(FriendOnlineState.FRIEND_ONLINE)
.setParam(1) .setParam(1)
.setUnk1(1) .setIsGameSource(true)
.setUnk2(3) .setPlatformType(PlatformTypeOuterClass.PlatformType.PC)
.build(); .build();
GetPlayerFriendListRsp.Builder proto = GetPlayerFriendListRsp.newBuilder().addFriendList(serverFriend); GetPlayerFriendListRsp.Builder proto = GetPlayerFriendListRsp.newBuilder().addFriendList(serverFriend);
......
...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send; ...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.GetPlayerSocialDetailRspOuterClass.GetPlayerSocialDetailRsp; import emu.grasscutter.net.proto.GetPlayerSocialDetailRspOuterClass.GetPlayerSocialDetailRsp;
import emu.grasscutter.net.proto.RetcodeOuterClass;
import emu.grasscutter.net.proto.SocialDetailOuterClass.SocialDetail; import emu.grasscutter.net.proto.SocialDetailOuterClass.SocialDetail;
public class PacketGetPlayerSocialDetailRsp extends GenshinPacket { public class PacketGetPlayerSocialDetailRsp extends GenshinPacket {
...@@ -15,7 +16,7 @@ public class PacketGetPlayerSocialDetailRsp extends GenshinPacket { ...@@ -15,7 +16,7 @@ public class PacketGetPlayerSocialDetailRsp extends GenshinPacket {
if (detail != null) { if (detail != null) {
proto.setDetailData(detail); proto.setDetailData(detail);
} else { } else {
proto.setRetcode(1); proto.setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE);
} }
this.setData(proto); this.setData(proto);
......
...@@ -16,18 +16,18 @@ public class PacketGetPlayerTokenRsp extends GenshinPacket { ...@@ -16,18 +16,18 @@ public class PacketGetPlayerTokenRsp extends GenshinPacket {
this.setUseDispatchKey(true); this.setUseDispatchKey(true);
GetPlayerTokenRsp p = GetPlayerTokenRsp.newBuilder() GetPlayerTokenRsp p = GetPlayerTokenRsp.newBuilder()
.setPlayerUid(session.getAccount().getPlayerUid()) .setUid(session.getAccount().getPlayerUid())
.setAccountToken(session.getAccount().getToken()) .setToken(session.getAccount().getToken())
.setAccountType(1) .setAccountType(1)
.setIsProficientPlayer(doesPlayerExist) // Not sure where this goes .setIsProficientPlayer(doesPlayerExist) // Not sure where this goes
.setSecretKey(Crypto.ENCRYPT_SEED) .setSecretKeySeed(Crypto.ENCRYPT_SEED)
.setSecretKeyBuffer(ByteString.copyFrom(Crypto.ENCRYPT_SEED_BUFFER)) .setSecurityCmdBuffer(ByteString.copyFrom(Crypto.ENCRYPT_SEED_BUFFER))
.setPlatformType(3) .setPlatformType(3)
.setChannelId(1) .setChannelId(1)
.setCountryCode("US") .setCountryCode("US")
.setUnk1("c25-314dd05b0b5f") .setClientVersionRandomKey("c25-314dd05b0b5f")
.setUnk3(3) .setRegPlatform(3)
.setClientIp(session.getAddress().getAddress().getHostAddress()) .setClientIpStr(session.getAddress().getAddress().getHostAddress())
.build(); .build();
this.setData(p.toByteArray()); this.setData(p.toByteArray());
......
...@@ -8,7 +8,7 @@ import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass.Player ...@@ -8,7 +8,7 @@ import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass.Player
public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket { public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket {
public PacketPlayerApplyEnterMpResultNotify(GenshinPlayer target, boolean isAgreed, PlayerApplyEnterMpReason reason) { public PacketPlayerApplyEnterMpResultNotify(GenshinPlayer target, boolean isAgreed, PlayerApplyEnterMpResultNotify.Reason reason) {
super(PacketOpcodes.PlayerApplyEnterMpResultNotify); super(PacketOpcodes.PlayerApplyEnterMpResultNotify);
PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder() PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder()
...@@ -21,7 +21,7 @@ public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket { ...@@ -21,7 +21,7 @@ public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket {
this.setData(proto); this.setData(proto);
} }
public PacketPlayerApplyEnterMpResultNotify(int targetId, String targetName, boolean isAgreed, PlayerApplyEnterMpReason reason) { public PacketPlayerApplyEnterMpResultNotify(int targetId, String targetName, boolean isAgreed, PlayerApplyEnterMpResultNotify.Reason reason) {
super(PacketOpcodes.PlayerApplyEnterMpResultNotify); super(PacketOpcodes.PlayerApplyEnterMpResultNotify);
PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder() PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder()
......
...@@ -43,7 +43,7 @@ public class PacketPlayerChatNotify extends GenshinPacket { ...@@ -43,7 +43,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
this.setData(proto); this.setData(proto);
} }
public PacketPlayerChatNotify(GenshinPlayer sender, int channelId, SystemHint systemHint) { public PacketPlayerChatNotify(GenshinPlayer sender, int channelId, ChatInfo.SystemHint systemHint) {
super(PacketOpcodes.PlayerChatNotify); super(PacketOpcodes.PlayerChatNotify);
ChatInfo info = ChatInfo.newBuilder() ChatInfo info = ChatInfo.newBuilder()
......
...@@ -13,7 +13,7 @@ public class PacketPlayerDataNotify extends GenshinPacket { ...@@ -13,7 +13,7 @@ public class PacketPlayerDataNotify extends GenshinPacket {
PlayerDataNotify.Builder p = PlayerDataNotify.newBuilder() PlayerDataNotify.Builder p = PlayerDataNotify.newBuilder()
.setNickName(player.getNickname()) .setNickName(player.getNickname())
.setClientTime(System.currentTimeMillis()) .setServerTime(System.currentTimeMillis())
.setIsFirstLoginToday(true) .setIsFirstLoginToday(true)
.setRegionId(player.getRegionId()); .setRegionId(player.getRegionId());
......
...@@ -5,6 +5,7 @@ import emu.grasscutter.game.entity.EntityAvatar; ...@@ -5,6 +5,7 @@ import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.game.inventory.GenshinItem; import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AbilityControlBlockOuterClass;
import emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo; import emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo;
import emu.grasscutter.net.proto.AvatarEnterSceneInfoOuterClass.AvatarEnterSceneInfo; import emu.grasscutter.net.proto.AvatarEnterSceneInfoOuterClass.AvatarEnterSceneInfo;
import emu.grasscutter.net.proto.MPLevelEntityInfoOuterClass.MPLevelEntityInfo; import emu.grasscutter.net.proto.MPLevelEntityInfoOuterClass.MPLevelEntityInfo;
...@@ -26,7 +27,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket { ...@@ -26,7 +27,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket {
TeamEnterSceneInfo.newBuilder() TeamEnterSceneInfo.newBuilder()
.setTeamEntityId(player.getTeamManager().getEntityId()) // 150995833 .setTeamEntityId(player.getTeamManager().getEntityId()) // 150995833
.setTeamAbilityInfo(empty) .setTeamAbilityInfo(empty)
.setUnk(empty) .setAbilityControlBlock(AbilityControlBlockOuterClass.AbilityControlBlock.newBuilder().build())
); );
proto.setMpLevelEntityInfo( proto.setMpLevelEntityInfo(
MPLevelEntityInfo.newBuilder() MPLevelEntityInfo.newBuilder()
......
...@@ -23,14 +23,14 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket { ...@@ -23,14 +23,14 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.setSceneId(player.getSceneId()) .setSceneId(player.getSceneId())
.setPos(player.getPos().toProto()) .setPos(player.getPos().toProto())
.setSceneBeginTime(System.currentTimeMillis()) .setSceneBeginTime(System.currentTimeMillis())
.setType(EnterType.EnterSelf) .setType(EnterType.ENTER_SELF)
.setTargetUid(player.getUid()) .setTargetUid(player.getUid())
.setEnterSceneToken(player.getEnterSceneToken()) .setEnterSceneToken(player.getEnterSceneToken())
.setWorldLevel(player.getWorldLevel()) .setWorldLevel(player.getWorldLevel())
.setEnterReason(EnterReason.Login.getValue()) .setEnterReason(EnterReason.Login.getValue())
.setIsFirstLoginEnterScene(player.isFirstLoginEnterScene()) .setIsFirstLoginEnterScene(player.isFirstLoginEnterScene())
.setUnk1(1) .setWorldType(1)
.setUnk2("3-" + player.getUid() + "-" + (int) (System.currentTimeMillis() / 1000) + "-" + 18402) .setSceneTransaction("3-" + player.getUid() + "-" + (int) (System.currentTimeMillis() / 1000) + "-" + 18402)
.build(); .build();
this.setData(proto); this.setData(proto);
...@@ -62,8 +62,8 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket { ...@@ -62,8 +62,8 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
.addSceneTagIdList(109) .addSceneTagIdList(109)
.addSceneTagIdList(113) .addSceneTagIdList(113)
.addSceneTagIdList(117) .addSceneTagIdList(117)
.setUnk1(1) .setWorldType(1)
.setUnk2(newScene + "-" + target.getUid() + "-" + (int) (System.currentTimeMillis() / 1000) + "-" + 18402) .setSceneTransaction(newScene + "-" + target.getUid() + "-" + (int) (System.currentTimeMillis() / 1000) + "-" + 18402)
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -40,8 +40,8 @@ public class PacketPlayerLoginRsp extends GenshinPacket { ...@@ -40,8 +40,8 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp regionQuery = QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp.parseFrom(decodedCurRegion); QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp regionQuery = QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp.parseFrom(decodedCurRegion);
RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder() RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder()
.setIp((Grasscutter.getConfig().getGameServerOptions().PublicIp.isEmpty() ? Grasscutter.getConfig().getGameServerOptions().Ip : Grasscutter.getConfig().getGameServerOptions().PublicIp)) .setGateserverIp((Grasscutter.getConfig().getGameServerOptions().PublicIp.isEmpty() ? Grasscutter.getConfig().getGameServerOptions().Ip : Grasscutter.getConfig().getGameServerOptions().PublicIp))
.setPort(Grasscutter.getConfig().getGameServerOptions().PublicPort != 0 ? Grasscutter.getConfig().getGameServerOptions().PublicPort : Grasscutter.getConfig().getGameServerOptions().Port) .setGateserverPort(Grasscutter.getConfig().getGameServerOptions().PublicPort != 0 ? Grasscutter.getConfig().getGameServerOptions().PublicPort : Grasscutter.getConfig().getGameServerOptions().Port)
.setSecretKey(ByteString.copyFrom(FileUtils.read(Grasscutter.getConfig().KEY_FOLDER + "dispatchSeed.bin"))) .setSecretKey(ByteString.copyFrom(FileUtils.read(Grasscutter.getConfig().KEY_FOLDER + "dispatchSeed.bin")))
.build(); .build();
...@@ -64,7 +64,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket { ...@@ -64,7 +64,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
.setClientSilenceDataVersion(info.getClientSilenceDataVersion()) .setClientSilenceDataVersion(info.getClientSilenceDataVersion())
.setClientMd5(info.getClientDataMd5()) .setClientMd5(info.getClientDataMd5())
.setClientSilenceMd5(info.getClientSilenceDataMd5()) .setClientSilenceMd5(info.getClientSilenceDataMd5())
.setResVersionConfig(info.getConfig()) .setResVersionConfig(info.getResVersionConfig())
.setClientVersionSuffix(info.getClientVersionSuffix()) .setClientVersionSuffix(info.getClientVersionSuffix())
.setClientSilenceVersionSuffix(info.getClientSilenceVersionSuffix()) .setClientSilenceVersionSuffix(info.getClientSilenceVersionSuffix())
.setIsScOpen(false) .setIsScOpen(false)
......
...@@ -18,7 +18,7 @@ public class PacketPlayerStoreNotify extends GenshinPacket { ...@@ -18,7 +18,7 @@ public class PacketPlayerStoreNotify extends GenshinPacket {
this.buildHeader(2); this.buildHeader(2);
PlayerStoreNotify.Builder p = PlayerStoreNotify.newBuilder() PlayerStoreNotify.Builder p = PlayerStoreNotify.newBuilder()
.setStoreType(StoreType.StorePack) .setStoreType(StoreType.STORE_PACK)
.setWeightLimit(Grasscutter.getConfig().getGameServerOptions().InventoryLimitAll); .setWeightLimit(Grasscutter.getConfig().getGameServerOptions().InventoryLimitAll);
for (GenshinItem item : player.getInventory()) { for (GenshinItem item : player.getInventory()) {
......
...@@ -15,7 +15,7 @@ public class PacketSceneEntityAppearNotify extends GenshinPacket { ...@@ -15,7 +15,7 @@ public class PacketSceneEntityAppearNotify extends GenshinPacket {
super(PacketOpcodes.SceneEntityAppearNotify, true); super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder() SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
.setAppearType(VisionType.VisionBorn) .setAppearType(VisionType.VISION_BORN)
.addEntityList(entity.toProto()); .addEntityList(entity.toProto());
this.setData(proto.build()); this.setData(proto.build());
......
...@@ -2,6 +2,7 @@ package emu.grasscutter.server.packet.send; ...@@ -2,6 +2,7 @@ package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.RetcodeOuterClass;
import emu.grasscutter.net.proto.SceneKickPlayerRspOuterClass.SceneKickPlayerRsp; import emu.grasscutter.net.proto.SceneKickPlayerRspOuterClass.SceneKickPlayerRsp;
public class PacketSceneKickPlayerRsp extends GenshinPacket { public class PacketSceneKickPlayerRsp extends GenshinPacket {
...@@ -20,7 +21,7 @@ public class PacketSceneKickPlayerRsp extends GenshinPacket { ...@@ -20,7 +21,7 @@ public class PacketSceneKickPlayerRsp extends GenshinPacket {
super(PacketOpcodes.SceneKickPlayerRsp); super(PacketOpcodes.SceneKickPlayerRsp);
SceneKickPlayerRsp proto = SceneKickPlayerRsp.newBuilder() SceneKickPlayerRsp proto = SceneKickPlayerRsp.newBuilder()
.setRetcode(1) .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -19,7 +19,7 @@ public class PacketSceneTeamUpdateNotify extends GenshinPacket { ...@@ -19,7 +19,7 @@ public class PacketSceneTeamUpdateNotify extends GenshinPacket {
for (GenshinPlayer p : player.getWorld().getPlayers()) { for (GenshinPlayer p : player.getWorld().getPlayers()) {
for (EntityAvatar entityAvatar : p.getTeamManager().getActiveTeam()) { for (EntityAvatar entityAvatar : p.getTeamManager().getActiveTeam()) {
SceneTeamAvatar.Builder avatarProto = SceneTeamAvatar.newBuilder() SceneTeamAvatar.Builder avatarProto = SceneTeamAvatar.newBuilder()
.setPlayerId(p.getUid()) .setPlayerUid(p.getUid())
.setAvatarGuid(entityAvatar.getAvatar().getGuid()) .setAvatarGuid(entityAvatar.getAvatar().getGuid())
.setSceneId(p.getSceneId()) .setSceneId(p.getSceneId())
.setEntityId(entityAvatar.getId()) .setEntityId(entityAvatar.getId())
......
...@@ -5,6 +5,7 @@ import emu.grasscutter.data.custom.ScenePointEntry; ...@@ -5,6 +5,7 @@ import emu.grasscutter.data.custom.ScenePointEntry;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.RetcodeOuterClass;
import emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp; import emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp;
import emu.grasscutter.utils.Position; import emu.grasscutter.utils.Position;
...@@ -26,7 +27,7 @@ public class PacketSceneTransToPointRsp extends GenshinPacket { ...@@ -26,7 +27,7 @@ public class PacketSceneTransToPointRsp extends GenshinPacket {
super(PacketOpcodes.SceneTransToPointRsp); super(PacketOpcodes.SceneTransToPointRsp);
SceneTransToPointRsp proto = SceneTransToPointRsp.newBuilder() SceneTransToPointRsp proto = SceneTransToPointRsp.newBuilder()
.setRetcode(1) // Internal server error .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE) // Internal server error
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -4,6 +4,7 @@ import emu.grasscutter.game.GenshinPlayer; ...@@ -4,6 +4,7 @@ import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SetPlayerBirthdayRspOuterClass.SetPlayerBirthdayRsp; import emu.grasscutter.net.proto.SetPlayerBirthdayRspOuterClass.SetPlayerBirthdayRsp;
import emu.grasscutter.net.proto.SetPlayerBornDataReqOuterClass;
public class PacketSetPlayerBirthdayRsp extends GenshinPacket { public class PacketSetPlayerBirthdayRsp extends GenshinPacket {
......
...@@ -12,7 +12,7 @@ public class PacketSetPlayerHeadImageRsp extends GenshinPacket { ...@@ -12,7 +12,7 @@ public class PacketSetPlayerHeadImageRsp extends GenshinPacket {
super(PacketOpcodes.SetPlayerHeadImageRsp); super(PacketOpcodes.SetPlayerHeadImageRsp);
SetPlayerHeadImageRsp proto = SetPlayerHeadImageRsp.newBuilder() SetPlayerHeadImageRsp proto = SetPlayerHeadImageRsp.newBuilder()
.setAvatar(HeadImage.newBuilder().setAvatarId(player.getHeadImage())) .setAvatarId(HeadImage.newBuilder().setAvatarId(player.getHeadImage()).getAvatarId())
.build(); .build();
this.setData(proto); this.setData(proto);
......
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);
}
}
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