protected override void OnClientReady(object sender, EventArgs eventArgs) { if (!(sender is PokeDPlayer client)) { return; } if (!AssignID(client)) { client.SendKick("You are already on server!"); return; } client.SendPacket(new AuthorizationCompletePacket { PlayerID = new VarInt(client.ID) }); SendPacketToAll(new ChatGlobalMessagePacket { Message = $"Player {client.Name} joined the game!" }); PlayersToAdd.Add(client); PlayersJoining.Remove(client); base.OnClientReady(sender, eventArgs); }
protected override void OnClientReady(object sender, EventArgs eventArgs) { var client = sender as SCONClient; PlayersToAdd.Add(client); PlayersJoining.Remove(client); base.OnClientReady(sender, eventArgs); }