Added !orglist cancel

fix for !whois <char_id>
added logging for invalid ORG_MSG_EVENT's
This commit is contained in:
2022-05-09 19:47:26 +02:00
parent 3cade228fe
commit 43918066a9
8 changed files with 107 additions and 42 deletions
+17
View File
@@ -109,6 +109,23 @@ class BuddyService:
else:
return False
def remove_buddy_type(self, chars: [], _type: str, force_remove=False):
removed = 0
if len(chars) < 1:
return removed
for bot, buddylist in self.buddy_list.items():
for x in buddylist.keys():
if x not in chars:
continue
if _type not in buddylist[x]['types']:
continue
buddylist[x]["types"].remove(_type)
if len(buddylist[x]["types"]) == 0 or force_remove:
conn = self.bot.conns[buddylist[x]["conn_id"]]
conn.send_packet(client_packets.BuddyRemove(x))
removed += 1
return removed
def get_buddy(self, char_id):
for conn_id, conn_buddy_list in self.buddy_list.items():
if char_id in conn_buddy_list: