Exemple #1
0
        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);
        }
Exemple #2
0
        protected override void OnClientReady(object sender, EventArgs eventArgs)
        {
            var client = sender as SCONClient;

            PlayersToAdd.Add(client);
            PlayersJoining.Remove(client);

            base.OnClientReady(sender, eventArgs);
        }