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;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerGetForceQuitBanInfoRspOuterClass.PlayerGetForceQuitBanInfoRsp;
public class PacketPlayerGetForceQuitBanInfoRsp extends GenshinPacket {
public class PacketPlayerGetForceQuitBanInfoRsp extends BasePacket {
public PacketPlayerGetForceQuitBanInfoRsp(int retcode) {
super(PacketOpcodes.PlayerGetForceQuitBanInfoRsp);
......
......@@ -2,11 +2,11 @@ package emu.grasscutter.server.packet.send;
import java.util.Set;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerLevelRewardUpdateNotifyOuterClass.PlayerLevelRewardUpdateNotify;
public class PacketPlayerLevelRewardUpdateNotify extends GenshinPacket {
public class PacketPlayerLevelRewardUpdateNotify extends BasePacket {
public PacketPlayerLevelRewardUpdateNotify(Set<Integer> rewardedLevels) {
super(PacketOpcodes.PlayerLevelRewardUpdateNotify);
......
......@@ -2,7 +2,7 @@ package emu.grasscutter.server.packet.send;
import com.google.protobuf.ByteString;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerLoginRspOuterClass.PlayerLoginRsp;
import emu.grasscutter.net.proto.QueryCurrRegionHttpRspOuterClass;
......@@ -14,7 +14,7 @@ import java.io.File;
import java.net.URL;
import java.util.Base64;
public class PacketPlayerLoginRsp extends GenshinPacket {
public class PacketPlayerLoginRsp extends BasePacket {
private static QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp regionCache;
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.PlayerProperty;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerPropNotifyOuterClass.PlayerPropNotify;
import emu.grasscutter.utils.ProtoHelper;
public class PacketPlayerPropNotify extends GenshinPacket {
public class PacketPlayerPropNotify extends BasePacket {
public PacketPlayerPropNotify(GenshinPlayer player, PlayerProperty prop) {
public PacketPlayerPropNotify(Player player, PlayerProperty prop) {
super(PacketOpcodes.PlayerPropNotify);
this.buildHeader(0);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
public class PacketPlayerSetPauseRsp extends GenshinPacket {
public class PacketPlayerSetPauseRsp extends BasePacket {
public PacketPlayerSetPauseRsp(int clientSequence) {
super(PacketOpcodes.PlayerSetPauseRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.GenshinConstants;
import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ItemOuterClass.Item;
import emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify;
import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType;
public class PacketPlayerStoreNotify extends GenshinPacket {
public class PacketPlayerStoreNotify extends BasePacket {
public PacketPlayerStoreNotify(GenshinPlayer player) {
public PacketPlayerStoreNotify(Player player) {
super(PacketOpcodes.PlayerStoreNotify);
this.buildHeader(2);
......@@ -21,7 +21,7 @@ public class PacketPlayerStoreNotify extends GenshinPacket {
.setStoreType(StoreType.STORE_PACK)
.setWeightLimit(Grasscutter.getConfig().getGameServerOptions().InventoryLimitAll);
for (GenshinItem item : player.getInventory()) {
for (GameItem item : player.getInventory()) {
Item itemProto = item.toProto();
p.addItemList(itemProto);
}
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
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.proto.PlayerTimeNotifyOuterClass.PlayerTimeNotify;
public class PacketPlayerTimeNotify extends GenshinPacket {
public class PacketPlayerTimeNotify extends BasePacket {
public PacketPlayerTimeNotify(GenshinPlayer player) {
public PacketPlayerTimeNotify(Player player) {
super(PacketOpcodes.PlayerTimeNotify);
PlayerTimeNotify proto = PlayerTimeNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
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.proto.PostEnterSceneRspOuterClass.PostEnterSceneRsp;
public class PacketPostEnterSceneRsp extends GenshinPacket {
public class PacketPostEnterSceneRsp extends BasePacket {
public PacketPostEnterSceneRsp(GenshinPlayer player) {
public PacketPostEnterSceneRsp(Player player) {
super(PacketOpcodes.PostEnterSceneRsp);
PostEnterSceneRsp p = PostEnterSceneRsp.newBuilder()
......
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.proto.ChatInfoOuterClass.ChatInfo;
import emu.grasscutter.net.proto.PrivateChatNotifyOuterClass.PrivateChatNotify;
public class PacketPrivateChatNotify extends GenshinPacket {
public class PacketPrivateChatNotify extends BasePacket {
public PacketPrivateChatNotify(int senderId, int recvId, String message) {
super(PacketOpcodes.PrivateChatNotify);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ProudSkillChangeNotifyOuterClass.ProudSkillChangeNotify;
public class PacketProudSkillChangeNotify extends GenshinPacket {
public class PacketProudSkillChangeNotify extends BasePacket {
public PacketProudSkillChangeNotify(GenshinAvatar avatar) {
public PacketProudSkillChangeNotify(Avatar avatar) {
super(PacketOpcodes.ProudSkillChangeNotify);
ProudSkillChangeNotify proto = ProudSkillChangeNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ProudSkillExtraLevelNotifyOuterClass.ProudSkillExtraLevelNotify;
public class PacketProudSkillExtraLevelNotify extends GenshinPacket {
public class PacketProudSkillExtraLevelNotify extends BasePacket {
public PacketProudSkillExtraLevelNotify(GenshinAvatar avatar, int talentIndex) {
public PacketProudSkillExtraLevelNotify(Avatar avatar, int talentIndex) {
super(PacketOpcodes.ProudSkillExtraLevelNotify);
ProudSkillExtraLevelNotify proto = ProudSkillExtraLevelNotify.newBuilder()
......
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.proto.PullPrivateChatRspOuterClass.PullPrivateChatRsp;
public class PacketPullPrivateChatRsp extends GenshinPacket {
public class PacketPullPrivateChatRsp extends BasePacket {
public PacketPullPrivateChatRsp() {
super(PacketOpcodes.PullPrivateChatRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.Config.GameServerOptions;
import emu.grasscutter.GenshinConstants;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo;
import emu.grasscutter.net.proto.PullRecentChatRspOuterClass.PullRecentChatRsp;
import emu.grasscutter.utils.Utils;
public class PacketPullRecentChatRsp extends GenshinPacket {
public PacketPullRecentChatRsp(GenshinPlayer player) {
public class PacketPullRecentChatRsp extends BasePacket {
public PacketPullRecentChatRsp(Player player) {
super(PacketOpcodes.PullRecentChatRsp);
GameServerOptions serverOptions = Grasscutter.getConfig().getGameServerOptions();
......@@ -20,7 +20,7 @@ public class PacketPullRecentChatRsp extends GenshinPacket {
if (serverOptions.WelcomeEmotes != null && serverOptions.WelcomeEmotes.length > 0) {
ChatInfo welcomeEmote = ChatInfo.newBuilder()
.setTime((int) (System.currentTimeMillis() / 1000))
.setUid(GenshinConstants.SERVER_CONSOLE_UID)
.setUid(GameConstants.SERVER_CONSOLE_UID)
.setToUid(player.getUid())
.setIcon(serverOptions.WelcomeEmotes[Utils.randomRange(0, serverOptions.WelcomeEmotes.length - 1)])
.build();
......@@ -31,7 +31,7 @@ public class PacketPullRecentChatRsp extends GenshinPacket {
if (serverOptions.WelcomeMotd != null && serverOptions.WelcomeMotd.length() > 0) {
ChatInfo welcomeMotd = ChatInfo.newBuilder()
.setTime((int) (System.currentTimeMillis() / 1000))
.setUid(GenshinConstants.SERVER_CONSOLE_UID)
.setUid(GameConstants.SERVER_CONSOLE_UID)
.setToUid(player.getUid())
.setText(Grasscutter.getConfig().getGameServerOptions().WelcomeMotd)
.build();
......
......@@ -2,14 +2,14 @@ package emu.grasscutter.server.packet.send;
import java.util.List;
import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ReliquaryUpgradeRspOuterClass.ReliquaryUpgradeRsp;
public class PacketReliquaryUpgradeRsp extends GenshinPacket {
public class PacketReliquaryUpgradeRsp extends BasePacket {
public PacketReliquaryUpgradeRsp(GenshinItem relic, int rate, int oldLevel, List<Integer> oldAppendPropIdList) {
public PacketReliquaryUpgradeRsp(GameItem relic, int rate, int oldLevel, List<Integer> oldAppendPropIdList) {
super(PacketOpcodes.ReliquaryUpgradeRsp);
ReliquaryUpgradeRsp proto = ReliquaryUpgradeRsp.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.World;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneAreaWeatherNotifyOuterClass.SceneAreaWeatherNotify;
public class PacketSceneAreaWeatherNotify extends GenshinPacket {
public class PacketSceneAreaWeatherNotify extends BasePacket {
public PacketSceneAreaWeatherNotify(GenshinPlayer player) {
public PacketSceneAreaWeatherNotify(Player player) {
super(PacketOpcodes.SceneAreaWeatherNotify);
SceneAreaWeatherNotify proto = SceneAreaWeatherNotify.newBuilder()
......
......@@ -2,16 +2,16 @@ package emu.grasscutter.server.packet.send;
import java.util.Collection;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.entity.GenshinEntity;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.entity.GameEntity;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneEntityAppearNotifyOuterClass.SceneEntityAppearNotify;
import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType;
public class PacketSceneEntityAppearNotify extends GenshinPacket {
public class PacketSceneEntityAppearNotify extends BasePacket {
public PacketSceneEntityAppearNotify(GenshinEntity entity) {
public PacketSceneEntityAppearNotify(GameEntity entity) {
super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
......@@ -21,7 +21,7 @@ public class PacketSceneEntityAppearNotify extends GenshinPacket {
this.setData(proto.build());
}
public PacketSceneEntityAppearNotify(GenshinEntity entity, VisionType vision, int param) {
public PacketSceneEntityAppearNotify(GameEntity entity, VisionType vision, int param) {
super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
......@@ -32,11 +32,11 @@ public class PacketSceneEntityAppearNotify extends GenshinPacket {
this.setData(proto.build());
}
public PacketSceneEntityAppearNotify(GenshinPlayer player) {
public PacketSceneEntityAppearNotify(Player player) {
this(player.getTeamManager().getCurrentAvatarEntity());
}
public PacketSceneEntityAppearNotify(Collection<GenshinEntity> entities, VisionType visionType) {
public PacketSceneEntityAppearNotify(Collection<GameEntity> entities, VisionType visionType) {
super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
......
......@@ -3,15 +3,15 @@ package emu.grasscutter.server.packet.send;
import java.util.Collection;
import java.util.List;
import emu.grasscutter.game.entity.GenshinEntity;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.entity.GameEntity;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneEntityDisappearNotifyOuterClass.SceneEntityDisappearNotify;
import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType;
public class PacketSceneEntityDisappearNotify extends GenshinPacket {
public class PacketSceneEntityDisappearNotify extends BasePacket {
public PacketSceneEntityDisappearNotify(GenshinEntity entity, VisionType disappearType) {
public PacketSceneEntityDisappearNotify(GameEntity entity, VisionType disappearType) {
super(PacketOpcodes.SceneEntityDisappearNotify);
SceneEntityDisappearNotify proto = SceneEntityDisappearNotify.newBuilder()
......@@ -22,7 +22,7 @@ public class PacketSceneEntityDisappearNotify extends GenshinPacket {
this.setData(proto);
}
public PacketSceneEntityDisappearNotify(Collection<GenshinEntity> entities, VisionType disappearType) {
public PacketSceneEntityDisappearNotify(Collection<GameEntity> entities, VisionType disappearType) {
super(PacketOpcodes.SceneEntityDisappearNotify);
SceneEntityDisappearNotify.Builder proto = SceneEntityDisappearNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneEntityDrownRspOuterClass.SceneEntityDrownRsp;
public class PacketSceneEntityDrownRsp extends BasePacket {
public PacketSceneEntityDrownRsp(int entityId) {
super(PacketOpcodes.SceneEntityDrownRsp);
SceneEntityDrownRsp proto = SceneEntityDrownRsp.newBuilder().setEntityId(entityId).build();
this.setData(proto);
}
}
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.proto.EntityMoveInfoOuterClass.EntityMoveInfo;
import emu.grasscutter.net.proto.SceneEntityMoveNotifyOuterClass.SceneEntityMoveNotify;
public class PacketSceneEntityMoveNotify extends GenshinPacket {
public class PacketSceneEntityMoveNotify extends BasePacket {
public PacketSceneEntityMoveNotify(EntityMoveInfo moveInfo) {
super(PacketOpcodes.SceneEntityMoveNotify, true);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
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.proto.SceneInitFinishRspOuterClass.SceneInitFinishRsp;
public class PacketSceneInitFinishRsp extends GenshinPacket {
public class PacketSceneInitFinishRsp extends BasePacket {
public PacketSceneInitFinishRsp(GenshinPlayer player) {
public PacketSceneInitFinishRsp(Player player) {
super(PacketOpcodes.SceneInitFinishRsp, 11);
SceneInitFinishRsp p = SceneInitFinishRsp.newBuilder().setEnterSceneToken(player.getEnterSceneToken()).build();
......
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