[TUTO] Desbugando o Modopwet 10.11.13 9:50
Desbugandoo ModoPwet
Eae galera beleza? Hoje estarei ensinando a desbugar a def openModoPwet
Primeiramente substitua def openModoPwet por essa:
- Código:
def openModoPwet(self):
if self.server.reportCache == {}:
self.sendData("\x19\x02", '\x00', True)
else:
disconnected = []
deleted = {}
banned = {}
data = ""
data += chr(len(self.server.reportCache["names"]))
count = 0
while count < len(self.server.reportCache["names"]):
data += chr(3)
data += struct.pack('!h', len('ALL'))+'ALL'
name = self.server.reportCache["names"][count]
data += str(struct.pack("!h", len(name))) + name
if self.server.GetPlayerRoomForModoPwet(name):
player = self.server.GetPlayerRoom(name)
data += str(struct.pack("!h", len(str(player.roomname)))) + str(player.roomname)
else:
data += str(struct.pack("!h", len("0")))+"0"
data += str(struct.pack("!i", self.server.getProfileCheeseCount(name)))
data += chr(len(self.server.reportCache[name]["types"]))
counta = 0
while counta < len(self.server.reportCache[name]["types"]):
data += str(struct.pack("!h", len(self.server.reportCache[name]["reporters"][counta]))) + self.server.reportCache[name]["reporters"][counta]+str(struct.pack("!h",int(self.server.getProfileCheeseCount(self.server.reportCache[name]["reporters"][counta]))))+str(struct.pack("!h", len(self.server.reportCache[name]["comments"][counta])))+self.server.reportCache[name]["comments"][counta]+chr(int(self.server.reportCache[name]["types"][counta]))+str(struct.pack("!h", counta))
counta += 1
count += 1
if self.server.reportCache[name]["status"] == "banned":
banned[name] = {"hours":self.server.reportCache[name]["banhours"],
"reason":self.server.reportCache[name]["banreason"],
"by":self.server.reportCache[name]["banby"]}
elif self.server.reportCache[name]["status"] == "deleted":
deleted[name] = self.server.reportCache[name]["deletedby"]
elif self.server.reportCache[name]["status"] == "disconnected":
disconnected.append(name)
self.sendData("\x19\x02", data, True)
print repr(data)
for userz in disconnected:
reactor.callLater(0, self.changeReportStatus, userz, "disconnected")
for userz in banned:
reactor.callLater(0, self.changeReportStatus, userz, "banned", banned[userz]["hours"],banned[userz]["reason"],banned[userz]["by"])
for userz in deleted:
reactor.callLater(0, self.changeReportStatus,userz,"deleted",deleted[userz])
Você não sabe o que é o modopwet? Veja este print:
[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]
Créditos:
Eu
Weeslleey
Phobos