Beispiel #1
0
    def __init__(self, loop):
        DownstreamMessageDirector.__init__(self, loop)

        self.pool = None

        self.dc = parse_dc_file('toon.dc')

        self.backend = SQLBackend(self)

        self.operations = {}
Beispiel #2
0
    def __init__(self, loop):
        DownstreamMessageDirector.__init__(self, loop)
        ChannelAllocator.__init__(self)

        self.dc_file = parse_dc_file('toon.dc')

        self.loop.set_exception_handler(self._on_exception)

        self.objects: Dict[int, DistributedObject] = {}
        self.database_objects = set()
        self.queries = {}
Beispiel #3
0
async def main():
    import builtins
    builtins.dc = parse_dc_file('toon.dc')

    loop = asyncio.get_running_loop()
    central_logger = CentralLoggerUD(loop)
    friend_manager = FriendManagerUD(loop)

    uberdog_tasks = [
        asyncio.create_task(central_logger.run()),
        asyncio.create_task(friend_manager.run()),
    ]

    await asyncio.gather(*uberdog_tasks)
Beispiel #4
0
    def __init__(self, loop):
        DownstreamMessageDirector.__init__(self, loop)
        UpstreamServer.__init__(self, loop)
        ChannelAllocator.__init__(self)

        self.dc_file = parse_dc_file('toon.dc')
        self.dc_hash = self.dc_file.hash

        self.avatars_field = self.dc_file.namespace['Account']['ACCOUNT_AV_SET']

        self.loop.set_exception_handler(self._on_exception)

        self._context = 0

        self.log.debug(f'DC Hash is {self.dc_hash}')

        self.name_parts = {}
        self.name_categories = {}

        self.listen_task = None
Beispiel #5
0
    def __init__(self):
        self.connection = None
        self.queue = queue.Queue()

        base_channel = 4000000

        max_channels = 1000000
        self.minChannel = base_channel
        self.maxChannel = base_channel + max_channels
        self.channelAllocator = UniqueIdAllocator(self.minChannel,
                                                  self.maxChannel)
        self.zoneAllocator = UniqueIdAllocator(DynamicZonesBegin,
                                               DynamicZonesEnd)

        self._registedChannels = set()

        self.__contextCounter = 0
        self.__callbacks = {}

        self.ourChannel = self.allocateChannel()

        self.doTable: Dict[int, 'DistributedObjectAI'] = {}
        self.zoneTable: Dict[int, set] = {}
        self.parentTable: Dict[int, set] = {}

        self.dcFile = parse_dc_file('toon.dc')

        self.currentSender = None
        self.loop = None
        self.net_thread = None
        self.hoods = None

        self.zoneDataStore = AIZoneData.AIZoneDataStore()

        self.vismap: Dict[int, Tuple[int]] = {}

        self.connected = Event()
Beispiel #6
0
    def __init__(self, loop):
        DownstreamMessageDirector.__init__(self, loop)
        UpstreamServer.__init__(self, loop)
        ChannelAllocator.__init__(self)

        self.dc_file = parse_dc_file('toon.dc')
        self.dc_hash = self.dc_file.hash

        self.avatars_field = self.dc_file.namespace['Account'][
            'ACCOUNT_AV_SET']

        self.loop.set_exception_handler(self._on_exception)

        self._context = 0

        self.log.debug(f'DC Hash is {self.dc_hash}')

        self.name_parts = {}
        self.name_categories = {}

        with open('NameMasterEnglish.txt', 'r') as f:
            for line in f:
                if line[0] == '#':
                    continue

                if line.endswith('\r\n'):
                    line = line[:-2]
                elif line.endswith('\n'):
                    line = line[:-1]

                index, category, name = line.split('*')
                index, category = int(index), int(category)
                self.name_parts[index] = name
                self.name_categories[index] = category

        self.listen_task = None
Beispiel #7
0
    def test_parse_otp(self):
        dc = parse_dc_file('otp.dc')

        self.assertEqual(dc.hash, 1788488919)
        self.assertEqual(dc.fields[150]().name, 'removeAvatarResponse')
        self.assertEqual(dc.classes[23].name, 'DistributedPlayer')