[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
This commit is contained in:
Yazawazi
2022-05-28 14:58:12 +08:00
committed by Melledy
parent a95002fd40
commit f139818224
50 changed files with 1726 additions and 1727 deletions

View File

@@ -253,7 +253,7 @@ public class EnergyManager {
float elementBonus = (ballElement == null) ? 2.0f : (avatarElement == ballElement) ? 3.0f : 1.0f;
// Add the energy.
entity.addEnergy(baseEnergy * elementBonus * offFieldPenalty * elemBall.getCount(), PropChangeReason.PROP_CHANGE_ENERGY_BALL);
entity.addEnergy(baseEnergy * elementBonus * offFieldPenalty * elemBall.getCount(), PropChangeReason.PROP_CHANGE_REASON_ENERGY_BALL);
}
}
@@ -268,7 +268,7 @@ public class EnergyManager {
// If the cast skill was a burst, consume energy.
if (avatar.getSkillDepot() != null && skillId == avatar.getSkillDepot().getEnergySkill()) {
avatar.getAsEntity().clearEnergy(PropChangeReason.PROP_CHANGE_ABILITY);
avatar.getAsEntity().clearEnergy(PropChangeReason.PROP_CHANGE_REASON_ABILITY);
}
}

View File

@@ -24,7 +24,7 @@ public class MapMarksManager {
public void handleMapMarkReq(MarkMapReq req) {
Operation op = req.getOp();
switch (op) {
case ADD -> {
case OPERATION_ADD -> {
MapMark createMark = new MapMark(req.getMark());
// keep teleporting functionality on fishhook mark.
if (createMark.getMapMarkPointType() == MapMarkPointType.MAP_MARK_POINT_TYPE_FISH_POOL) {
@@ -33,18 +33,18 @@ public class MapMarksManager {
}
addMapMark(createMark);
}
case MOD -> {
case OPERATION_MOD -> {
MapMark oldMark = new MapMark(req.getOld());
removeMapMark(oldMark.getPosition());
MapMark newMark = new MapMark(req.getMark());
addMapMark(newMark);
}
case DEL -> {
case OPERATION_DEL -> {
MapMark deleteMark = new MapMark(req.getMark());
removeMapMark(deleteMark.getPosition());
}
}
if (op != Operation.GET) {
if (op != Operation.OPERATION_GET) {
saveMapMarks();
}
player.getSession().send(new PacketMarkMapRsp(getMapMarks()));

View File

@@ -27,7 +27,7 @@ public class MultiplayerManager {
public void applyEnterMp(Player player, int targetUid) {
Player target = getServer().getPlayerByUid(targetUid);
if (target == null) {
player.sendPacket(new PacketPlayerApplyEnterMpResultNotify(targetUid, "", false, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason.PLAYER_CANNOT_ENTER_MP));
player.sendPacket(new PacketPlayerApplyEnterMpResultNotify(targetUid, "", false, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason.REASON_PLAYER_CANNOT_ENTER_MP));
return;
}
@@ -72,12 +72,12 @@ public class MultiplayerManager {
// Sanity checks - Dont let the requesting player join if they are already in multiplayer
if (requester.getWorld().isMultiplayer()) {
request.getRequester().sendPacket(new PacketPlayerApplyEnterMpResultNotify(hostPlayer, false, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason.PLAYER_CANNOT_ENTER_MP));
request.getRequester().sendPacket(new PacketPlayerApplyEnterMpResultNotify(hostPlayer, false, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason.REASON_PLAYER_CANNOT_ENTER_MP));
return;
}
// Response packet
request.getRequester().sendPacket(new PacketPlayerApplyEnterMpResultNotify(hostPlayer, isAgreed, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason.PLAYER_JUDGE));
request.getRequester().sendPacket(new PacketPlayerApplyEnterMpResultNotify(hostPlayer, isAgreed, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason.REASON_PLAYER_JUDGE));
// Declined
if (!isAgreed) {
@@ -93,7 +93,7 @@ public class MultiplayerManager {
world.addPlayer(hostPlayer);
// Rejoin packet
hostPlayer.sendPacket(new PacketPlayerEnterSceneNotify(hostPlayer, hostPlayer, EnterType.ENTER_SELF, EnterReason.HostFromSingleToMp, hostPlayer.getScene().getId(), hostPlayer.getPos()));
hostPlayer.sendPacket(new PacketPlayerEnterSceneNotify(hostPlayer, hostPlayer, EnterType.ENTER_TYPE_SELF, EnterReason.HostFromSingleToMp, hostPlayer.getScene().getId(), hostPlayer.getPos()));
}
// Set scene pos and id of requester to the host player's
@@ -105,7 +105,7 @@ public class MultiplayerManager {
hostPlayer.getWorld().addPlayer(requester);
// Packet
requester.sendPacket(new PacketPlayerEnterSceneNotify(requester, hostPlayer, EnterType.ENTER_OTHER, EnterReason.TeamJoin, hostPlayer.getScene().getId(), hostPlayer.getPos()));
requester.sendPacket(new PacketPlayerEnterSceneNotify(requester, hostPlayer, EnterType.ENTER_TYPE_OTHER, EnterReason.TeamJoin, hostPlayer.getScene().getId(), hostPlayer.getPos()));
}
public boolean leaveCoop(Player player) {
@@ -126,7 +126,7 @@ public class MultiplayerManager {
world.addPlayer(player);
// Packet
player.sendPacket(new PacketPlayerEnterSceneNotify(player, EnterType.ENTER_SELF, EnterReason.TeamBack, player.getScene().getId(), player.getPos()));
player.sendPacket(new PacketPlayerEnterSceneNotify(player, EnterType.ENTER_TYPE_SELF, EnterReason.TeamBack, player.getScene().getId(), player.getPos()));
return true;
}
@@ -153,7 +153,7 @@ public class MultiplayerManager {
World world = new World(victim);
world.addPlayer(victim);
victim.sendPacket(new PacketPlayerEnterSceneNotify(victim, EnterType.ENTER_SELF, EnterReason.TeamKick, victim.getScene().getId(), victim.getPos()));
victim.sendPacket(new PacketPlayerEnterSceneNotify(victim, EnterType.ENTER_TYPE_SELF, EnterReason.TeamKick, victim.getScene().getId(), victim.getPos()));
return true;
}
}

View File

@@ -158,8 +158,8 @@ public class SotSManager {
logger.trace("Healing avatar " + entity.getAvatar().getAvatarData().getName() + " +" + needHP);
player.getTeamManager().healAvatar(entity.getAvatar(), 0, needHP);
player.getSession().send(new PacketEntityFightPropChangeReasonNotify(entity, FightProperty.FIGHT_PROP_CUR_HP,
((float) needHP / 100), List.of(3), PropChangeReason.PROP_CHANGE_STATUE_RECOVER,
ChangeHpReason.ChangeHpAddStatue));
((float) needHP / 100), List.of(3), PropChangeReason.PROP_CHANGE_REASON_STATUE_RECOVER,
ChangeHpReason.CHANGE_HP_REASON_CHANGE_HP_ADD_STATUE));
player.getSession().send(new PacketEntityFightPropUpdateNotify(entity, FightProperty.FIGHT_PROP_CUR_HP));
}

View File

@@ -31,81 +31,81 @@ public class StaminaManager {
private final Player player;
private static final HashMap<String, HashSet<MotionState>> MotionStatesCategorized = new HashMap<>() {{
put("CLIMB", new HashSet<>(List.of(
MotionState.MOTION_CLIMB, // sustained, when not moving no cost no recover
MotionState.MOTION_STANDBY_TO_CLIMB // NOT OBSERVED, see MOTION_JUMP_UP_WALL_FOR_STANDBY
MotionState.MOTION_STATE_CLIMB, // sustained, when not moving no cost no recover
MotionState.MOTION_STATE_STANDBY_TO_CLIMB // NOT OBSERVED, see MOTION_JUMP_UP_WALL_FOR_STANDBY
)));
put("DASH", new HashSet<>(List.of(
MotionState.MOTION_DANGER_DASH, // sustained
MotionState.MOTION_DASH // sustained
MotionState.MOTION_STATE_DANGER_DASH, // sustained
MotionState.MOTION_STATE_DASH // sustained
)));
put("FLY", new HashSet<>(List.of(
MotionState.MOTION_FLY, // sustained
MotionState.MOTION_FLY_FAST, // sustained
MotionState.MOTION_FLY_SLOW, // sustained
MotionState.MOTION_POWERED_FLY // sustained, recover
MotionState.MOTION_STATE_FLY, // sustained
MotionState.MOTION_STATE_FLY_FAST, // sustained
MotionState.MOTION_STATE_FLY_SLOW, // sustained
MotionState.MOTION_STATE_POWERED_FLY // sustained, recover
)));
put("RUN", new HashSet<>(List.of(
MotionState.MOTION_DANGER_RUN, // sustained, recover
MotionState.MOTION_RUN // sustained, recover
MotionState.MOTION_STATE_DANGER_RUN, // sustained, recover
MotionState.MOTION_STATE_RUN // sustained, recover
)));
put("SKIFF", new HashSet<>(List.of(
MotionState.MOTION_SKIFF_BOARDING, // NOT OBSERVED even when boarding
MotionState.MOTION_SKIFF_DASH, // sustained, observed with waverider entity ID.
MotionState.MOTION_SKIFF_NORMAL, // sustained, OBSERVED when both normal and dashing
MotionState.MOTION_SKIFF_POWERED_DASH // sustained, recover
MotionState.MOTION_STATE_SKIFF_BOARDING, // NOT OBSERVED even when boarding
MotionState.MOTION_STATE_SKIFF_DASH, // sustained, observed with waverider entity ID.
MotionState.MOTION_STATE_SKIFF_NORMAL, // sustained, OBSERVED when both normal and dashing
MotionState.MOTION_STATE_SKIFF_POWERED_DASH // sustained, recover
)));
put("STANDBY", new HashSet<>(List.of(
MotionState.MOTION_DANGER_STANDBY_MOVE, // sustained, recover
MotionState.MOTION_DANGER_STANDBY, // sustained, recover
MotionState.MOTION_LADDER_TO_STANDBY, // NOT OBSERVED
MotionState.MOTION_STANDBY_MOVE, // sustained, recover
MotionState.MOTION_STANDBY // sustained, recover
MotionState.MOTION_STATE_DANGER_STANDBY_MOVE, // sustained, recover
MotionState.MOTION_STATE_DANGER_STANDBY, // sustained, recover
MotionState.MOTION_STATE_LADDER_TO_STANDBY, // NOT OBSERVED
MotionState.MOTION_STATE_STANDBY_MOVE, // sustained, recover
MotionState.MOTION_STATE_STANDBY // sustained, recover
)));
put("SWIM", new HashSet<>(List.of(
MotionState.MOTION_SWIM_IDLE, // sustained
MotionState.MOTION_SWIM_DASH, // immediate and sustained
MotionState.MOTION_SWIM_JUMP, // NOT OBSERVED
MotionState.MOTION_SWIM_MOVE // sustained
MotionState.MOTION_STATE_SWIM_IDLE, // sustained
MotionState.MOTION_STATE_SWIM_DASH, // immediate and sustained
MotionState.MOTION_STATE_SWIM_JUMP, // NOT OBSERVED
MotionState.MOTION_STATE_SWIM_MOVE // sustained
)));
put("WALK", new HashSet<>(List.of(
MotionState.MOTION_DANGER_WALK, // sustained, recover
MotionState.MOTION_WALK // sustained, recover
MotionState.MOTION_STATE_DANGER_WALK, // sustained, recover
MotionState.MOTION_STATE_WALK // sustained, recover
)));
put("OTHER", new HashSet<>(List.of(
MotionState.MOTION_CLIMB_JUMP, // cost only once if repeated without switching state
MotionState.MOTION_DASH_BEFORE_SHAKE, // immediate one time sprint charge.
MotionState.MOTION_FIGHT, // immediate, if sustained then subsequent will be MOTION_NOTIFY
MotionState.MOTION_JUMP_UP_WALL_FOR_STANDBY, // immediate, observed when RUN/WALK->CLIMB
MotionState.MOTION_NOTIFY, // can be either cost or recover - check previous state and check skill casting
MotionState.MOTION_SIT_IDLE, // sustained, recover
MotionState.MOTION_JUMP // recover
MotionState.MOTION_STATE_CLIMB_JUMP, // cost only once if repeated without switching state
MotionState.MOTION_STATE_DASH_BEFORE_SHAKE, // immediate one time sprint charge.
MotionState.MOTION_STATE_FIGHT, // immediate, if sustained then subsequent will be MOTION_NOTIFY
MotionState.MOTION_STATE_JUMP_UP_WALL_FOR_STANDBY, // immediate, observed when RUN/WALK->CLIMB
MotionState.MOTION_STATE_NOTIFY, // can be either cost or recover - check previous state and check skill casting
MotionState.MOTION_STATE_SIT_IDLE, // sustained, recover
MotionState.MOTION_STATE_JUMP // recover
)));
put("NOCOST_NORECOVER", new HashSet<>(List.of(
MotionState.MOTION_LADDER_SLIP, // NOT OBSERVED
MotionState.MOTION_SLIP, // sustained, no cost no recover
MotionState.MOTION_FLY_IDLE // NOT OBSERVED
MotionState.MOTION_STATE_LADDER_SLIP, // NOT OBSERVED
MotionState.MOTION_STATE_SLIP, // sustained, no cost no recover
MotionState.MOTION_STATE_FLY_IDLE // NOT OBSERVED
)));
put("IGNORE", new HashSet<>(List.of(
// these states have no impact on stamina
MotionState.MOTION_CROUCH_IDLE,
MotionState.MOTION_CROUCH_MOVE,
MotionState.MOTION_CROUCH_ROLL,
MotionState.MOTION_DESTROY_VEHICLE,
MotionState.MOTION_FALL_ON_GROUND,
MotionState.MOTION_FOLLOW_ROUTE,
MotionState.MOTION_FORCE_SET_POS,
MotionState.MOTION_GO_UPSTAIRS,
MotionState.MOTION_JUMP_OFF_WALL,
MotionState.MOTION_LADDER_IDLE,
MotionState.MOTION_LADDER_MOVE,
MotionState.MOTION_LAND_SPEED,
MotionState.MOTION_MOVE_FAIL_ACK,
MotionState.MOTION_NONE,
MotionState.MOTION_NUM,
MotionState.MOTION_QUEST_FORCE_DRAG,
MotionState.MOTION_RESET,
MotionState.MOTION_STANDBY_TO_LADDER,
MotionState.MOTION_WATERFALL
MotionState.MOTION_STATE_CROUCH_IDLE,
MotionState.MOTION_STATE_CROUCH_MOVE,
MotionState.MOTION_STATE_CROUCH_ROLL,
MotionState.MOTION_STATE_DESTROY_VEHICLE,
MotionState.MOTION_STATE_FALL_ON_GROUND,
MotionState.MOTION_STATE_FOLLOW_ROUTE,
MotionState.MOTION_STATE_FORCE_SET_POS,
MotionState.MOTION_STATE_GO_UPSTAIRS,
MotionState.MOTION_STATE_JUMP_OFF_WALL,
MotionState.MOTION_STATE_LADDER_IDLE,
MotionState.MOTION_STATE_LADDER_MOVE,
MotionState.MOTION_STATE_LAND_SPEED,
MotionState.MOTION_STATE_MOVE_FAIL_ACK,
MotionState.MOTION_STATE_NONE,
MotionState.MOTION_STATE_NUM,
MotionState.MOTION_STATE_QUEST_FORCE_DRAG,
MotionState.MOTION_STATE_RESET,
MotionState.MOTION_STATE_STANDBY_TO_LADDER,
MotionState.MOTION_STATE_WATERFALL
)));
}};
@@ -114,8 +114,8 @@ public class StaminaManager {
public final static int GlobalVehicleMaxStamina = 24000;
private Position currentCoordinates = new Position(0, 0, 0);
private Position previousCoordinates = new Position(0, 0, 0);
private MotionState currentState = MotionState.MOTION_STANDBY;
private MotionState previousState = MotionState.MOTION_STANDBY;
private MotionState currentState = MotionState.MOTION_STATE_STANDBY;
private MotionState previousState = MotionState.MOTION_STATE_STANDBY;
private Timer sustainedStaminaHandlerTimer;
private GameSession cachedSession = null;
private GameEntity cachedEntity = null;
@@ -406,7 +406,7 @@ public class StaminaManager {
}
public void handleVehicleInteractReq(GameSession session, int vehicleId, VehicleInteractType vehicleInteractType) {
if (vehicleInteractType == VehicleInteractType.VEHICLE_INTERACT_IN) {
if (vehicleInteractType == VehicleInteractType.VEHICLE_INTERACT_TYPE_IN) {
this.vehicleId = vehicleId;
// Reset character stamina here to prevent falling into water immediately on ejection if char stamina is
// close to empty when boarding.
@@ -421,23 +421,23 @@ public class StaminaManager {
private void handleImmediateStamina(GameSession session, @NotNull MotionState motionState) {
switch (motionState) {
case MOTION_CLIMB:
if (currentState != MotionState.MOTION_CLIMB) {
case MOTION_STATE_CLIMB:
if (currentState != MotionState.MOTION_STATE_CLIMB) {
updateStaminaRelative(session, new Consumption(ConsumptionType.CLIMB_START), true);
}
break;
case MOTION_DASH_BEFORE_SHAKE:
if (previousState != MotionState.MOTION_DASH_BEFORE_SHAKE) {
case MOTION_STATE_DASH_BEFORE_SHAKE:
if (previousState != MotionState.MOTION_STATE_DASH_BEFORE_SHAKE) {
updateStaminaRelative(session, new Consumption(ConsumptionType.SPRINT), true);
}
break;
case MOTION_CLIMB_JUMP:
if (previousState != MotionState.MOTION_CLIMB_JUMP) {
case MOTION_STATE_CLIMB_JUMP:
if (previousState != MotionState.MOTION_STATE_CLIMB_JUMP) {
updateStaminaRelative(session, new Consumption(ConsumptionType.CLIMB_JUMP), true);
}
break;
case MOTION_SWIM_DASH:
if (previousState != MotionState.MOTION_SWIM_DASH) {
case MOTION_STATE_SWIM_DASH:
if (previousState != MotionState.MOTION_STATE_SWIM_DASH) {
updateStaminaRelative(session, new Consumption(ConsumptionType.SWIM_DASH_START), true);
}
break;
@@ -526,8 +526,8 @@ public class StaminaManager {
if (stamina < 10) {
logger.trace(getCurrentCharacterStamina() + "/" +
getMaxCharacterStamina() + "\t" + currentState);
if (currentState != MotionState.MOTION_SWIM_IDLE) {
killAvatar(cachedSession, cachedEntity, PlayerDieType.PLAYER_DIE_DRAWN);
if (currentState != MotionState.MOTION_STATE_SWIM_IDLE) {
killAvatar(cachedSession, cachedEntity, PlayerDieType.PLAYER_DIE_TYPE_DRAWN);
}
}
}
@@ -568,7 +568,7 @@ public class StaminaManager {
private Consumption getClimbConsumption() {
Consumption consumption = new Consumption();
if (currentState == MotionState.MOTION_CLIMB && isPlayerMoving()) {
if (currentState == MotionState.MOTION_STATE_CLIMB && isPlayerMoving()) {
consumption.type = ConsumptionType.CLIMBING;
consumption.amount = ConsumptionType.CLIMBING.amount;
}
@@ -581,11 +581,11 @@ public class StaminaManager {
private Consumption getSwimConsumptions() {
handleDrowning();
Consumption consumption = new Consumption();
if (currentState == MotionState.MOTION_SWIM_MOVE) {
if (currentState == MotionState.MOTION_STATE_SWIM_MOVE) {
consumption.type = ConsumptionType.SWIMMING;
consumption.amount = ConsumptionType.SWIMMING.amount;
}
if (currentState == MotionState.MOTION_SWIM_DASH) {
if (currentState == MotionState.MOTION_STATE_SWIM_DASH) {
consumption.type = ConsumptionType.SWIM_DASH;
consumption.amount = ConsumptionType.SWIM_DASH.amount;
}
@@ -597,7 +597,7 @@ public class StaminaManager {
private Consumption getDashConsumption() {
Consumption consumption = new Consumption();
if (currentState == MotionState.MOTION_DASH) {
if (currentState == MotionState.MOTION_STATE_DASH) {
consumption.type = ConsumptionType.DASH;
consumption.amount = ConsumptionType.DASH.amount;
// Dashing specific reductions
@@ -608,7 +608,7 @@ public class StaminaManager {
private Consumption getFlyConsumption() {
// POWERED_FLY, e.g. wind tunnel
if (currentState == MotionState.MOTION_POWERED_FLY) {
if (currentState == MotionState.MOTION_STATE_POWERED_FLY) {
return new Consumption(ConsumptionType.POWERED_FLY);
}
Consumption consumption = new Consumption(ConsumptionType.FLY);
@@ -621,21 +621,21 @@ public class StaminaManager {
private Consumption getSkiffConsumption() {
// No known reduction for skiffing.
return switch (currentState) {
case MOTION_SKIFF_DASH -> new Consumption(ConsumptionType.SKIFF_DASH);
case MOTION_SKIFF_POWERED_DASH -> new Consumption(ConsumptionType.POWERED_SKIFF);
case MOTION_SKIFF_NORMAL -> new Consumption(ConsumptionType.SKIFF);
case MOTION_STATE_SKIFF_DASH -> new Consumption(ConsumptionType.SKIFF_DASH);
case MOTION_STATE_SKIFF_POWERED_DASH -> new Consumption(ConsumptionType.POWERED_SKIFF);
case MOTION_STATE_SKIFF_NORMAL -> new Consumption(ConsumptionType.SKIFF);
default -> new Consumption();
};
}
private Consumption getOtherConsumptions() {
switch (currentState) {
case MOTION_NOTIFY:
case MOTION_STATE_NOTIFY:
// if (BowSkills.contains(lastSkillId)) {
// return new Consumption(ConsumptionType.FIGHT, 500);
// }
break;
case MOTION_FIGHT:
case MOTION_STATE_FIGHT:
// TODO: what if charged attack
return new Consumption(ConsumptionType.FIGHT, 500);
}