1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-24 21:57:45 +00:00

Fixed bug with warp. WorldManager cannot be statically stored like that.

This commit is contained in:
Filip Maj 2016-04-24 17:59:50 -04:00
parent 9e2960c047
commit 541456bd8e

View file

@ -24,7 +24,6 @@ namespace FFXIVClassic_Lobby_Server
class CommandProcessor class CommandProcessor
{ {
private Dictionary<uint, ConnectedPlayer> mConnectedPlayerList; private Dictionary<uint, ConnectedPlayer> mConnectedPlayerList;
private static WorldManager mWorldManager = Server.GetWorldManager();
private static Dictionary<uint, Item> gamedataItems = Server.GetGamedataItems(); private static Dictionary<uint, Item> gamedataItems = Server.GetGamedataItems();
// For the moment, this is the only predefined item // For the moment, this is the only predefined item
@ -102,25 +101,29 @@ namespace FFXIVClassic_Lobby_Server
/// <param name="id">Predefined list: &lt;ffxiv_database&gt;\server_zones_spawnlocations</param> /// <param name="id">Predefined list: &lt;ffxiv_database&gt;\server_zones_spawnlocations</param>
public void doWarp(ConnectedPlayer client, uint id) 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) if (ze == null)
return; return;
if (client != null) 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 else
{ {
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) foreach (KeyValuePair<uint, ConnectedPlayer> 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) 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) 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)); 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) 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 else
{ {
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) foreach (KeyValuePair<uint, ConnectedPlayer> 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.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)); 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; return true;
} }
#endregion #endregion