Fix for !lc; invalid parameters (site, PF) nolonger trigger [ERROR]'s
Remove more debugging Stuff Fix for penalty timers
This commit is contained in:
@@ -37,8 +37,20 @@ class TowerHotController(BaseModule):
|
||||
is_enabled=False)
|
||||
def tower_victory_event(self, _, event_data):
|
||||
if event_data.attacker.org_id:
|
||||
self.db.exec("UPDATE towers SET penalty_until=? where org_id=?",
|
||||
[time.time() + 60 * 60, event_data.attacker.org_id])
|
||||
data = self.db.query(
|
||||
"""SELECT pf_id, site_number, t.org_id, t.faction, penalty_until, planted, close_time
|
||||
FROM towers t
|
||||
LEFT JOIN all_orgs a ON a.org_id = t.org_id WHERE a.org_name = ? AND t.faction = ? AND close_time IS NOT NULL""", [event_data.attacker.org_name, event_data.attacker.faction.lower()])
|
||||
blob = []
|
||||
for row in data:
|
||||
blob.append((((row.planted - time.time()) % 3600) + 3600+time.time(), row.pf_id, row.site_number, row.org_id))
|
||||
if blob:
|
||||
with self.db.lock:
|
||||
with self.db.pool.get_connection() as conn:
|
||||
with conn.cursor() as cur:
|
||||
cur.executemany("UPDATE towers SET penalty_until=? WHERE pf_id=? AND site_number=? AND org_id=?", blob)
|
||||
# self.db.exec("UPDATE towers SET penalty_until=? where org_id=?",
|
||||
# [time.time() + 60 * 60, event_data.attacker.org_id])
|
||||
|
||||
@command(command="hot",
|
||||
params=[Options(['tl1', 'tl2', 'tl3', 'tl4', 'tl5', 'tl6', 'tl7']), Any('faction', is_optional=True),
|
||||
|
||||
Reference in New Issue
Block a user