Exemple #1
0
        private static void joinRoom(Packet <string[]> packet)
        {
            bool status = true;

            Rooms.Room room = packet.roomManager.findRoomByID(packet.data[0]);

            if (!room.open)
            {
                status = false;
            }
            else if (room.Authenticate(packet.data[1]))
            {
                room.addClient(packet.client);
            }
            else
            {
                status = false;
            }

            packet.client.send(PacketUtils.constructPacket(Packets.JOIN_ROOM.ToString(), status.ToString()));
        }