Commit f1398182 authored by Yazawazi's avatar Yazawazi Committed by Melledy
Browse files

[Anime Game Version update] Support 2.7 (#1072)

* feature(2.7 version): support 2.7 version & upload new protos

1. Support GC in GI 2.7.0;
2. Upload new protos;
3. Fix some bugs cuz by new protos.

BREAKING CHANGE: all

* fix(database helper): fix player uid issues

* fix(ability embryo): uint32 to fixed32

* fix(proto): map mark

rename MAP_MARK_FROM_TYPE_NOE to MAP_MARK_FROM_TYPE_NONE

* fix(game version): change game version to 2.7.0

* perf(proto): remove unused protos

1. Remove unused protos;
2. Temporarily commented out some of the proto fields.

* fix(proto): uint32 to fixed32
parent a95002fd
...@@ -37,10 +37,10 @@ public class PacketMailChangeNotify extends BasePacket { ...@@ -37,10 +37,10 @@ public class PacketMailChangeNotify extends BasePacket {
for (Mail.MailItem item : message.itemList) { for (Mail.MailItem item : message.itemList) {
MailItemOuterClass.MailItem.Builder mailItem = MailItemOuterClass.MailItem.newBuilder(); MailItemOuterClass.MailItem.Builder mailItem = MailItemOuterClass.MailItem.newBuilder();
ItemParamOuterClass.ItemParam.Builder itemParam = ItemParamOuterClass.ItemParam.newBuilder(); EquipParamOuterClass.EquipParam.Builder itemParam = EquipParamOuterClass.EquipParam.newBuilder();
itemParam.setItemId(item.itemId); itemParam.setItemId(item.itemId);
itemParam.setCount(item.itemCount); itemParam.setItemNum(item.itemCount);
mailItem.setItemParam(itemParam.build()); mailItem.setEquipParam(itemParam.build());
mailItems.add(mailItem.build()); mailItems.add(mailItem.build());
} }
...@@ -54,7 +54,7 @@ public class PacketMailChangeNotify extends BasePacket { ...@@ -54,7 +54,7 @@ public class PacketMailChangeNotify extends BasePacket {
mailData.setImportance(message.importance); mailData.setImportance(message.importance);
mailData.setIsRead(message.isRead); mailData.setIsRead(message.isRead);
mailData.setIsAttachmentGot(message.isAttachmentGot); mailData.setIsAttachmentGot(message.isAttachmentGot);
mailData.setStateValue(message.stateValue); mailData.setBHCAHLJIKFFValue(message.stateValue);
proto.addMailList(mailData.build()); proto.addMailList(mailData.build());
} }
......
...@@ -23,7 +23,7 @@ public class PacketPlayerEnterSceneNotify extends BasePacket { ...@@ -23,7 +23,7 @@ public class PacketPlayerEnterSceneNotify extends BasePacket {
.setSceneId(player.getSceneId()) .setSceneId(player.getSceneId())
.setPos(player.getPos().toProto()) .setPos(player.getPos().toProto())
.setSceneBeginTime(System.currentTimeMillis()) .setSceneBeginTime(System.currentTimeMillis())
.setType(EnterType.ENTER_SELF) .setType(EnterType.ENTER_TYPE_SELF)
.setTargetUid(player.getUid()) .setTargetUid(player.getUid())
.setEnterSceneToken(player.getEnterSceneToken()) .setEnterSceneToken(player.getEnterSceneToken())
.setWorldLevel(player.getWorldLevel()) .setWorldLevel(player.getWorldLevel())
......
...@@ -18,7 +18,7 @@ public class PacketPlayerStoreNotify extends BasePacket { ...@@ -18,7 +18,7 @@ public class PacketPlayerStoreNotify extends BasePacket {
this.buildHeader(2); this.buildHeader(2);
PlayerStoreNotify.Builder p = PlayerStoreNotify.newBuilder() PlayerStoreNotify.Builder p = PlayerStoreNotify.newBuilder()
.setStoreType(StoreType.STORE_PACK) .setStoreType(StoreType.STORE_TYPE_PACK)
.setWeightLimit(GAME_OPTIONS.inventoryLimits.all); .setWeightLimit(GAME_OPTIONS.inventoryLimits.all);
for (GameItem item : player.getInventory()) { for (GameItem item : player.getInventory()) {
......
...@@ -3,20 +3,59 @@ package emu.grasscutter.server.packet.send; ...@@ -3,20 +3,59 @@ package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerWorldSceneInfoListNotifyOuterClass.PlayerWorldSceneInfoListNotify; import emu.grasscutter.net.proto.PlayerWorldSceneInfoListNotifyOuterClass.PlayerWorldSceneInfoListNotify;
import emu.grasscutter.net.proto.PlayerWorldSceneInfoOuterClass;
import emu.grasscutter.net.proto.SceneUnlockInfoOuterClass.SceneUnlockInfo; import emu.grasscutter.net.proto.SceneUnlockInfoOuterClass.SceneUnlockInfo;
import static emu.grasscutter.net.proto.PlayerWorldSceneInfoOuterClass.*;
public class PacketPlayerWorldSceneInfoListNotify extends BasePacket { public class PacketPlayerWorldSceneInfoListNotify extends BasePacket {
public PacketPlayerWorldSceneInfoListNotify() { public PacketPlayerWorldSceneInfoListNotify() {
super(PacketOpcodes.PlayerWorldSceneInfoListNotify); // Rename opcode later super(PacketOpcodes.PlayerWorldSceneInfoListNotify); // Rename opcode later
PlayerWorldSceneInfoListNotify proto = PlayerWorldSceneInfoListNotify.newBuilder() PlayerWorldSceneInfoListNotify proto = PlayerWorldSceneInfoListNotify.newBuilder()
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(1)) .addInfoList(
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(3).addSceneTagIdList(102).addSceneTagIdList(113).addSceneTagIdList(117)) PlayerWorldSceneInfo.newBuilder()
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(4).addSceneTagIdList(106).addSceneTagIdList(109)) .setSceneId(1)
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(5)) .setIsLocked(false)
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(6)) .build()
.addUnlockInfos(SceneUnlockInfo.newBuilder().setSceneId(7)) )
.addInfoList(
PlayerWorldSceneInfo.newBuilder()
.setSceneId(3)
.setIsLocked(false)
.addSceneTagIdList(102)
.addSceneTagIdList(113)
.addSceneTagIdList(117)
.build()
)
.addInfoList(
PlayerWorldSceneInfo.newBuilder()
.setSceneId(4)
.setIsLocked(false)
.addSceneTagIdList(106)
.addSceneTagIdList(109)
.addSceneTagIdList(117)
.build()
)
.addInfoList(
PlayerWorldSceneInfo.newBuilder()
.setSceneId(5)
.setIsLocked(false)
.build()
)
.addInfoList(
PlayerWorldSceneInfo.newBuilder()
.setSceneId(6)
.setIsLocked(false)
.build()
)
.addInfoList(
PlayerWorldSceneInfo.newBuilder()
.setSceneId(7)
.setIsLocked(false)
.build()
)
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -17,7 +17,7 @@ public class PacketQueryCodexMonsterBeKilledNumRsp extends BasePacket { ...@@ -17,7 +17,7 @@ public class PacketQueryCodexMonsterBeKilledNumRsp extends BasePacket {
if(player.getCodex().getUnlockedAnimal().containsKey(animal)){ if(player.getCodex().getUnlockedAnimal().containsKey(animal)){
proto.addCodexIdList(animal) proto.addCodexIdList(animal)
.addBeKilledNumList(player.getCodex().getUnlockedAnimal().get(animal)) .addBeKilledNumList(player.getCodex().getUnlockedAnimal().get(animal))
.addBeKilledNumEmptyList(0); .addCHPBKCLKPCJ(0);
} }
}); });
......
...@@ -15,7 +15,7 @@ public class PacketSceneEntityAppearNotify extends BasePacket { ...@@ -15,7 +15,7 @@ public class PacketSceneEntityAppearNotify extends BasePacket {
super(PacketOpcodes.SceneEntityAppearNotify, true); super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder() SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
.setAppearType(VisionType.VISION_BORN) .setAppearType(VisionType.VISION_TYPE_BORN)
.addEntityList(entity.toProto()); .addEntityList(entity.toProto());
this.setData(proto.build()); this.setData(proto.build());
......
...@@ -18,7 +18,7 @@ public class PacketStoreItemChangeNotify extends BasePacket { ...@@ -18,7 +18,7 @@ public class PacketStoreItemChangeNotify extends BasePacket {
this(); this();
StoreItemChangeNotify.Builder proto = StoreItemChangeNotify.newBuilder() StoreItemChangeNotify.Builder proto = StoreItemChangeNotify.newBuilder()
.setStoreType(StoreType.STORE_PACK) .setStoreType(StoreType.STORE_TYPE_PACK)
.addItemList(item.toProto()); .addItemList(item.toProto());
this.setData(proto); this.setData(proto);
...@@ -28,7 +28,7 @@ public class PacketStoreItemChangeNotify extends BasePacket { ...@@ -28,7 +28,7 @@ public class PacketStoreItemChangeNotify extends BasePacket {
this(); this();
StoreItemChangeNotify.Builder proto = StoreItemChangeNotify.newBuilder() StoreItemChangeNotify.Builder proto = StoreItemChangeNotify.newBuilder()
.setStoreType(StoreType.STORE_PACK); .setStoreType(StoreType.STORE_TYPE_PACK);
items.forEach(item -> proto.addItemList(item.toProto())); items.forEach(item -> proto.addItemList(item.toProto()));
......
...@@ -18,7 +18,7 @@ public class PacketStoreItemDelNotify extends BasePacket { ...@@ -18,7 +18,7 @@ public class PacketStoreItemDelNotify extends BasePacket {
this(); this();
StoreItemDelNotify.Builder proto = StoreItemDelNotify.newBuilder() StoreItemDelNotify.Builder proto = StoreItemDelNotify.newBuilder()
.setStoreType(StoreType.STORE_PACK) .setStoreType(StoreType.STORE_TYPE_PACK)
.addGuidList(item.getGuid()); .addGuidList(item.getGuid());
this.setData(proto); this.setData(proto);
...@@ -28,7 +28,7 @@ public class PacketStoreItemDelNotify extends BasePacket { ...@@ -28,7 +28,7 @@ public class PacketStoreItemDelNotify extends BasePacket {
this(); this();
StoreItemDelNotify.Builder proto = StoreItemDelNotify.newBuilder() StoreItemDelNotify.Builder proto = StoreItemDelNotify.newBuilder()
.setStoreType(StoreType.STORE_PACK); .setStoreType(StoreType.STORE_TYPE_PACK);
items.stream().forEach(item -> proto.addGuidList(item.getGuid())); items.stream().forEach(item -> proto.addGuidList(item.getGuid()));
......
...@@ -13,7 +13,7 @@ public class PacketStoreWeightLimitNotify extends BasePacket { ...@@ -13,7 +13,7 @@ public class PacketStoreWeightLimitNotify extends BasePacket {
super(PacketOpcodes.StoreWeightLimitNotify); super(PacketOpcodes.StoreWeightLimitNotify);
StoreWeightLimitNotify p = StoreWeightLimitNotify.newBuilder() StoreWeightLimitNotify p = StoreWeightLimitNotify.newBuilder()
.setStoreType(StoreType.STORE_PACK) .setStoreType(StoreType.STORE_TYPE_PACK)
.setWeightLimit(INVENTORY_LIMITS.all) .setWeightLimit(INVENTORY_LIMITS.all)
.setWeaponCountLimit(INVENTORY_LIMITS.weapons) .setWeaponCountLimit(INVENTORY_LIMITS.weapons)
.setReliquaryCountLimit(INVENTORY_LIMITS.relics) .setReliquaryCountLimit(INVENTORY_LIMITS.relics)
......
...@@ -31,10 +31,10 @@ public class PacketVehicleInteractRsp extends BasePacket { ...@@ -31,10 +31,10 @@ public class PacketVehicleInteractRsp extends BasePacket {
proto.setMember(vehicleMember); proto.setMember(vehicleMember);
switch(interactType){ switch(interactType){
case VEHICLE_INTERACT_IN -> { case VEHICLE_INTERACT_TYPE_IN -> {
((EntityVehicle) vehicle).getVehicleMembers().add(vehicleMember); ((EntityVehicle) vehicle).getVehicleMembers().add(vehicleMember);
} }
case VEHICLE_INTERACT_OUT -> { case VEHICLE_INTERACT_TYPE_OUT -> {
((EntityVehicle) vehicle).getVehicleMembers().remove(vehicleMember); ((EntityVehicle) vehicle).getVehicleMembers().remove(vehicleMember);
} }
default -> {} default -> {}
...@@ -53,10 +53,10 @@ public class PacketVehicleInteractRsp extends BasePacket { ...@@ -53,10 +53,10 @@ public class PacketVehicleInteractRsp extends BasePacket {
proto.setMember(vehicleMember); proto.setMember(vehicleMember);
switch(interactType){ switch(interactType){
case VEHICLE_INTERACT_IN -> { case VEHICLE_INTERACT_TYPE_IN -> {
vehicle.getVehicleMembers().add(vehicleMember); vehicle.getVehicleMembers().add(vehicleMember);
} }
case VEHICLE_INTERACT_OUT -> { case VEHICLE_INTERACT_TYPE_OUT -> {
vehicle.getVehicleMembers().remove(vehicleMember); vehicle.getVehicleMembers().remove(vehicleMember);
} }
default -> {} default -> {}
......
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