public Packet addPlayer(String player, String pass, String rip, PrintWriter socks, BotClass botc)
    {
        try {
        if (!this.roompass.equals(pass)) //wrong pass
        {
            Packet packet = new Packet();
            packet.addHeader((byte) 0x28, (byte) 0x2F);
            packet.addByte2((byte) 0x00, (byte) 0x3E);
            return packet;
        }
        if (this.roomstatus == 3) //already starten
        {
            Packet packet = new Packet();
            packet.addHeader((byte) 0x28, (byte) 0x2F);
            packet.addByte2((byte) 0x00, (byte) 0x3B);
            return packet;
        }
        for (int i = 0; i < 8; i++)
        {
            if (this.roomsocks[i] == null)
            {
                sql.doupdate("INSERT INTO `rooms` (`ip`) VALUES ('" + rip + "')");
                this.roomplayer[i] = player;
                this.bot[i] = botc;
                this.roomposi[i] = 0x50;

                this.roomport[i] = 0;
                this.roomid[i] = i;
                this.roomreadytoplay[i] = false;

                this.roomready[i] = false;

                String[] ip = rip.split("\\.");
                for (int i2 = 0; i2 < 4; i2++)
                {
                    this.roomips[i][i2] = (byte) Integer.parseInt(ip[i2]);
                }
                


                Packet packet = new Packet();
                packet.addHeader((byte) 0x29, (byte) 0x27);
                packet.addString(generateUserPack(i));
                this.writeRoomAll(packet);
                this.roomsocks[i] = socks;

                return getRoomPacket();
            }
        }
        Packet packet = new Packet();
        packet.addHeader((byte) 0x28, (byte) 0x2F);
        packet.addByte2((byte) 0x00, (byte) 0x50);
        return packet;
        } catch (Exception e){

        }
        return null;
    }