Dirty fixing of some more mariadb -> mysql-connector issues....

TODO: do it properly.
This commit is contained in:
Cedric
2023-08-08 14:07:36 +02:00
parent 7f55828c5f
commit bdc826c15b
8 changed files with 15 additions and 15 deletions
@@ -365,7 +365,7 @@ class AccountService:
"auto_invite, raid_invite, raid_spam, news_spam) "
f"VALUES(?, ?, ?, 1, ?, ?, {pref_autoinvite}, {pref_raidinvite}, "
f"{pref_raidspam}, {pref_newsspam}) ON DUPLICATE KEY UPDATE "
"member=VALUE(member), last_updated=VALUE(last_updated), disabled=1",
"member=VALUE(member), last_updated=VALUE(last_updated), disabled=1".replace("?", "%s"),
users)
return cur.rowcount
cur.executemany(
@@ -373,7 +373,7 @@ class AccountService:
"created, auto_invite, raid_invite, raid_spam, news_spam) "
f"VALUES(?, ?, ?, ?, ?, {pref_autoinvite}, {pref_raidinvite}, "
f"{pref_raidspam}, {pref_newsspam}) ON DUPLICATE KEY UPDATE "
"member=VALUE(member), last_updated=VALUE(last_updated)",
"member=VALUE(member), last_updated=VALUE(last_updated)".replace("?", "%s"),
users)
return cur.rowcount
@@ -396,7 +396,7 @@ class AccountService:
if type(users) == list and len(users) > 0:
with self.db.pool.get_connection() as conn:
with conn.cursor() as cur:
cur.executemany("UPDATE account set member=-1 where char_id=? and ?", users)
cur.executemany("UPDATE account set member=-1 where char_id=? and ?".replace("?", "%s"), users)
def check_member(self, char_id) -> bool:
account = self.get_account(char_id) or {}
+1 -1
View File
@@ -150,7 +150,7 @@ class OrgBanController(BaseModule):
"REPLACE INTO player(char_id, name, first_name, last_name, level, breed, gender, faction, "
"profession, profession_title, ai_rank, ai_level, org_id, org_name, org_rank_name, "
"org_rank_id, dimension, head_id, pvp_rating, pvp_title, source, last_updated) "
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)".replace("?", "%s"),
data)
self.account_service.create_users(accounts, disable=True)
if sender: