|
|
|
@ -27,7 +27,7 @@ MYSQL_DB = 'rezo_admin' |
|
|
|
|
|
|
|
BAN_DURATION = 30. * 60. |
|
|
|
|
|
|
|
IMMUNITY_FILE = '/var/www/roulette/immunity' |
|
|
|
IMMUNITY_FILE = '/var/roulette/immunity' |
|
|
|
ASSHOLES_FILE = '/var/www/roulette/assholes' |
|
|
|
|
|
|
|
IMMUNITY = [ |
|
|
|
@ -143,6 +143,7 @@ def get_player_from_ip(ip): |
|
|
|
row = cur.fetchone() |
|
|
|
con.close() |
|
|
|
|
|
|
|
print("last good line") |
|
|
|
user = None |
|
|
|
if row is not None: |
|
|
|
user = {'id': row[0], 'firstname': row[1], 'name': row[2], \ |
|
|
|
@ -208,15 +209,14 @@ def get_players_not_banned(): |
|
|
|
con.close() |
|
|
|
|
|
|
|
not_banned = [{'id': row[0], 'firstname': row[1], 'name': row[2]} for row in rows] |
|
|
|
|
|
|
|
|
|
|
|
# Ensuite on applique les règles d'immunité |
|
|
|
with open(IMMUNITY_FILE, 'r') as f: |
|
|
|
immunity = f.read() |
|
|
|
result = [] |
|
|
|
for user in not_banned: |
|
|
|
if user['firstname']+' '+usr['name'] not in immunity: |
|
|
|
if user['firstname']+' '+user['name'] not in immunity: |
|
|
|
result.append(user) |
|
|
|
|
|
|
|
return result |
|
|
|
|
|
|
|
def cheat(player_id, target_id): |
|
|
|
|