void OnAllPlayersDisconnect_Normal(Player sender, API.Events.ConnectionEventArgs args) { if (InvokeRequired) { BeginInvoke((MethodInvoker) delegate { OnAllPlayersDisconnect_Normal(sender, args); }); return; } lstPlayers.RemoveIfExists(sender.Username); }
void OnAllPlayersConnect_Normal(Player sender, API.Events.ConnectionEventArgs args) { if (InvokeRequired) { BeginInvoke((MethodInvoker) delegate { OnAllPlayersConnect_Normal(sender, args); }); return; } char color = '0'; if (!String.IsNullOrWhiteSpace(sender.Color) && sender.Color.Length == 2) { color = sender.Color[1]; } else { color = sender.Group.Color[1]; } lstPlayers.AddIfNotExist(color, sender.Username); }