Players disconnect

This commit is contained in:
brausjonas committed 2022-05-13 16:51:55 +02:00
1 parent fb04675716
commit a36cf65f6d
4 files changed
+44 -15

No files matched your search

+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);