diff --git a/roulette.py b/roulette.py index 280397e..1360000 100644 --- a/roulette.py +++ b/roulette.py @@ -202,22 +202,12 @@ def ban(player_id, target_id, success): cur.execute("""select id,ban_end from players where id=%i"""% banned_player['id']) - con.commit() - con.close() - con = connect_sql() - cur = con.cursor() - ban_end = cur.fetchone()[0] ban_end = time() + BAN_DURATION cur.execute("""update players set ban_end=%f where id=%i"""% [ban_end, banned_player['id']]) - - con.commit() - con.close() - con = connect_sql() - cur = con.cursor() cur.execute("""insert into bans (player_id,target_id,success,time) values %i,%i,%i,%f"""% [player['id'], target['id'], \ success and 1 or 0, time()])