Commit fa9d703d authored by BaiSugar's avatar BaiSugar Committed by GitHub
Browse files

Merge branch 'Grasscutters:development' into development

parents 6a5d97a3 d1fc8c1f
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.World; import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.GetWorldMpInfoRspOuterClass.GetWorldMpInfoRsp; import emu.grasscutter.net.proto.GetWorldMpInfoRspOuterClass.GetWorldMpInfoRsp;
public class PacketGetWorldMpInfoRsp extends GenshinPacket { public class PacketGetWorldMpInfoRsp extends BasePacket {
public PacketGetWorldMpInfoRsp(World world) { public PacketGetWorldMpInfoRsp(World world) {
super(PacketOpcodes.GetWorldMpInfoRsp); super(PacketOpcodes.GetWorldMpInfoRsp);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.H5ActivityIdsNotifyOuterClass.H5ActivityIdsNotify; import emu.grasscutter.net.proto.H5ActivityIdsNotifyOuterClass.H5ActivityIdsNotify;
public class PacketH5ActivityIdsNotify extends GenshinPacket { public class PacketH5ActivityIdsNotify extends BasePacket {
public PacketH5ActivityIdsNotify() { public PacketH5ActivityIdsNotify() {
super(PacketOpcodes.H5ActivityIdsNotify); super(PacketOpcodes.H5ActivityIdsNotify);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.World; import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.HostPlayerNotifyOuterClass.HostPlayerNotify; import emu.grasscutter.net.proto.HostPlayerNotifyOuterClass.HostPlayerNotify;
public class PacketHostPlayerNotify extends GenshinPacket { public class PacketHostPlayerNotify extends BasePacket {
public PacketHostPlayerNotify(World world) { public PacketHostPlayerNotify(World world) {
super(PacketOpcodes.HostPlayerNotify); super(PacketOpcodes.HostPlayerNotify);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import java.util.Collection;
import java.util.List; import java.util.List;
import emu.grasscutter.game.inventory.GenshinItem; import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.props.ActionReason; import emu.grasscutter.game.props.ActionReason;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ItemAddHintNotifyOuterClass.ItemAddHintNotify; import emu.grasscutter.net.proto.ItemAddHintNotifyOuterClass.ItemAddHintNotify;
public class PacketItemAddHintNotify extends GenshinPacket { public class PacketItemAddHintNotify extends BasePacket {
public PacketItemAddHintNotify(GenshinItem item, ActionReason reason) { public PacketItemAddHintNotify(GameItem item, ActionReason reason) {
super(PacketOpcodes.ItemAddHintNotify); super(PacketOpcodes.ItemAddHintNotify);
ItemAddHintNotify proto = ItemAddHintNotify.newBuilder() ItemAddHintNotify proto = ItemAddHintNotify.newBuilder()
...@@ -21,13 +22,13 @@ public class PacketItemAddHintNotify extends GenshinPacket { ...@@ -21,13 +22,13 @@ public class PacketItemAddHintNotify extends GenshinPacket {
this.setData(proto); this.setData(proto);
} }
public PacketItemAddHintNotify(List<GenshinItem> items, ActionReason reason) { public PacketItemAddHintNotify(Collection<GameItem> items, ActionReason reason) {
super(PacketOpcodes.ItemAddHintNotify); super(PacketOpcodes.ItemAddHintNotify);
ItemAddHintNotify.Builder proto = ItemAddHintNotify.newBuilder() ItemAddHintNotify.Builder proto = ItemAddHintNotify.newBuilder()
.setReason(reason.getValue()); .setReason(reason.getValue());
for (GenshinItem item : items) { for (GameItem item : items) {
proto.addItemList(item.toItemHintProto()); proto.addItemList(item.toItemHintProto());
} }
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.entity.GenshinEntity; import emu.grasscutter.game.entity.GameEntity;
import emu.grasscutter.game.props.LifeState; import emu.grasscutter.game.props.LifeState;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.LifeStateChangeNotifyOuterClass.LifeStateChangeNotify; import emu.grasscutter.net.proto.LifeStateChangeNotifyOuterClass.LifeStateChangeNotify;
public class PacketLifeStateChangeNotify extends GenshinPacket { public class PacketLifeStateChangeNotify extends BasePacket {
public PacketLifeStateChangeNotify(GenshinEntity attacker, GenshinEntity target, LifeState lifeState) { public PacketLifeStateChangeNotify(GameEntity attacker, GameEntity target, LifeState lifeState) {
super(PacketOpcodes.LifeStateChangeNotify); super(PacketOpcodes.LifeStateChangeNotify);
LifeStateChangeNotify proto = LifeStateChangeNotify.newBuilder() LifeStateChangeNotify proto = LifeStateChangeNotify.newBuilder()
...@@ -18,7 +18,7 @@ public class PacketLifeStateChangeNotify extends GenshinPacket { ...@@ -18,7 +18,7 @@ public class PacketLifeStateChangeNotify extends GenshinPacket {
this.setData(proto); this.setData(proto);
} }
public PacketLifeStateChangeNotify(int attackerId, GenshinEntity target, LifeState lifeState) { public PacketLifeStateChangeNotify(int attackerId, GameEntity target, LifeState lifeState) {
super(PacketOpcodes.LifeStateChangeNotify); super(PacketOpcodes.LifeStateChangeNotify);
LifeStateChangeNotify proto = LifeStateChangeNotify.newBuilder() LifeStateChangeNotify proto = LifeStateChangeNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.mail.Mail;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.*;
import java.util.ArrayList;
import java.util.List;
public class PacketMailChangeNotify extends BasePacket {
public PacketMailChangeNotify(Player player, Mail message) {
this (player, new ArrayList<Mail>(){{add(message);}});
}
public PacketMailChangeNotify(Player player, List<Mail> mailList) {
this(player, mailList, null);
}
public PacketMailChangeNotify(Player player, List<Mail> mailList, List<Integer> delMailIdList) {
super(PacketOpcodes.MailChangeNotify);
MailChangeNotifyOuterClass.MailChangeNotify.Builder proto = MailChangeNotifyOuterClass.MailChangeNotify.newBuilder();
if (mailList != null) {
for (Mail message : mailList) {
MailTextContentOuterClass.MailTextContent.Builder mailTextContent = MailTextContentOuterClass.MailTextContent.newBuilder();
mailTextContent.setTitle(message.mailContent.title);
mailTextContent.setContent(message.mailContent.content);
mailTextContent.setSender(message.mailContent.sender);
List<MailItemOuterClass.MailItem> mailItems = new ArrayList<MailItemOuterClass.MailItem>();
for (Mail.MailItem item : message.itemList) {
MailItemOuterClass.MailItem.Builder mailItem = MailItemOuterClass.MailItem.newBuilder();
ItemParamOuterClass.ItemParam.Builder itemParam = ItemParamOuterClass.ItemParam.newBuilder();
itemParam.setItemId(item.itemId);
itemParam.setCount(item.itemCount);
mailItem.setItemParam(itemParam.build());
mailItems.add(mailItem.build());
}
MailDataOuterClass.MailData.Builder mailData = MailDataOuterClass.MailData.newBuilder();
mailData.setMailId(player.getMailId(message));
mailData.setMailTextContent(mailTextContent.build());
mailData.addAllItemList(mailItems);
mailData.setSendTime((int) message.sendTime);
mailData.setExpireTime((int) message.expireTime);
mailData.setImportance(message.importance);
mailData.setIsRead(message.isRead);
mailData.setIsAttachmentGot(message.isAttachmentGot);
mailData.setStateValue(message.stateValue);
proto.addMailList(mailData.build());
}
}
if(delMailIdList != null) {
proto.addAllDelMailIdList(delMailIdList);
}
this.setData(proto.build());
}
}
\ No newline at end of file
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.NpcTalkRspOuterClass.NpcTalkRsp; import emu.grasscutter.net.proto.NpcTalkRspOuterClass.NpcTalkRsp;
public class PacketNpcTalkRsp extends GenshinPacket { public class PacketNpcTalkRsp extends BasePacket {
public PacketNpcTalkRsp(int npcEntityId, int curTalkId, int entityId) { public PacketNpcTalkRsp(int npcEntityId, int curTalkId, int entityId) {
super(PacketOpcodes.NpcTalkRsp); super(PacketOpcodes.NpcTalkRsp);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.props.OpenState; import emu.grasscutter.game.props.OpenState;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.OpenStateUpdateNotifyOuterClass.OpenStateUpdateNotify; import emu.grasscutter.net.proto.OpenStateUpdateNotifyOuterClass.OpenStateUpdateNotify;
public class PacketOpenStateUpdateNotify extends GenshinPacket { public class PacketOpenStateUpdateNotify extends BasePacket {
public PacketOpenStateUpdateNotify() { public PacketOpenStateUpdateNotify() {
super(PacketOpcodes.OpenStateUpdateNotify); super(PacketOpcodes.OpenStateUpdateNotify);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
public class PacketPathfindingEnterSceneRsp extends GenshinPacket { public class PacketPathfindingEnterSceneRsp extends BasePacket {
public PacketPathfindingEnterSceneRsp(int clientSequence) { public PacketPathfindingEnterSceneRsp(int clientSequence) {
super(PacketOpcodes.PathfindingEnterSceneRsp); super(PacketOpcodes.PathfindingEnterSceneRsp);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PingRspOuterClass.PingRsp; import emu.grasscutter.net.proto.PingRspOuterClass.PingRsp;
public class PacketPingRsp extends GenshinPacket { public class PacketPingRsp extends BasePacket {
public PacketPingRsp(int clientSeq, int time) { public PacketPingRsp(int clientSeq, int time) {
super(PacketOpcodes.PingRsp, clientSeq); super(PacketOpcodes.PingRsp, clientSeq);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerApplyEnterMpNotifyOuterClass.PlayerApplyEnterMpNotify; import emu.grasscutter.net.proto.PlayerApplyEnterMpNotifyOuterClass.PlayerApplyEnterMpNotify;
public class PacketPlayerApplyEnterMpNotify extends GenshinPacket { public class PacketPlayerApplyEnterMpNotify extends BasePacket {
public PacketPlayerApplyEnterMpNotify(GenshinPlayer srcPlayer) { public PacketPlayerApplyEnterMpNotify(Player srcPlayer) {
super(PacketOpcodes.PlayerApplyEnterMpNotify); super(PacketOpcodes.PlayerApplyEnterMpNotify);
PlayerApplyEnterMpNotify proto = PlayerApplyEnterMpNotify.newBuilder() PlayerApplyEnterMpNotify proto = PlayerApplyEnterMpNotify.newBuilder()
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerApplyEnterMpReasonOuterClass.PlayerApplyEnterMpReason; import emu.grasscutter.net.proto.PlayerApplyEnterMpReasonOuterClass.PlayerApplyEnterMpReason;
import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass;
import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify; import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify;
public class PacketPlayerApplyEnterMpResultNotify extends GenshinPacket { public class PacketPlayerApplyEnterMpResultNotify extends BasePacket {
public PacketPlayerApplyEnterMpResultNotify(GenshinPlayer target, boolean isAgreed, PlayerApplyEnterMpResultNotify.Reason reason) { public PacketPlayerApplyEnterMpResultNotify(Player target, boolean isAgreed, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason reason) {
super(PacketOpcodes.PlayerApplyEnterMpResultNotify); super(PacketOpcodes.PlayerApplyEnterMpResultNotify);
PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder() PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder()
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerApplyEnterMpResultRspOuterClass.PlayerApplyEnterMpResultRsp; import emu.grasscutter.net.proto.PlayerApplyEnterMpResultRspOuterClass.PlayerApplyEnterMpResultRsp;
public class PacketPlayerApplyEnterMpResultRsp extends GenshinPacket { public class PacketPlayerApplyEnterMpResultRsp extends BasePacket {
public PacketPlayerApplyEnterMpResultRsp(int applyUid, boolean isAgreed) { public PacketPlayerApplyEnterMpResultRsp(int applyUid, boolean isAgreed) {
super(PacketOpcodes.PlayerApplyEnterMpResultRsp); super(PacketOpcodes.PlayerApplyEnterMpResultRsp);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerApplyEnterMpRspOuterClass.PlayerApplyEnterMpRsp; import emu.grasscutter.net.proto.PlayerApplyEnterMpRspOuterClass.PlayerApplyEnterMpRsp;
public class PacketPlayerApplyEnterMpRsp extends GenshinPacket { public class PacketPlayerApplyEnterMpRsp extends BasePacket {
public PacketPlayerApplyEnterMpRsp(int targetUid) { public PacketPlayerApplyEnterMpRsp(int targetUid) {
super(PacketOpcodes.PlayerApplyEnterMpRsp); super(PacketOpcodes.PlayerApplyEnterMpRsp);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo; import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo;
import emu.grasscutter.net.proto.PlayerChatNotifyOuterClass.PlayerChatNotify; import emu.grasscutter.net.proto.PlayerChatNotifyOuterClass.PlayerChatNotify;
import emu.grasscutter.net.proto.SystemHintOuterClass.SystemHint; import emu.grasscutter.net.proto.SystemHintOuterClass.SystemHint;
public class PacketPlayerChatNotify extends GenshinPacket { public class PacketPlayerChatNotify extends BasePacket {
public PacketPlayerChatNotify(GenshinPlayer sender, int channelId, String message) { public PacketPlayerChatNotify(Player sender, int channelId, String message) {
super(PacketOpcodes.PlayerChatNotify); super(PacketOpcodes.PlayerChatNotify);
ChatInfo info = ChatInfo.newBuilder() ChatInfo info = ChatInfo.newBuilder()
...@@ -26,7 +26,7 @@ public class PacketPlayerChatNotify extends GenshinPacket { ...@@ -26,7 +26,7 @@ public class PacketPlayerChatNotify extends GenshinPacket {
this.setData(proto); this.setData(proto);
} }
public PacketPlayerChatNotify(GenshinPlayer sender, int channelId, int emote) { public PacketPlayerChatNotify(Player sender, int channelId, int emote) {
super(PacketOpcodes.PlayerChatNotify); super(PacketOpcodes.PlayerChatNotify);
ChatInfo info = ChatInfo.newBuilder() ChatInfo info = ChatInfo.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, ChatInfo.SystemHint systemHint) { public PacketPlayerChatNotify(Player sender, int channelId, ChatInfo.SystemHint systemHint) {
super(PacketOpcodes.PlayerChatNotify); super(PacketOpcodes.PlayerChatNotify);
ChatInfo info = ChatInfo.newBuilder() ChatInfo info = ChatInfo.newBuilder()
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerChatRspOuterClass.PlayerChatRsp; import emu.grasscutter.net.proto.PlayerChatRspOuterClass.PlayerChatRsp;
public class PacketPlayerChatRsp extends GenshinPacket { public class PacketPlayerChatRsp extends BasePacket {
public PacketPlayerChatRsp() { public PacketPlayerChatRsp() {
super(PacketOpcodes.PlayerChatRsp); super(PacketOpcodes.PlayerChatRsp);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerDataNotifyOuterClass.PlayerDataNotify; import emu.grasscutter.net.proto.PlayerDataNotifyOuterClass.PlayerDataNotify;
import emu.grasscutter.net.proto.PropValueOuterClass.PropValue; import emu.grasscutter.net.proto.PropValueOuterClass.PropValue;
public class PacketPlayerDataNotify extends GenshinPacket { public class PacketPlayerDataNotify extends BasePacket {
public PacketPlayerDataNotify(GenshinPlayer player) { public PacketPlayerDataNotify(Player player) {
super(PacketOpcodes.PlayerDataNotify, 2); super(PacketOpcodes.PlayerDataNotify, 2);
PlayerDataNotify.Builder p = PlayerDataNotify.newBuilder() PlayerDataNotify.Builder p = PlayerDataNotify.newBuilder()
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.game.inventory.GenshinItem; import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AbilityControlBlockOuterClass; import emu.grasscutter.net.proto.AbilityControlBlockOuterClass;
import emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo; import emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo;
...@@ -12,9 +12,9 @@ import emu.grasscutter.net.proto.MPLevelEntityInfoOuterClass.MPLevelEntityInfo; ...@@ -12,9 +12,9 @@ import emu.grasscutter.net.proto.MPLevelEntityInfoOuterClass.MPLevelEntityInfo;
import emu.grasscutter.net.proto.PlayerEnterSceneInfoNotifyOuterClass.PlayerEnterSceneInfoNotify; import emu.grasscutter.net.proto.PlayerEnterSceneInfoNotifyOuterClass.PlayerEnterSceneInfoNotify;
import emu.grasscutter.net.proto.TeamEnterSceneInfoOuterClass.TeamEnterSceneInfo; import emu.grasscutter.net.proto.TeamEnterSceneInfoOuterClass.TeamEnterSceneInfo;
public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket { public class PacketPlayerEnterSceneInfoNotify extends BasePacket {
public PacketPlayerEnterSceneInfoNotify(GenshinPlayer player) { public PacketPlayerEnterSceneInfoNotify(Player player) {
super(PacketOpcodes.PlayerEnterSceneInfoNotify); super(PacketOpcodes.PlayerEnterSceneInfoNotify);
AbilitySyncStateInfo empty = AbilitySyncStateInfo.newBuilder().build(); AbilitySyncStateInfo empty = AbilitySyncStateInfo.newBuilder().build();
...@@ -37,7 +37,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket { ...@@ -37,7 +37,7 @@ public class PacketPlayerEnterSceneInfoNotify extends GenshinPacket {
); );
for (EntityAvatar avatarEntity : player.getTeamManager().getActiveTeam()) { for (EntityAvatar avatarEntity : player.getTeamManager().getActiveTeam()) {
GenshinItem weapon = avatarEntity.getAvatar().getWeapon(); GameItem weapon = avatarEntity.getAvatar().getWeapon();
long weaponGuid = weapon != null ? weapon.getGuid() : 0; long weaponGuid = weapon != null ? weapon.getGuid() : 0;
AvatarEnterSceneInfo avatarInfo = AvatarEnterSceneInfo.newBuilder() AvatarEnterSceneInfo avatarInfo = AvatarEnterSceneInfo.newBuilder()
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.GenshinPlayer.SceneLoadState; import emu.grasscutter.game.player.Player.SceneLoadState;
import emu.grasscutter.game.props.EnterReason; import emu.grasscutter.game.props.EnterReason;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType; import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType;
import emu.grasscutter.net.proto.PlayerEnterSceneNotifyOuterClass.PlayerEnterSceneNotify; import emu.grasscutter.net.proto.PlayerEnterSceneNotifyOuterClass.PlayerEnterSceneNotify;
import emu.grasscutter.utils.Position; import emu.grasscutter.utils.Position;
import emu.grasscutter.utils.Utils; import emu.grasscutter.utils.Utils;
public class PacketPlayerEnterSceneNotify extends GenshinPacket { public class PacketPlayerEnterSceneNotify extends BasePacket {
// Login // Login
public PacketPlayerEnterSceneNotify(GenshinPlayer player) { public PacketPlayerEnterSceneNotify(Player player) {
super(PacketOpcodes.PlayerEnterSceneNotify); super(PacketOpcodes.PlayerEnterSceneNotify);
player.setSceneLoadState(SceneLoadState.LOADING); player.setSceneLoadState(SceneLoadState.LOADING);
...@@ -36,12 +36,12 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket { ...@@ -36,12 +36,12 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
this.setData(proto); this.setData(proto);
} }
public PacketPlayerEnterSceneNotify(GenshinPlayer player, EnterType type, EnterReason reason, int newScene, Position newPos) { public PacketPlayerEnterSceneNotify(Player player, EnterType type, EnterReason reason, int newScene, Position newPos) {
this(player, player, type, reason, newScene, newPos); this(player, player, type, reason, newScene, newPos);
} }
// Teleport or go somewhere // Teleport or go somewhere
public PacketPlayerEnterSceneNotify(GenshinPlayer player, GenshinPlayer target, EnterType type, EnterReason reason, int newScene, Position newPos) { public PacketPlayerEnterSceneNotify(Player player, Player target, EnterType type, EnterReason reason, int newScene, Position newPos) {
super(PacketOpcodes.PlayerEnterSceneNotify); super(PacketOpcodes.PlayerEnterSceneNotify);
player.setEnterSceneToken(Utils.randomRange(1000, 99999)); player.setEnterSceneToken(Utils.randomRange(1000, 99999));
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.World; import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerGameTimeNotifyOuterClass.PlayerGameTimeNotify; import emu.grasscutter.net.proto.PlayerGameTimeNotifyOuterClass.PlayerGameTimeNotify;
public class PacketPlayerGameTimeNotify extends GenshinPacket { public class PacketPlayerGameTimeNotify extends BasePacket {
public PacketPlayerGameTimeNotify(GenshinPlayer player) { public PacketPlayerGameTimeNotify(Player player) {
super(PacketOpcodes.PlayerGameTimeNotify); super(PacketOpcodes.PlayerGameTimeNotify);
PlayerGameTimeNotify proto = PlayerGameTimeNotify.newBuilder() PlayerGameTimeNotify proto = PlayerGameTimeNotify.newBuilder()
......
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