Beispiel #1
0
        protected void HandleJoinChannelPacket(Packet packet)
        {
            short senderId  = BitConverter.ToInt16(packet.Data, 0);
            short channelId = BitConverter.ToInt16(packet.Data, 2);

            Channel channel = FindChannel(channelId);

            if (channel == null)
            {
                return;
            }

            ServerClient client = FindClient(senderId);

            if (client == null)
            {
                return;
            }

            client.SwitchChannel(channel);
            SignedPacket sendingPacket = new SignedPacket(Messages.SWAPCHANNEL, client.Id, BitConverter.GetBytes(channel.channelId).ToArray());

            SendToClients(0, sendingPacket, senderId);
        }
Beispiel #2
0
 internal void Leave(ServerClient serverClient)
 {
     clients.Remove(serverClient);
 }
Beispiel #3
0
 public void Kick(ServerClient client)
 {
     client.Disconnect();
 }