Adds connection and disconnection callbacks for all players

Not only for own player
This commit is contained in:
Makinolo
2021-11-19 17:05:57 -07:00
parent b5d4fa6297
commit 1c3c9ec1fa
2 changed files with 28 additions and 3 deletions

View File

@ -45,6 +45,11 @@ namespace CoopClient
Client.Start();
string[] ip = address.Split(':');
if(ip.Length != 2)
{
throw new Exception("Malformed URL");
}
// Send HandshakePacket
NetOutgoingMessage outgoingMessage = Client.CreateMessage();
@ -260,6 +265,7 @@ namespace CoopClient
};
Main.Players.Add(packet.ID, player);
Interface.Connected(packet.ID);
}
private void PlayerDisconnect(PlayerDisconnectPacket packet)
@ -275,6 +281,7 @@ namespace CoopClient
player.PedBlip?.Delete();
Interface.Disconnected(packet.ID);
Main.Players.Remove(packet.ID);
}
}