Correction de syntaxe
This commit is contained in:
parent
af2e766e0a
commit
25adda3eba
1 changed files with 5 additions and 5 deletions
10
roulette.py
10
roulette.py
|
@ -108,7 +108,7 @@ def get_player_from_full_name(firstname, name):
|
||||||
machines.id,machines.ip,players.ban_end
|
machines.id,machines.ip,players.ban_end
|
||||||
from players
|
from players
|
||||||
inner join machines on players.id=machines.player_id
|
inner join machines on players.id=machines.player_id
|
||||||
where players.firstname=%s and players.name=%s"""% [firstname, name])
|
where players.firstname=%s and players.name=%s"""% firstname, name)
|
||||||
|
|
||||||
row = cur.fetchone()
|
row = cur.fetchone()
|
||||||
con.close()
|
con.close()
|
||||||
|
@ -206,11 +206,11 @@ def ban(player_id, target_id, success):
|
||||||
ban_end = time() + BAN_DURATION
|
ban_end = time() + BAN_DURATION
|
||||||
|
|
||||||
cur.execute("""update players set ban_end=%f
|
cur.execute("""update players set ban_end=%f
|
||||||
where id=%i"""% [ban_end, banned_player['id']])
|
where id=%i"""% (ban_end, banned_player['id']))
|
||||||
|
|
||||||
cur.execute("""insert into bans (player_id,target_id,success,time)
|
cur.execute("""insert into bans (player_id,target_id,success,time)
|
||||||
values %i,%i,%i,%f"""% [player['id'], target['id'], \
|
values %i,%i,%i,%f"""% (player['id'], target['id'], \
|
||||||
success and 1 or 0, time()])
|
success and 1 or 0, time())
|
||||||
con.commit()
|
con.commit()
|
||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ def unban(player_id):
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
|
|
||||||
cur.execute("""update players set ban_end=%f
|
cur.execute("""update players set ban_end=%f
|
||||||
where id=%i"""% [time() - BAN_DURATION, player_id])
|
where id=%i"""% (time() - BAN_DURATION, player_id))
|
||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
con.close()
|
con.close()
|
||||||
|
|
Loading…
Reference in a new issue