public Packet getroompacket(int mode, int page)
    {
        int cmode = 0;
        int firstnr = 0;
        switch (mode)
        {
            case 1:
                cmode = 0;
                mode = SECTOR;
                firstnr = 89;
                break;

            case 0:
                cmode = 1;
                mode = PVP;
                firstnr = 89;
                break;

            case 2:
                cmode = 2;
                mode = BASE;
                firstnr = 89;
                break;

            default:
                cmode = 0;
                firstnr = 89;
                break;
        }

        Packet packet = new Packet();
        packet.addHeader((byte) 0xEF, (byte) 0x2E);
        packet.addPacketHead((byte) 0x01, (byte) 0x00);

        for (int i = 0; i < 6; i++)
        {
            if (this.rooms[cmode][i + (6 * page)] != null)
            {
                packet.addByte((byte) ((i + (6 * page)) + firstnr));
                packet.addByte((byte) mode);
                String cname, cpass;

                cname = this.rooms[cmode][i + (6 * page)].getName();
                while (cname.length() != 27)
                {
                    cname += nullbyte;
                }

                cpass = this.rooms[cmode][i + (6 * page)].getPass();
                while (cpass.length() != 11)
                {
                    cpass += nullbyte;
                }

                packet.addString(cname);
                packet.addString(cpass);
                packet.addByte((byte) 0x02);
                packet.addByte((byte) 0x08);
                packet.addByte((byte) this.rooms[cmode][i + (6 * page)].getStatus());
                packet.addByte((byte) this.rooms[cmode][i + (6 * page)].getLevel());
                packet.addByte4((byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00);
            }
            else
            {
                for (int z = 0; z < 48; z++)
                {
                    packet.addByte((byte) 0x00);
                }
            }
        }

        return packet;
    }