diff --git a/FFXIVClassic Map Server/CommandProcessor.cs b/FFXIVClassic Map Server/CommandProcessor.cs index 1e4de7a0..e9e59681 100644 --- a/FFXIVClassic Map Server/CommandProcessor.cs +++ b/FFXIVClassic Map Server/CommandProcessor.cs @@ -24,7 +24,6 @@ namespace FFXIVClassic_Lobby_Server class CommandProcessor { private Dictionary mConnectedPlayerList; - private static WorldManager mWorldManager = Server.GetWorldManager(); private static Dictionary gamedataItems = Server.GetGamedataItems(); // For the moment, this is the only predefined item @@ -102,25 +101,29 @@ namespace FFXIVClassic_Lobby_Server /// Predefined list: <ffxiv_database>\server_zones_spawnlocations public void doWarp(ConnectedPlayer client, uint id) { - FFXIVClassic_Map_Server.WorldManager.ZoneEntrance ze = mWorldManager.getZoneEntrance(id); + WorldManager worldManager = Server.GetWorldManager(); + + FFXIVClassic_Map_Server.WorldManager.ZoneEntrance ze = worldManager.getZoneEntrance(id); if (ze == null) return; if (client != null) - mWorldManager.DoZoneChange(client.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation); + worldManager.DoZoneChange(client.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation); else { foreach (KeyValuePair entry in mConnectedPlayerList) { - mWorldManager.DoZoneChange(entry.Value.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation); + worldManager.DoZoneChange(entry.Value.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation); } } } public void doWarp(ConnectedPlayer client, uint zoneId, string privateArea, float x, float y, float z, float r) { - if (mWorldManager.GetZone(zoneId) == null) + WorldManager worldManager = Server.GetWorldManager(); + + if (worldManager.GetZone(zoneId) == null) { if (client != null) client.queuePacket(BasePacket.createPacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", "Zone does not exist or setting isn't valid."), true, false)); @@ -128,12 +131,12 @@ namespace FFXIVClassic_Lobby_Server } if (client != null) - mWorldManager.DoZoneChange(client.getActor(), zoneId, privateArea, 0x2, x, y, z, r); + worldManager.DoZoneChange(client.getActor(), zoneId, privateArea, 0x2, x, y, z, r); else { foreach (KeyValuePair entry in mConnectedPlayerList) { - mWorldManager.DoZoneChange(entry.Value.getActor(), zoneId, privateArea, 0x2, x, y, z, r); + worldManager.DoZoneChange(entry.Value.getActor(), zoneId, privateArea, 0x2, x, y, z, r); } } } @@ -554,7 +557,7 @@ namespace FFXIVClassic_Lobby_Server client.getActor().sendInstanceUpdate(); client.queuePacket(BasePacket.createPacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", String.Format("Reseting zone {0}...", client.getActor().zoneId)), true, false)); } - mWorldManager.reloadZone(client.getActor().zoneId); + Server.GetWorldManager().reloadZone(client.getActor().zoneId); return true; } #endregion