Browse Source

create PlayerManager static class

lakebane-optimize
FatBoy-DOTC 2 weeks ago
parent
commit
450ae2ec82
  1. 25
      src/engine/InterestManagement/InterestManager.java
  2. 3
      src/engine/db/handlers/dbAccountHandler.java
  3. 4
      src/engine/db/handlers/dbCSSessionHandler.java
  4. 3
      src/engine/db/handlers/dbGuildHandler.java
  5. 3
      src/engine/devcmd/cmds/AuditFailedItemsCmd.java
  6. 5
      src/engine/devcmd/cmds/DecachePlayerCmd.java
  7. 3
      src/engine/devcmd/cmds/GotoBoundsCmd.java
  8. 9
      src/engine/devcmd/cmds/GotoCmd.java
  9. 3
      src/engine/devcmd/cmds/GotoObj.java
  10. 3
      src/engine/devcmd/cmds/InfoCmd.java
  11. 5
      src/engine/devcmd/cmds/JumpCmd.java
  12. 9
      src/engine/devcmd/cmds/MakeBaneCmd.java
  13. 3
      src/engine/devcmd/cmds/ResetLevelCmd.java
  14. 3
      src/engine/devcmd/cmds/SlotTestCmd.java
  15. 3
      src/engine/devcmd/cmds/SummonCmd.java
  16. 3
      src/engine/devcmd/cmds/aiInfoCmd.java
  17. 6
      src/engine/gameManager/CombatManager.java
  18. 2
      src/engine/gameManager/DbManager.java
  19. 10
      src/engine/gameManager/GuildManager.java
  20. 2392
      src/engine/gameManager/PlayerManager.java
  21. 6
      src/engine/gameManager/PowersManager.java
  22. 2
      src/engine/gameManager/TradeManager.java
  23. 3
      src/engine/jobs/DatabaseUpdateJob.java
  24. 4
      src/engine/jobs/FinishSummonsJob.java
  25. 3
      src/engine/jobs/StuckJob.java
  26. 3
      src/engine/jobs/TeleportJob.java
  27. 13
      src/engine/mobileAI/MobAI.java
  28. 30
      src/engine/net/client/ClientMessagePump.java
  29. 7
      src/engine/net/client/handlers/AcceptInviteToGuildHandler.java
  30. 2
      src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java
  31. 7
      src/engine/net/client/handlers/BanishUnbanishHandler.java
  32. 3
      src/engine/net/client/handlers/ChangeAltitudeHandler.java
  33. 13
      src/engine/net/client/handlers/ChangeGuildLeaderHandler.java
  34. 15
      src/engine/net/client/handlers/ChangeRankHandler.java
  35. 5
      src/engine/net/client/handlers/DisbandGuildHandler.java
  36. 3
      src/engine/net/client/handlers/GuildControlHandler.java
  37. 13
      src/engine/net/client/handlers/GuildCreationFinalizeHandler.java
  38. 3
      src/engine/net/client/handlers/GuildInfoHandler.java
  39. 3
      src/engine/net/client/handlers/MerchantMsgHandler.java
  40. 2
      src/engine/net/client/handlers/ObjectActionMsgHandler.java
  41. 7
      src/engine/net/client/handlers/OpenFriendsCondemnListMsgHandler.java
  42. 5
      src/engine/net/client/handlers/RequestEnterWorldHandler.java
  43. 3
      src/engine/net/client/handlers/SwearInHandler.java
  44. 3
      src/engine/net/client/handlers/TransferAssetMsgHandler.java
  45. 11
      src/engine/net/client/msg/ApplyRuneMsg.java
  46. 3
      src/engine/net/client/msg/ArcViewAssetTransactionsMsg.java
  47. 3
      src/engine/net/client/msg/BuyFromNPCWindowMsg.java
  48. 7
      src/engine/net/client/msg/IgnoreMsg.java
  49. 5
      src/engine/net/client/msg/OpenFriendsCondemnListMsg.java
  50. 11
      src/engine/net/client/msg/RefineMsg.java
  51. 3
      src/engine/net/client/msg/SendOwnPlayerMsg.java
  52. 3
      src/engine/net/client/msg/TerritoryChangeMessage.java
  53. 5
      src/engine/net/client/msg/TrackWindowMsg.java
  54. 15
      src/engine/net/client/msg/VendorDialogMsg.java
  55. 5
      src/engine/net/client/msg/WhoResponseMsg.java
  56. 7
      src/engine/net/client/msg/guild/GuildInfoMsg.java
  57. 3
      src/engine/net/client/msg/guild/GuildListMsg.java
  58. 5
      src/engine/net/client/msg/login/CharSelectScreenMsg.java
  59. 22
      src/engine/objects/AbstractCharacter.java
  60. 3
      src/engine/objects/AbstractGameObject.java
  61. 13
      src/engine/objects/AbstractWorldObject.java
  62. 3
      src/engine/objects/Account.java
  63. 10
      src/engine/objects/Bane.java
  64. 5
      src/engine/objects/Building.java
  65. 11
      src/engine/objects/CharacterItemManager.java
  66. 3
      src/engine/objects/CharacterPower.java
  67. 3
      src/engine/objects/CharacterSkill.java
  68. 14
      src/engine/objects/City.java
  69. 2
      src/engine/objects/Contract.java
  70. 5
      src/engine/objects/Experience.java
  71. 16
      src/engine/objects/Guild.java
  72. 3
      src/engine/objects/Heraldry.java
  73. 6
      src/engine/objects/Item.java
  74. 6
      src/engine/objects/Mine.java
  75. 2
      src/engine/objects/Mob.java
  76. 2697
      src/engine/objects/PlayerCharacter.java
  77. 3
      src/engine/objects/Portal.java
  78. 3
      src/engine/objects/Realm.java
  79. 3
      src/engine/powers/effectmodifiers/NoModEffectModifier.java
  80. 3
      src/engine/powers/poweractions/CharmPowerAction.java
  81. 3
      src/engine/powers/poweractions/RecallPowerAction.java
  82. 4
      src/engine/powers/poweractions/RunegateTeleportPowerAction.java
  83. 2
      src/engine/server/login/LoginServer.java
  84. 7
      src/engine/server/login/LoginServerMsgHandler.java
  85. 6
      src/engine/server/world/WorldServer.java
  86. 3
      src/engine/session/CSSession.java
  87. 9
      src/engine/workthreads/HalfHourlyJobThread.java

25
src/engine/InterestManagement/InterestManager.java

@ -12,6 +12,7 @@ import engine.Enum;
import engine.Enum.DispatchChannel; import engine.Enum.DispatchChannel;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.job.JobScheduler; import engine.job.JobScheduler;
import engine.jobs.RefreshGroupJob; import engine.jobs.RefreshGroupJob;
@ -233,7 +234,7 @@ public enum InterestManager implements Runnable {
if (distanceSquared > sqr(64)) if (distanceSquared > sqr(64))
player.setLastStaticLoc(player.getLoc()); player.setLastStaticLoc(player.getLoc());
else if (player.isDirtyLoad() == false) else if (PlayerManager.isDirtyLoad(player) == false)
return; return;
// Get Statics in range // Get Statics in range
@ -286,14 +287,14 @@ public enum InterestManager implements Runnable {
lsm.addObject((Building) awo); lsm.addObject((Building) awo);
else if (awo.getObjectType().equals(GameObjectType.Corpse)) { else if (awo.getObjectType().equals(GameObjectType.Corpse)) {
Corpse corpse = (Corpse) awo; Corpse corpse = (Corpse) awo;
lcm = new LoadCharacterMsg(corpse, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(corpse, PlayerManager.hideNonAscii());
Dispatch dispatch = Dispatch.borrow(player, lcm); Dispatch dispatch = Dispatch.borrow(player, lcm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} else if (awo.getObjectType().equals(GameObjectType.NPC)) { } else if (awo.getObjectType().equals(GameObjectType.NPC)) {
NPC npc = (NPC) awo; NPC npc = (NPC) awo;
lcm = new LoadCharacterMsg(npc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(npc, PlayerManager.hideNonAscii());
lcmList.add(lcm); lcmList.add(lcm);
} }
@ -311,7 +312,7 @@ public enum InterestManager implements Runnable {
} }
loadedStaticObjects.addAll(toLoad); loadedStaticObjects.addAll(toLoad);
player.setDirtyLoad(false); PlayerManager.setDirtyLoad(player, false);
} }
private void updateMobileList(PlayerCharacter player, ClientConnection origin) { private void updateMobileList(PlayerCharacter player, ClientConnection origin) {
@ -437,7 +438,7 @@ public enum InterestManager implements Runnable {
if (player.getSeeInvis() < awopc.getHidden()) if (player.getSeeInvis() < awopc.getHidden())
continue; continue;
lcm = new LoadCharacterMsg(awopc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awopc, PlayerManager.hideNonAscii());
players.add(awo); players.add(awo);
// check if in a group with the person being loaded // check if in a group with the person being loaded
@ -466,11 +467,11 @@ public enum InterestManager implements Runnable {
awonpc.playerAgroMap.put(player.getObjectUUID(), false); awonpc.playerAgroMap.put(player.getObjectUUID(), false);
((Mob) awonpc).setCombatTarget(null); ((Mob) awonpc).setCombatTarget(null);
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awonpc, PlayerManager.hideNonAscii());
} else if ((awo.getObjectTypeMask() & MBServerStatics.MASK_NPC) != 0) { } else if ((awo.getObjectTypeMask() & MBServerStatics.MASK_NPC) != 0) {
NPC awonpc = (NPC) awo; NPC awonpc = (NPC) awo;
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awonpc, PlayerManager.hideNonAscii());
} else if ((awo.getObjectTypeMask() & MBServerStatics.MASK_PET) != 0) { } else if ((awo.getObjectTypeMask() & MBServerStatics.MASK_PET) != 0) {
Mob awonpc = (Mob) awo; Mob awonpc = (Mob) awo;
@ -482,7 +483,7 @@ public enum InterestManager implements Runnable {
if ((awonpc.agentType.equals(Enum.AIAgentType.MOBILE))) if ((awonpc.agentType.equals(Enum.AIAgentType.MOBILE)))
((Mob) awonpc).setCombatTarget(null); ((Mob) awonpc).setCombatTarget(null);
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awonpc, PlayerManager.hideNonAscii());
} }
addToList.add(awo); addToList.add(awo);
@ -518,8 +519,8 @@ public enum InterestManager implements Runnable {
// Update loaded upbjects lists // Update loaded upbjects lists
player.isBoxed = PlayerCharacter.checkIfBoxed(player); player.isBoxed = PlayerManager.checkIfBoxed(player);
player.setDirtyLoad(true); PlayerManager.setDirtyLoad(player, true);
updateStaticList(player, origin); updateStaticList(player, origin);
updateMobileList(player, origin); updateMobileList(player, origin);
} }
@ -536,7 +537,7 @@ public enum InterestManager implements Runnable {
// Update loaded upbjects lists // Update loaded upbjects lists
playerCharacter.setDirtyLoad(true); PlayerManager.setDirtyLoad(playerCharacter, true);
updateStaticList(playerCharacter, origin); updateStaticList(playerCharacter, origin);
updateMobileList(playerCharacter, origin); updateMobileList(playerCharacter, origin);
@ -552,7 +553,7 @@ public enum InterestManager implements Runnable {
for (AbstractWorldObject playerObject : playerList) { for (AbstractWorldObject playerObject : playerList) {
PlayerCharacter playerCharacter = (PlayerCharacter) playerObject; PlayerCharacter playerCharacter = (PlayerCharacter) playerObject;
playerCharacter.setDirtyLoad(true); PlayerManager.setDirtyLoad(playerCharacter, true);
} }
} }
} }

3
src/engine/db/handlers/dbAccountHandler.java

@ -13,6 +13,7 @@ import engine.Enum;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.objects.Account; import engine.objects.Account;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -140,7 +141,7 @@ public class dbAccountHandler extends dbHandlerBase {
int playerID; int playerID;
playerID = rs.getInt(1); playerID = rs.getInt(1);
trashPlayer = PlayerCharacter.getPlayerCharacter(playerID); trashPlayer = PlayerManager.getPlayerCharacter(playerID);
if (trashPlayer == null) if (trashPlayer == null)
continue; continue;

4
src/engine/db/handlers/dbCSSessionHandler.java

@ -10,8 +10,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.objects.Account; import engine.objects.Account;
import engine.objects.PlayerCharacter;
import engine.session.CSSession; import engine.session.CSSession;
import engine.util.StringUtils; import engine.util.StringUtils;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -103,7 +103,7 @@ public class dbCSSessionHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery(); ResultSet rs = preparedStatement.executeQuery();
if (rs.next()) if (rs.next())
css = new CSSession(secKey, DbManager.AccountQueries.GET_ACCOUNT(rs.getInt("accountID")), PlayerCharacter.getPlayerCharacter(rs.getInt("characterID")), rs.getString("machineID")); css = new CSSession(secKey, DbManager.AccountQueries.GET_ACCOUNT(rs.getInt("accountID")), PlayerManager.getPlayerCharacter(rs.getInt("characterID")), rs.getString("machineID"));
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);

3
src/engine/db/handlers/dbGuildHandler.java

@ -12,6 +12,7 @@ package engine.db.handlers;
import engine.Enum; import engine.Enum;
import engine.Enum.GuildHistoryType; import engine.Enum.GuildHistoryType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.objects.*; import engine.objects.*;
import engine.server.world.WorldServer; import engine.server.world.WorldServer;
import org.joda.time.DateTime; import org.joda.time.DateTime;
@ -222,7 +223,7 @@ public class dbGuildHandler extends dbHandlerBase {
while (rs.next()) { while (rs.next()) {
int playerUUID = rs.getInt(1); int playerUUID = rs.getInt(1);
PlayerCharacter kosPlayer = PlayerCharacter.getPlayerCharacter(playerUUID); PlayerCharacter kosPlayer = PlayerManager.getPlayerCharacter(playerUUID);
if (kosPlayer != null) if (kosPlayer != null)
kosList.add(kosPlayer); kosList.add(kosPlayer);

3
src/engine/devcmd/cmds/AuditFailedItemsCmd.java

@ -11,6 +11,7 @@ package engine.devcmd.cmds;
import engine.Enum.ModType; import engine.Enum.ModType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PlayerManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.net.ItemProductionManager; import engine.net.ItemProductionManager;
import engine.objects.*; import engine.objects.*;
@ -57,7 +58,7 @@ public class AuditFailedItemsCmd extends AbstractDevCmd {
contractName = npc.getContract().getName(); contractName = npc.getContract().getName();
} }
PlayerCharacter roller = PlayerCharacter.getFromCache(failedItem.getPlayerID()); PlayerCharacter roller = PlayerManager.getFromCache(failedItem.getPlayerID());
if (roller == null) if (roller == null)
playerName = "null"; playerName = "null";

5
src/engine/devcmd/cmds/DecachePlayerCmd.java

@ -12,6 +12,7 @@ package engine.devcmd.cmds;
import engine.Enum; import engine.Enum;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -34,8 +35,8 @@ public class DecachePlayerCmd extends AbstractDevCmd {
int objectUUID = Integer.parseInt(words[0]); int objectUUID = Integer.parseInt(words[0]);
if (DbManager.inCache(Enum.GameObjectType.PlayerCharacter, objectUUID)) { if (DbManager.inCache(Enum.GameObjectType.PlayerCharacter, objectUUID)) {
this.setTarget(PlayerCharacter.getFromCache(objectUUID)); //for logging this.setTarget(PlayerManager.getFromCache(objectUUID)); //for logging
PlayerCharacter.getFromCache(objectUUID).removeFromCache(); PlayerManager.getFromCache(objectUUID).removeFromCache();
} else { } else {
this.sendHelp(pc); this.sendHelp(pc);
} }

3
src/engine/devcmd/cmds/GotoBoundsCmd.java

@ -11,6 +11,7 @@ package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PlayerManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Building; import engine.objects.Building;
@ -89,7 +90,7 @@ public class GotoBoundsCmd extends AbstractDevCmd {
return; return;
} }
player.teleport(targetLoc); PlayerManager.teleport(player, targetLoc);
} }

