diff --git a/FFXIVClassic Map Server/PacketProcessor.cs b/FFXIVClassic Map Server/PacketProcessor.cs index 7607e2e8..12b31425 100644 --- a/FFXIVClassic Map Server/PacketProcessor.cs +++ b/FFXIVClassic Map Server/PacketProcessor.cs @@ -49,7 +49,9 @@ namespace FFXIVClassic_Map_Server if (session.GetActor().destinationZone != 0) Server.GetWorldManager().DoZoneIn(session.GetActor(), false, session.GetActor().destinationSpawnType); - + + Program.Log.Info("{0} has been added to the session list.", session.GetActor().customDisplayName); + client.FlushQueuedSendPackets(); break; //World Server - Session End @@ -59,7 +61,10 @@ namespace FFXIVClassic_Map_Server if (endSessionPacket.destinationZoneId == 0) session.GetActor().CleanupAndSave(); else - session.GetActor().CleanupAndSave(endSessionPacket.destinationZoneId, endSessionPacket.destinationSpawnType, endSessionPacket.destinationX, endSessionPacket.destinationY, endSessionPacket.destinationZ, endSessionPacket.destinationRot); + session.GetActor().CleanupAndSave(endSessionPacket.destinationZoneId, endSessionPacket.destinationSpawnType, endSessionPacket.destinationX, endSessionPacket.destinationY, endSessionPacket.destinationZ, endSessionPacket.destinationRot); + + Server.GetServer().RemoveSession(session.id); + Program.Log.Info("{0} has been removed from the session list.", session.GetActor().customDisplayName); client.QueuePacket(SessionEndConfirmPacket.BuildPacket(session, endSessionPacket.destinationZoneId), true, false); client.FlushQueuedSendPackets(); diff --git a/FFXIVClassic Map Server/WorldManager.cs b/FFXIVClassic Map Server/WorldManager.cs index c330d99c..a9b03e08 100644 --- a/FFXIVClassic Map Server/WorldManager.cs +++ b/FFXIVClassic Map Server/WorldManager.cs @@ -468,12 +468,14 @@ namespace FFXIVClassic_Map_Server if (!isLogin) { player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId), true, false); - player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x0), true, false); - player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x0), true, false); + player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x2), true, false); + player.SendZoneInPackets(this, spawnType); } player.SendZoneInPackets(this, spawnType); - + + player.playerSession.LockUpdates(false); + LuaEngine.OnZoneIn(player); } diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs index 72e23282..9df7fe81 100644 --- a/FFXIVClassic Map Server/actors/chara/player/Player.cs +++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs @@ -476,7 +476,7 @@ namespace FFXIVClassic_Map_Server.Actors QueuePacket(SetMapPacket.BuildPacket(actorId, zone.regionId, zone.actorId)); QueuePacket(GetSpawnPackets(actorId, spawnType)); - GetSpawnPackets(actorId, spawnType).DebugPrintPacket(); + //GetSpawnPackets(actorId, spawnType).DebugPrintPacket(); #region grouptest //Retainers @@ -660,11 +660,7 @@ namespace FFXIVClassic_Map_Server.Actors //Save Player Database.SavePlayerPlayTime(this); - Database.SavePlayerPosition(this); - - Server.GetServer().RemoveSession(playerSession.id); - - Program.Log.Info("{0} has been removed from the session list.", this.customDisplayName); + Database.SavePlayerPosition(this); } public void CleanupAndSave(uint destinationZone, ushort spawnType, float destinationX, float destinationY, float destinationZ, float destinationRot) @@ -684,11 +680,7 @@ namespace FFXIVClassic_Map_Server.Actors //Save Player Database.SavePlayerPlayTime(this); - Database.SavePlayerPosition(this); - - Server.GetServer().RemoveSession(playerSession.id); - - Program.Log.Info("{0} has been removed from the session list.", this.customDisplayName); + Database.SavePlayerPosition(this); } public Area GetZone() diff --git a/FFXIVClassic Map Server/dataobjects/Session.cs b/FFXIVClassic Map Server/dataobjects/Session.cs index 2e0c3ebb..0ea83806 100644 --- a/FFXIVClassic Map Server/dataobjects/Session.cs +++ b/FFXIVClassic Map Server/dataobjects/Session.cs @@ -20,7 +20,7 @@ namespace FFXIVClassic_Map_Server.dataobjects public uint languageCode = 1; private uint lastPingPacket = Utils.UnixTimeStampUTC(); - public bool isUpdatesLocked = false; + public bool isUpdatesLocked = true; public string errorMessage = ""; diff --git a/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionEndPacket.cs b/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionEndPacket.cs index 762ba91d..868f65bd 100644 --- a/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionEndPacket.cs +++ b/FFXIVClassic World Server/Packets/WorldPackets/Send/SessionEndPacket.cs @@ -45,7 +45,7 @@ namespace FFXIVClassic_World_Server.Packets.WorldPackets.Send try { binWriter.Write((UInt32)destinationZoneId); - binWriter.Write((UInt32)spawnType); + binWriter.Write((UInt16)spawnType); binWriter.Write((Single)spawnX); binWriter.Write((Single)spawnY); binWriter.Write((Single)spawnZ);