toontown-just-works/toontown/distributed/ShardStatusReceiver.py

17 lines
423 B
Python
Raw Normal View History

2024-07-07 18:08:39 -05:00
class ShardStatusReceiver:
def __init__(self, air):
self.air = air
self.shards = {}
# Accept the shardStatus event:
self.air.accept('shardStatus', self.handleShardStatus)
self.air.sendNetEvent('queryShardStatus')
def handleShardStatus(self, channel, status):
self.shards.setdefault(channel, {}).update(status)
def getShards(self):
return self.shards