Fix for mrelay - some bots are sending malformed messages, caused by wrong usage of their modules.

Accessing an external service through the bot for gathering tower data is nolonger supported; and should be done via external scripts.
Fix for callers, and missing alias'es for loot tables.
!accounts will only show mains now.
the character order of all alt lists has been reversed: [main] high => low instead of [main] low => high
!account add <name> also marks accounts as type 0, if an account gets re-enabled. might cause strange behaviour with member-logs, if used in onlinebots.
Member type is being displayed in !account now. [Member (X)]
This commit is contained in:
2021-09-19 14:09:44 +02:00
parent 5acfb6866a
commit 810c2c8c4d
9 changed files with 69 additions and 111 deletions
+15 -7
View File
@@ -51,12 +51,12 @@ class AccountController:
if main != entry.main:
main = entry.main
out += f"\n<{entry.faction.lower()}>{entry.name}</{entry.faction.lower()}>: " \
f"[{self.text.make_tellcmd('D', f'account {entry.name}')}]\n"
f"[{self.text.make_tellcmd('D', f'account {entry.name}')}]"
main_name = entry.name
n = f"<red>N</red>" if entry.last_seen == 0 else ""
out += f"<tab> {self.util.get_prof_icon(entry.profession)}" \
f" {self.text.zfill(entry.level, 220)}/<green>{self.text.zfill(entry.ai_level, 30)}</green> " \
f"<{entry.faction.lower()}>{entry.name}</{entry.faction.lower()}> {n}\n"
# n = f"<red>N</red>" if entry.last_seen == 0 else ""
# out += f"<tab> {self.util.get_prof_icon(entry.profession)}" \
# f" {self.text.zfill(entry.level, 220)}/<green>{self.text.zfill(entry.ai_level, 30)}</green> " \
# f"<{entry.faction.lower()}>{entry.name}</{entry.faction.lower()}> {n}\n"
entries.append([main_name, out])
out = ""
msg = sorted(entries, key=lambda k: k[0])
@@ -81,12 +81,20 @@ class AccountController:
@command(command="account", params=[Const("add"), Character("char")],
access_level="moderator",
sub_command="moderate", description="Create a new account for given character")
sub_command="moderate", description="Create a new account for given character",
extended_description="Potentially breaks in bots using a database generated by an onlinebot. "
"Use with extreme caution.")
def add_account(self, request: command_request, _, user):
if not user.char_id:
return f"Character <highlight>{user.name}</highlight> not found."
if self.account_service.get_account(user.char_id):
# Unban the account, if banned
self.account_service.account_enable(user.char_id)
# set the memberstatus to 0
# (-1 is no member,
# 0 is member,
# any number above 0 indicates that its an org_member of the same ID)
self.account_service.account_add_member(user.char_id)
self.buddy_service.add_buddy(user.char_id, "member")
self.account_service.add_log(request.sender.char_id, "system",
f"Opened Account for <highlight>{user.name}</highlight>.",
@@ -230,7 +238,7 @@ class AccountController:
if not mod:
response += f" Options: {prefs}\n"
response += f" Points: <notice>{alts[0].points}</notice>\n"
access_levels = {"Member": self.account_service.check_member(alts[0].char_id),
access_levels = {f"Member ({alts[0].member})": self.account_service.check_member(alts[0].char_id),
"Officer": self.account_service.check_officer(alts[0].char_id),
"General": self.account_service.check_general(alts[0].char_id),
"President": self.account_service.check_president(alts[0].char_id),