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

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

@ -10,8 +10,8 @@ @@ -10,8 +10,8 @@
package engine.db.handlers;
import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.objects.Account;
import engine.objects.PlayerCharacter;
import engine.session.CSSession;
import engine.util.StringUtils;
import org.pmw.tinylog.Logger;
@ -103,7 +103,7 @@ public class dbCSSessionHandler extends dbHandlerBase { @@ -103,7 +103,7 @@ public class dbCSSessionHandler extends dbHandlerBase {
ResultSet rs = preparedStatement.executeQuery();
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) {
Logger.error(e);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -11,6 +11,7 @@ package engine.devcmd.cmds; @@ -11,6 +11,7 @@ package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PlayerManager;
import engine.objects.AbstractGameObject;
import engine.objects.Mob;
import engine.objects.PlayerCharacter;
@ -77,7 +78,7 @@ public class aiInfoCmd extends AbstractDevCmd { @@ -77,7 +78,7 @@ public class aiInfoCmd extends AbstractDevCmd {
output += "Players Loaded:" + newline;
}
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)
output += "Current Target: " + mob.getCombatTarget().getName() + newline;

6
src/engine/gameManager/CombatManager.java

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

2
src/engine/gameManager/DbManager.java

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

10
src/engine/gameManager/GuildManager.java

@ -74,16 +74,16 @@ public enum GuildManager { @@ -74,16 +74,16 @@ public enum GuildManager {
}
}
playerCharacter.setInnerCouncil(false);
playerCharacter.setGuildLeader(false);
PlayerManager.setInnerCouncil(playerCharacter, false);
PlayerManager.setGuildLeader(playerCharacter, false);
playerCharacter.setGuild(guild);
// Cleanup guild stuff
playerCharacter.resetGuildStatuses();
PlayerManager.resetGuildStatuses(playerCharacter);
// send success message to client
if (fromTeleportScreen && guild.isNPCGuild())
playerCharacter.setFullMember(true);
PlayerManager.setFullMember(playerCharacter, true);
msg = new AcceptInviteToGuildMsg(guild.getObjectUUID(), 1, 0);
@ -178,7 +178,7 @@ public enum GuildManager { @@ -178,7 +178,7 @@ public enum GuildManager {
bindBuilding = city.getTOL();
if (bindBuilding == null)
bindBuilding = PlayerCharacter.getBindBuildingForGuild(playerCharacter);
bindBuilding = PlayerManager.getBindBuildingForGuild(playerCharacter);
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 { @@ -165,7 +165,7 @@ public enum PowersManager {
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);
if(pc.isMoving())
@ -294,7 +294,7 @@ public enum PowersManager { @@ -294,7 +294,7 @@ public enum PowersManager {
}
//check for movement buffs while flying
if(playerCharacter.isFlying()) {
if(PlayerManager.isFlying(playerCharacter)) {
switch(pb.token){
case 429005674:
case 429505739:
@ -1363,7 +1363,7 @@ public enum PowersManager { @@ -1363,7 +1363,7 @@ public enum PowersManager {
if (pc == null)
return;
PlayerCharacter source = PlayerCharacter.getFromCache(msg.getSourceID());
PlayerCharacter source = PlayerManager.getFromCache(msg.getSourceID());
if (source == null)
return;

2
src/engine/gameManager/TradeManager.java

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

3
src/engine/jobs/DatabaseUpdateJob.java

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

4
src/engine/jobs/FinishSummonsJob.java

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

3
src/engine/jobs/StuckJob.java

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

3
src/engine/jobs/TeleportJob.java

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

13
src/engine/mobileAI/MobAI.java

@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
package engine.mobileAI;
import engine.Enum;
import engine.Enum.DispatchChannel;
import engine.InterestManagement.WorldGrid;
import engine.gameManager.*;
import engine.math.Vector3f;
@ -17,9 +16,7 @@ import engine.math.Vector3fImmutable; @@ -17,9 +16,7 @@ import engine.math.Vector3fImmutable;
import engine.mobileAI.Threads.MobAIThread;
import engine.mobileAI.utilities.CombatUtilities;
import engine.mobileAI.utilities.MovementUtilities;
import engine.net.DispatchMessage;
import engine.net.client.msg.PerformActionMsg;
import engine.net.client.msg.PowerProjectileMsg;
import engine.objects.*;
import engine.powers.ActionsBase;
import engine.powers.PowersBase;
@ -85,7 +82,7 @@ public class MobAI { @@ -85,7 +82,7 @@ public class MobAI {
if(mob.StrongholdGuardian || mob.StrongholdEpic){
// attempt to ground all players in attack range
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){
PowersManager.applyPower(mob,tar,tar.loc, 111111,40,false);
}
@ -727,7 +724,7 @@ public class MobAI { @@ -727,7 +724,7 @@ public class MobAI {
for (Entry playerEntry : loadedPlayers.entrySet()) {
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.
@ -980,7 +977,7 @@ public class MobAI { @@ -980,7 +977,7 @@ public class MobAI {
mob.setCombatTarget(null);
for (Entry playerEntry : mob.playerAgroMap.entrySet())
PlayerCharacter.getFromCache((int) playerEntry.getKey()).setHateValue(0);
PlayerManager.getFromCache((int) playerEntry.getKey()).setHateValue(0);
mob.setCombatTarget(null);
}
} catch (Exception e) {
@ -1218,7 +1215,7 @@ public class MobAI { @@ -1218,7 +1215,7 @@ public class MobAI {
for (Entry playerEntry : loadedPlayers.entrySet()) {
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.
@ -1379,7 +1376,7 @@ public class MobAI { @@ -1379,7 +1376,7 @@ public class MobAI {
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()))
continue;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -11,6 +11,7 @@ package engine.net.client.handlers; @@ -11,6 +11,7 @@ package engine.net.client.handlers;
import engine.Enum;
import engine.exception.MsgSendException;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
@ -60,7 +61,7 @@ public class GuildControlHandler extends AbstractClientMsgHandler { @@ -60,7 +61,7 @@ public class GuildControlHandler extends AbstractClientMsgHandler {
PlayerCharacter player = SessionManager.getPlayerCharacter(origin);
//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) {
dispatch = Dispatch.borrow(player, new GuildListMsg(pc));

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

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

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

@ -11,6 +11,7 @@ package engine.net.client.handlers; @@ -11,6 +11,7 @@ package engine.net.client.handlers;
import engine.Enum.GameObjectType;
import engine.exception.MsgSendException;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
@ -43,7 +44,7 @@ public class GuildInfoHandler extends AbstractClientMsgHandler { @@ -43,7 +44,7 @@ public class GuildInfoHandler extends AbstractClientMsgHandler {
} else if (msg.getMsgType() == 5) {
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));
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
} else {

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

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

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

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

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

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

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

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

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

@ -12,6 +12,7 @@ package engine.net.client.handlers; @@ -12,6 +12,7 @@ package engine.net.client.handlers;
import engine.Enum;
import engine.exception.MsgSendException;
import engine.gameManager.ChatManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
@ -63,7 +64,7 @@ public class SwearInHandler extends AbstractClientMsgHandler { @@ -63,7 +64,7 @@ public class SwearInHandler extends AbstractClientMsgHandler {
}
// Swear target in and send message to guild
target.setFullMember(true);
PlayerManager.setFullMember(target, true);
target.incVer();
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; @@ -4,6 +4,7 @@ import engine.Enum;
import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager;
import engine.gameManager.PlayerManager;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg;
@ -35,7 +36,7 @@ public class TransferAssetMsgHandler extends AbstractClientMsgHandler { @@ -35,7 +36,7 @@ public class TransferAssetMsgHandler extends AbstractClientMsgHandler {
int TargetType = transferAssetMsg.getTargetType(); //ToDue later
Building building = BuildingManager.getBuildingFromCache(Buildingid);
PlayerCharacter newOwner = PlayerCharacter.getFromCache(TargetID);
PlayerCharacter newOwner = PlayerManager.getFromCache(TargetID);
PlayerCharacter player = origin.getPlayerCharacter();
if (player == null || building == null || newOwner == null)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
package engine.net.client.msg;
import engine.Enum;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager;
import engine.net.*;
import engine.net.client.ClientConnection;
@ -233,8 +234,8 @@ public class WhoResponseMsg extends ClientNetMsg { @@ -233,8 +234,8 @@ public class WhoResponseMsg extends ClientNetMsg {
writer.putInt(pc.getObjectUUID());
writer.putString(pc.getFirstName());
writer.putString(pc.getLastName());
writer.putInt(pc.getRaceToken());
writer.putInt(pc.getClassToken());
writer.putInt(PlayerManager.getRaceToken(pc));
writer.putInt(PlayerManager.getClassToken(pc));
writer.putInt(pc.getLevel());
writer.putInt(0); // unknown 0
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; @@ -11,6 +11,7 @@ package engine.net.client.msg.guild;
import engine.Enum.GameObjectType;
import engine.gameManager.PlayerManager;
import engine.net.AbstractConnection;
import engine.net.ByteBufferReader;
import engine.net.ByteBufferWriter;
@ -193,7 +194,7 @@ class GuildInfoMessageType2 extends GuildInfoMessageType { @@ -193,7 +194,7 @@ class GuildInfoMessageType2 extends GuildInfoMessageType {
writer.putString(g.getName());
if (this.objectType == GameObjectType.PlayerCharacter.ordinal()) {
PlayerCharacter pc = PlayerCharacter.getFromCache(this.objectID);
PlayerCharacter pc = PlayerManager.getFromCache(this.objectID);
if (pc != null) {
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus()));
@ -254,7 +255,7 @@ class GuildInfoMessageType4 extends GuildInfoMessageType { @@ -254,7 +255,7 @@ class GuildInfoMessageType4 extends GuildInfoMessageType {
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) {
writer.putInt(0);
writer.putInt(0);
@ -298,7 +299,7 @@ class GuildInfoMessageType4 extends GuildInfoMessageType { @@ -298,7 +299,7 @@ class GuildInfoMessageType4 extends GuildInfoMessageType {
if (guildLeader != null)
guildLeaderName = guildLeader.getName();
} else {
guildLeader = PlayerCharacter.getFromCache(g.getGuildLeaderUUID());
guildLeader = PlayerManager.getFromCache(g.getGuildLeaderUUID());
if (guildLeader != null)
guildLeaderName = ((PlayerCharacter) guildLeader).getCombinedName();
}

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

@ -11,6 +11,7 @@ package engine.net.client.msg.guild; @@ -11,6 +11,7 @@ package engine.net.client.msg.guild;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager;
import engine.net.AbstractConnection;
import engine.net.ByteBufferReader;
@ -204,7 +205,7 @@ class GuildListMessageType2 extends GuildListMessageType { @@ -204,7 +205,7 @@ class GuildListMessageType2 extends GuildListMessageType {
writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); //Title Maybe?
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(2); //PAD

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

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

22
src/engine/objects/AbstractCharacter.java

@ -57,7 +57,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -57,7 +57,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
protected short statIntCurrent;
protected short statSpiCurrent;
protected short unusedStatPoints;
protected int exp;
public int exp;
public int buildingUUID;
public Building building;
@ -67,8 +67,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -67,8 +67,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
public int guildUUID;
public Guild guild;
protected byte runningTrains;
protected ConcurrentHashMap<Integer, CharacterPower> powers;
protected ConcurrentHashMap<String, CharacterSkill> skills;
public ConcurrentHashMap<Integer, CharacterPower> powers;
public ConcurrentHashMap<String, CharacterSkill> skills;
// Variables NOT to be stored in db
protected boolean sit = false;
protected boolean walkMode;
@ -80,11 +80,11 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -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
protected Vector3fImmutable nextEndLoc = Vector3fImmutable.ZERO;
protected float speed;
protected AtomicFloat stamina = new AtomicFloat();
public AtomicFloat stamina = new AtomicFloat();
protected float staminaMax;
protected AtomicFloat mana = new AtomicFloat();
public AtomicFloat mana = new AtomicFloat();
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 ConcurrentHashMap<String, JobContainer> timers;
protected ConcurrentHashMap<String, Long> timestamps;
@ -102,7 +102,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -102,7 +102,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
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 ConcurrentHashMap<Integer, JobContainer> recycleTimers;
protected PlayerBonuses bonuses;
public PlayerBonuses bonuses;
protected JobContainer lastChant;
protected boolean isCasting = false;
protected long lastSetLocUpdate = 0L;
@ -363,7 +363,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -363,7 +363,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
switch (abstractCharacter.getObjectType()) {
case PlayerCharacter:
PlayerCharacter.serializePlayerForClientMsgOtherPlayer((PlayerCharacter) abstractCharacter, writer, asciiLastName);
PlayerManager.serializePlayerForClientMsgOtherPlayer((PlayerCharacter) abstractCharacter, writer, asciiLastName);
break;
case Mob:
Mob.serializeMobForClientMsgOtherPlayer((Mob) abstractCharacter, writer);
@ -445,7 +445,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -445,7 +445,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
playerCharacter.calculateItemBonuses();
//recalculate formulas
PlayerCharacter.recalculatePlayerStatsOnLoad(playerCharacter);
PlayerManager.recalculatePlayerStatsOnLoad(playerCharacter);
} catch (Exception e) {
Logger.error(e);
@ -746,7 +746,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -746,7 +746,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
}
if (this.getObjectType().equals(GameObjectType.PlayerCharacter))
if (((PlayerCharacter) this).isLastSwimming())
if (PlayerManager.isLastSwimming(((PlayerCharacter) this)))
return 1; //swimming
return 2; //ground
@ -1707,7 +1707,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -1707,7 +1707,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (CanFly(player) == false &&
player.getMovementState().equals(MovementState.FLYING))
PlayerCharacter.GroundPlayer(player);
PlayerManager.GroundPlayer(player);
}
} catch (Exception e) {

3
src/engine/objects/AbstractGameObject.java

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

13
src/engine/objects/AbstractWorldObject.java

@ -15,6 +15,7 @@ import engine.Enum.GameObjectType; @@ -15,6 +15,7 @@ import engine.Enum.GameObjectType;
import engine.Enum.GridObjectType;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.WorldGrid;
import engine.gameManager.PlayerManager;
import engine.job.AbstractScheduleJob;
import engine.job.JobContainer;
import engine.job.JobScheduler;
@ -39,7 +40,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -39,7 +40,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
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);
public float healthMax;
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 { @@ -49,7 +50,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
public Regions landingRegion = null;
public Vector3fImmutable lastLoc = Vector3fImmutable.ZERO;
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 GridObjectType gridObjectType;
protected float altitude = 0;
@ -150,7 +151,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject { @@ -150,7 +151,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
Regions region = null;
if (worldObject.getObjectType().equals(GameObjectType.PlayerCharacter))
if (((PlayerCharacter) worldObject).isFlying())
if (PlayerManager.isFlying(((PlayerCharacter) worldObject)))
return null;
//Find 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 { @@ -271,7 +272,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
if (this.getObjectType().equals(GameObjectType.PlayerCharacter))
if (name.equals("Flight")) {
((PlayerCharacter) this).update(false);
PlayerCharacter.GroundPlayer((PlayerCharacter) this);
PlayerManager.GroundPlayer((PlayerCharacter) this);
}
}
applyAllBonuses();
@ -386,7 +387,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject { @@ -386,7 +387,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
//ground player
if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) {
((PlayerCharacter) this).update(false);
PlayerCharacter.GroundPlayer((PlayerCharacter) this);
PlayerManager.GroundPlayer((PlayerCharacter) this);
}
}
} else {
@ -415,7 +416,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject { @@ -415,7 +416,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
//ground player
if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) {
((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; @@ -14,6 +14,7 @@ import engine.Enum.DispatchChannel;
import engine.Enum.ItemContainerType;
import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.SessionManager;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
@ -163,7 +164,7 @@ public class Account extends AbstractGameObject { @@ -163,7 +164,7 @@ public class Account extends AbstractGameObject {
ArrayList<PlayerCharacter> playerList = DbManager.PlayerCharacterQueries.GET_CHARACTERS_FOR_ACCOUNT(this.getObjectUUID());
for (PlayerCharacter player : playerList) {
PlayerCharacter.initializePlayer(player);
PlayerManager.initializePlayer(player);
this.characterMap.putIfAbsent(player.getObjectUUID(), player);
}

10
src/engine/objects/Bane.java

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

5
src/engine/objects/Building.java

@ -19,6 +19,7 @@ import engine.db.archive.DataWarehouse; @@ -19,6 +19,7 @@ import engine.db.archive.DataWarehouse;
import engine.db.archive.MineRecord;
import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.ZoneManager;
import engine.job.JobContainer;
import engine.job.JobScheduler;
@ -970,7 +971,7 @@ public class Building extends AbstractWorldObject { @@ -970,7 +971,7 @@ public class Building extends AbstractWorldObject {
if (this.ownerIsNPC)
return NPC.getFromCache(this.ownerUUID);
return PlayerCharacter.getFromCache(this.ownerUUID);
return PlayerManager.getFromCache(this.ownerUUID);
}
@ -1095,7 +1096,7 @@ public class Building extends AbstractWorldObject { @@ -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());
} 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());
}
}

11
src/engine/objects/CharacterItemManager.java

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

3
src/engine/objects/CharacterPower.java

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
package engine.objects;
import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.gameManager.PowersManager;
import engine.net.ByteBufferWriter;
import engine.net.client.msg.ErrorPopupMsg;
@ -90,7 +91,7 @@ public class CharacterPower extends AbstractGameObject { @@ -90,7 +91,7 @@ public class CharacterPower extends AbstractGameObject {
}
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; @@ -14,6 +14,7 @@ import engine.Enum.CharacterSkills;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.net.ByteBufferWriter;
import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger;
@ -287,7 +288,7 @@ public class CharacterSkill extends AbstractGameObject { @@ -287,7 +288,7 @@ public class CharacterSkill extends AbstractGameObject {
if (cs.isMobOwner)
return Mob.getFromCache(cs.ownerUID);
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 { @@ -694,7 +694,7 @@ public class City extends AbstractWorldObject {
if (this.isNpc == 1)
return NPC.getNPC(ownerID);
else
return PlayerCharacter.getPlayerCharacter(ownerID);
return PlayerManager.getPlayerCharacter(ownerID);
}
public Guild getGuild() {
@ -882,7 +882,7 @@ public class City extends AbstractWorldObject { @@ -882,7 +882,7 @@ public class City extends AbstractWorldObject {
continue;
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 { @@ -903,7 +903,7 @@ public class City extends AbstractWorldObject {
for (Integer playerID : this._playerMemory) {
player = PlayerCharacter.getFromCache(playerID);
player = PlayerManager.getFromCache(playerID);
if (player == null)
continue;
@ -912,7 +912,7 @@ public class City extends AbstractWorldObject { @@ -912,7 +912,7 @@ public class City extends AbstractWorldObject {
// Reapply effect with timeout?
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 { @@ -969,7 +969,7 @@ public class City extends AbstractWorldObject {
if (effectBase == null)
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) {
Logger.error(e.getMessage());
@ -992,7 +992,7 @@ public class City extends AbstractWorldObject { @@ -992,7 +992,7 @@ public class City extends AbstractWorldObject {
return;
// 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) {
Logger.error(e.getMessage());
@ -1089,7 +1089,7 @@ public class City extends AbstractWorldObject { @@ -1089,7 +1089,7 @@ public class City extends AbstractWorldObject {
playerUUID = iter.next();
player = PlayerCharacter.getFromCache(playerUUID);
player = PlayerManager.getFromCache(playerUUID);
if (this.isLocationWithinSiegeBounds(player.getLoc()))
continue;

2
src/engine/objects/Contract.java

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

5
src/engine/objects/Experience.java

@ -11,6 +11,7 @@ package engine.objects; @@ -11,6 +11,7 @@ package engine.objects;
import engine.Enum;
import engine.Enum.TargetColor;
import engine.gameManager.PlayerManager;
import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable;
import engine.server.MBServerStatics;
@ -444,7 +445,7 @@ public class Experience { @@ -444,7 +445,7 @@ public class Experience {
grantedExperience = 1;
// 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
@ -471,7 +472,7 @@ public class Experience { @@ -471,7 +472,7 @@ public class Experience {
grantedExperience *= .6;
// 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 { @@ -180,7 +180,7 @@ public class Guild extends AbstractWorldObject {
if (guild.ownerIsNPC)
return NPC.getFromCache(guild.guildLeaderUUID);
return PlayerCharacter.getFromCache(guild.guildLeaderUUID);
return PlayerManager.getFromCache(guild.guildLeaderUUID);
}
public static boolean sameGuild(Guild a, Guild b) {
@ -268,7 +268,7 @@ public class Guild extends AbstractWorldObject { @@ -268,7 +268,7 @@ public class Guild extends AbstractWorldObject {
writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); // TODO Double check this is
// title and rank
if (GuildStatusController.isGuildLeader(pc.getGuildStatus()))
writer.putInt(PlayerCharacter.GetPlayerRealmTitle(pc));
writer.putInt(PlayerManager.GetPlayerRealmTitle(pc));
else
writer.putInt(GuildStatusController.getRank(pc.getGuildStatus()));
//writer.putInt(GuildStatusController.getRank(pc.getGuildStatus()));
@ -576,14 +576,14 @@ public class Guild extends AbstractWorldObject { @@ -576,14 +576,14 @@ public class Guild extends AbstractWorldObject {
return false;
}
PlayerCharacter oldGuildLeader = PlayerCharacter.getFromCache(this.guildLeaderUUID);
PlayerCharacter oldGuildLeader = PlayerManager.getFromCache(this.guildLeaderUUID);
//old guildLeader no longer has guildLeadership stauts.
if (oldGuildLeader != null)
oldGuildLeader.setGuildLeader(false);
PlayerManager.setGuildLeader(oldGuildLeader, false);
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter))
((PlayerCharacter) ac).setGuildLeader(true);
PlayerManager.setGuildLeader(((PlayerCharacter) ac), true);
this.guildLeaderUUID = ac.getObjectUUID();
return true;
@ -597,7 +597,7 @@ public class Guild extends AbstractWorldObject { @@ -597,7 +597,7 @@ public class Guild extends AbstractWorldObject {
return false;
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter))
((PlayerCharacter) ac).setGuildLeader(true);
PlayerManager.setGuildLeader(((PlayerCharacter) ac), true);
this.guildLeaderUUID = ac.getObjectUUID();
return true;
@ -665,7 +665,7 @@ public class Guild extends AbstractWorldObject { @@ -665,7 +665,7 @@ public class Guild extends AbstractWorldObject {
}
// Clear Guild Ranks
pc.resetGuildStatuses();
PlayerManager.resetGuildStatuses(pc);
pc.setGuild(Guild.getErrantGuild());
pc.incVer();
@ -835,7 +835,7 @@ public class Guild extends AbstractWorldObject { @@ -835,7 +835,7 @@ public class Guild extends AbstractWorldObject {
Logger.info("Guild UID " + this.getObjectUUID() + " Failed to Load NPC Owner with ID " + this.guildLeaderUUID);
} 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);
}

3
src/engine/objects/Heraldry.java

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

6
src/engine/objects/Item.java

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

6
src/engine/objects/Mine.java

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

2
src/engine/objects/Mob.java

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

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

3
src/engine/objects/Realm.java

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

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

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

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

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

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

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

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

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

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

@ -460,7 +460,7 @@ public class LoginServer { @@ -460,7 +460,7 @@ public class LoginServer {
case "character":
DbManager.removeFromCache(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);
Logger.info("Player active state is : " + player.isActive());
break;

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

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

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

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

3
src/engine/session/CSSession.java

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
package engine.session;
import engine.gameManager.DbManager;
import engine.gameManager.PlayerManager;
import engine.objects.AbstractGameObject;
import engine.objects.Account;
import engine.objects.PlayerCharacter;
@ -34,7 +35,7 @@ public class CSSession extends AbstractGameObject { @@ -34,7 +35,7 @@ public class CSSession extends AbstractGameObject {
this.machineID = machineID;
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; @@ -15,19 +15,12 @@ import engine.db.archive.DataWarehouse;
import engine.db.archive.MineRecord;
import engine.gameManager.*;
import engine.net.DispatchMessage;
import engine.net.MessageDispatcher;
import engine.net.client.msg.chat.ChatSystemMsg;
import engine.objects.*;
import engine.server.world.WorldServer;
import org.pmw.tinylog.Logger;
import java.time.LocalDateTime;
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 {
@ -155,7 +148,7 @@ public class HalfHourlyJobThread implements Runnable { @@ -155,7 +148,7 @@ public class HalfHourlyJobThread implements Runnable {
mine.setActive(false);
mine.wasClaimed = true;
for(Integer id : mine._playerMemory){
PlayerCharacter pc = PlayerCharacter.getFromCache(id);
PlayerCharacter pc = PlayerManager.getFromCache(id);
if(pc != null)
pc.ZergMultiplier = 1.0f;
}

Loading…
Cancel
Save