Add is_vanilla_client & is_legacy_client attributes to client objects

This commit is contained in:
Ben 2019-10-09 01:19:18 +01:00
parent 23a071dbe8
commit 6e302e8723

View File

@ -33,6 +33,14 @@ class Spheniscidae:
self.received_packets = set() self.received_packets = set()
@property
def is_vanilla_client(self):
return self.client_type == ClientType.Vanilla
@property
def is_legacy_client(self):
return self.client_type == ClientType.Legacy
async def send_error_and_disconnect(self, error, *args): async def send_error_and_disconnect(self, error, *args):
await self.send_xt('e', error, *args) await self.send_xt('e', error, *args)
await self.close() await self.close()