Correction de l'immunité

This commit is contained in:
root 2017-01-29 17:00:21 +01:00
parent 15dbb71759
commit 2b20eb9a0d
3 changed files with 6 additions and 10 deletions

2
.gitignore vendored
View file

@ -1,4 +1,6 @@
players.db players.db
immunity
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]

View file

@ -1,6 +0,0 @@
Goulven Kermarec
Lazare Olivry
Brieuc Lacroix
Cyriaque Millot
Juliette Tibayrenc
Siqi Liu

View file

@ -27,7 +27,7 @@ MYSQL_DB = 'rezo_admin'
BAN_DURATION = 30. * 60. BAN_DURATION = 30. * 60.
IMMUNITY_FILE = '/var/www/roulette/immunity' IMMUNITY_FILE = '/var/roulette/immunity'
ASSHOLES_FILE = '/var/www/roulette/assholes' ASSHOLES_FILE = '/var/www/roulette/assholes'
IMMUNITY = [ IMMUNITY = [
@ -143,6 +143,7 @@ def get_player_from_ip(ip):
row = cur.fetchone() row = cur.fetchone()
con.close() con.close()
print("last good line")
user = None user = None
if row is not None: if row is not None:
user = {'id': row[0], 'firstname': row[1], 'name': row[2], \ user = {'id': row[0], 'firstname': row[1], 'name': row[2], \
@ -214,9 +215,8 @@ def get_players_not_banned():
immunity = f.read() immunity = f.read()
result = [] result = []
for user in not_banned: for user in not_banned:
if user['firstname']+' '+usr['name'] not in immunity: if user['firstname']+' '+user['name'] not in immunity:
result.append(user) result.append(user)
return result return result
def cheat(player_id, target_id): def cheat(player_id, target_id):