Commit 01b190bc authored by Magix's avatar Magix Committed by GitHub
Browse files

UPGRADE TO 1.1.0 POG

Merge `development` into `stable`
parents 6b81b888 1beddf16
package emu.grasscutter.server.packet.send;
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.SetEquipLockStateRspOuterClass.SetEquipLockStateRsp;
public class PacketSetEquipLockStateRsp extends GenshinPacket {
public class PacketSetEquipLockStateRsp extends BasePacket {
public PacketSetEquipLockStateRsp(GenshinItem equip) {
public PacketSetEquipLockStateRsp(GameItem equip) {
super(PacketOpcodes.SetEquipLockStateRsp);
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;
import emu.grasscutter.net.proto.SetNameCardRspOuterClass.SetNameCardRsp;
public class PacketSetNameCardRsp extends GenshinPacket {
public class PacketSetNameCardRsp extends BasePacket {
public PacketSetNameCardRsp(int nameCardId) {
super(PacketOpcodes.SetNameCardRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SetPlayerBirthdayRspOuterClass.SetPlayerBirthdayRsp;
import emu.grasscutter.net.proto.SetPlayerBornDataReqOuterClass;
public class PacketSetPlayerBirthdayRsp extends BasePacket {
public PacketSetPlayerBirthdayRsp(int retCode) {
super(PacketOpcodes.SetPlayerBirthdayRsp);
SetPlayerBirthdayRsp proto = SetPlayerBirthdayRsp.newBuilder()
.setRetcode(retCode)
.build();
this.setData(proto);
}
public PacketSetPlayerBirthdayRsp(Player player) {
super(PacketOpcodes.SetPlayerBirthdayRsp);
SetPlayerBirthdayRsp proto = SetPlayerBirthdayRsp.newBuilder()
.setBirthday(player.getBirthday().toProto())
.build();
this.setData(proto);
}
}
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.HeadImageOuterClass.HeadImage;
import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture;
import emu.grasscutter.net.proto.SetPlayerHeadImageRspOuterClass.SetPlayerHeadImageRsp;
public class PacketSetPlayerHeadImageRsp extends GenshinPacket {
public class PacketSetPlayerHeadImageRsp extends BasePacket {
public PacketSetPlayerHeadImageRsp(GenshinPlayer player) {
public PacketSetPlayerHeadImageRsp(Player player) {
super(PacketOpcodes.SetPlayerHeadImageRsp);
SetPlayerHeadImageRsp proto = SetPlayerHeadImageRsp.newBuilder()
.setAvatar(HeadImage.newBuilder().setAvatarId(player.getHeadImage()))
.setProfilePicture(ProfilePicture.newBuilder().setAvatarId(player.getHeadImage()))
.build();
this.setData(proto);
......
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.SetPlayerNameRspOuterClass.SetPlayerNameRsp;
public class PacketSetPlayerNameRsp extends GenshinPacket {
public class PacketSetPlayerNameRsp extends BasePacket {
public PacketSetPlayerNameRsp(GenshinPlayer player) {
public PacketSetPlayerNameRsp(Player player) {
super(PacketOpcodes.SetPlayerNameRsp);
SetPlayerNameRsp proto = SetPlayerNameRsp.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SetPlayerPropRspOuterClass;
import emu.grasscutter.net.proto.SetPlayerPropRspOuterClass.SetPlayerPropRsp;
public class PacketSetPlayerPropRsp extends BasePacket {
public PacketSetPlayerPropRsp(int retCode) {
super(PacketOpcodes.SetPlayerPropRsp);
SetPlayerPropRspOuterClass.SetPlayerPropRsp.Builder proto = SetPlayerPropRspOuterClass.SetPlayerPropRsp.newBuilder();
if (retCode != 0) {
proto.setRetcode(retCode);
}
this.setData(proto.build());
}
}
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.SetPlayerSignatureRspOuterClass.SetPlayerSignatureRsp;
public class PacketSetPlayerSignatureRsp extends GenshinPacket {
public class PacketSetPlayerSignatureRsp extends BasePacket {
public PacketSetPlayerSignatureRsp(GenshinPlayer player) {
public PacketSetPlayerSignatureRsp(Player player) {
super(PacketOpcodes.SetPlayerSignatureRsp);
SetPlayerSignatureRsp proto = SetPlayerSignatureRsp.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.TeamInfo;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.player.TeamInfo;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SetUpAvatarTeamRspOuterClass.SetUpAvatarTeamRsp;
public class PacketSetUpAvatarTeamRsp extends GenshinPacket {
public class PacketSetUpAvatarTeamRsp extends BasePacket {
public PacketSetUpAvatarTeamRsp(GenshinPlayer player, int teamId, TeamInfo teamInfo) {
public PacketSetUpAvatarTeamRsp(Player player, int teamId, TeamInfo teamInfo) {
super(PacketOpcodes.SetUpAvatarTeamRsp);
SetUpAvatarTeamRsp.Builder proto = SetUpAvatarTeamRsp.newBuilder()
......
......@@ -2,35 +2,35 @@ package emu.grasscutter.server.packet.send;
import java.util.Collection;
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.StoreItemChangeNotifyOuterClass.StoreItemChangeNotify;
import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType;
public class PacketStoreItemChangeNotify extends GenshinPacket {
public class PacketStoreItemChangeNotify extends BasePacket {
private PacketStoreItemChangeNotify() {
super(PacketOpcodes.StoreItemChangeNotify);
}
public PacketStoreItemChangeNotify(GenshinItem item) {
public PacketStoreItemChangeNotify(GameItem item) {
this();
StoreItemChangeNotify.Builder proto = StoreItemChangeNotify.newBuilder()
.setStoreType(StoreType.StorePack)
.setStoreType(StoreType.STORE_PACK)
.addItemList(item.toProto());
this.setData(proto);
}
public PacketStoreItemChangeNotify(Collection<GenshinItem> items) {
public PacketStoreItemChangeNotify(Collection<GameItem> items) {
this();
StoreItemChangeNotify.Builder proto = StoreItemChangeNotify.newBuilder()
.setStoreType(StoreType.StorePack);
.setStoreType(StoreType.STORE_PACK);
items.stream().forEach(item -> proto.addItemList(item.toProto()));
items.forEach(item -> proto.addItemList(item.toProto()));
this.setData(proto);
}
......
......@@ -2,33 +2,33 @@ package emu.grasscutter.server.packet.send;
import java.util.Collection;
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.StoreItemDelNotifyOuterClass.StoreItemDelNotify;
import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType;
public class PacketStoreItemDelNotify extends GenshinPacket {
public class PacketStoreItemDelNotify extends BasePacket {
private PacketStoreItemDelNotify() {
super(PacketOpcodes.StoreItemDelNotify);
}
public PacketStoreItemDelNotify(GenshinItem item) {
public PacketStoreItemDelNotify(GameItem item) {
this();
StoreItemDelNotify.Builder proto = StoreItemDelNotify.newBuilder()
.setStoreType(StoreType.StorePack)
.setStoreType(StoreType.STORE_PACK)
.addGuidList(item.getGuid());
this.setData(proto);
}
public PacketStoreItemDelNotify(Collection<GenshinItem> items) {
public PacketStoreItemDelNotify(Collection<GameItem> items) {
this();
StoreItemDelNotify.Builder proto = StoreItemDelNotify.newBuilder()
.setStoreType(StoreType.StorePack);
.setStoreType(StoreType.STORE_PACK);
items.stream().forEach(item -> proto.addGuidList(item.getGuid()));
......
package emu.grasscutter.server.packet.send;
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.StoreTypeOuterClass.StoreType;
import emu.grasscutter.net.proto.StoreWeightLimitNotifyOuterClass.StoreWeightLimitNotify;
public class PacketStoreWeightLimitNotify extends GenshinPacket {
public class PacketStoreWeightLimitNotify extends BasePacket {
public PacketStoreWeightLimitNotify() {
super(PacketOpcodes.StoreWeightLimitNotify);
StoreWeightLimitNotify p = StoreWeightLimitNotify.newBuilder()
.setStoreType(StoreType.StorePack)
.setStoreType(StoreType.STORE_PACK)
.setWeightLimit(Grasscutter.getConfig().getGameServerOptions().InventoryLimitAll)
.setWeaponCountLimit(Grasscutter.getConfig().getGameServerOptions().InventoryLimitWeapon)
.setReliquaryCountLimit(Grasscutter.getConfig().getGameServerOptions().InventoryLimitRelic)
......
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.SyncScenePlayTeamEntityNotifyOuterClass.SyncScenePlayTeamEntityNotify;
public class PacketSyncScenePlayTeamEntityNotify extends GenshinPacket {
public class PacketSyncScenePlayTeamEntityNotify extends BasePacket {
public PacketSyncScenePlayTeamEntityNotify(GenshinPlayer player) {
public PacketSyncScenePlayTeamEntityNotify(Player player) {
super(PacketOpcodes.SyncScenePlayTeamEntityNotify);
SyncScenePlayTeamEntityNotify proto = SyncScenePlayTeamEntityNotify.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.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo;
import emu.grasscutter.net.proto.SyncTeamEntityNotifyOuterClass.SyncTeamEntityNotify;
import emu.grasscutter.net.proto.TeamEntityInfoOuterClass.TeamEntityInfo;
public class PacketSyncTeamEntityNotify extends GenshinPacket {
public class PacketSyncTeamEntityNotify extends BasePacket {
public PacketSyncTeamEntityNotify(GenshinPlayer player) {
public PacketSyncTeamEntityNotify(Player player) {
super(PacketOpcodes.SyncTeamEntityNotify);
SyncTeamEntityNotify.Builder proto = SyncTeamEntityNotify.newBuilder()
.setSceneId(player.getSceneId());
if (player.getWorld().isMultiplayer()) {
for (GenshinPlayer p : player.getWorld().getPlayers()) {
for (Player p : player.getWorld().getPlayers()) {
// Skip if same player
if (player == p) {
continue;
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AchievementInfoOuterClass;
import emu.grasscutter.net.proto.AchievementInfoOuterClass.AchievementInfo;
import emu.grasscutter.net.proto.TakeAchievementRewardReqOuterClass.TakeAchievementRewardReq;
import emu.grasscutter.server.game.GameSession;
import java.util.ArrayList;
import java.util.List;
public class PacketTakeAchievementRewardReq extends BasePacket {
public PacketTakeAchievementRewardReq(GameSession session) {
super(PacketOpcodes.TakeAchievementRewardReq);
TakeAchievementRewardReq proto = TakeAchievementRewardReq.newBuilder().build();
this.setData(proto);
}
}
\ No newline at end of file
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TakePlayerLevelRewardRspOuterClass.TakePlayerLevelRewardRsp;
public class PacketTakePlayerLevelRewardRsp extends BasePacket {
public PacketTakePlayerLevelRewardRsp(int level, int rewardId) {
super(PacketOpcodes.TakePlayerLevelRewardRsp);
int retcode = 0;
if (rewardId == 0) {
retcode = 1;
}
TakePlayerLevelRewardRsp proto = TakePlayerLevelRewardRsp.newBuilder()
.setLevel(level)
.setRewardId(rewardId)
.setRetcode(retcode)
.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.TakeoffEquipRspOuterClass.TakeoffEquipRsp;
public class PacketTakeoffEquipRsp extends GenshinPacket {
public class PacketTakeoffEquipRsp extends BasePacket {
public PacketTakeoffEquipRsp(long avatarGuid, int slot) {
super(PacketOpcodes.TakeoffEquipRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.TowerFloorData;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TowerAllDataRspOuterClass.TowerAllDataRsp;
import emu.grasscutter.net.proto.TowerCurLevelRecordOuterClass.TowerCurLevelRecord;
import emu.grasscutter.net.proto.TowerFloorRecordOuterClass.TowerFloorRecord;
public class PacketTowerAllDataRsp extends GenshinPacket {
import java.util.stream.Collectors;
public class PacketTowerAllDataRsp extends BasePacket {
public PacketTowerAllDataRsp() {
super(PacketOpcodes.TowerAllDataRsp);
var list = GameData.getTowerFloorDataMap().values().stream()
.map(TowerFloorData::getFloorId)
.map(id -> TowerFloorRecord.newBuilder().setFloorId(id).build())
.collect(Collectors.toList());
TowerAllDataRsp proto = TowerAllDataRsp.newBuilder()
.setTowerScheduleId(29)
.addTowerFloorRecordList(TowerFloorRecord.newBuilder().setFloorId(1001))
.addAllTowerFloorRecordList(list)
.setCurLevelRecord(TowerCurLevelRecord.newBuilder().setIsEmpty(true))
.setNextScheduleChangeTime(Integer.MAX_VALUE)
.putFloorOpenTimeMap(1024, 1630486800)
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TowerCurLevelRecordChangeNotifyOuterClass.TowerCurLevelRecordChangeNotify;
import emu.grasscutter.net.proto.TowerCurLevelRecordOuterClass.TowerCurLevelRecord;
public class PacketTowerCurLevelRecordChangeNotify extends BasePacket {
public PacketTowerCurLevelRecordChangeNotify(int curFloorId, int curLevelIndex) {
super(PacketOpcodes.TowerCurLevelRecordChangeNotify);
TowerCurLevelRecordChangeNotify proto = TowerCurLevelRecordChangeNotify.newBuilder()
.setCurLevelRecord(TowerCurLevelRecord.newBuilder()
.setCurFloorId(curFloorId)
.setCurLevelIndex(curLevelIndex)
// TODO team info
.build())
.build();
this.setData(proto);
}
}
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TowerEnterLevelRspOuterClass.TowerEnterLevelRsp;
public class PacketTowerEnterLevelRsp extends BasePacket {
public PacketTowerEnterLevelRsp(int floorId, int levelIndex) {
super(PacketOpcodes.TowerEnterLevelRsp);
TowerEnterLevelRsp proto = TowerEnterLevelRsp.newBuilder()
.setFloorId(floorId)
.setLevelIndex(levelIndex)
.addTowerBuffIdList(4)
.addTowerBuffIdList(28)
.addTowerBuffIdList(18)
.build();
this.setData(proto);
}
}
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TowerFloorRecordChangeNotifyOuterClass.TowerFloorRecordChangeNotify;
import emu.grasscutter.net.proto.TowerFloorRecordOuterClass.TowerFloorRecord;
import emu.grasscutter.net.proto.TowerLevelRecordOuterClass.TowerLevelRecord;
public class PacketTowerFloorRecordChangeNotify extends BasePacket {
public PacketTowerFloorRecordChangeNotify(int floorId) {
super(PacketOpcodes.TowerFloorRecordChangeNotify);
TowerFloorRecordChangeNotify proto = TowerFloorRecordChangeNotify.newBuilder()
.addTowerFloorRecordList(TowerFloorRecord.newBuilder()
.setFloorId(floorId)
.setFloorStarRewardProgress(3)
.addPassedLevelRecordList(TowerLevelRecord.newBuilder()
.setLevelId(1)
.addSatisfiedCondList(1)
.addSatisfiedCondList(2)
.addSatisfiedCondList(3)
.build())
.build())
.setIsFinishedEntranceFloor(true)
.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