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.recv;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.GetMailItemReqOuterClass;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketGetMailItemRsp;
@Opcodes(PacketOpcodes.GetMailItemReq)
public class HandlerGetMailItemReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
GetMailItemReqOuterClass.GetMailItemReq req = GetMailItemReqOuterClass.GetMailItemReq.parseFrom(payload);
session.send(new PacketGetMailItemRsp(session.getPlayer(), req.getMailIdListList()));
}
}
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketHandler;
...@@ -11,7 +11,7 @@ public class HandlerGetPlayerBlacklistReq extends PacketHandler { ...@@ -11,7 +11,7 @@ public class HandlerGetPlayerBlacklistReq extends PacketHandler {
@Override @Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
session.send(new GenshinPacket(PacketOpcodes.GetPlayerBlacklistRsp).buildHeader(3)); session.send(new BasePacket(PacketOpcodes.GetPlayerBlacklistRsp).buildHeader(3));
} }
} }
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.World;
import emu.grasscutter.game.props.EnterReason; import emu.grasscutter.game.props.EnterReason;
import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
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;
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.game.inventory.GenshinItem; import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.NpcTalkReqOuterClass.NpcTalkReq; import emu.grasscutter.net.proto.NpcTalkReqOuterClass.NpcTalkReq;
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.database.DatabaseHelper;
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.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerLoginReqOuterClass.PlayerLoginReq; import emu.grasscutter.net.proto.PlayerLoginReqOuterClass.PlayerLoginReq;
...@@ -30,12 +30,12 @@ public class HandlerPlayerLoginReq extends PacketHandler { ...@@ -30,12 +30,12 @@ public class HandlerPlayerLoginReq extends PacketHandler {
} }
// Load character from db // Load character from db
GenshinPlayer player = DatabaseHelper.getPlayerById(session.getAccount().getPlayerUid()); Player player = DatabaseHelper.getPlayerById(session.getAccount().getPlayerUid());
if (player == null) { if (player == null) {
// Send packets // Send packets
session.setState(SessionState.PICKING_CHARACTER); session.setState(SessionState.PICKING_CHARACTER);
session.send(new GenshinPacket(PacketOpcodes.DoSetPlayerBornDataNotify)); session.send(new BasePacket(PacketOpcodes.DoSetPlayerBornDataNotify));
} else { } else {
// Set character // Set character
session.setPlayer(player); session.setPlayer(player);
......
...@@ -19,8 +19,6 @@ public class HandlerPrivateChatReq extends PacketHandler { ...@@ -19,8 +19,6 @@ public class HandlerPrivateChatReq extends PacketHandler {
} else if (content == PrivateChatReq.ContentCase.ICON) { } else if (content == PrivateChatReq.ContentCase.ICON) {
session.getServer().getChatManager().sendPrivateMessage(session.getPlayer(), req.getTargetUid(), req.getIcon()); session.getServer().getChatManager().sendPrivateMessage(session.getPlayer(), req.getTargetUid(), req.getIcon());
} }
//session.send(new GenshinPacket(PacketOpcodes.PrivateChatRsp)); // Unused by server
} }
} }
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.game.mail.Mail;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.GetAllMailReqOuterClass;
import emu.grasscutter.net.proto.ReadMailNotifyOuterClass;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketMailChangeNotify;
import java.util.ArrayList;
import java.util.List;
@Opcodes(PacketOpcodes.ReadMailNotify)
public class HandlerReadMailNotify extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
ReadMailNotifyOuterClass.ReadMailNotify req = ReadMailNotifyOuterClass.ReadMailNotify.parseFrom(payload);
List<Mail> updatedMail = new ArrayList<>();
for (int mailId : req.getMailIdListList()) {
Mail message = session.getPlayer().getMail(mailId);
message.isRead = true;
session.getPlayer().replaceMailByIndex(mailId, message);
updatedMail.add(message);
}
session.send(new PacketMailChangeNotify(session.getPlayer(), updatedMail));
}
}
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.game.entity.EntityMonster;
import emu.grasscutter.game.entity.GameEntity;
import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.game.props.LifeState;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneEntityDrownReqOuterClass.SceneEntityDrownReq;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketSceneEntityDrownRsp;
@Opcodes(PacketOpcodes.SceneEntityDrownReq)
public class HandlerSceneEntityDrownReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
SceneEntityDrownReq req = SceneEntityDrownReq.parseFrom(payload);
GameEntity entity = session.getPlayer().getScene().getEntityById(req.getEntityId());
if (entity == null || !(entity instanceof EntityMonster || entity instanceof EntityAvatar)) {
return;
}
entity.setFightProperty(FightProperty.FIGHT_PROP_CUR_HP, 0);
//TODO: make a list somewhere of all entities to remove per tick rather than one by one
session.getPlayer().getScene().killEntity(entity, 0);
session.getPlayer().getScene().broadcastPacket(new PacketSceneEntityDrownRsp(req.getEntityId()));
}
}
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.game.GenshinPlayer.SceneLoadState; import emu.grasscutter.game.player.Player.SceneLoadState;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketHandler;
...@@ -31,7 +31,7 @@ public class HandlerSceneInitFinishReq extends PacketHandler { ...@@ -31,7 +31,7 @@ public class HandlerSceneInitFinishReq extends PacketHandler {
session.send(new PacketWorldPlayerInfoNotify(session.getPlayer().getWorld())); session.send(new PacketWorldPlayerInfoNotify(session.getPlayer().getWorld()));
session.send(new PacketWorldDataNotify(session.getPlayer().getWorld())); session.send(new PacketWorldDataNotify(session.getPlayer().getWorld()));
session.send(new PacketSceneUnlockInfoNotify()); session.send(new PacketSceneUnlockInfoNotify());
session.send(new GenshinPacket(PacketOpcodes.SceneForceUnlockNotify)); session.send(new BasePacket(PacketOpcodes.SceneForceUnlockNotify));
session.send(new PacketHostPlayerNotify(session.getPlayer().getWorld())); session.send(new PacketHostPlayerNotify(session.getPlayer().getWorld()));
session.send(new PacketSceneTimeNotify(session.getPlayer())); session.send(new PacketSceneTimeNotify(session.getPlayer()));
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.data.GenshinData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.custom.ScenePointEntry; import emu.grasscutter.data.custom.ScenePointEntry;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
...@@ -19,7 +19,7 @@ public class HandlerSceneTransToPointReq extends PacketHandler { ...@@ -19,7 +19,7 @@ public class HandlerSceneTransToPointReq extends PacketHandler {
SceneTransToPointReq req = SceneTransToPointReq.parseFrom(payload); SceneTransToPointReq req = SceneTransToPointReq.parseFrom(payload);
String code = req.getSceneId() + "_" + req.getPointId(); String code = req.getSceneId() + "_" + req.getPointId();
ScenePointEntry scenePointEntry = GenshinData.getScenePointEntries().get(code); ScenePointEntry scenePointEntry = GameData.getScenePointEntries().get(code);
if (scenePointEntry != null) { if (scenePointEntry != null) {
float x = scenePointEntry.getPointData().getTranPos().getX(); float x = scenePointEntry.getPointData().getTranPos().getX();
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SetEntityClientDataNotifyOuterClass.SetEntityClientDataNotify; import emu.grasscutter.net.proto.SetEntityClientDataNotifyOuterClass.SetEntityClientDataNotify;
...@@ -20,7 +20,7 @@ public class HandlerSetEntityClientDataNotify extends PacketHandler { ...@@ -20,7 +20,7 @@ public class HandlerSetEntityClientDataNotify extends PacketHandler {
// Make sure packet is a valid proto before replaying it to the other players // Make sure packet is a valid proto before replaying it to the other players
SetEntityClientDataNotify notif = SetEntityClientDataNotify.parseFrom(payload); SetEntityClientDataNotify notif = SetEntityClientDataNotify.parseFrom(payload);
GenshinPacket packet = new GenshinPacket(PacketOpcodes.SetEntityClientDataNotify, true); BasePacket packet = new BasePacket(PacketOpcodes.SetEntityClientDataNotify, true);
packet.setData(notif); packet.setData(notif);
session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), packet); session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), packet);
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.GenshinConstants; import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GenshinData; import emu.grasscutter.data.GameData;
import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.avatar.GenshinAvatar; import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SetPlayerBornDataReqOuterClass.SetPlayerBornDataReq; import emu.grasscutter.net.proto.SetPlayerBornDataReqOuterClass.SetPlayerBornDataReq;
...@@ -24,9 +24,9 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { ...@@ -24,9 +24,9 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
// Sanity checks // Sanity checks
int avatarId = req.getAvatarId(); int avatarId = req.getAvatarId();
int startingSkillDepot = 0; int startingSkillDepot = 0;
if (avatarId == GenshinConstants.MAIN_CHARACTER_MALE) { if (avatarId == GameConstants.MAIN_CHARACTER_MALE) {
startingSkillDepot = 504; startingSkillDepot = 504;
} else if (avatarId == GenshinConstants.MAIN_CHARACTER_FEMALE) { } else if (avatarId == GameConstants.MAIN_CHARACTER_FEMALE) {
startingSkillDepot = 704; startingSkillDepot = 704;
} else { } else {
return; return;
...@@ -38,7 +38,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { ...@@ -38,7 +38,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
} }
// Create character // Create character
GenshinPlayer player = new GenshinPlayer(session); Player player = new Player(session);
player.setNickname(nickname); player.setNickname(nickname);
try { try {
...@@ -47,8 +47,8 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { ...@@ -47,8 +47,8 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
// Create avatar // Create avatar
if (player.getAvatars().getAvatarCount() == 0) { if (player.getAvatars().getAvatarCount() == 0) {
GenshinAvatar mainCharacter = new GenshinAvatar(avatarId); Avatar mainCharacter = new Avatar(avatarId);
mainCharacter.setSkillDepot(GenshinData.getAvatarSkillDepotDataMap().get(startingSkillDepot)); mainCharacter.setSkillDepot(GameData.getAvatarSkillDepotDataMap().get(startingSkillDepot));
player.addAvatar(mainCharacter); player.addAvatar(mainCharacter);
player.setMainCharacterId(avatarId); player.setMainCharacterId(avatarId);
player.setHeadImage(avatarId); player.setHeadImage(avatarId);
...@@ -68,7 +68,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { ...@@ -68,7 +68,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
session.setState(SessionState.ACTIVE); session.setState(SessionState.ACTIVE);
// Born resp packet // Born resp packet
session.send(new GenshinPacket(PacketOpcodes.SetPlayerBornDataRsp)); session.send(new BasePacket(PacketOpcodes.SetPlayerBornDataRsp));
} catch (Exception e) { } catch (Exception e) {
Grasscutter.getLogger().error("Error creating player object: ", e); Grasscutter.getLogger().error("Error creating player object: ", e);
session.close(); session.close();
......
...@@ -5,9 +5,9 @@ import java.util.List; ...@@ -5,9 +5,9 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GenshinData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.common.RewardItemData; import emu.grasscutter.data.common.RewardItemData;
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.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketHandler;
...@@ -24,15 +24,15 @@ public class HandlerTakePlayerLevelRewardReq extends PacketHandler { ...@@ -24,15 +24,15 @@ public class HandlerTakePlayerLevelRewardReq extends PacketHandler {
TakePlayerLevelRewardReq req = TakePlayerLevelRewardReq.parseFrom(payload); TakePlayerLevelRewardReq req = TakePlayerLevelRewardReq.parseFrom(payload);
int level = req.getLevel(); int level = req.getLevel();
int rewardId = GenshinData.getPlayerLevelDataMap().get(level).getRewardId(); int rewardId = GameData.getPlayerLevelDataMap().get(level).getRewardId();
if (rewardId != 0) { if (rewardId != 0) {
List<RewardItemData> rewardItems = GenshinData.getRewardDataMap().get(rewardId).getRewardItemList(); List<RewardItemData> rewardItems = GameData.getRewardDataMap().get(rewardId).getRewardItemList();
List<GenshinItem> items = new LinkedList<>(); List<GameItem> items = new LinkedList<>();
for (RewardItemData rewardItem : rewardItems) { for (RewardItemData rewardItem : rewardItems) {
if (rewardItem != null) { if (rewardItem != null) {
if (rewardItem.getItemId() != 0) { if (rewardItem.getItemId() != 0) {
items.add(new GenshinItem(rewardItem.getItemId(), rewardItem.getItemCount())); items.add(new GameItem(rewardItem.getItemId(), rewardItem.getItemCount()));
} }
} }
} }
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import emu.grasscutter.game.inventory.GenshinItem; import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.UseItemReqOuterClass.UseItemReq; import emu.grasscutter.net.proto.UseItemReqOuterClass.UseItemReq;
...@@ -15,7 +15,7 @@ public class HandlerUseItemReq extends PacketHandler { ...@@ -15,7 +15,7 @@ public class HandlerUseItemReq extends PacketHandler {
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
UseItemReq req = UseItemReq.parseFrom(payload); UseItemReq req = UseItemReq.parseFrom(payload);
GenshinItem useItem = session.getServer().getInventoryManager().useItem(session.getPlayer(), req.getTargetGuid(), req.getGuid(), req.getCount()); GameItem useItem = session.getServer().getInventoryManager().useItem(session.getPlayer(), req.getTargetGuid(), req.getGuid(), req.getCount());
if (useItem != null) { if (useItem != null) {
session.send(new PacketUseItemRsp(req.getTargetGuid(), useItem)); session.send(new PacketUseItemRsp(req.getTargetGuid(), useItem));
} else { } else {
......
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 Packet extends GenshinPacket { public class Packet extends BasePacket {
public Packet() { public Packet() {
super(PacketOpcodes.NONE); super(PacketOpcodes.NONE);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.entity.EntityAvatar;
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.AbilityChangeNotifyOuterClass.AbilityChangeNotify; import emu.grasscutter.net.proto.AbilityChangeNotifyOuterClass.AbilityChangeNotify;
public class PacketAbilityChangeNotify extends GenshinPacket { public class PacketAbilityChangeNotify extends BasePacket {
public PacketAbilityChangeNotify(EntityAvatar entity) { public PacketAbilityChangeNotify(EntityAvatar entity) {
super(PacketOpcodes.AbilityChangeNotify, true); super(PacketOpcodes.AbilityChangeNotify, true);
......
...@@ -2,12 +2,12 @@ package emu.grasscutter.server.packet.send; ...@@ -2,12 +2,12 @@ package emu.grasscutter.server.packet.send;
import java.util.List; import java.util.List;
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.AbilityInvocationsNotifyOuterClass.AbilityInvocationsNotify; import emu.grasscutter.net.proto.AbilityInvocationsNotifyOuterClass.AbilityInvocationsNotify;
import emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry; import emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry;
public class PacketAbilityInvocationsNotify extends GenshinPacket { public class PacketAbilityInvocationsNotify extends BasePacket {
public PacketAbilityInvocationsNotify(AbilityInvokeEntry entry) { public PacketAbilityInvocationsNotify(AbilityInvokeEntry entry) {
super(PacketOpcodes.AbilityInvocationsNotify, true); super(PacketOpcodes.AbilityInvocationsNotify, true);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.friends.Friendship; import emu.grasscutter.game.friends.Friendship;
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.AskAddFriendNotifyOuterClass.AskAddFriendNotify; import emu.grasscutter.net.proto.AskAddFriendNotifyOuterClass.AskAddFriendNotify;
public class PacketAskAddFriendNotify extends GenshinPacket { public class PacketAskAddFriendNotify extends BasePacket {
public PacketAskAddFriendNotify(Friendship friendship) { public PacketAskAddFriendNotify(Friendship friendship) {
super(PacketOpcodes.AskAddFriendNotify); super(PacketOpcodes.AskAddFriendNotify);
......
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.AskAddFriendRspOuterClass.AskAddFriendRsp; import emu.grasscutter.net.proto.AskAddFriendRspOuterClass.AskAddFriendRsp;
public class PacketAskAddFriendRsp extends GenshinPacket { public class PacketAskAddFriendRsp extends BasePacket {
public PacketAskAddFriendRsp(int targetUid) { public PacketAskAddFriendRsp(int targetUid) {
super(PacketOpcodes.AskAddFriendRsp); super(PacketOpcodes.AskAddFriendRsp);
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar; import emu.grasscutter.game.avatar.Avatar;
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.AvatarAddNotifyOuterClass.AvatarAddNotify; import emu.grasscutter.net.proto.AvatarAddNotifyOuterClass.AvatarAddNotify;
public class PacketAvatarAddNotify extends GenshinPacket { public class PacketAvatarAddNotify extends BasePacket {
public PacketAvatarAddNotify(GenshinAvatar avatar, boolean addedToTeam) { public PacketAvatarAddNotify(Avatar avatar, boolean addedToTeam) {
super(PacketOpcodes.AvatarAddNotify); super(PacketOpcodes.AvatarAddNotify);
AvatarAddNotify proto = AvatarAddNotify.newBuilder() AvatarAddNotify proto = AvatarAddNotify.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