示例#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);
        }
示例#2
0
 internal void Leave(ServerClient serverClient)
 {
     clients.Remove(serverClient);
 }
示例#3
0
 public void Kick(ServerClient client)
 {
     client.Disconnect();
 }