9
src/engine/devcmd/cmds/GotoCmd.java

@ -12,6 +12,7 @@ package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.*; import engine.objects.*;
@ -35,7 +36,7 @@ public class GotoCmd extends AbstractDevCmd {
if (target != null && words[0].isEmpty()) { if (target != null && words[0].isEmpty()) {
AbstractWorldObject targetAgo = (AbstractWorldObject) target; AbstractWorldObject targetAgo = (AbstractWorldObject) target;
pc.teleport(targetAgo.getLoc()); PlayerManager.teleport(pc, targetAgo.getLoc());
return; return;
} }
@ -50,7 +51,7 @@ public class GotoCmd extends AbstractDevCmd {
} }
if (loc != null) if (loc != null)
pc.teleport(loc); PlayerManager.teleport(pc, loc);
return; return;
} }
@ -61,7 +62,7 @@ public class GotoCmd extends AbstractDevCmd {
} }
if (loc != null) if (loc != null)
pc.teleport(loc); PlayerManager.teleport(pc, loc);
return; return;
} }
@ -164,7 +165,7 @@ public class GotoCmd extends AbstractDevCmd {
} }
} }
if (loc != null) { if (loc != null) {
pc.teleport(loc); PlayerManager.teleport(pc, loc);
} }
} }

3
src/engine/devcmd/cmds/GotoObj.java

@ -12,6 +12,7 @@ package engine.devcmd.cmds;
import engine.Enum; import engine.Enum;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.*; import engine.objects.*;
@ -84,7 +85,7 @@ public class GotoObj extends AbstractDevCmd {
return; return;
} }
player.teleport(targetLoc); PlayerManager.teleport(player, targetLoc);
} }

3
src/engine/devcmd/cmds/InfoCmd.java

