Fix buddy request object naming collision for legacy clients

This commit is contained in:
Ben 2020-01-02 23:04:55 +00:00
parent ac8b20fcfe
commit 85726627b1
2 changed files with 6 additions and 6 deletions

View File

@ -80,7 +80,7 @@ async def handle_get_buddies(p):
await p.send_xt('gs', best_friend_count, notification_aware, int(p.active), best_friends_enabled) await p.send_xt('gs', best_friend_count, notification_aware, int(p.active), best_friends_enabled)
await p.send_xt('gb', *buddies) await p.send_xt('gb', *buddies)
await p.send_xt('pr', *requests) await p.send_xt('pbr', *requests)
await p.send_xt('gc', *characters) await p.send_xt('gc', *characters)
if best_friends_enabled: if best_friends_enabled:
@ -125,8 +125,8 @@ async def handle_buddy_request(p, buddy_id: int):
if buddy.client_type == ClientType.Vanilla and p.id not in buddy.buddy_requests: if buddy.client_type == ClientType.Vanilla and p.id not in buddy.buddy_requests:
await buddy.buddy_requests.insert(buddy_id=p.id) await buddy.buddy_requests.insert(buddy_id=p.id)
elif p.id not in buddy.buddy_requests: elif p.id not in buddy.legacy_buddy_requests:
buddy.buddy_requests.add(p.id) buddy.legacy_buddy_requests.add(p.id)
else: else:
return return
@ -139,8 +139,8 @@ async def handle_buddy_request(p, buddy_id: int):
async def handle_buddy_accept(p, buddy_id: int): async def handle_buddy_accept(p, buddy_id: int):
if buddy_id in p.buddy_requests: if buddy_id in p.buddy_requests:
await p.buddy_requests.delete(buddy_id) await p.buddy_requests.delete(buddy_id)
elif buddy_id in p.buddy_requests: elif buddy_id in p.legacy_buddy_requests:
p.buddy_requests.remove(buddy_id) p.legacy_buddy_requests.remove(buddy_id)
else: else:
return return

View File

@ -31,7 +31,7 @@ class Penguin(Spheniscidae, penguin.Penguin):
self.avatar = None self.avatar = None
self.walking_puffle = None self.walking_puffle = None
self.active_quests = None self.active_quests = None
self.buddy_requests = set() self.legacy_buddy_requests = set()
self.heartbeat = time.time() self.heartbeat = time.time()