示例#1
0
文件: nospam.py 项目: pguenth/xsbs
def check_kick_timeout(cn, victim):
    t = time.time()
    try:
        if (t - spam_last_votekick[cn]) <= 2:
            ban(playercn, ban_duration, 'spamming server', -1)
    except KeyError:
        pass
    spam_last_votekick[cn] = t
示例#2
0
文件: notk.py 项目: greghaynes/xsbs
def onTeamkill(cn, tcn):
	try:
		if player(cn).teamkills() >= limit:
			ban(cn, duration, 'killing teammates', -1)
		elif warn_tk_limit and player(cn).teamkills() == 1:
			player(cn).message(warning(warn_tk_message.substitute(colordict, limit=limit)))
	except KeyError:
		pass
示例#3
0
文件: nospam.py 项目: greghaynes/xsbs
def check_kick_timeout(cn, victim):
    t = time.time()
    try:
        if (t - spam_last_votekick[cn]) <= 2:
            ban(playercn, ban_duration, 'spamming server', -1)
    except KeyError:
        pass
    spam_last_votekick[cn] = t
示例#4
0
文件: notk.py 项目: pguenth/xsbs
def onTeamkill(cn, tcn):
    try:
        if player(cn).teamkills() >= limit:
            ban(cn, duration, 'killing teammates', -1)
        elif warn_tk_limit and player(cn).teamkills() == 1:
            player(cn).message(
                warning(warn_tk_message.substitute(colordict, limit=limit)))
    except KeyError:
        pass
示例#5
0
def checkVotes(cn):
	players = allPlayers()
	needed = len(players) / 2
	if needed <= 1:
		needed += 1
	votes = 0
	for player in players:
		try:
			if player.votekick == cn:
				votes += 1
		except AttributeError:
			pass
	if votes >= needed:
		ban(cn, 3600, 'Vote', -1)
示例#6
0
文件: votekick.py 项目: pguenth/xsbs
def checkVotes(cn):
    players = allPlayers()
    needed = len(players) / 2
    if needed <= 1:
        needed += 1
    votes = 0
    for player in players:
        try:
            if player.votekick == cn:
                votes += 1
        except AttributeError:
            pass
    if votes >= needed:
        ban(cn, 3600, 'Vote', -1)
示例#7
0
文件: nospam.py 项目: pguenth/xsbs
 def dealwithspammer(self, ip):
     try:
         playercn = playerByIpString(ip).cn
         ban(playercn, ban_duration, 'spamming server', -1)
     except ValueError:
         print "Error while banning spamming player by IP"
示例#8
0
文件: nospam.py 项目: GunioRobot/xsbs
	def dealwithspammer(self, ip):
		try:
			playercn = playerByIpString(ip).cn
			ban(playercn, ban_duration, 'spamming server', -1)
		except ValueError:
			print "Error while banning spamming player by IP"