Test Test Test Test Password
:: FLASH ZONE :: Tutoriais
Página 1 de 1
Test Test Test Test Password
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:
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:
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:
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
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)
:: FLASH ZONE :: Tutoriais
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos