Browse Source

Unused lastXYZ timers set but never used.

master
MagicBot 1 year ago
parent
commit
c79d9ae891
  1. 2
      src/engine/gameManager/CombatManager.java
  2. 13
      src/engine/gameManager/PowersManager.java
  3. 4
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java
  4. 22
      src/engine/objects/PlayerCharacter.java
  5. 2
      src/engine/powers/poweractions/StealPowerAction.java

2
src/engine/gameManager/CombatManager.java

@ -1197,8 +1197,6 @@ public enum CombatManager { @@ -1197,8 +1197,6 @@ public enum CombatManager {
if (target.getObjectType().equals(GameObjectType.PlayerCharacter))
pc.setLastPlayerAttackTime();
else
pc.setLastMobAttackTime();
}
public static float getWeaponRange(ItemBase weapon, PlayerBonuses bonus) {

13
src/engine/gameManager/PowersManager.java

@ -541,8 +541,6 @@ public enum PowersManager { @@ -541,8 +541,6 @@ public enum PowersManager {
playerCharacter.setLastMovementState(playerCharacter.getMovementState());
// update used power timer
playerCharacter.setLastUsedPowerTime();
// run timer job to end cast
if (time < 1) // run immediately
@ -751,9 +749,6 @@ public enum PowersManager { @@ -751,9 +749,6 @@ public enum PowersManager {
int trains = msg.getNumTrains();
// update used power timer
playerCharacter.setLastUsedPowerTime();
// verify player is not stunned or power type is blocked
PlayerBonuses bonus = playerCharacter.getBonuses();
@ -904,8 +899,6 @@ public enum PowersManager { @@ -904,8 +899,6 @@ public enum PowersManager {
if (pb.isHarmful())
if (target.getObjectType().equals(GameObjectType.PlayerCharacter) && target.getObjectUUID() != playerCharacter.getObjectUUID()) {
((PlayerCharacter) target).setLastTargetOfUsedPowerTime();
((PlayerCharacter) target).setTimeStamp("LastCombatPlayer", System.currentTimeMillis());
playerCharacter.setTimeStamp("LastCombatPlayer", System.currentTimeMillis());
}
@ -1087,12 +1080,8 @@ public enum PowersManager { @@ -1087,12 +1080,8 @@ public enum PowersManager {
// update target of used power timer
if (target.getObjectType().equals(GameObjectType.PlayerCharacter)) {
((PlayerCharacter) target).setLastTargetOfUsedPowerTime();
if (target.getObjectType().equals(GameObjectType.PlayerCharacter))
((PlayerCharacter) target).setTimeStamp("LastCombatPlayer", System.currentTimeMillis());
}
// finally Apply actions
for (ActionsBase ab : pb.getActions()) {

4
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -445,10 +445,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -445,10 +445,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
lock.writeLock().unlock();
}
// Update the player's last contract (What is this used for?)
playerCharacter.setLastContract(msg.getContractID());
// Remove the appropriate deed.
if (buildingCreated == true)
if (contract != null) {

22
src/engine/objects/PlayerCharacter.java

@ -84,6 +84,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -84,6 +84,7 @@ public class PlayerCharacter extends AbstractCharacter {
private final ConcurrentHashMap<Integer, LinkedList<Long>> chatChanFloodList = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
private final ConcurrentHashMap<Integer, Long> killMap = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
private final AtomicInteger trainsAvailable = new AtomicInteger(0); // num skill trains not used
public boolean notDeleted; // <-Use this for deleting character
// ===========================================
// Variables NOT to put into the database!!!! (session only)
@ -143,18 +144,14 @@ public class PlayerCharacter extends AbstractCharacter { @@ -143,18 +144,14 @@ public class PlayerCharacter extends AbstractCharacter {
private int hidden = 0; // current rank of hide/sneak/invis
private int seeInvis = 0; // current rank of see invis
private float speedMod;
private float raceRunMod;
private boolean teleportMode = false; // Teleport on MoveToPoint
private float dexPenalty;
private long lastPlayerAttackTime = 0;
private long lastMobAttackTime = 0;
private long lastUsedPowerTime = 0;
private long lastTargetOfUsedPowerTime = 0;
private long lastUpdateTime = System.currentTimeMillis();
private long lastStamUpdateTime = System.currentTimeMillis();
private boolean safeZone = false;
private int bindBuildingID;
private int lastContract;
/*
DataWarehouse based kill/death tracking.
These sets contain the last 10 UUID's
@ -2806,18 +2803,6 @@ public class PlayerCharacter extends AbstractCharacter { @@ -2806,18 +2803,6 @@ public class PlayerCharacter extends AbstractCharacter {
this.lastPlayerAttackTime = System.currentTimeMillis();
}
public void setLastMobAttackTime() {
this.lastMobAttackTime = System.currentTimeMillis();
}
public void setLastUsedPowerTime() {
this.lastUsedPowerTime = System.currentTimeMillis();
}
public void setLastTargetOfUsedPowerTime() {
this.lastTargetOfUsedPowerTime = System.currentTimeMillis();
}
public NPC getLastNPCDialog() {
return this.lastNPCDialog;
}
@ -2826,9 +2811,6 @@ public class PlayerCharacter extends AbstractCharacter { @@ -2826,9 +2811,6 @@ public class PlayerCharacter extends AbstractCharacter {
this.lastNPCDialog = value;
}
public void setLastContract(int value) {
this.lastContract = value;
}
public Mob getPet() {
return this.pet;

2
src/engine/powers/poweractions/StealPowerAction.java

@ -131,8 +131,6 @@ public class StealPowerAction extends AbstractPowerAction { @@ -131,8 +131,6 @@ public class StealPowerAction extends AbstractPowerAction {
//Handle target attacking back if in combat and has no other target
CombatManager.handleRetaliate(ownerAC, sourcePlayer);
} else if (owner.getObjectType().equals(Enum.GameObjectType.Mob)) {
sourcePlayer.setLastMobAttackTime(); //mark thief as mob aggressive
} else
return;

Loading…
Cancel
Save