Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def banPlayer(this, playerName, banTime, reason, modName, silent):
- found = False
- player = this.players.get(playerName)
- if player != None:
- found = True
- if not modName == "Server":
- player.banHours += banTime
- this.cursor.execute("insert into BanLog values (?, ?, ?, ?, ?, ?, 'Ban')", [playerName, modName, banTime, reason, str(time.time())[:len(str(time.time())) - 4], player.ipAddress])
- else:
- this.sendStaffMessage(5, "<V>Servidor <BL>baniu o jogador <V>%s<BL> por <V>1 <BL> hora. Motivo: <V>Vote Populaire<BL>." %(playerName))
- this.cursor.execute("update Users SET BanHours = ? WHERE Username = ?", [banTime, playerName])
- if banTime >= 361 or player.banHours >= 361 and not player.isGuest:
- this.userPermaBanCache.append(playerName)
- this.cursor.execute("insert into UserPermaBan values (?)", [playerName])
- this.ipPermaBanCache.append(player.ipAddress)
- this.cursor.execute("insert into IPPermaBan values (?)", [player.ipAddress])
- if banTime >= 1 and banTime <= 360 and not player.isGuest:
- this.userTempBanCache.append(playerName)
- this.cursor.execute("insert into usertempban values (?, ?, ?)", [playerName, Utils.getTime() + (banTime * 3600), reason])
- if not player.ipAddress in this.tempIPBanList:
- this.tempIPBanList.append(player.ipAddress)
- reactor.callLater(banTime, lambda: this.tempIPBanList.remove(player.ipAddress))
- if playerName in this.reports["names"]:
- this.reports[playerName]["status"] = "banned"
- this.reports[playerName]["status"] = "modName"
- this.reports[playerName]["status"] = str(banTime)
- this.reports[playerName]["banreason"] = "hack"
- player.sendPlayerBan(banTime, reason, silent)
- if not found and this.checkExistingAccount(playerName) and not modName == "Server" and banTime >= 1:
- found = True
- totalBanTime = this.getTotalBanHours(playerName) + banTime
- if ((totalBanTime >= 361 and banTime <= 360) or banTime >= 361):
- this.userPermaBanCache.append(playerName)
- this.cursor.execute("insert into UserPermaBan values (?)", [playerName])
- if banTime >= 1 and banTime <= 360:
- this.userTempBanCache.append(playerName)
- this.cursor.execute("insert into UserTempBan values (?, ?, ?)", [playerName, str(Utils.getTime() + (banTime * 60 * 60)), reason])
- this.cursor.execute("update Users set BanHours = ? WHERE Username = ?", [banTime, playerName])
- this.cursor.execute("insert into BanLog (Name, BannedBy, Time, Reason, Date, Status, Room, IP) values (?, ?, ?, ?, ?, ?, ?, ?)", [playerName, modName, str(banTime), reason, "Online", "Online", "Online", str(time.time())[:len(str(time.time())) - 4]])
- return found
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement