JavidPack / HEROsMod

HERO's Mod for tModLoader
https://forums.terraria.org/index.php?threads/heros-mod-creative-mode-server-management-and-over-25-tools-1-3-4-4-compatible.44650/
GNU General Public License v3.0
87 stars 42 forks source link

Users are unable to rejoin server after disconnecting. #110

Open UndefinedBHVR opened 2 years ago

UndefinedBHVR commented 2 years ago

On my server while attempting to run this mod, if a user disconnects at any point, they will become unable to rejoin until the server restarts.

I cannot find any error message that gives a clear picture of what is happening, beyond the following:

System.ArgumentNullException: Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   at DMD<Terraria.Net.Sockets.TcpSocket::Terraria.Net.Sockets.ISocket.AsyncSend>(TcpSocket this, Byte[] data, Int32 offset, Int32 size, SocketSendCallback callback, Object state)
   at Terraria.ModLoader.ModPacket.Send(Int32 toClient, Int32 ignoreClient)
   at HEROsMod.HEROsModNetwork.Network.SendDataToAllHEROsModUsers()
   at HEROsMod.HEROsModNetwork.Network.CheckIncomingDataForHEROsModMessage(Byte& msgType, BinaryReader& binaryReader, Int32 playerNumber)
   at HEROsMod.HerosModSystem.HijackGetData(Byte& messageType, BinaryReader& reader, Int32 playerNumber)
   at Terraria.ModLoader.SystemLoader.HijackGetData(Byte& messageType, BinaryReader& reader, Int32 playerNumber)
   at Terraria.MessageBuffer.GetData(Int32 start, Int32 length, Int32& messageType)
   at DMD<Terraria.NetMessage::CheckBytes>(Int32 bufferIndex)

No other message appears, only this. When this occurs the client get stuck with "Receiving Tile Data: Complete", I assume that its trying to send a message to a player that isn't properly loaded in/registered yet, which causes the issue to occur?