Esempio n. 1
0
    def serve_realm(sck):
        name_bytes = PacketWriter.string_to_bytes(config.Server.Connection.RealmServer.realm_name)
        address_bytes = PacketWriter.string_to_bytes(('%s:%s' % (config.Server.Connection.RealmProxy.host,
                                                                 config.Server.Connection.RealmProxy.port)))

        # TODO: Should probably move realms to database at some point, instead of config.yml
        packet = pack(
            '<B%us%usI' % (len(name_bytes), len(address_bytes)),
            1,  # Number of realms
            name_bytes,
            address_bytes,
            # I assume this number is meant to show current online players since there is
            # no way of knowing the account yet when realmlist is requested in 0.5.3.
            WorldSessionStateHandler.get_process_shared_session_number()
        )

        Logger.debug('[%s] Sending realmlist...' % sck.getpeername()[0])
        sck.sendall(packet)
Esempio n. 2
0
    def serve_realm(sck):
        name_bytes = PacketWriter.string_to_bytes(
            config.Server.Connection.RealmServer.realm_name)
        forward_address = os.getenv('FORWARD_ADDRESS_OVERRIDE',
                                    config.Server.Connection.RealmProxy.host)
        address_bytes = PacketWriter.string_to_bytes(
            f'{forward_address}:{config.Server.Connection.RealmProxy.port}')

        # TODO: Should probably move realms to database at some point, instead of config.yml
        packet = pack(
            f'<B{len(name_bytes)}s{len(address_bytes)}sI',
            1,  # Number of realms
            name_bytes,
            address_bytes,
            # I assume this number is meant to show current online players since there is
            # no way of knowing the account yet when realmlist is requested in 0.5.3.
            WorldSessionStateHandler.get_process_shared_session_number())

        Logger.debug(f'[{sck.getpeername()[0]}] Sending realmlist...')
        sck.sendall(packet)