@ -15,6 +15,7 @@ import engine.Enum.GameObjectType;
import engine.Enum.TargetColor; import engine.Enum.TargetColor;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.*; import engine.objects.*;
@ -335,7 +336,7 @@ public class InfoCmd extends AbstractDevCmd {
output += "Altitude : " + targetPC.getLoc().y; output += "Altitude : " + targetPC.getLoc().y;
output += "Swimming : " + targetPC.isSwimming(); output += "Swimming : " + PlayerManager.isSwimming(targetPC);
output += newline; output += newline;
output += "isMoving : " + targetPC.isMoving(); output += "isMoving : " + targetPC.isMoving();
output += newline; output += newline;

5
src/engine/devcmd/cmds/JumpCmd.java

@ -10,6 +10,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PlayerManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -36,7 +37,7 @@ public class JumpCmd extends AbstractDevCmd {
try { try {
float range = Float.parseFloat(words[1]); float range = Float.parseFloat(words[1]);
Vector3fImmutable newLoc = pc.getFaceDir().scaleAdd(range, pc.getLoc()); Vector3fImmutable newLoc = pc.getFaceDir().scaleAdd(range, pc.getLoc());
pc.teleport(newLoc); PlayerManager.teleport(pc, newLoc);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
@ -68,7 +69,7 @@ public class JumpCmd extends AbstractDevCmd {
Vector3fImmutable loc = pc.getLoc(); Vector3fImmutable loc = pc.getLoc();
loc = loc.add(lat, 0f, -lon); loc = loc.add(lat, 0f, -lon);
pc.teleport(loc); PlayerManager.teleport(pc, loc);
} }
@Override @Override

9
src/engine/devcmd/cmds/MakeBaneCmd.java

@ -12,10 +12,7 @@ package engine.devcmd.cmds;
import engine.Enum.ProtectionState; import engine.Enum.ProtectionState;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.*;
import engine.gameManager.ChatManager;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.*; import engine.objects.*;
@ -74,7 +71,7 @@ public class MakeBaneCmd extends AbstractDevCmd {
return; return;
} }
PlayerCharacter player = PlayerCharacter.getPlayerCharacter(attackerID); PlayerCharacter player = PlayerManager.getPlayerCharacter(attackerID);
if (player.getGuild().isEmptyGuild()) { if (player.getGuild().isEmptyGuild()) {
@ -194,7 +191,7 @@ public class MakeBaneCmd extends AbstractDevCmd {
Vector3fImmutable movePlayerOutsideStone = player.getLoc(); Vector3fImmutable movePlayerOutsideStone = player.getLoc();
movePlayerOutsideStone = movePlayerOutsideStone.setX(movePlayerOutsideStone.x + 10); movePlayerOutsideStone = movePlayerOutsideStone.setX(movePlayerOutsideStone.x + 10);
movePlayerOutsideStone = movePlayerOutsideStone.setZ(movePlayerOutsideStone.z + 10); movePlayerOutsideStone = movePlayerOutsideStone.setZ(movePlayerOutsideStone.z + 10);
player.teleport(movePlayerOutsideStone); PlayerManager.teleport(player, movePlayerOutsideStone);
throwbackInfo(pc, "The city has been succesfully baned."); throwbackInfo(pc, "The city has been succesfully baned.");
} }

3
src/engine/devcmd/cmds/ResetLevelCmd.java

@ -1,6 +1,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PlayerManager;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -16,7 +17,7 @@ public class ResetLevelCmd extends AbstractDevCmd {
protected void _doCmd(PlayerCharacter player, String[] args, protected void _doCmd(PlayerCharacter player, String[] args,
AbstractGameObject target) { AbstractGameObject target) {
player.ResetLevel(Short.parseShort(args[0])); PlayerManager.ResetLevel(player, Short.parseShort(args[0]));
} }
@Override @Override

3
src/engine/devcmd/cmds/SlotTestCmd.java

@ -13,6 +13,7 @@ import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.PlayerManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.*; import engine.objects.*;
@ -56,7 +57,7 @@ public class SlotTestCmd extends AbstractDevCmd {
BuildingLocation buildingLocation = BuildingManager._slotLocations.get(building.meshUUID).get(slot - 1); BuildingLocation buildingLocation = BuildingManager._slotLocations.get(building.meshUUID).get(slot - 1);
slotLocation = building.getLoc().add(buildingLocation.getLocation()); slotLocation = building.getLoc().add(buildingLocation.getLocation());
slotLocation = Vector3fImmutable.rotateAroundPoint(building.getLoc(), slotLocation, building.getBounds().getQuaternion().angleY); slotLocation = Vector3fImmutable.rotateAroundPoint(building.getLoc(), slotLocation, building.getBounds().getQuaternion().angleY);
playerCharacter.teleport(slotLocation); PlayerManager.teleport(playerCharacter, slotLocation);
return; return;
} }

3
src/engine/devcmd/cmds/SummonCmd.java

@ -10,6 +10,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
@ -91,7 +92,7 @@ public class SummonCmd extends AbstractDevCmd {
this.setTarget(pcToSummon); //for logging this.setTarget(pcToSummon); //for logging
Vector3fImmutable loc = pc.getLoc(); Vector3fImmutable loc = pc.getLoc();
pcToSummon.teleport(loc); PlayerManager.teleport(pcToSummon, loc);
this.throwbackInfo(pc, "Player " + pcToSummon.getCombinedName() this.throwbackInfo(pc, "Player " + pcToSummon.getCombinedName()
+ " has been summoned to your location."); + " has been summoned to your location.");

3
src/engine/devcmd/cmds/aiInfoCmd.java

@ -11,6 +11,7 @@ package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PlayerManager;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Mob; import engine.objects.Mob;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -77,7 +78,7 @@ public class aiInfoCmd extends AbstractDevCmd {
output += "Players Loaded:" + newline; output += "Players Loaded:" + newline;
} }
for (Map.Entry<Integer, Boolean> entry : mob.playerAgroMap.entrySet()) { for (Map.Entry<Integer, Boolean> entry : mob.playerAgroMap.entrySet()) {
output += "Player ID: " + entry.getKey() + " Hate Value: " + (PlayerCharacter.getPlayerCharacter(entry.getKey())).getHateValue() + newline; output += "Player ID: " + entry.getKey() + " Hate Value: " + (PlayerManager.getPlayerCharacter(entry.getKey())).getHateValue() + newline;
} }
if (mob.getCombatTarget() != null) if (mob.getCombatTarget() != null)
output += "Current Target: " + mob.getCombatTarget().getName() + newline; output += "Current Target: " + mob.getCombatTarget().getName() + newline;

6
src/engine/gameManager/CombatManager.java

@ -65,7 +65,7 @@ public enum CombatManager {
targetType = msg.getTargetType(); targetType = msg.getTargetType();
if (targetType == GameObjectType.PlayerCharacter.ordinal()) { if (targetType == GameObjectType.PlayerCharacter.ordinal()) {
target = PlayerCharacter.getFromCache(msg.getTargetID()); target = PlayerManager.getFromCache(msg.getTargetID());
} else if (targetType == GameObjectType.Building.ordinal()) { } else if (targetType == GameObjectType.Building.ordinal()) {
target = BuildingManager.getBuildingFromCache(msg.getTargetID()); target = BuildingManager.getBuildingFromCache(msg.getTargetID());
} else if (targetType == GameObjectType.Mob.ordinal()) { } else if (targetType == GameObjectType.Mob.ordinal()) {
@ -171,7 +171,7 @@ public enum CombatManager {
targetType = msg.getTargetType(); targetType = msg.getTargetType();
if (targetType == GameObjectType.PlayerCharacter.ordinal()) if (targetType == GameObjectType.PlayerCharacter.ordinal())
target = PlayerCharacter.getFromCache(msg.getTargetID()); target = PlayerManager.getFromCache(msg.getTargetID());
else if (targetType == GameObjectType.Building.ordinal()) else if (targetType == GameObjectType.Building.ordinal())
target = BuildingManager.getBuildingFromCache(msg.getTargetID()); target = BuildingManager.getBuildingFromCache(msg.getTargetID());
else if (targetType == GameObjectType.Mob.ordinal()) else if (targetType == GameObjectType.Mob.ordinal())
@ -1249,7 +1249,7 @@ public enum CombatManager {
if (pc == null) if (pc == null)
return; return;
if(pc.isFlying()) if(PlayerManager.isFlying(pc))
pc.setSit(false); pc.setSit(false);
else else
pc.setSit(toggle); pc.setSit(toggle);

2
src/engine/gameManager/DbManager.java

@ -85,7 +85,7 @@ public enum DbManager {
switch (objectType) { switch (objectType) {
case PlayerCharacter: case PlayerCharacter:
outObject = PlayerCharacter.getPlayerCharacter(objectUUID); outObject = PlayerManager.getPlayerCharacter(objectUUID);
break; break;
case NPC: case NPC:
outObject = NPC.getNPC(objectUUID); outObject = NPC.getNPC(objectUUID);

10
src/engine/gameManager/GuildManager.java

@ -74,16 +74,16 @@ public enum GuildManager {
} }
} }
playerCharacter.setInnerCouncil(false); PlayerManager.setInnerCouncil(playerCharacter, false);
playerCharacter.setGuildLeader(false); PlayerManager.setGuildLeader(playerCharacter, false);
playerCharacter.setGuild(guild); playerCharacter.setGuild(guild);
// Cleanup guild stuff // Cleanup guild stuff
playerCharacter.resetGuildStatuses(); PlayerManager.resetGuildStatuses(playerCharacter);
// send success message to client // send success message to client
if (fromTeleportScreen && guild.isNPCGuild()) if (fromTeleportScreen && guild.isNPCGuild())
playerCharacter.setFullMember(true); PlayerManager.setFullMember(playerCharacter, true);
msg = new AcceptInviteToGuildMsg(guild.getObjectUUID(), 1, 0); msg = new AcceptInviteToGuildMsg(guild.getObjectUUID(), 1, 0);
@ -178,7 +178,7 @@ public enum GuildManager {
bindBuilding = city.getTOL(); bindBuilding = city.getTOL();
if (bindBuilding == null) if (bindBuilding == null)
bindBuilding = PlayerCharacter.getBindBuildingForGuild(playerCharacter); bindBuilding = PlayerManager.getBindBuildingForGuild(playerCharacter);
playerCharacter.setBindBuildingID(bindBuilding != null ? bindBuilding.getObjectUUID() : 0); playerCharacter.setBindBuildingID(bindBuilding != null ? bindBuilding.getObjectUUID() : 0);
} }

2392
src/engine/gameManager/PlayerManager.java

File diff suppressed because it is too large Load Diff

6
src/engine/gameManager/PowersManager.java

@ -165,7 +165,7 @@ public enum PowersManager {
PlayerCharacter pc = SessionManager.getPlayerCharacter(origin); PlayerCharacter pc = SessionManager.getPlayerCharacter(origin);
if(!pc.isFlying()) //cant be sitting if flying if(!PlayerManager.isFlying(pc)) //cant be sitting if flying
CombatManager.toggleSit(false,origin); CombatManager.toggleSit(false,origin);
if(pc.isMoving()) if(pc.isMoving())
@ -294,7 +294,7 @@ public enum PowersManager {
} }
//check for movement buffs while flying //check for movement buffs while flying
if(playerCharacter.isFlying()) { if(PlayerManager.isFlying(playerCharacter)) {
switch(pb.token){ switch(pb.token){
case 429005674: case 429005674:
case 429505739: case 429505739:
@ -1363,7 +1363,7 @@ public enum PowersManager {
if (pc == null) if (pc == null)
return; return;
PlayerCharacter source = PlayerCharacter.getFromCache(msg.getSourceID()); PlayerCharacter source = PlayerManager.getFromCache(msg.getSourceID());
if (source == null) if (source == null)
return; return;

2
src/engine/gameManager/TradeManager.java

@ -151,7 +151,7 @@ public enum TradeManager {
} }
public static void invalidTradeRequest(InvalidTradeRequestMsg msg) { public static void invalidTradeRequest(InvalidTradeRequestMsg msg) {
PlayerCharacter requester = PlayerCharacter.getFromCache(msg.getRequesterID()); PlayerCharacter requester = PlayerManager.getFromCache(msg.getRequesterID());
Dispatch dispatch; Dispatch dispatch;
dispatch = Dispatch.borrow(requester, msg); dispatch = Dispatch.borrow(requester, msg);

3
src/engine/jobs/DatabaseUpdateJob.java

@ -11,6 +11,7 @@ package engine.jobs;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.job.AbstractScheduleJob; import engine.job.AbstractScheduleJob;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Building; import engine.objects.Building;
@ -39,7 +40,7 @@ public class DatabaseUpdateJob extends AbstractScheduleJob {
switch (this.type) { switch (this.type) {
case "Skills": case "Skills":
pc.updateSkillsAndPowersToDatabase(); PlayerManager.updateSkillsAndPowersToDatabase(pc);
break; break;
case "Stats": case "Stats":
DbManager.PlayerCharacterQueries.UPDATE_CHARACTER_STATS(pc); DbManager.PlayerCharacterQueries.UPDATE_CHARACTER_STATS(pc);

4
src/engine/jobs/FinishSummonsJob.java

@ -11,7 +11,7 @@ package engine.jobs;
import engine.Enum.ModType; import engine.Enum.ModType;
import engine.Enum.SourceType; import engine.Enum.SourceType;
import engine.gameManager.PowersManager; import engine.gameManager.PlayerManager;
import engine.job.AbstractScheduleJob; import engine.job.AbstractScheduleJob;
import engine.job.JobContainer; import engine.job.JobContainer;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -64,7 +64,7 @@ public class FinishSummonsJob extends AbstractScheduleJob {
if (this.source.region != null) if (this.source.region != null)
this.target.setRegion(this.source.region); this.target.setRegion(this.source.region);
//teleport target to source //teleport target to source
target.teleport(source.getLoc()); PlayerManager.teleport(target, source.getLoc());
} }
@Override @Override

3
src/engine/jobs/StuckJob.java

@ -9,6 +9,7 @@
package engine.jobs; package engine.jobs;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.PlayerManager;
import engine.job.AbstractScheduleJob; import engine.job.AbstractScheduleJob;
import engine.math.Bounds; import engine.math.Bounds;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
@ -69,7 +70,7 @@ public class StuckJob extends AbstractScheduleJob {
return; return;
} }
player.teleport(stuckLoc); PlayerManager.teleport(player, stuckLoc);
} }

3
src/engine/jobs/TeleportJob.java

@ -9,6 +9,7 @@
package engine.jobs; package engine.jobs;
import engine.gameManager.PlayerManager;
import engine.job.AbstractScheduleJob; import engine.job.AbstractScheduleJob;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -52,7 +53,7 @@ public class TeleportJob extends AbstractScheduleJob {
return; return;
} }
pc.teleport(loc); PlayerManager.teleport(pc, loc);
if (this.setSafeMode) if (this.setSafeMode)
pc.setSafeMode(); pc.setSafeMode();

13
src/engine/mobileAI/MobAI.java

@ -9,7 +9,6 @@
package engine.mobileAI; package engine.mobileAI;
import engine.Enum; import engine.Enum;
import engine.Enum.DispatchChannel;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.*; import engine.gameManager.*;
import engine.math.Vector3f; import engine.math.Vector3f;
@ -17,9 +16,7 @@ import engine.math.Vector3fImmutable;
import engine.mobileAI.Threads.MobAIThread; import engine.mobileAI.Threads.MobAIThread;
import engine.mobileAI.utilities.CombatUtilities; import engine.mobileAI.utilities.CombatUtilities;
import engine.mobileAI.utilities.MovementUtilities; import engine.mobileAI.utilities.MovementUtilities;
import engine.net.DispatchMessage;
import engine.net.client.msg.PerformActionMsg; import engine.net.client.msg.PerformActionMsg;
import engine.net.client.msg.PowerProjectileMsg;
import engine.objects.*; import engine.objects.*;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
import engine.powers.PowersBase; import engine.powers.PowersBase;
@ -85,7 +82,7 @@ public class MobAI {
if(mob.StrongholdGuardian || mob.StrongholdEpic){ if(mob.StrongholdGuardian || mob.StrongholdEpic){
// attempt to ground all players in attack range // attempt to ground all players in attack range
for(int i : mob.playerAgroMap.keySet()){ for(int i : mob.playerAgroMap.keySet()){
PlayerCharacter tar = PlayerCharacter.getFromCache(i); PlayerCharacter tar = PlayerManager.getFromCache(i);
if(tar != null && tar.loc.distanceSquared(mob.loc) < 80){ if(tar != null && tar.loc.distanceSquared(mob.loc) < 80){
PowersManager.applyPower(mob,tar,tar.loc, 111111,40,false); PowersManager.applyPower(mob,tar,tar.loc, 111111,40,false);
} }
@ -727,7 +724,7 @@ public class MobAI {
for (Entry playerEntry : loadedPlayers.entrySet()) { for (Entry playerEntry : loadedPlayers.entrySet()) {
int playerID = (int) playerEntry.getKey(); int playerID = (int) playerEntry.getKey();
PlayerCharacter loadedPlayer = PlayerCharacter.getFromCache(playerID); PlayerCharacter loadedPlayer = PlayerManager.getFromCache(playerID);
//Player is null, let's remove them from the list. //Player is null, let's remove them from the list.
@ -980,7 +977,7 @@ public class MobAI {
mob.setCombatTarget(null); mob.setCombatTarget(null);
for (Entry playerEntry : mob.playerAgroMap.entrySet()) for (Entry playerEntry : mob.playerAgroMap.entrySet())
PlayerCharacter.getFromCache((int) playerEntry.getKey()).setHateValue(0); PlayerManager.getFromCache((int) playerEntry.getKey()).setHateValue(0);
mob.setCombatTarget(null); mob.setCombatTarget(null);
} }
} catch (Exception e) { } catch (Exception e) {
@ -1218,7 +1215,7 @@ public class MobAI {
for (Entry playerEntry : loadedPlayers.entrySet()) { for (Entry playerEntry : loadedPlayers.entrySet()) {
int playerID = (int) playerEntry.getKey(); int playerID = (int) playerEntry.getKey();
PlayerCharacter loadedPlayer = PlayerCharacter.getFromCache(playerID); PlayerCharacter loadedPlayer = PlayerManager.getFromCache(playerID);
//Player is null, let's remove them from the list. //Player is null, let's remove them from the list.
@ -1379,7 +1376,7 @@ public class MobAI {
for (Entry playerEntry : mob.playerAgroMap.entrySet()) { for (Entry playerEntry : mob.playerAgroMap.entrySet()) {
PlayerCharacter potentialTarget = PlayerCharacter.getFromCache((int) playerEntry.getKey()); PlayerCharacter potentialTarget = PlayerManager.getFromCache((int) playerEntry.getKey());
if (potentialTarget.equals(mob.getCombatTarget())) if (potentialTarget.equals(mob.getCombatTarget()))
continue; continue;

30
src/engine/net/client/ClientMessagePump.java

@ -603,19 +603,19 @@ public class ClientMessagePump implements NetMsgHandler {
switch (type) { switch (type) {
case MBServerStatics.STAT_STR_ID: case MBServerStatics.STAT_STR_ID:
pc.addStr(msg.getAmount()); PlayerManager.addStr(pc, msg.getAmount());
break; break;
case MBServerStatics.STAT_DEX_ID: case MBServerStatics.STAT_DEX_ID:
pc.addDex(msg.getAmount()); PlayerManager.addDex(pc, msg.getAmount());
break; break;
case MBServerStatics.STAT_CON_ID: case MBServerStatics.STAT_CON_ID:
pc.addCon(msg.getAmount()); PlayerManager.addCon(pc, msg.getAmount());
break; break;
case MBServerStatics.STAT_INT_ID: case MBServerStatics.STAT_INT_ID:
pc.addInt(msg.getAmount()); PlayerManager.addInt(pc, msg.getAmount());
break; break;
case MBServerStatics.STAT_SPI_ID: case MBServerStatics.STAT_SPI_ID:
pc.addSpi(msg.getAmount()); PlayerManager.addSpi(pc, msg.getAmount());
break; break;
} }
} }
@ -641,7 +641,7 @@ public class ClientMessagePump implements NetMsgHandler {
// ResetAfterDeath player // ResetAfterDeath player
sourcePlayer.respawnLock.writeLock().lock(); sourcePlayer.respawnLock.writeLock().lock();
try { try {
sourcePlayer.respawn(true, false, true); PlayerManager.respawn(sourcePlayer, true, false, true);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
@ -705,7 +705,7 @@ public class ClientMessagePump implements NetMsgHandler {
switch (targetType) { switch (targetType) {
case PlayerCharacter: case PlayerCharacter:
characterTarget = PlayerCharacter.getFromCache(msg.getTargetID()); characterTarget = PlayerManager.getFromCache(msg.getTargetID());
if (characterTarget == null) if (characterTarget == null)
return; return;
if (characterTarget.isAlive()) if (characterTarget.isAlive())
@ -809,7 +809,7 @@ public class ClientMessagePump implements NetMsgHandler {
if (targetType == GameObjectType.PlayerCharacter.ordinal() || targetType == GameObjectType.Mob.ordinal()) { if (targetType == GameObjectType.PlayerCharacter.ordinal() || targetType == GameObjectType.Mob.ordinal()) {
if (targetType == GameObjectType.PlayerCharacter.ordinal()) { if (targetType == GameObjectType.PlayerCharacter.ordinal()) {
tar = PlayerCharacter.getFromCache(targetID); tar = PlayerManager.getFromCache(targetID);
if (tar == null) if (tar == null)
return; return;
@ -1013,7 +1013,7 @@ public class ClientMessagePump implements NetMsgHandler {
AbstractCharacter tar = null; AbstractCharacter tar = null;
if (targetType == GameObjectType.PlayerCharacter.ordinal()) if (targetType == GameObjectType.PlayerCharacter.ordinal())
tar = PlayerCharacter.getFromCache(msg.getTargetID()); tar = PlayerManager.getFromCache(msg.getTargetID());
else if (targetType == GameObjectType.NPC.ordinal()) else if (targetType == GameObjectType.NPC.ordinal())
tar = NPC.getFromCache(msg.getTargetID()); tar = NPC.getFromCache(msg.getTargetID());
else if (targetType == GameObjectType.Mob.ordinal()) else if (targetType == GameObjectType.Mob.ordinal())
@ -1166,7 +1166,7 @@ public class ClientMessagePump implements NetMsgHandler {
if (con == null) if (con == null)
return; return;
float bargain = sourcePlayer.getBargain(); float bargain = PlayerManager.getBargain(sourcePlayer);
float profit = npc.getBuyPercent(sourcePlayer) + bargain; float profit = npc.getBuyPercent(sourcePlayer) + bargain;
@ -1271,7 +1271,7 @@ public class ClientMessagePump implements NetMsgHandler {
float durabilityMax = sell.getDurabilityMax(); float durabilityMax = sell.getDurabilityMax();
float damagedModifier = durabilityCurrent / durabilityMax; float damagedModifier = durabilityCurrent / durabilityMax;
cost *= damagedModifier; cost *= damagedModifier;
float bargain = player.getBargain(); float bargain = PlayerManager.getBargain(player);
float profit = npc.getBuyPercent(player) + bargain; float profit = npc.getBuyPercent(player) + bargain;
@ -1422,7 +1422,7 @@ public class ClientMessagePump implements NetMsgHandler {
return; return;
} }
int cost = me.getMagicValue(); int cost = me.getMagicValue();
float bargain = sourcePlayer.getBargain(); float bargain = PlayerManager.getBargain(sourcePlayer);
switch(npc.getContractID()){ switch(npc.getContractID()){
case 1201: case 1201:
cost = ItemBase.getDiscPrice(ib.getUUID()); cost = ItemBase.getDiscPrice(ib.getUUID());
@ -1503,7 +1503,7 @@ public class ClientMessagePump implements NetMsgHandler {
int cost = buy.getBaseValue(); int cost = buy.getBaseValue();
if (buy.isID() || buy.isCustomValue()) if (buy.isID() || buy.isCustomValue())
cost = buy.getMagicValue(); cost = buy.getMagicValue();
float bargain = sourcePlayer.getBargain(); float bargain = PlayerManager.getBargain(sourcePlayer);
float profit = npc.getSellPercent(sourcePlayer) - bargain; float profit = npc.getSellPercent(sourcePlayer) - bargain;
if (profit < 1) if (profit < 1)
profit = 1; profit = 1;
@ -1821,7 +1821,7 @@ public class ClientMessagePump implements NetMsgHandler {
long type = player.getTimeStamp("LastRecallType"); long type = player.getTimeStamp("LastRecallType");
if (type == 1) { //recall to bind if (type == 1) { //recall to bind
player.teleport(player.getBindLoc()); PlayerManager.teleport(player, player.getBindLoc());
player.setSafeMode(); player.setSafeMode();
} else { //recall to rg } else { //recall to rg
float dist = 9999999999f; float dist = 9999999999f;
@ -1842,7 +1842,7 @@ public class ClientMessagePump implements NetMsgHandler {
//nearest runegate found. teleport characterTarget //nearest runegate found. teleport characterTarget
if (rg != null) { if (rg != null) {
player.teleport(rg.getLoc()); PlayerManager.teleport(player, rg.getLoc());
player.setSafeMode(); player.setSafeMode();
} }
} }

7
src/engine/net/client/handlers/AcceptInviteToGuildHandler.java

@ -13,10 +13,7 @@ import engine.Enum;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.Enum.GuildHistoryType; import engine.Enum.GuildHistoryType;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -83,7 +80,7 @@ public class AcceptInviteToGuildHandler extends AbstractClientMsgHandler {
player.setGuild(guild); player.setGuild(guild);
// Cleanup guild stuff // Cleanup guild stuff
player.resetGuildStatuses(); PlayerManager.resetGuildStatuses(player);
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);

2
src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java

@ -53,7 +53,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler {
GroupManager.RefreshOthersGroupList(player); GroupManager.RefreshOthersGroupList(player);
} }
player.setEnteredWorld(true); PlayerManager.setEnteredWorld(player, true);
// Set player active // Set player active
player.resetRegenUpdateTime(); player.resetRegenUpdateTime();
player.setActive(true); player.setActive(true);

7
src/engine/net/client/handlers/BanishUnbanishHandler.java

@ -14,6 +14,7 @@ import engine.Enum.GuildHistoryType;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -55,7 +56,7 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler {
boolean success = false; boolean success = false;
Guild guild = source.getGuild(); Guild guild = source.getGuild();
PlayerCharacter realizedTarget = PlayerCharacter.getFromCache(target); PlayerCharacter realizedTarget = PlayerManager.getFromCache(target);
if (realizedTarget != null) { if (realizedTarget != null) {
// Guild leader can't leave guild. must pass GL or disband // Guild leader can't leave guild. must pass GL or disband
@ -83,7 +84,7 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler {
} }
} else { } else {
if (guild.getGuildLeaderUUID() != target) { if (guild.getGuildLeaderUUID() != target) {
PlayerCharacter toBanish = PlayerCharacter.getPlayerCharacter(target); PlayerCharacter toBanish = PlayerManager.getPlayerCharacter(target);
if (toBanish == null) if (toBanish == null)
return true; return true;
//already added previously. //already added previously.
@ -110,7 +111,7 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler {
//DbManager.GuildQueries.ADD_TO_BANISHED_FROM_GUILDLIST(guild.getobjectUUID(), target); //DbManager.GuildQueries.ADD_TO_BANISHED_FROM_GUILDLIST(guild.getobjectUUID(), target);
// Send left guild message to rest of guild // Send left guild message to rest of guild
String targetName = PlayerCharacter.getFirstName(target); String targetName = PlayerManager.getFirstName(target);
ChatManager.chatGuildInfo(guild, ChatManager.chatGuildInfo(guild,
targetName + " has been banished from " + guild.getName() + '.'); targetName + " has been banished from " + guild.getName() + '.');
GuildListMsg guildListMsg = new GuildListMsg(guild); GuildListMsg guildListMsg = new GuildListMsg(guild);

3
src/engine/net/client/handlers/ChangeAltitudeHandler.java

@ -11,6 +11,7 @@ package engine.net.client.handlers;
import engine.Enum.DispatchChannel; import engine.Enum.DispatchChannel;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.PlayerManager;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ChangeAltitudeMsg; import engine.net.client.msg.ChangeAltitudeMsg;
@ -42,7 +43,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler {
if (!AbstractCharacter.CanFly(pc)) if (!AbstractCharacter.CanFly(pc))
return false; return false;
if (pc.isSwimming()) if (PlayerManager.isSwimming(pc))
return false; return false;
if (pc.region != null && !pc.region.isOutside()) if (pc.region != null && !pc.region.isOutside())
return false; return false;

13
src/engine/net/client/handlers/ChangeGuildLeaderHandler.java

@ -14,6 +14,7 @@ import engine.Enum.GameObjectType;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -97,9 +98,9 @@ public class ChangeGuildLeaderHandler extends AbstractClientMsgHandler {
} }
targetPlayer.setGuildLeader(true); PlayerManager.setGuildLeader(targetPlayer, true);
targetPlayer.setInnerCouncil(true); PlayerManager.setInnerCouncil(targetPlayer, true);
targetPlayer.setFullMember(true); PlayerManager.setFullMember(targetPlayer, true);
targetPlayer.incVer(); targetPlayer.incVer();
targetName = targetPlayer.getFirstName(); targetName = targetPlayer.getFirstName();
updateTarget = true; updateTarget = true;
@ -113,9 +114,9 @@ public class ChangeGuildLeaderHandler extends AbstractClientMsgHandler {
//updateOldGuildLeader //updateOldGuildLeader
sourcePlayer.setInnerCouncil(true); PlayerManager.setInnerCouncil(sourcePlayer, true);
sourcePlayer.setFullMember(true); PlayerManager.setFullMember(sourcePlayer, true);
sourcePlayer.setGuildLeader(false); PlayerManager.setGuildLeader(sourcePlayer, false);
sourcePlayer.incVer(); sourcePlayer.incVer();
GuildInfoMsg guildInfoMsg = new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 2); GuildInfoMsg guildInfoMsg = new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 2);

15
src/engine/net/client/handlers/ChangeRankHandler.java

@ -14,6 +14,7 @@ import engine.Enum.GameObjectType;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -63,14 +64,14 @@ public class ChangeRankHandler extends AbstractClientMsgHandler {
Enum.GuildType t = Enum.GuildType.getGuildTypeFromInt(sourcePlayer.getGuild().getCharter()); Enum.GuildType t = Enum.GuildType.getGuildTypeFromInt(sourcePlayer.getGuild().getCharter());
if (targetPlayer != null) { if (targetPlayer != null) {
targetPlayer.setGuildTitle(msg.getNewRank()); PlayerManager.setGuildTitle(targetPlayer, msg.getNewRank());
targetName = targetPlayer.getFirstName(); targetName = targetPlayer.getFirstName();
isMale = targetPlayer.getRace().getRaceType().getCharacterSex().equals(Enum.CharacterSex.MALE); isMale = targetPlayer.getRace().getRaceType().getCharacterSex().equals(Enum.CharacterSex.MALE);
} else { } else {
DbManager.GuildQueries.UPDATE_GUILD_RANK_OFFLINE(msg.getPlayerUUID(), msg.getNewRank(), sourcePlayer.getGuild().getObjectUUID()); DbManager.GuildQueries.UPDATE_GUILD_RANK_OFFLINE(msg.getPlayerUUID(), msg.getNewRank(), sourcePlayer.getGuild().getObjectUUID());
targetName = PlayerCharacter.getFirstName(msg.getPlayerUUID()); targetName = PlayerManager.getFirstName(msg.getPlayerUUID());
isMale = true; isMale = true;
} }
@ -98,7 +99,7 @@ public class ChangeRankHandler extends AbstractClientMsgHandler {
taxUpdate = (updateMask & 1) > 0; taxUpdate = (updateMask & 1) > 0;
if (targetName == null && updateMask > 0) if (targetName == null && updateMask > 0)
targetName = PlayerCharacter.getFirstName(msg.getPlayerUUID()); targetName = PlayerManager.getFirstName(msg.getPlayerUUID());
} else { } else {
icUpdate = (GuildStatusController.isInnerCouncil(targetPlayer.getGuildStatus()) != (msg.getIc() > 0)) && GuildStatusController.isGuildLeader(sourcePlayer.getGuildStatus()); icUpdate = (GuildStatusController.isInnerCouncil(targetPlayer.getGuildStatus()) != (msg.getIc() > 0)) && GuildStatusController.isGuildLeader(sourcePlayer.getGuildStatus());
recruitUpdate = (GuildStatusController.isRecruiter(targetPlayer.getGuildStatus()) != (msg.getRec() > 0)) && GuildStatusController.isGuildLeader(sourcePlayer.getGuildStatus()); recruitUpdate = (GuildStatusController.isRecruiter(targetPlayer.getGuildStatus()) != (msg.getRec() > 0)) && GuildStatusController.isGuildLeader(sourcePlayer.getGuildStatus());
@ -106,16 +107,16 @@ public class ChangeRankHandler extends AbstractClientMsgHandler {
//This logic branch only executes if targetPlayer has passed a null check... //This logic branch only executes if targetPlayer has passed a null check...
if (icUpdate) { if (icUpdate) {
targetPlayer.setInnerCouncil(msg.getIc() > 0); PlayerManager.setInnerCouncil(targetPlayer, msg.getIc() > 0);
targetPlayer.setFullMember(true); PlayerManager.setFullMember(targetPlayer, true);
targetPlayer.incVer(); targetPlayer.incVer();
} }
if (recruitUpdate) if (recruitUpdate)
targetPlayer.setRecruiter(msg.getRec() > 0); PlayerManager.setRecruiter(targetPlayer, msg.getRec() > 0);
if (taxUpdate) if (taxUpdate)
targetPlayer.setTaxCollector(msg.getTax() > 0); PlayerManager.setTaxCollector(targetPlayer, msg.getTax() > 0);
if (targetName == null) if (targetName == null)
targetName = targetPlayer.getFirstName(); targetName = targetPlayer.getFirstName();

5
src/engine/net/client/handlers/DisbandGuildHandler.java

@ -17,6 +17,7 @@ import engine.db.archive.GuildRecord;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -98,8 +99,8 @@ public class DisbandGuildHandler extends AbstractClientMsgHandler {
//Save Guild data //Save Guild data
player.setGuildLeader(false); PlayerManager.setGuildLeader(player, false);
player.setInnerCouncil(false); PlayerManager.setInnerCouncil(player, false);
guild.setGuildLeaderUUID(0); guild.setGuildLeaderUUID(0);
guild.setNation(null); guild.setNation(null);

3
src/engine/net/client/handlers/GuildControlHandler.java

@ -11,6 +11,7 @@ package engine.net.client.handlers;
import engine.Enum; import engine.Enum;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -60,7 +61,7 @@ public class GuildControlHandler extends AbstractClientMsgHandler {
PlayerCharacter player = SessionManager.getPlayerCharacter(origin); PlayerCharacter player = SessionManager.getPlayerCharacter(origin);
//If we don't get a valid PC for whatever reason.. just ignore it. //If we don't get a valid PC for whatever reason.. just ignore it.
PlayerCharacter pc = PlayerCharacter.getFromCache(msg.getUnknown03()); PlayerCharacter pc = PlayerManager.getFromCache(msg.getUnknown03());
if (pc != null) { if (pc != null) {
dispatch = Dispatch.borrow(player, new GuildListMsg(pc)); dispatch = Dispatch.borrow(player, new GuildListMsg(pc));

13
src/engine/net/client/handlers/GuildCreationFinalizeHandler.java

@ -15,10 +15,7 @@ import engine.Enum.GuildHistoryType;
import engine.Enum.ItemType; import engine.Enum.ItemType;
import engine.Enum.OwnerType; import engine.Enum.OwnerType;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -130,10 +127,10 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler {
GuildManager.joinGuild(player, newGuild, GuildHistoryType.CREATE); GuildManager.joinGuild(player, newGuild, GuildHistoryType.CREATE);
newGuild.setGuildLeader(player); newGuild.setGuildLeader(player);
player.setGuildLeader(true); PlayerManager.setGuildLeader(player, true);
player.setInnerCouncil(true); PlayerManager.setInnerCouncil(player, true);
player.setFullMember(true); PlayerManager.setFullMember(player, true);
player.setGuildTitle(charterType.getNumberOfRanks() - 1); PlayerManager.setGuildTitle(player, charterType.getNumberOfRanks() - 1);
player.getCharItemManager().delete(charter); player.getCharItemManager().delete(charter);
player.getCharItemManager().updateInventory(); player.getCharItemManager().updateInventory();
player.incVer(); player.incVer();

3
src/engine/net/client/handlers/GuildInfoHandler.java

@ -11,6 +11,7 @@ package engine.net.client.handlers;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -43,7 +44,7 @@ public class GuildInfoHandler extends AbstractClientMsgHandler {
} else if (msg.getMsgType() == 5) { } else if (msg.getMsgType() == 5) {
if (msg.getObjectType() == GameObjectType.PlayerCharacter.ordinal()) { if (msg.getObjectType() == GameObjectType.PlayerCharacter.ordinal()) {
PlayerCharacter pc = PlayerCharacter.getPlayerCharacter(msg.getObjectID()); PlayerCharacter pc = PlayerManager.getPlayerCharacter(msg.getObjectID());
dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(pc, pc.getGuild(), 5)); dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(pc, pc.getGuild(), 5));
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
} else { } else {

3
src/engine/net/client/handlers/MerchantMsgHandler.java

@ -17,7 +17,6 @@ import engine.powers.PowersBase;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Objects;
/* /*
* @Author: * @Author:
@ -347,7 +346,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
TeleportJob tj = new TeleportJob(player, npc, teleportLoc, origin, true); TeleportJob tj = new TeleportJob(player, npc, teleportLoc, origin, true);
JobScheduler.getInstance().scheduleJob(tj, time * 1000); JobScheduler.getInstance().scheduleJob(tj, time * 1000);
} else if (joinedGuild) { } else if (joinedGuild) {
player.teleport(teleportLoc); PlayerManager.teleport(player, teleportLoc);
player.setSafeMode(); player.setSafeMode();
} }
} }

2
src/engine/net/client/handlers/ObjectActionMsgHandler.java

@ -417,7 +417,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
if (!toCommand.isSiege()) if (!toCommand.isSiege())
return true; return true;
if (player.commandSiegeMinion(toCommand)) { if (PlayerManager.commandSiegeMinion(player, toCommand)) {
itemMan.consume(item); itemMan.consume(item);
} }
break; break;

7
src/engine/net/client/handlers/OpenFriendsCondemnListMsgHandler.java

@ -6,6 +6,7 @@ import engine.Enum.GameObjectType;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -71,7 +72,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
} }
AbstractCharacter toAdd = null; AbstractCharacter toAdd = null;
if (msg.getPlayerType() == GameObjectType.PlayerCharacter.ordinal()) if (msg.getPlayerType() == GameObjectType.PlayerCharacter.ordinal())
toAdd = PlayerCharacter.getFromCache(msg.getPlayerID()); toAdd = PlayerManager.getFromCache(msg.getPlayerID());
else if (msg.getPlayerType() == GameObjectType.NPC.ordinal()) else if (msg.getPlayerType() == GameObjectType.NPC.ordinal())
toAdd = NPC.getFromCache(msg.getPlayerID()); toAdd = NPC.getFromCache(msg.getPlayerID());
else if (msg.getPlayerType() == GameObjectType.Mob.ordinal()) else if (msg.getPlayerType() == GameObjectType.Mob.ordinal())
@ -214,7 +215,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
if (msg.getPlayerType() != GameObjectType.PlayerCharacter.ordinal()) if (msg.getPlayerType() != GameObjectType.PlayerCharacter.ordinal())
return true; return true;
PlayerCharacter playerCharacter = PlayerCharacter.getFromCache(msg.getPlayerID()); PlayerCharacter playerCharacter = PlayerManager.getFromCache(msg.getPlayerID());
if (playerCharacter == null) if (playerCharacter == null)
return true; return true;
@ -303,7 +304,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
//Check to see if the invited is already on the friends list. //Check to see if the invited is already on the friends list.
switch (msg.getInviteType()) { switch (msg.getInviteType()) {
case 7: case 7:
playerCharacter = PlayerCharacter.getFromCache(msg.getPlayerID()); playerCharacter = PlayerManager.getFromCache(msg.getPlayerID());
if (playerCharacter == null) if (playerCharacter == null)
return true; return true;
if (sourceBuilding.getFriends().containsKey(playerCharacter.getObjectUUID())) if (sourceBuilding.getFriends().containsKey(playerCharacter.getObjectUUID()))

5
src/engine/net/client/handlers/RequestEnterWorldHandler.java

@ -8,6 +8,7 @@ import engine.db.archive.CharacterRecord;
import engine.db.archive.DataWarehouse; import engine.db.archive.DataWarehouse;
import engine.db.archive.PvpRecord; import engine.db.archive.PvpRecord;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.Dispatch; import engine.net.Dispatch;
@ -57,7 +58,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
return true; return true;
} }
player.setEnteredWorld(false); PlayerManager.setEnteredWorld(player, false);
Account acc = SessionManager.getAccount(origin); Account acc = SessionManager.getAccount(origin);
@ -118,7 +119,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
try { try {
if (!player.isAlive()) { if (!player.isAlive()) {
Logger.info("respawning player on enter world."); Logger.info("respawning player on enter world.");
player.respawn(true, true, true); PlayerManager.respawn(player, true, true, true);
} }
} catch (Exception e) { } catch (Exception e) {

3
src/engine/net/client/handlers/SwearInHandler.java

@ -12,6 +12,7 @@ package engine.net.client.handlers;
import engine.Enum; import engine.Enum;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -63,7 +64,7 @@ public class SwearInHandler extends AbstractClientMsgHandler {
} }
// Swear target in and send message to guild // Swear target in and send message to guild
target.setFullMember(true); PlayerManager.setFullMember(target, true);
target.incVer(); target.incVer();
ChatManager.chatGuildInfo(source, target.getFirstName() + " has been sworn in as a full member!"); ChatManager.chatGuildInfo(source, target.getFirstName() + " has been sworn in as a full member!");

3
src/engine/net/client/handlers/TransferAssetMsgHandler.java

@ -4,6 +4,7 @@ import engine.Enum;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.PlayerManager;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -35,7 +36,7 @@ public class TransferAssetMsgHandler extends AbstractClientMsgHandler {
int TargetType = transferAssetMsg.getTargetType(); //ToDue later int TargetType = transferAssetMsg.getTargetType(); //ToDue later
Building building = BuildingManager.getBuildingFromCache(Buildingid); Building building = BuildingManager.getBuildingFromCache(Buildingid);
PlayerCharacter newOwner = PlayerCharacter.getFromCache(TargetID); PlayerCharacter newOwner = PlayerManager.getFromCache(TargetID);
PlayerCharacter player = origin.getPlayerCharacter(); PlayerCharacter player = origin.getPlayerCharacter();
if (player == null || building == null || newOwner == null) if (player == null || building == null || newOwner == null)

11
src/engine/net/client/msg/ApplyRuneMsg.java

@ -12,6 +12,7 @@ package engine.net.client.msg;
import engine.Enum; import engine.Enum;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.net.*; import engine.net.*;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.Protocol; import engine.net.client.Protocol;
@ -381,23 +382,23 @@ public class ApplyRuneMsg extends ClientNetMsg {
//add any additional stats to match old amount //add any additional stats to match old amount
int dif = strTotal - (int) playerCharacter.statStrBase; int dif = strTotal - (int) playerCharacter.statStrBase;
if (dif > 0 && strTotal < (int) playerCharacter.statStrMax) { if (dif > 0 && strTotal < (int) playerCharacter.statStrMax) {
playerCharacter.addStr(dif); PlayerManager.addStr(playerCharacter, dif);
} }
dif = dexTotal - (int) playerCharacter.statDexBase; dif = dexTotal - (int) playerCharacter.statDexBase;
if (dif > 0 && dexTotal < (int) playerCharacter.statDexMax) { if (dif > 0 && dexTotal < (int) playerCharacter.statDexMax) {
playerCharacter.addDex(dif); PlayerManager.addDex(playerCharacter, dif);
} }
dif = conTotal - (int) playerCharacter.statConBase; dif = conTotal - (int) playerCharacter.statConBase;
if (dif > 0 && conTotal < (int) playerCharacter.statConMax) { if (dif > 0 && conTotal < (int) playerCharacter.statConMax) {
playerCharacter.addCon(dif); PlayerManager.addCon(playerCharacter, dif);
} }
dif = intTotal - (int) playerCharacter.statIntBase; dif = intTotal - (int) playerCharacter.statIntBase;
if (dif > 0 && intTotal < (int) playerCharacter.statIntMax) { if (dif > 0 && intTotal < (int) playerCharacter.statIntMax) {
playerCharacter.addInt(dif); PlayerManager.addInt(playerCharacter, dif);
} }
dif = spiTotal - (int) playerCharacter.statSpiBase; dif = spiTotal - (int) playerCharacter.statSpiBase;
if (dif > 0 && spiTotal < (int) playerCharacter.statSpiMax) { if (dif > 0 && spiTotal < (int) playerCharacter.statSpiMax) {
playerCharacter.addSpi(dif); PlayerManager.addSpi(playerCharacter, dif);
} }
// recalculate all bonuses/formulas/skills/powers // recalculate all bonuses/formulas/skills/powers
playerCharacter.recalculate(); playerCharacter.recalculate();

3
src/engine/net/client/msg/ArcViewAssetTransactionsMsg.java

@ -13,6 +13,7 @@ import engine.Enum.GameObjectType;
import engine.Enum.TransactionType; import engine.Enum.TransactionType;
import engine.exception.SerializationException; import engine.exception.SerializationException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
@ -102,7 +103,7 @@ public class ArcViewAssetTransactionsMsg extends ClientNetMsg {
break; break;
case PlayerCharacter: case PlayerCharacter:
PlayerCharacter pc = PlayerCharacter.getPlayerCharacter(transaction.getTargetUUID()); PlayerCharacter pc = PlayerManager.getPlayerCharacter(transaction.getTargetUUID());
if (pc != null) if (pc != null)
name = pc.getCombinedName(); name = pc.getCombinedName();
break; break;

3
src/engine/net/client/msg/BuyFromNPCWindowMsg.java

@ -11,6 +11,7 @@ package engine.net.client.msg;
import engine.Enum.ItemType; import engine.Enum.ItemType;
import engine.exception.SerializationException; import engine.exception.SerializationException;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
@ -100,7 +101,7 @@ public class BuyFromNPCWindowMsg extends ClientNetMsg {
man = npc.getCharItemManager(); man = npc.getCharItemManager();
Contract contract = npc.getContract(); Contract contract = npc.getContract();
if (player != null) { if (player != null) {
float barget = player.getBargain(); float barget = PlayerManager.getBargain(player);
float profit = npc.getSellPercent(player) - barget; float profit = npc.getSellPercent(player) - barget;
if (profit < 1) if (profit < 1)

7
src/engine/net/client/msg/IgnoreMsg.java

@ -12,6 +12,7 @@ package engine.net.client.msg;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
@ -81,7 +82,7 @@ public class IgnoreMsg extends ClientNetMsg {
} }
//FIX THIS, USE OUR CACHE! //FIX THIS, USE OUR CACHE!
PlayerCharacter pcToIgnore = PlayerCharacter.getByFirstName(nameToIgnore); PlayerCharacter pcToIgnore = PlayerManager.getByFirstName(nameToIgnore);
if (pcSource == null) { if (pcSource == null) {
return; return;
@ -114,11 +115,11 @@ public class IgnoreMsg extends ClientNetMsg {
pcSource.removeIgnoredPlayer(pcToIgnore.getAccount()); pcSource.removeIgnoredPlayer(pcToIgnore.getAccount());
ChatManager.chatSystemInfo(pcSource, "Character " + fn + " is no longer ignored."); ChatManager.chatSystemInfo(pcSource, "Character " + fn + " is no longer ignored.");
} else { } else {
if (!PlayerCharacter.isIgnorable()) { if (!PlayerManager.isIgnorable()) {
ChatManager.chatSystemError(pcSource, "This character cannot be ignored."); ChatManager.chatSystemError(pcSource, "This character cannot be ignored.");
return; return;
} }
if (PlayerCharacter.isIgnoreListFull()) { if (PlayerManager.isIgnoreListFull()) {
ChatManager.chatSystemError(pcSource, "Your ignore list is already full."); ChatManager.chatSystemError(pcSource, "Your ignore list is already full.");
return; return;
} }

5
src/engine/net/client/msg/OpenFriendsCondemnListMsg.java

@ -11,6 +11,7 @@ package engine.net.client.msg;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
@ -619,7 +620,7 @@ public class OpenFriendsCondemnListMsg extends ClientNetMsg {
writer.putInt(listSize); writer.putInt(listSize);
for (BuildingFriends friend : this.friends.values()) { for (BuildingFriends friend : this.friends.values()) {
pc = PlayerCharacter.getFromCache(friend.getPlayerUID()); pc = PlayerManager.getFromCache(friend.getPlayerUID());
guild = Guild.getGuild(friend.getGuildUID()); guild = Guild.getGuild(friend.getGuildUID());
if (friend.getFriendType() == 7) { if (friend.getFriendType() == 7) {
if (pc != null) if (pc != null)
@ -718,7 +719,7 @@ public class OpenFriendsCondemnListMsg extends ClientNetMsg {
AbstractCharacter heraldryCharacter = null; AbstractCharacter heraldryCharacter = null;
int characterType = heraldryMap.get(characterID); int characterType = heraldryMap.get(characterID);
if (characterType == GameObjectType.PlayerCharacter.ordinal()) if (characterType == GameObjectType.PlayerCharacter.ordinal())
heraldryCharacter = PlayerCharacter.getFromCache(characterID); heraldryCharacter = PlayerManager.getFromCache(characterID);
else if (characterType == GameObjectType.NPC.ordinal()) else if (characterType == GameObjectType.NPC.ordinal())
heraldryCharacter = NPC.getFromCache(characterID); heraldryCharacter = NPC.getFromCache(characterID);
else if (characterType == GameObjectType.Mob.ordinal()) else if (characterType == GameObjectType.Mob.ordinal())

11
src/engine/net/client/msg/RefineMsg.java

@ -10,6 +10,7 @@
package engine.net.client.msg; package engine.net.client.msg;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.*; import engine.net.*;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -160,15 +161,15 @@ public class RefineMsg extends ClientNetMsg {
private static boolean refineStat(ClientConnection origin, PlayerCharacter pc, int token, RefineMsg msg) { private static boolean refineStat(ClientConnection origin, PlayerCharacter pc, int token, RefineMsg msg) {
if (token == MBServerStatics.STAT_STR_ID) if (token == MBServerStatics.STAT_STR_ID)
return pc.refineStr(); return PlayerManager.refineStr(pc);
if (token == MBServerStatics.STAT_DEX_ID) if (token == MBServerStatics.STAT_DEX_ID)
return pc.refineDex(); return PlayerManager.refineDex(pc);
if (token == MBServerStatics.STAT_CON_ID) if (token == MBServerStatics.STAT_CON_ID)
return pc.refineCon(); return PlayerManager.refineCon(pc);
if (token == MBServerStatics.STAT_INT_ID) if (token == MBServerStatics.STAT_INT_ID)
return pc.refineInt(msg); return PlayerManager.refineInt(pc, msg);
if (token == MBServerStatics.STAT_SPI_ID) if (token == MBServerStatics.STAT_SPI_ID)
return pc.refineSpi(); return PlayerManager.refineSpi(pc);
return false; return false;
} }

3
src/engine/net/client/msg/SendOwnPlayerMsg.java

@ -11,6 +11,7 @@ package engine.net.client.msg;
import engine.exception.SerializationException; import engine.exception.SerializationException;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
@ -90,7 +91,7 @@ public class SendOwnPlayerMsg extends ClientNetMsg {
} }
writer.putVector3f(ch.getLoc()); writer.putVector3f(ch.getLoc());
try { try {
PlayerCharacter.serializeForClientMsgFull(this.ch, writer); PlayerManager.serializeForClientMsgFull(this.ch, writer);
} catch (SerializationException e) { } catch (SerializationException e) {
Logger.error(e); Logger.error(e);
} }

3
src/engine/net/client/msg/TerritoryChangeMessage.java

@ -11,6 +11,7 @@ package engine.net.client.msg;
import engine.exception.SerializationException; import engine.exception.SerializationException;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
@ -64,7 +65,7 @@ public class TerritoryChangeMessage extends ClientNetMsg {
writer.putString(realm.getRealmName()); writer.putString(realm.getRealmName());
if (this.realmOwner != null) { if (this.realmOwner != null) {
writer.putString(this.realmOwner.getCombinedName()); writer.putString(this.realmOwner.getCombinedName());
writer.putInt(PlayerCharacter.GetPlayerRealmTitle(this.realmOwner)); writer.putInt(PlayerManager.GetPlayerRealmTitle(this.realmOwner));
writer.putInt(1); writer.putInt(1);
writer.put((byte) 1); writer.put((byte) 1);
writer.put((byte) 1); writer.put((byte) 1);

5
src/engine/net/client/msg/TrackWindowMsg.java

@ -10,6 +10,7 @@
package engine.net.client.msg; package engine.net.client.msg;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
@ -89,7 +90,7 @@ public class TrackWindowMsg extends ClientNetMsg {
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
int objectType = reader.getInt(); int objectType = reader.getInt();
int objectID = reader.getInt(); int objectID = reader.getInt();
this.source = PlayerCharacter.getFromCache(objectID); this.source = PlayerManager.getFromCache(objectID);
reader.getString(); //name reader.getString(); //name
reader.get(); //always 00? reader.get(); //always 00?
reader.getInt(); //guildObjectType reader.getInt(); //guildObjectType
@ -106,7 +107,7 @@ public class TrackWindowMsg extends ClientNetMsg {
//Get the Character from it's Object Type and ID //Get the Character from it's Object Type and ID
AbstractCharacter ac = null; AbstractCharacter ac = null;
if (objectType == GameObjectType.PlayerCharacter.ordinal()) if (objectType == GameObjectType.PlayerCharacter.ordinal())
ac = PlayerCharacter.getFromCache(objectID); ac = PlayerManager.getFromCache(objectID);
else if (objectType == GameObjectType.NPC.ordinal()) else if (objectType == GameObjectType.NPC.ordinal())
ac = NPC.getFromCache(objectID); ac = NPC.getFromCache(objectID);
else if (objectType == GameObjectType.Mob.ordinal()) else if (objectType == GameObjectType.Mob.ordinal())

15
src/engine/net/client/msg/VendorDialogMsg.java

@ -12,10 +12,7 @@ package engine.net.client.msg;
import engine.Enum.DispatchChannel; import engine.Enum.DispatchChannel;
import engine.Enum.GuildHistoryType; import engine.Enum.GuildHistoryType;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.*; import engine.net.*;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -437,7 +434,7 @@ public class VendorDialogMsg extends ClientNetMsg {
if (level >= minLevel && level <= maxLevel) { if (level >= minLevel && level <= maxLevel) {
if (useSquare) if (useSquare)
loc = getSquare(loc); loc = getSquare(loc);
pc.teleport(loc); PlayerManager.teleport(pc, loc);
pc.setSafeMode(); pc.setSafeMode();
// PowersManager.applyPower(pc, pc, new Vector3f(0f, // PowersManager.applyPower(pc, pc, new Vector3f(0f,
// 0f, 0f), -1661758934, 40, false); // 0f, 0f), -1661758934, 40, false);
@ -463,7 +460,7 @@ public class VendorDialogMsg extends ClientNetMsg {
// teleport player // teleport player
if (useSquare) if (useSquare)
loc = getSquare(loc); loc = getSquare(loc);
pc.teleport(loc); PlayerManager.teleport(pc, loc);
pc.setSafeMode(); pc.setSafeMode();
// PowersManager.applyPower(pc, pc, new // PowersManager.applyPower(pc, pc, new
// Vector3f(0f, 0f, 0f), -1661758934, 40, false); // Vector3f(0f, 0f, 0f), -1661758934, 40, false);
@ -471,10 +468,10 @@ public class VendorDialogMsg extends ClientNetMsg {
// join guild // join guild
GuildManager.joinGuild(pc, guild, GuildHistoryType.JOIN); GuildManager.joinGuild(pc, guild, GuildHistoryType.JOIN);
pc.resetGuildStatuses(); PlayerManager.resetGuildStatuses(pc);
if (guild.isNPCGuild()) if (guild.isNPCGuild())
pc.setFullMember(true); PlayerManager.setFullMember(pc, true);
if (useSquare) if (useSquare)
loc = loc.add(30, 0, 0); loc = loc.add(30, 0, 0);
@ -483,7 +480,7 @@ public class VendorDialogMsg extends ClientNetMsg {
// guild not found, just teleport // guild not found, just teleport
if (useSquare) if (useSquare)
loc = getSquare(loc); loc = getSquare(loc);
pc.teleport(loc); PlayerManager.teleport(pc, loc);
pc.setSafeMode(); pc.setSafeMode();
// PowersManager.applyPower(pc, pc, new // PowersManager.applyPower(pc, pc, new
// Vector3f(0f, 0f, 0f), -1661758934, 50, false); // Vector3f(0f, 0f, 0f), -1661758934, 50, false);

5
src/engine/net/client/msg/WhoResponseMsg.java

@ -10,6 +10,7 @@
package engine.net.client.msg; package engine.net.client.msg;
import engine.Enum; import engine.Enum;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.*; import engine.net.*;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -233,8 +234,8 @@ public class WhoResponseMsg extends ClientNetMsg {
writer.putInt(pc.getObjectUUID()); writer.putInt(pc.getObjectUUID());
writer.putString(pc.getFirstName()); writer.putString(pc.getFirstName());
writer.putString(pc.getLastName()); writer.putString(pc.getLastName());
writer.putInt(pc.getRaceToken()); writer.putInt(PlayerManager.getRaceToken(pc));
writer.putInt(pc.getClassToken()); writer.putInt(PlayerManager.getClassToken(pc));
writer.putInt(pc.getLevel()); writer.putInt(pc.getLevel());
writer.putInt(0); // unknown 0 writer.putInt(0); // unknown 0
writer.putInt(pc.isMale() ? 1 : 2); //gender? writer.putInt(pc.isMale() ? 1 : 2); //gender?

7
src/engine/net/client/msg/guild/GuildInfoMsg.java

@ -11,6 +11,7 @@ package engine.net.client.msg.guild;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
@ -193,7 +194,7 @@ class GuildInfoMessageType2 extends GuildInfoMessageType {
writer.putString(g.getName()); writer.putString(g.getName());
if (this.objectType == GameObjectType.PlayerCharacter.ordinal()) { if (this.objectType == GameObjectType.PlayerCharacter.ordinal()) {
PlayerCharacter pc = PlayerCharacter.getFromCache(this.objectID); PlayerCharacter pc = PlayerManager.getFromCache(this.objectID);
if (pc != null) { if (pc != null) {
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus())); writer.putInt(GuildStatusController.getRank(pc.getGuildStatus()));
@ -254,7 +255,7 @@ class GuildInfoMessageType4 extends GuildInfoMessageType {
writer.putInt(0); writer.putInt(0);
writer.putInt(0); writer.putInt(0);
writer.putInt(0); writer.putInt(0);
PlayerCharacter pc = PlayerCharacter.getFromCache(this.objectID); PlayerCharacter pc = PlayerManager.getFromCache(this.objectID);
if (this.g == null || pc == null) { if (this.g == null || pc == null) {
writer.putInt(0); writer.putInt(0);
writer.putInt(0); writer.putInt(0);
@ -298,7 +299,7 @@ class GuildInfoMessageType4 extends GuildInfoMessageType {
if (guildLeader != null) if (guildLeader != null)
guildLeaderName = guildLeader.getName(); guildLeaderName = guildLeader.getName();
} else { } else {
guildLeader = PlayerCharacter.getFromCache(g.getGuildLeaderUUID()); guildLeader = PlayerManager.getFromCache(g.getGuildLeaderUUID());
if (guildLeader != null) if (guildLeader != null)
guildLeaderName = ((PlayerCharacter) guildLeader).getCombinedName(); guildLeaderName = ((PlayerCharacter) guildLeader).getCombinedName();
} }

3
src/engine/net/client/msg/guild/GuildListMsg.java

@ -11,6 +11,7 @@ package engine.net.client.msg.guild;
import engine.Enum; import engine.Enum;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
@ -204,7 +205,7 @@ class GuildListMessageType2 extends GuildListMessageType {
writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); //Title Maybe? writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); //Title Maybe?
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus())); //Rank? writer.putInt(GuildStatusController.getRank(pc.getGuildStatus())); //Rank?
writer.putInt(pc.getRaceToken()); //race token writer.putInt(PlayerManager.getRaceToken(pc)); //race token
writer.putInt(pc.getBaseClassToken()); //class token writer.putInt(pc.getBaseClassToken()); //class token
writer.putInt(2); //PAD writer.putInt(2); //PAD

5
src/engine/net/client/msg/login/CharSelectScreenMsg.java

@ -11,6 +11,7 @@ package engine.net.client.msg.login;
import engine.exception.SerializationException; import engine.exception.SerializationException;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection; import engine.net.AbstractConnection;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
@ -162,9 +163,9 @@ public class CharSelectScreenMsg extends ClientNetMsg {
for (int i = 0; i < this.numChars; ++i) { for (int i = 0; i < this.numChars; ++i) {
try { try {
if (!fromCommit) if (!fromCommit)
PlayerCharacter.serializeForClientMsgLogin(this.chars.get(i), writer); PlayerManager.serializeForClientMsgLogin(this.chars.get(i), writer);
else else
PlayerCharacter.serializeForClientMsgCommit(this.chars.get(i), writer); PlayerManager.serializeForClientMsgCommit(this.chars.get(i), writer);
} catch (SerializationException e) { } catch (SerializationException e) {
Logger.error("failed to serialize character " + this.chars.get(i).getObjectUUID()); Logger.error("failed to serialize character " + this.chars.get(i).getObjectUUID());
// Handled already. // Handled already.

22
src/engine/objects/AbstractCharacter.java

@ -57,7 +57,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
protected short statIntCurrent; protected short statIntCurrent;
protected short statSpiCurrent; protected short statSpiCurrent;
protected short unusedStatPoints; protected short unusedStatPoints;
protected int exp; public int exp;
public int buildingUUID; public int buildingUUID;
public Building building; public Building building;
@ -67,8 +67,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
public int guildUUID; public int guildUUID;
public Guild guild; public Guild guild;
protected byte runningTrains; protected byte runningTrains;
protected ConcurrentHashMap<Integer, CharacterPower> powers; public ConcurrentHashMap<Integer, CharacterPower> powers;
protected ConcurrentHashMap<String, CharacterSkill> skills; public ConcurrentHashMap<String, CharacterSkill> skills;
// Variables NOT to be stored in db // Variables NOT to be stored in db
protected boolean sit = false; protected boolean sit = false;
protected boolean walkMode; protected boolean walkMode;
@ -80,11 +80,11 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
// ticking down so that mobs/players following dont just move away to your projected location // ticking down so that mobs/players following dont just move away to your projected location
protected Vector3fImmutable nextEndLoc = Vector3fImmutable.ZERO; protected Vector3fImmutable nextEndLoc = Vector3fImmutable.ZERO;
protected float speed; protected float speed;
protected AtomicFloat stamina = new AtomicFloat(); public AtomicFloat stamina = new AtomicFloat();
protected float staminaMax; protected float staminaMax;
protected AtomicFloat mana = new AtomicFloat(); public AtomicFloat mana = new AtomicFloat();
protected float manaMax; // Health/Mana/Stamina protected float manaMax; // Health/Mana/Stamina
protected AtomicBoolean isAlive = new AtomicBoolean(true); public AtomicBoolean isAlive = new AtomicBoolean(true);
protected Resists resists = new Resists("Genric"); protected Resists resists = new Resists("Genric");
protected ConcurrentHashMap<String, JobContainer> timers; protected ConcurrentHashMap<String, JobContainer> timers;
protected ConcurrentHashMap<String, Long> timestamps; protected ConcurrentHashMap<String, Long> timestamps;
@ -102,7 +102,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
protected boolean isActive; // <-Do not use this for deleting character! protected boolean isActive; // <-Do not use this for deleting character!
protected float altitude = 0; // 0=on terrain, 1=tier 1, 2=tier 2, etc. protected float altitude = 0; // 0=on terrain, 1=tier 1, 2=tier 2, etc.
protected ConcurrentHashMap<Integer, JobContainer> recycleTimers; protected ConcurrentHashMap<Integer, JobContainer> recycleTimers;
protected PlayerBonuses bonuses; public PlayerBonuses bonuses;
protected JobContainer lastChant; protected JobContainer lastChant;
protected boolean isCasting = false; protected boolean isCasting = false;
protected long lastSetLocUpdate = 0L; protected long lastSetLocUpdate = 0L;
@ -363,7 +363,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
switch (abstractCharacter.getObjectType()) { switch (abstractCharacter.getObjectType()) {
case PlayerCharacter: case PlayerCharacter:
PlayerCharacter.serializePlayerForClientMsgOtherPlayer((PlayerCharacter) abstractCharacter, writer, asciiLastName); PlayerManager.serializePlayerForClientMsgOtherPlayer((PlayerCharacter) abstractCharacter, writer, asciiLastName);
break; break;
case Mob: case Mob:
Mob.serializeMobForClientMsgOtherPlayer((Mob) abstractCharacter, writer); Mob.serializeMobForClientMsgOtherPlayer((Mob) abstractCharacter, writer);
@ -445,7 +445,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
playerCharacter.calculateItemBonuses(); playerCharacter.calculateItemBonuses();
//recalculate formulas //recalculate formulas
PlayerCharacter.recalculatePlayerStatsOnLoad(playerCharacter); PlayerManager.recalculatePlayerStatsOnLoad(playerCharacter);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
@ -746,7 +746,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
} }
if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) if (this.getObjectType().equals(GameObjectType.PlayerCharacter))
if (((PlayerCharacter) this).isLastSwimming()) if (PlayerManager.isLastSwimming(((PlayerCharacter) this)))
return 1; //swimming return 1; //swimming
return 2; //ground return 2; //ground
@ -1707,7 +1707,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (CanFly(player) == false && if (CanFly(player) == false &&
player.getMovementState().equals(MovementState.FLYING)) player.getMovementState().equals(MovementState.FLYING))
PlayerCharacter.GroundPlayer(player); PlayerManager.GroundPlayer(player);
} }
} catch (Exception e) { } catch (Exception e) {

3
src/engine/objects/AbstractGameObject.java

@ -12,6 +12,7 @@ package engine.objects;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.job.JobContainer; import engine.job.JobContainer;
import engine.job.JobScheduler; import engine.job.JobScheduler;
import engine.jobs.DatabaseUpdateJob; import engine.jobs.DatabaseUpdateJob;
@ -107,7 +108,7 @@ public abstract class AbstractGameObject {
switch (objectType) { switch (objectType) {
case PlayerCharacter: case PlayerCharacter:
return PlayerCharacter.getPlayerCharacter(tableID); return PlayerManager.getPlayerCharacter(tableID);
case NPC: case NPC:
return NPC.getNPC(tableID); return NPC.getNPC(tableID);

13
src/engine/objects/AbstractWorldObject.java

@ -15,6 +15,7 @@ import engine.Enum.GameObjectType;
import engine.Enum.GridObjectType; import engine.Enum.GridObjectType;
import engine.InterestManagement.HeightMap; import engine.InterestManagement.HeightMap;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.PlayerManager;
import engine.job.AbstractScheduleJob; import engine.job.AbstractScheduleJob;
import engine.job.JobContainer; import engine.job.JobContainer;
import engine.job.JobScheduler; import engine.job.JobScheduler;
@ -39,7 +40,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
public abstract class AbstractWorldObject extends AbstractGameObject { public abstract class AbstractWorldObject extends AbstractGameObject {
protected final ReadWriteLock locationLock = new ReentrantReadWriteLock(true); public final ReadWriteLock locationLock = new ReentrantReadWriteLock(true);
protected final ReadWriteLock updateLock = new ReentrantReadWriteLock(true); protected final ReadWriteLock updateLock = new ReentrantReadWriteLock(true);
public float healthMax; public float healthMax;
public ConcurrentHashMap<String, Effect> effects = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); public ConcurrentHashMap<String, Effect> effects = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
@ -49,7 +50,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
public Regions landingRegion = null; public Regions landingRegion = null;
public Vector3fImmutable lastLoc = Vector3fImmutable.ZERO; public Vector3fImmutable lastLoc = Vector3fImmutable.ZERO;
public Vector3fImmutable loc = new Vector3fImmutable(0.0f, 0.0f, 0.0f); public Vector3fImmutable loc = new Vector3fImmutable(0.0f, 0.0f, 0.0f);
protected AtomicFloat health = new AtomicFloat(); public AtomicFloat health = new AtomicFloat();
protected boolean load = true; protected boolean load = true;
protected GridObjectType gridObjectType; protected GridObjectType gridObjectType;
protected float altitude = 0; protected float altitude = 0;
@ -150,7 +151,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
Regions region = null; Regions region = null;
if (worldObject.getObjectType().equals(GameObjectType.PlayerCharacter)) if (worldObject.getObjectType().equals(GameObjectType.PlayerCharacter))
if (((PlayerCharacter) worldObject).isFlying()) if (PlayerManager.isFlying(((PlayerCharacter) worldObject)))
return null; return null;
//Find building //Find building
for (AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(worldObject.getLoc(), MBServerStatics.STRUCTURE_LOAD_RANGE, MBServerStatics.MASK_BUILDING)) { for (AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(worldObject.getLoc(), MBServerStatics.STRUCTURE_LOAD_RANGE, MBServerStatics.MASK_BUILDING)) {
@ -271,7 +272,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) if (this.getObjectType().equals(GameObjectType.PlayerCharacter))
if (name.equals("Flight")) { if (name.equals("Flight")) {
((PlayerCharacter) this).update(false); ((PlayerCharacter) this).update(false);
PlayerCharacter.GroundPlayer((PlayerCharacter) this); PlayerManager.GroundPlayer((PlayerCharacter) this);
} }
} }
applyAllBonuses(); applyAllBonuses();
@ -386,7 +387,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
//ground player //ground player
if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) { if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) {
((PlayerCharacter) this).update(false); ((PlayerCharacter) this).update(false);
PlayerCharacter.GroundPlayer((PlayerCharacter) this); PlayerManager.GroundPlayer((PlayerCharacter) this);
} }
} }
} else { } else {
@ -415,7 +416,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
//ground player //ground player
if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) { if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) {
((PlayerCharacter) this).update(false); ((PlayerCharacter) this).update(false);
PlayerCharacter.GroundPlayer((PlayerCharacter) this); PlayerManager.GroundPlayer((PlayerCharacter) this);
} }
} }

3
src/engine/objects/Account.java

@ -14,6 +14,7 @@ import engine.Enum.DispatchChannel;
import engine.Enum.ItemContainerType; import engine.Enum.ItemContainerType;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -163,7 +164,7 @@ public class Account extends AbstractGameObject {
ArrayList<PlayerCharacter> playerList = DbManager.PlayerCharacterQueries.GET_CHARACTERS_FOR_ACCOUNT(this.getObjectUUID()); ArrayList<PlayerCharacter> playerList = DbManager.PlayerCharacterQueries.GET_CHARACTERS_FOR_ACCOUNT(this.getObjectUUID());
for (PlayerCharacter player : playerList) { for (PlayerCharacter player : playerList) {
PlayerCharacter.initializePlayer(player); PlayerManager.initializePlayer(player);
this.characterMap.putIfAbsent(player.getObjectUUID(), player); this.characterMap.putIfAbsent(player.getObjectUUID(), player);
} }

10
src/engine/objects/Bane.java

@ -261,7 +261,7 @@ public final class Bane {
Vector3fImmutable movePlayerOutsideStone = player.getLoc(); Vector3fImmutable movePlayerOutsideStone = player.getLoc();
movePlayerOutsideStone = movePlayerOutsideStone.setX(movePlayerOutsideStone.x + 10); movePlayerOutsideStone = movePlayerOutsideStone.setX(movePlayerOutsideStone.x + 10);
movePlayerOutsideStone = movePlayerOutsideStone.setZ(movePlayerOutsideStone.z + 10); movePlayerOutsideStone = movePlayerOutsideStone.setZ(movePlayerOutsideStone.z + 10);
player.teleport(movePlayerOutsideStone); PlayerManager.teleport(player, movePlayerOutsideStone);
// Notify players // Notify players
@ -734,7 +734,7 @@ public final class Bane {
HashSet<AbstractWorldObject> inSiegeRange = WorldGrid.getObjectsInRangePartial(city.getTOL().loc,1750f,1); HashSet<AbstractWorldObject> inSiegeRange = WorldGrid.getObjectsInRangePartial(city.getTOL().loc,1750f,1);
for(AbstractWorldObject obj : inSiegeRange){ for(AbstractWorldObject obj : inSiegeRange){
int uuid = obj.getObjectUUID(); int uuid = obj.getObjectUUID();
PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid); PlayerCharacter player = PlayerManager.getPlayerCharacter(uuid);
if(player == null) if(player == null)
continue; continue;
Guild playerNation = player.guild.getNation(); Guild playerNation = player.guild.getNation();
@ -749,7 +749,7 @@ public final class Bane {
int attackerSize = 0; int attackerSize = 0;
int defenderSize = 0; int defenderSize = 0;
for(int uuid : city.baneAttendees.keySet()){ for(int uuid : city.baneAttendees.keySet()){
PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid); PlayerCharacter player = PlayerManager.getPlayerCharacter(uuid);
if(player == null) if(player == null)
continue; continue;
if(player.guild.getNation().equals(defendNation)) if(player.guild.getNation().equals(defendNation))
@ -762,7 +762,7 @@ public final class Bane {
float attackerMultiplier = ZergManager.getCurrentMultiplier(attackerSize,this.capSize); float attackerMultiplier = ZergManager.getCurrentMultiplier(attackerSize,this.capSize);
float defenderMultiplier = ZergManager.getCurrentMultiplier(defenderSize,this.capSize); float defenderMultiplier = ZergManager.getCurrentMultiplier(defenderSize,this.capSize);
for(int uuid : attackers){ for(int uuid : attackers){
PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid); PlayerCharacter player = PlayerManager.getPlayerCharacter(uuid);
if(inSiegeRange.contains(player)) //player is still physically here, needs updated multiplier if(inSiegeRange.contains(player)) //player is still physically here, needs updated multiplier
player.ZergMultiplier = attackerMultiplier; player.ZergMultiplier = attackerMultiplier;
else else
@ -770,7 +770,7 @@ public final class Bane {
} }
for(int uuid : defenders){ for(int uuid : defenders){
PlayerCharacter player = PlayerCharacter.getPlayerCharacter(uuid); PlayerCharacter player = PlayerManager.getPlayerCharacter(uuid);
if(inSiegeRange.contains(player)) //player is still physically here, needs updated multiplier if(inSiegeRange.contains(player)) //player is still physically here, needs updated multiplier
player.ZergMultiplier = defenderMultiplier; player.ZergMultiplier = defenderMultiplier;
else else

5
src/engine/objects/Building.java

@ -19,6 +19,7 @@ import engine.db.archive.DataWarehouse;
import engine.db.archive.MineRecord; import engine.db.archive.MineRecord;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.job.JobContainer; import engine.job.JobContainer;
import engine.job.JobScheduler; import engine.job.JobScheduler;
@ -970,7 +971,7 @@ public class Building extends AbstractWorldObject {
if (this.ownerIsNPC) if (this.ownerIsNPC)
return NPC.getFromCache(this.ownerUUID); return NPC.getFromCache(this.ownerUUID);
return PlayerCharacter.getFromCache(this.ownerUUID); return PlayerManager.getFromCache(this.ownerUUID);
} }
@ -1095,7 +1096,7 @@ public class Building extends AbstractWorldObject {
Logger.info("Building UID " + this.getObjectUUID() + " Failed to Load NPC Owner with ID " + this.ownerUUID + " Location " + this.getLoc().toString()); Logger.info("Building UID " + this.getObjectUUID() + " Failed to Load NPC Owner with ID " + this.ownerUUID + " Location " + this.getLoc().toString());
} else if (this.ownerUUID != 0) { } else if (this.ownerUUID != 0) {
if (PlayerCharacter.getPlayerCharacter(this.ownerUUID) == null) { if (PlayerManager.getPlayerCharacter(this.ownerUUID) == null) {
Logger.info("Building UID " + this.getObjectUUID() + " Failed to Load Player Owner with ID " + this.ownerUUID + " Location " + this.getLoc().toString()); Logger.info("Building UID " + this.getObjectUUID() + " Failed to Load Player Owner with ID " + this.ownerUUID + " Location " + this.getLoc().toString());
} }
} }

11
src/engine/objects/CharacterItemManager.java

@ -12,10 +12,7 @@ package engine.objects;
import engine.Enum; import engine.Enum;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.Enum.ItemType; import engine.Enum.ItemType;
import engine.gameManager.BuildingManager; import engine.gameManager.*;
import engine.gameManager.ChatManager;
import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -424,7 +421,7 @@ public class CharacterItemManager {
public synchronized boolean tradeRequest(TradeRequestMsg msg) { public synchronized boolean tradeRequest(TradeRequestMsg msg) {
PlayerCharacter source = (PlayerCharacter) this.getOwner(); PlayerCharacter source = (PlayerCharacter) this.getOwner();
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getPlayerID()); PlayerCharacter target = PlayerManager.getFromCache(msg.getPlayerID());
Dispatch dispatch; Dispatch dispatch;
if (!canTrade(source, target)) { if (!canTrade(source, target)) {
@ -450,7 +447,7 @@ public class CharacterItemManager {
} }
public synchronized boolean invalidTradeRequest(InvalidTradeRequestMsg msg) { public synchronized boolean invalidTradeRequest(InvalidTradeRequestMsg msg) {
PlayerCharacter requester = PlayerCharacter.getFromCache(msg.getRequesterID()); PlayerCharacter requester = PlayerManager.getFromCache(msg.getRequesterID());
Dispatch dispatch; Dispatch dispatch;
dispatch = Dispatch.borrow(requester, msg); dispatch = Dispatch.borrow(requester, msg);
@ -495,7 +492,7 @@ public class CharacterItemManager {
public synchronized boolean acceptTradeRequest(AcceptTradeRequestMsg msg) { public synchronized boolean acceptTradeRequest(AcceptTradeRequestMsg msg) {
PlayerCharacter source = (PlayerCharacter) this.getOwner(); PlayerCharacter source = (PlayerCharacter) this.getOwner();
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID()); PlayerCharacter target = PlayerManager.getFromCache(msg.getTargetID());
Dispatch dispatch; Dispatch dispatch;

3
src/engine/objects/CharacterPower.java

@ -10,6 +10,7 @@
package engine.objects; package engine.objects;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -90,7 +91,7 @@ public class CharacterPower extends AbstractGameObject {
} }
public static PlayerCharacter getOwner(CharacterPower cp) { public static PlayerCharacter getOwner(CharacterPower cp) {
return PlayerCharacter.getFromCache(cp.ownerUID); return PlayerManager.getFromCache(cp.ownerUID);
} }
/* /*

3
src/engine/objects/CharacterSkill.java

@ -14,6 +14,7 @@ import engine.Enum.CharacterSkills;
import engine.Enum.ModType; import engine.Enum.ModType;
import engine.Enum.SourceType; import engine.Enum.SourceType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -287,7 +288,7 @@ public class CharacterSkill extends AbstractGameObject {
if (cs.isMobOwner) if (cs.isMobOwner)
return Mob.getFromCache(cs.ownerUID); return Mob.getFromCache(cs.ownerUID);
else else
return PlayerCharacter.getFromCache(cs.ownerUID); return PlayerManager.getFromCache(cs.ownerUID);
} }
/* /*

14
src/engine/objects/City.java

@ -694,7 +694,7 @@ public class City extends AbstractWorldObject {
if (this.isNpc == 1) if (this.isNpc == 1)
return NPC.getNPC(ownerID); return NPC.getNPC(ownerID);
else else
return PlayerCharacter.getPlayerCharacter(ownerID); return PlayerManager.getPlayerCharacter(ownerID);
} }
public Guild getGuild() { public Guild getGuild() {
@ -882,7 +882,7 @@ public class City extends AbstractWorldObject {
continue; continue;
player = (PlayerCharacter) playerObject; player = (PlayerCharacter) playerObject;
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, true, this); PlayerManager.addCityEffect(player, Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, true, this);
} }
} }
@ -903,7 +903,7 @@ public class City extends AbstractWorldObject {
for (Integer playerID : this._playerMemory) { for (Integer playerID : this._playerMemory) {
player = PlayerCharacter.getFromCache(playerID); player = PlayerManager.getFromCache(playerID);
if (player == null) if (player == null)
continue; continue;
@ -912,7 +912,7 @@ public class City extends AbstractWorldObject {
// Reapply effect with timeout? // Reapply effect with timeout?
if (refreshEffect == true) if (refreshEffect == true)
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this); PlayerManager.addCityEffect(player, Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
} }
@ -969,7 +969,7 @@ public class City extends AbstractWorldObject {
if (effectBase == null) if (effectBase == null)
continue; continue;
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, effect.getTrains(), MBServerStatics.FOURTYFIVE_SECONDS, true, this); PlayerManager.addCityEffect(player, Integer.toString(effectBase.getUUID()), effectBase, effect.getTrains(), MBServerStatics.FOURTYFIVE_SECONDS, true, this);
} }
} catch (Exception e) { } catch (Exception e) {
Logger.error(e.getMessage()); Logger.error(e.getMessage());
@ -992,7 +992,7 @@ public class City extends AbstractWorldObject {
return; return;
// player.endEffectNoPower(cityEffect); // player.endEffectNoPower(cityEffect);
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, effect.getTrains(), MBServerStatics.FOURTYFIVE_SECONDS, false, this); PlayerManager.addCityEffect(player, Integer.toString(effectBase.getUUID()), effectBase, effect.getTrains(), MBServerStatics.FOURTYFIVE_SECONDS, false, this);
} }
} catch (Exception e) { } catch (Exception e) {
Logger.error(e.getMessage()); Logger.error(e.getMessage());
@ -1089,7 +1089,7 @@ public class City extends AbstractWorldObject {
playerUUID = iter.next(); playerUUID = iter.next();
player = PlayerCharacter.getFromCache(playerUUID); player = PlayerManager.getFromCache(playerUUID);
if (this.isLocationWithinSiegeBounds(player.getLoc())) if (this.isLocationWithinSiegeBounds(player.getLoc()))
continue; continue;

2
src/engine/objects/Contract.java

@ -242,7 +242,7 @@ public class Contract extends AbstractGameObject {
} }
break; break;
case 15020401: case 15020401:
PlayerCharacter.unboxPlayer(pc); PlayerManager.unboxPlayer(pc);
vd.getOptions().clear(); vd.getOptions().clear();
break; break;
} }

5
src/engine/objects/Experience.java

@ -11,6 +11,7 @@ package engine.objects;
import engine.Enum; import engine.Enum;
import engine.Enum.TargetColor; import engine.Enum.TargetColor;
import engine.gameManager.PlayerManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@ -444,7 +445,7 @@ public class Experience {
grantedExperience = 1; grantedExperience = 1;
// Grant the player the EXP // Grant the player the EXP
playerCharacter.grantXP((int) Math.floor(grantedExperience)); PlayerManager.grantXP(playerCharacter, (int) Math.floor(grantedExperience));
} }
} else { // Give EXP to a single character } else { // Give EXP to a single character
@ -471,7 +472,7 @@ public class Experience {
grantedExperience *= .6; grantedExperience *= .6;
// Grant XP // Grant XP
killer.grantXP((int) Math.floor(grantedExperience)); PlayerManager.grantXP(killer, (int) Math.floor(grantedExperience));
} }
} }
} }

16
src/engine/objects/Guild.java

@ -180,7 +180,7 @@ public class Guild extends AbstractWorldObject {
if (guild.ownerIsNPC) if (guild.ownerIsNPC)
return NPC.getFromCache(guild.guildLeaderUUID); return NPC.getFromCache(guild.guildLeaderUUID);
return PlayerCharacter.getFromCache(guild.guildLeaderUUID); return PlayerManager.getFromCache(guild.guildLeaderUUID);
} }
public static boolean sameGuild(Guild a, Guild b) { public static boolean sameGuild(Guild a, Guild b) {
@ -268,7 +268,7 @@ public class Guild extends AbstractWorldObject {
writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); // TODO Double check this is writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); // TODO Double check this is
// title and rank // title and rank
if (GuildStatusController.isGuildLeader(pc.getGuildStatus())) if (GuildStatusController.isGuildLeader(pc.getGuildStatus()))
writer.putInt(PlayerCharacter.GetPlayerRealmTitle(pc)); writer.putInt(PlayerManager.GetPlayerRealmTitle(pc));
else else
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus())); writer.putInt(GuildStatusController.getRank(pc.getGuildStatus()));
//writer.putInt(GuildStatusController.getRank(pc.getGuildStatus())); //writer.putInt(GuildStatusController.getRank(pc.getGuildStatus()));
@ -576,14 +576,14 @@ public class Guild extends AbstractWorldObject {
return false; return false;
} }
PlayerCharacter oldGuildLeader = PlayerCharacter.getFromCache(this.guildLeaderUUID); PlayerCharacter oldGuildLeader = PlayerManager.getFromCache(this.guildLeaderUUID);
//old guildLeader no longer has guildLeadership stauts. //old guildLeader no longer has guildLeadership stauts.
if (oldGuildLeader != null) if (oldGuildLeader != null)
oldGuildLeader.setGuildLeader(false); PlayerManager.setGuildLeader(oldGuildLeader, false);
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) if (ac.getObjectType().equals(GameObjectType.PlayerCharacter))
((PlayerCharacter) ac).setGuildLeader(true); PlayerManager.setGuildLeader(((PlayerCharacter) ac), true);
this.guildLeaderUUID = ac.getObjectUUID(); this.guildLeaderUUID = ac.getObjectUUID();
return true; return true;
@ -597,7 +597,7 @@ public class Guild extends AbstractWorldObject {
return false; return false;
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) if (ac.getObjectType().equals(GameObjectType.PlayerCharacter))
((PlayerCharacter) ac).setGuildLeader(true); PlayerManager.setGuildLeader(((PlayerCharacter) ac), true);
this.guildLeaderUUID = ac.getObjectUUID(); this.guildLeaderUUID = ac.getObjectUUID();
return true; return true;
@ -665,7 +665,7 @@ public class Guild extends AbstractWorldObject {
} }
// Clear Guild Ranks // Clear Guild Ranks
pc.resetGuildStatuses(); PlayerManager.resetGuildStatuses(pc);
pc.setGuild(Guild.getErrantGuild()); pc.setGuild(Guild.getErrantGuild());
pc.incVer(); pc.incVer();
@ -835,7 +835,7 @@ public class Guild extends AbstractWorldObject {
Logger.info("Guild UID " + this.getObjectUUID() + " Failed to Load NPC Owner with ID " + this.guildLeaderUUID); Logger.info("Guild UID " + this.getObjectUUID() + " Failed to Load NPC Owner with ID " + this.guildLeaderUUID);
} else if (this.guildLeaderUUID != 0) { } else if (this.guildLeaderUUID != 0) {
if (PlayerCharacter.getPlayerCharacter(this.guildLeaderUUID) == null) if (PlayerManager.getPlayerCharacter(this.guildLeaderUUID) == null)
Logger.info("Guild UID " + this.getObjectUUID() + " Failed to Load Player Owner with ID " + this.guildLeaderUUID); Logger.info("Guild UID " + this.getObjectUUID() + " Failed to Load Player Owner with ID " + this.guildLeaderUUID);
} }

3
src/engine/objects/Heraldry.java

@ -11,6 +11,7 @@ package engine.objects;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.ResultSet; import java.sql.ResultSet;
@ -125,7 +126,7 @@ public class Heraldry {
// Player is deleted, add to purge list // Player is deleted, add to purge list
if (PlayerCharacter.getFromCache(characterID) == null) if (PlayerManager.getFromCache(characterID) == null)
purgeList.add(characterID); purgeList.add(characterID);
} }

6
src/engine/objects/Item.java

@ -14,6 +14,7 @@ import engine.Enum.*;
import engine.exception.SerializationException; import engine.exception.SerializationException;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.net.ByteBufferReader; import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
@ -23,7 +24,6 @@ import engine.net.client.ClientConnection;
import engine.net.client.msg.DeleteItemMsg; import engine.net.client.msg.DeleteItemMsg;
import engine.powers.EffectsBase; import engine.powers.EffectsBase;
import engine.powers.effectmodifiers.AbstractEffectModifier; import engine.powers.effectmodifiers.AbstractEffectModifier;
import engine.powers.effectmodifiers.WeaponProcEffectModifier;
import engine.powers.poweractions.AbstractPowerAction; import engine.powers.poweractions.AbstractPowerAction;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -287,7 +287,7 @@ public class Item extends AbstractWorldObject {
boolean isBeard = (item.equipSlot == (byte) MBServerStatics.SLOT_BEARDSTYLE); boolean isBeard = (item.equipSlot == (byte) MBServerStatics.SLOT_BEARDSTYLE);
int itemColor = 0; int itemColor = 0;
if (isHair || isBeard) { if (isHair || isBeard) {
PlayerCharacter pc = PlayerCharacter.getFromCache(item.ownerID); PlayerCharacter pc = PlayerManager.getFromCache(item.ownerID);
if (pc != null) if (pc != null)
if (isHair) if (isHair)
itemColor = pc.getHairColor(); itemColor = pc.getHairColor();
@ -851,7 +851,7 @@ public class Item extends AbstractWorldObject {
if (this.ownerType == OwnerType.Npc) if (this.ownerType == OwnerType.Npc)
return NPC.getFromCache(this.ownerID); return NPC.getFromCache(this.ownerID);
else if (this.ownerType == OwnerType.PlayerCharacter) else if (this.ownerType == OwnerType.PlayerCharacter)
return PlayerCharacter.getFromCache(this.ownerID); return PlayerManager.getFromCache(this.ownerID);
else if (this.ownerType == OwnerType.Mob) else if (this.ownerType == OwnerType.Mob)
return Mob.getFromCache(this.ownerID); return Mob.getFromCache(this.ownerID);
else if (this.ownerType == OwnerType.Account) else if (this.ownerType == OwnerType.Account)

6
src/engine/objects/Mine.java

@ -10,11 +10,8 @@
package engine.objects; package engine.objects;
import engine.Enum; import engine.Enum;
import engine.InterestManagement.InterestManager;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.*; import engine.gameManager.*;
import engine.math.Vector3f;
import engine.math.Vector3fImmutable;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@ -27,7 +24,6 @@ import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import static engine.gameManager.DbManager.MineQueries; import static engine.gameManager.DbManager.MineQueries;
@ -677,7 +673,7 @@ public class Mine extends AbstractGameObject {
ArrayList<Integer>toRemove = new ArrayList<>(); ArrayList<Integer>toRemove = new ArrayList<>();
HashSet<AbstractWorldObject> currentPlayers = WorldGrid.getObjectsInRangePartial(tower.loc, Enum.CityBoundsType.GRID.extents, MBServerStatics.MASK_PLAYER); HashSet<AbstractWorldObject> currentPlayers = WorldGrid.getObjectsInRangePartial(tower.loc, Enum.CityBoundsType.GRID.extents, MBServerStatics.MASK_PLAYER);
for(Integer id : currentMemory){ for(Integer id : currentMemory){
PlayerCharacter pc = PlayerCharacter.getPlayerCharacter(id); PlayerCharacter pc = PlayerManager.getPlayerCharacter(id);
if(currentPlayers.contains(pc) == false){ if(currentPlayers.contains(pc) == false){
toRemove.add(id); toRemove.add(id);
pc.ZergMultiplier = 1.0f; pc.ZergMultiplier = 1.0f;

2
src/engine/objects/Mob.java

@ -1130,7 +1130,7 @@ public class Mob extends AbstractIntelligenceAgent {
if (this.ownerUID == 0) if (this.ownerUID == 0)
return null; return null;
return PlayerCharacter.getFromCache(this.ownerUID); return PlayerManager.getFromCache(this.ownerUID);
} }
public void setOwner(PlayerCharacter value) { public void setOwner(PlayerCharacter value) {

2697
src/engine/objects/PlayerCharacter.java

File diff suppressed because it is too large Load Diff

3
src/engine/objects/Portal.java

@ -4,6 +4,7 @@ import engine.Enum;
import engine.Enum.PortalType; import engine.Enum.PortalType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.PlayerManager;
import engine.job.JobScheduler; import engine.job.JobScheduler;
import engine.jobs.CloseGateJob; import engine.jobs.CloseGateJob;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
@ -104,7 +105,7 @@ public class Portal {
if (player.getTimeStamp("lastMoveGate") < this.lastActive) if (player.getTimeStamp("lastMoveGate") < this.lastActive)
return; return;
player.teleport(targetGate.getLoc()); PlayerManager.teleport(player, targetGate.getLoc());
player.setSafeMode(); player.setSafeMode();
} }

3
src/engine/objects/Realm.java

@ -14,6 +14,7 @@ import engine.InterestManagement.RealmMap;
import engine.db.archive.DataWarehouse; import engine.db.archive.DataWarehouse;
import engine.db.archive.RealmRecord; import engine.db.archive.RealmRecord;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.powers.PowersBase; import engine.powers.PowersBase;
@ -281,7 +282,7 @@ public class Realm {
if (this.getRulingCity().getTOL() == null) if (this.getRulingCity().getTOL() == null)
return; return;
rulingCharacter = PlayerCharacter.getPlayerCharacter(this.getRulingCity().getTOL().getOwnerUUID()); rulingCharacter = PlayerManager.getPlayerCharacter(this.getRulingCity().getTOL().getOwnerUUID());
if (rulingCharacter == null) { if (rulingCharacter == null) {
Logger.info(this.realmName + " failed to load " + this.getRulingCity().getCityName() + " ID : " + this.rulingCityUUID); Logger.info(this.realmName + " failed to load " + this.getRulingCity().getCityName() + " ID : " + this.rulingCityUUID);
return; return;

3
src/engine/powers/effectmodifiers/NoModEffectModifier.java

@ -10,6 +10,7 @@
package engine.powers.effectmodifiers; package engine.powers.effectmodifiers;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.PlayerManager;
import engine.jobs.AbstractEffectJob; import engine.jobs.AbstractEffectJob;
import engine.objects.*; import engine.objects.*;
@ -40,7 +41,7 @@ public class NoModEffectModifier extends AbstractEffectModifier {
if (flyer.getAltitude() > 0) if (flyer.getAltitude() > 0)
flyer.update(false); flyer.update(false);
PlayerCharacter.GroundPlayer(flyer); PlayerManager.GroundPlayer(flyer);
break; break;
} }

3
src/engine/powers/poweractions/CharmPowerAction.java

@ -10,6 +10,7 @@
package engine.powers.poweractions; package engine.powers.poweractions;
import engine.Enum; import engine.Enum;
import engine.gameManager.PlayerManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.objects.AbstractCharacter; import engine.objects.AbstractCharacter;
@ -57,7 +58,7 @@ public class CharmPowerAction extends AbstractPowerAction {
return; return;
//turn mob into pet. //turn mob into pet.
owner.commandSiegeMinion(mob); PlayerManager.commandSiegeMinion(owner, mob);
} }
@Override @Override

3
src/engine/powers/poweractions/RecallPowerAction.java

@ -12,6 +12,7 @@ package engine.powers.poweractions;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.MovementManager; import engine.gameManager.MovementManager;
import engine.gameManager.PlayerManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -45,7 +46,7 @@ public class RecallPowerAction extends AbstractPowerAction {
PlayerCharacter pc = (PlayerCharacter) awo; PlayerCharacter pc = (PlayerCharacter) awo;
if (pc.hasBoon()) if (PlayerManager.hasBoon(pc))
return; return;
ClientConnection cc = pc.getClientConnection(); ClientConnection cc = pc.getClientConnection();

4
src/engine/powers/poweractions/RunegateTeleportPowerAction.java

@ -10,6 +10,7 @@
package engine.powers.poweractions; package engine.powers.poweractions;
import engine.Enum; import engine.Enum;
import engine.gameManager.PlayerManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -22,7 +23,6 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import static engine.math.FastMath.sqr; import static engine.math.FastMath.sqr;
import static engine.math.FastMath.sqrt;
public class RunegateTeleportPowerAction extends AbstractPowerAction { public class RunegateTeleportPowerAction extends AbstractPowerAction {
@ -65,7 +65,7 @@ public class RunegateTeleportPowerAction extends AbstractPowerAction {
} else { } else {
if (rg != null) { if (rg != null) {
pc.teleport(rg.getLoc()); PlayerManager.teleport(pc, rg.getLoc());
pc.setSafeMode(); pc.setSafeMode();
} }
} }

2
src/engine/server/login/LoginServer.java

@ -460,7 +460,7 @@ public class LoginServer {
case "character": case "character":
DbManager.removeFromCache(Enum.GameObjectType.PlayerCharacter, objectUUID); DbManager.removeFromCache(Enum.GameObjectType.PlayerCharacter, objectUUID);
PlayerCharacter player = (PlayerCharacter) DbManager.getObject(Enum.GameObjectType.PlayerCharacter, objectUUID); PlayerCharacter player = (PlayerCharacter) DbManager.getObject(Enum.GameObjectType.PlayerCharacter, objectUUID);
PlayerCharacter.initializePlayer(player); PlayerManager.initializePlayer(player);
player.getAccount().characterMap.replace(player.getObjectUUID(), player); player.getAccount().characterMap.replace(player.getObjectUUID(), player);
Logger.info("Player active state is : " + player.isActive()); Logger.info("Player active state is : " + player.isActive());
break; break;

7
src/engine/server/login/LoginServerMsgHandler.java

@ -14,6 +14,7 @@ import engine.Enum.DispatchChannel;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.job.JobScheduler; import engine.job.JobScheduler;
import engine.jobs.DisconnectJob; import engine.jobs.DisconnectJob;
@ -346,7 +347,7 @@ public class LoginServerMsgHandler implements NetMsgHandler {
return; return;
} }
PlayerCharacter pc = PlayerCharacter.generatePCFromCommitNewCharacterMsg(session.getAccount(), commitNewCharacterMessage, clientConnection); PlayerCharacter pc = PlayerManager.generatePCFromCommitNewCharacterMsg(session.getAccount(), commitNewCharacterMessage, clientConnection);
if (pc == null) { if (pc == null) {
Logger.info("Player returned null while creating character."); Logger.info("Player returned null while creating character.");
@ -354,7 +355,7 @@ public class LoginServerMsgHandler implements NetMsgHandler {
return; return;
} }
PlayerCharacter.initializePlayer(pc); PlayerManager.initializePlayer(pc);
session.getAccount().characterMap.putIfAbsent(pc.getObjectUUID(), pc); session.getAccount().characterMap.putIfAbsent(pc.getObjectUUID(), pc);
// Send back to Character Select Screen // Send back to Character Select Screen
this.sendCharacterSelectScreen(session, true); this.sendCharacterSelectScreen(session, true);
@ -372,7 +373,7 @@ public class LoginServerMsgHandler implements NetMsgHandler {
Session session; Session session;
session = SessionManager.getSession(origin); session = SessionManager.getSession(origin);
playerCharacter = PlayerCharacter.getPlayerCharacter(msg.getCharacterUUID()); playerCharacter = PlayerManager.getPlayerCharacter(msg.getCharacterUUID());
if (playerCharacter == null) { if (playerCharacter == null) {
Logger.error("Delete Error: PlayerID=" + msg.getCharacterUUID() + " not found."); Logger.error("Delete Error: PlayerID=" + msg.getCharacterUUID() + " not found.");

6
src/engine/server/world/WorldServer.java

@ -744,7 +744,7 @@ public class WorldServer {
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); DispatchMessage.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
if (playerCharacter.region != null) if (playerCharacter.region != null)
if (PlayerCharacter.CanBindToBuilding(playerCharacter, playerCharacter.region.parentBuildingID)) if (PlayerManager.CanBindToBuilding(playerCharacter, playerCharacter.region.parentBuildingID))
playerCharacter.bindBuilding = playerCharacter.region.parentBuildingID; playerCharacter.bindBuilding = playerCharacter.region.parentBuildingID;
else else
playerCharacter.bindBuilding = 0; playerCharacter.bindBuilding = 0;
@ -775,7 +775,7 @@ public class WorldServer {
loadedMob.playerAgroMap.remove(player.getObjectUUID()); loadedMob.playerAgroMap.remove(player.getObjectUUID());
} }
player.getTimestamps().put("logout", System.currentTimeMillis()); player.getTimestamps().put("logout", System.currentTimeMillis());
player.setEnteredWorld(false); PlayerManager.setEnteredWorld(player, false);
// remove from simulation and zero current loc // remove from simulation and zero current loc
@ -809,7 +809,7 @@ public class WorldServer {
player.respawnLock.writeLock().lock(); player.respawnLock.writeLock().lock();
try { try {
if (!player.isAlive()) if (!player.isAlive())
player.respawn(false, false, true); PlayerManager.respawn(player, false, false, true);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
} finally { } finally {

3
src/engine/session/CSSession.java

@ -10,6 +10,7 @@
package engine.session; package engine.session;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Account; import engine.objects.Account;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -34,7 +35,7 @@ public class CSSession extends AbstractGameObject {
this.machineID = machineID; this.machineID = machineID;
if (this.playerCharacter != null) if (this.playerCharacter != null)
PlayerCharacter.initializePlayer(this.playerCharacter); PlayerManager.initializePlayer(this.playerCharacter);
} }
/* /*

9
src/engine/workthreads/HalfHourlyJobThread.java

@ -15,19 +15,12 @@ import engine.db.archive.DataWarehouse;
import engine.db.archive.MineRecord; import engine.db.archive.MineRecord;
import engine.gameManager.*; import engine.gameManager.*;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.MessageDispatcher;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.net.client.msg.chat.ChatSystemMsg;
import engine.objects.*; import engine.objects.*;
import engine.server.world.WorldServer;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import static engine.gameManager.StrongholdManager.EndStronghold;
import static engine.server.MBServerStatics.MINE_LATE_WINDOW;
public class HalfHourlyJobThread implements Runnable { public class HalfHourlyJobThread implements Runnable {
@ -155,7 +148,7 @@ public class HalfHourlyJobThread implements Runnable {
mine.setActive(false); mine.setActive(false);
mine.wasClaimed = true; mine.wasClaimed = true;
for(Integer id : mine._playerMemory){ for(Integer id : mine._playerMemory){
PlayerCharacter pc = PlayerCharacter.getFromCache(id); PlayerCharacter pc = PlayerManager.getFromCache(id);
if(pc != null) if(pc != null)
pc.ZergMultiplier = 1.0f; pc.ZergMultiplier = 1.0f;
} }

Loading…
Cancel
Save