Fixed OwnerClientName & OwnerClientIP not being set on respawned characters. The characters of clients who aren't in-game 30 seconds after a round starts are treated as disconnected, making it possible for the client to gain control of the character if they do manage to connect. Closes #583, #584

This commit is contained in:
Joonas Rikkonen
2018-08-06 15:48:47 +03:00
parent e60ebc1930
commit a5a09aa664
2 changed files with 4 additions and 3 deletions
@@ -519,6 +519,8 @@ namespace Barotrauma.Networking
{
#endif
clients[i].Character = character;
character.OwnerClientIP = clients[i].Connection.RemoteEndPoint.Address.ToString();
character.OwnerClientName = clients[i].Name;
GameServer.Log(string.Format("Respawning {0} ({1}) as {2}", clients[i].Name, clients[i].Connection?.RemoteEndPoint?.Address, characterInfos[i].Job.Name), ServerLog.MessageType.Spawning);
#if CLIENT