Displaying the names of the connected players in the server lobby

This commit is contained in:
Regalis
2017-02-01 18:10:48 +02:00
parent b87e22409a
commit 05c5880269
4 changed files with 49 additions and 17 deletions
+9 -5
View File
@@ -77,7 +77,7 @@ namespace Barotrauma.Networking
config.SimulatedDuplicatesChance = 0.05f;
config.SimulatedMinimumLatency = 0.1f;
config.ConnectionTimeout = 60.0f;
config.ConnectionTimeout = 5.0f;
#endif
config.Port = port;
Port = port;
@@ -504,7 +504,7 @@ namespace Barotrauma.Networking
}
}
}
updateTimer = DateTime.Now + updateInterval;
}
@@ -690,7 +690,6 @@ namespace Barotrauma.Networking
break;
default:
return;
//break;
}
}
}
@@ -811,6 +810,12 @@ namespace Barotrauma.Networking
{
outmsg.Write(AutoRestartTimer);
}
outmsg.Write((byte)connectedClients.Count);
foreach (Client client in connectedClients)
{
outmsg.Write(client.name);
}
}
else
{
@@ -1269,8 +1274,7 @@ namespace Barotrauma.Networking
client.Connection.Disconnect(targetmsg);
GameMain.NetLobbyScreen.RemovePlayer(client.name);
GameMain.NetLobbyScreen.RemovePlayer(client.name);
connectedClients.Remove(client);
AddChatMessage(msg, ChatMessageType.Server);