the Player datanode is null when onPlayerDisconnect fires.
any chance the Player datanode could get sync'd up with TcpPlayer before the onPlayerDisconnect event is called?
temporary fix:
//void RemovePlayer(TcpPlayer p)
//line #610~
#if STANDALONE
if (p.id != 0) Tools.Log(p.name + " (" + p.address + "): Disconnected [" + p.id + "]");
#endif
//temp_onPlayerDisconnect(p);//sends TcpPlayer instead of Player -- (TcpPlayer)p.datanode is ok with all data
LeaveAllChannels(p);
p.Release();
p.savePath = null;
mPlayerList.Remove(p);
if (p.udpEndPoint != null)
{
mDictionaryEP.Remove(p.udpEndPoint);
p.udpEndPoint = null;
p.udpIsUsable = false;
}
if (p.id != 0)
{
if (mPlayerDict.Remove(p.id))
{
if (lobbyLink != null) lobbyLink.SendUpdate(this);
if (onPlayerDisconnect != null) onPlayerDisconnect(p);//(Player)p.datanode is null at this point
}
p.id = 0;
}