Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
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
Beispiel #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)
Beispiel #6
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)
Beispiel #7
0
 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"
Beispiel #8
0
	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"