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