Players disconnect

This commit is contained in:
brausjonas
2022-05-13 16:51:55 +02:00
parent fb04675716
commit a36cf65f6d
4 changed files with 44 additions and 15 deletions
+8
View File
@@ -73,6 +73,14 @@ public class Server
if (tempEndPoint != null)
{
foreach (IPEndPoint e in players)
{
if (i != GetPlayerID(e))
{
Send(new byte[]{4, (byte)i}, e);
}
}
players.Remove(tempEndPoint);
Console.WriteLine(playerNames[i] + " left the game" + "\n");
playerNames.RemoveAt(i);