Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Test Test Test Test Password

Ir para baixo

Test Test Test Test Password Empty Test Test Test Test Password

Mensagem por Admin Qua Set 11, 2013 12:28 pm

Hi guys,

I've seen that nobody has posted nothing about the new command /pw added in TFM.

I made a system (in Python), but still I haven't tested it to see if it works. And today I'll pass to you a little bit what I did.

To make one, you need create a new eventToken below MajPositionMobile or another place like this there.

The code I've made myself:



Código:
elif eventToken2 == "\x0f":
                                        # Send room password
                                        rpasslen = struct.unpack("!h", data[:2])[0]
                                        rpass = data[2:int(rpasslen)+2]
                                        data = data[int(rpasslen)+2:]
                                        rnamelen = struct.unpack("!h", data[:2])[0]
                                        rname = data[2:int(rnamelen)+2]
                                        if rname != "" and rpass != "":
                                                dbcur.execute("SELECT roomswpass FROM users")
                                                row = dbcur.fetchoe()
                                                if row is None:
                                                    ccontent = ""
                                                else:
                                                    ccontent = row[0]
                                                for rooms in ccontent.split("\xFF"):
                                                    roomname = rooms.split("\xDD")[0]
                                                    roompass = rooms.split("\xDD")[1]
                                                    if roomname == rname:
                                                        if roompass == rpass:
                                                            self.sendData("\x06\x14", ["Password <J>" + str(rpass) + "<BL> allowed for room <J>" + str(rname) + "<BL>!"])
                                                        else:
                                                            self.sendData("\x06\x14", ["Wrong password <J>" + str(rpass) + "<BL> for room <J>" + str(rname) + "<BL>!"])

After this you need to add a column in your Database called 'roomswpass' that means: rooms with password.

To make it by an easy way, enter in DB, click on 'SQL' and will appear a text box, put the following code in:

Código:
ALTER TABLE users ADD roomswpass TEXT
Case an error has occurred, it'll be shown and answr this post with it at your message.

Okay, I passed a good help to you, now, you need to think about it and make yourself to improve your Python's skills. Smile

To help you more than I already did, set_room_password's packet:

Código:
self.sendData("\x05'" + struct.pack("!h", len(roomname)) + str(roomname), [], True)
P.S.: At the 'roomswpass' column, the rooms with password will stay: roomname\xDDroompassword\xFFroomname2\xDDroompassword2 and like this forever.
Admin
Admin
Administradores
Administradores

Mensagens : 811
Pontos : 2437
Data de inscrição : 12/09/2011

https://cheatswarez.forumeiros.com

Ir para o topo Ir para baixo

Ir para o topo


 
Permissões neste sub-fórum
Não podes responder a tópicos