Exemple #1
0
def at_server_start():
    """
    This is called every time the server starts up, regardless of
    how it was shut down.
    """
    # reset settings
    from muddery.utils.game_settings import GAME_SETTINGS
    GAME_SETTINGS.reset()

    # reload local strings
    from muddery.utils.localized_strings_handler import LOCALIZED_STRINGS_HANDLER
    LOCALIZED_STRINGS_HANDLER.reload()

    # reset default locations
    from muddery.utils import builder
    builder.reset_default_locations()
    
    # clear dialogues
    from muddery.utils.dialogue_handler import DIALOGUE_HANDLER
    DIALOGUE_HANDLER.clear()
    
    # reload equipment types
    from muddery.utils.equip_type_handler import EQUIP_TYPE_HANDLER
    EQUIP_TYPE_HANDLER.reload()

    # localize model fields
    from muddery.utils.localiztion_handler import localize_model_fields
    localize_model_fields()
    
    # load condition descriptions
    from muddery.utils.desc_handler import DESC_HANDLER
    DESC_HANDLER.reload()
def at_server_start():
    """
    This is called every time the server starts up, regardless of
    how it was shut down.
    """
    # reset settings
    GAME_SETTINGS.reset()

    # reload keys
    OBJECT_KEY_HANDLER.reload()

    # reset default locations
    builder.reset_default_locations()
    
    # clear dialogues
    DIALOGUE_HANDLER.clear()

    # clear quest dependencies
    QUEST_DEP_HANDLER.clear()

    # reload equipment types
    EQUIP_TYPE_HANDLER.reload()

    # reload local strings
    LOCALIZED_STRINGS_HANDLER.reload()

    # localize model fields
    localize_model_fields()
Exemple #3
0
def at_server_start():
    """
    This is called every time the server starts up, regardless of
    how it was shut down.
    """
    # reset settings
    GAME_SETTINGS.reset()
    CLIENT_SETTINGS.reset()

    # reload keys
    OBJECT_KEY_HANDLER.reload()

    # reset default locations
    builder.reset_default_locations()

    # clear dialogues
    DIALOGUE_HANDLER.clear()

    # clear quest dependencies
    QUEST_DEP_HANDLER.clear()

    # reload equipment types
    EQUIP_TYPE_HANDLER.reload()

    # reload local strings
    LOCALIZED_STRINGS_HANDLER.reload()

    # localize model fields
    localize_model_fields()
def at_server_start():
    """
    This is called every time the server starts up, regardless of
    how it was shut down.
    """
    # reload keys
    OBJECT_KEY_HANDLER.reload()

    # reset default locations
    builder.reset_default_locations()
    
    # clear dialogues
    DIALOGUE_HANDLER.clear()

    # clear quest dependencies
    QUEST_DEP_HANDLER.clear()

    # reload equipment types
    EQUIP_TYPE_HANDLER.reload()

    # reload local strings
    LOCALIZED_STRINGS_HANDLER.reload()

    # reload skill modules
    MudderySkill.load_skill_modules()
Exemple #5
0
def at_initial_setup():
    """
    Build up the default world and set default locations.
    """

    try:
        # load world data
        import_local_data()
        print("Import local data.")

        # load game settings
        GAME_SETTINGS.reset()
        print("Reset game settings.")

        # build world
        builder.build_all()
        print("Builder build all.")

        # set limbo's desc
        limbo_obj = search.search_object("#2", exact=True)
        if limbo_obj:
            limbo_obj[0].db.desc = LIMBO_DESC
            limbo_obj[0].position = None
        print("Set limbo object.")

        # set default locations
        builder.reset_default_locations()
        print("Set default locations.")

        superuser = search.search_object("#1", exact=True)
        if superuser:
            superuser = superuser[0]

            # move the superuser to the start location
            start_location = search.search_object(settings.START_LOCATION,
                                                  exact=True)
            if start_location:
                start_location = start_location[0]
                superuser.move_to(start_location, quiet=True)

            # set superuser's data
            superuser.set_data_key(
                GAME_SETTINGS.get("default_player_character_key"))
            superuser.set_level(1)
            superuser.set_nickname("superuser")

            # set superuser's honour to -1
            HONOURS_MAPPER.set_honour(superuser, -1)

            print("Set supervisor.")

    except Exception, e:
        ostring = "Can't set initial data: %s" % e
        print(ostring)
        print(traceback.format_exc())
def at_server_start():
    """
    This is called every time the server starts up, regardless of
    how it was shut down.
    """
    # reset settings
    from muddery.utils.game_settings import GAME_SETTINGS
    GAME_SETTINGS.reset()

    # reload local strings
    from muddery.utils.localized_strings_handler import LOCALIZED_STRINGS_HANDLER
    LOCALIZED_STRINGS_HANDLER.reload()

    # reload attributes
    from muddery.utils.attributes_info_handler import CHARACTER_ATTRIBUTES_INFO
    CHARACTER_ATTRIBUTES_INFO.reload()

    from muddery.utils.attributes_info_handler import EQUIPMENT_ATTRIBUTES_INFO
    EQUIPMENT_ATTRIBUTES_INFO.reload()

    from muddery.utils.attributes_info_handler import FOOD_ATTRIBUTES_INFO
    FOOD_ATTRIBUTES_INFO.reload()

    # reset default locations
    from muddery.utils import builder
    builder.reset_default_locations()
    
    # clear dialogues
    from muddery.utils.dialogue_handler import DIALOGUE_HANDLER
    DIALOGUE_HANDLER.clear()
    
    # reload equipment types
    from muddery.utils.equip_type_handler import EQUIP_TYPE_HANDLER
    EQUIP_TYPE_HANDLER.reload()

    # localize model fields
    from muddery.utils.localiztion_handler import localize_model_fields
    localize_model_fields()

    # set character attribute field names
    CHARACTER_ATTRIBUTES_INFO.set_model_fields()
    EQUIPMENT_ATTRIBUTES_INFO.set_model_fields()
    FOOD_ATTRIBUTES_INFO.set_model_fields()
    
    # load condition descriptions
    from muddery.utils.desc_handler import DESC_HANDLER
    DESC_HANDLER.reload()
    
    # load honours
    from muddery.dao.honours_mapper import HONOURS_MAPPER
    HONOURS_MAPPER.reload()
def at_server_start():
    """
    This is called every time the server starts up, regardless of
    how it was shut down.
    """
    # reset settings
    from muddery.utils.game_settings import GAME_SETTINGS
    GAME_SETTINGS.reset()

    # reload local strings
    from muddery.utils.localized_strings_handler import LOCALIZED_STRINGS_HANDLER
    LOCALIZED_STRINGS_HANDLER.reload()

    # reload attributes
    from muddery.utils.attributes_info_handler import CHARACTER_ATTRIBUTES_INFO
    CHARACTER_ATTRIBUTES_INFO.reload()

    from muddery.utils.attributes_info_handler import EQUIPMENT_ATTRIBUTES_INFO
    EQUIPMENT_ATTRIBUTES_INFO.reload()

    from muddery.utils.attributes_info_handler import FOOD_ATTRIBUTES_INFO
    FOOD_ATTRIBUTES_INFO.reload()

    # reset default locations
    from muddery.utils import builder
    builder.reset_default_locations()

    # clear dialogues
    from muddery.utils.dialogue_handler import DIALOGUE_HANDLER
    DIALOGUE_HANDLER.clear()

    # reload equipment types
    from muddery.utils.equip_type_handler import EQUIP_TYPE_HANDLER
    EQUIP_TYPE_HANDLER.reload()

    # localize model fields
    from muddery.utils.localiztion_handler import localize_model_fields
    localize_model_fields()

    # set character attribute field names
    CHARACTER_ATTRIBUTES_INFO.set_model_fields()
    EQUIPMENT_ATTRIBUTES_INFO.set_model_fields()
    FOOD_ATTRIBUTES_INFO.set_model_fields()

    # load condition descriptions
    from muddery.utils.desc_handler import DESC_HANDLER
    DESC_HANDLER.reload()

    # load honours
    from muddery.dao.honours_mapper import HONOURS_MAPPER
    HONOURS_MAPPER.reload()
Exemple #8
0
def at_initial_setup():
    """
    Build up the default world and set default locations.
    """

    try:
        # load world data
        import_local_data()
        print("Import local data.")

        # load game settings
        GAME_SETTINGS.reset()
        print("Reset game settings.")

        # build world
        builder.build_all()
        print("Builder build all.")

        # set limbo's desc
        limbo_obj = search.search_object("#2", exact=True)
        if limbo_obj:
            limbo_obj[0].db.desc = LIMBO_DESC
            limbo_obj[0].position = None
        print("Set limbo object.")

        # set default locations
        builder.reset_default_locations()
        print("Set default locations.")

        superuser = search.search_object("#1", exact=True)
        if superuser:
            superuser = superuser[0]

            # move the superuser to the start location
            start_location = search.search_object(settings.START_LOCATION, exact=True)
            if start_location:
                start_location = start_location[0]
                superuser.move_to(start_location, quiet=True)

            # set superuser's data
            superuser.set_data_key(GAME_SETTINGS.get("default_player_character_key"))
            superuser.set_level(1)
            superuser.set_nickname("superuser")
            print("Set supervisor.")

    except Exception, e:
        ostring = "Can't set initial data: %s" % e
        print(ostring)
        print(traceback.format_exc())
Exemple #9
0
def at_initial_setup():
    """
    Build up the default world and set default locations.
    """

    try:
        # load world data
        importer.import_local_all()

        # load game settings
        GAME_SETTINGS.reset()
    	
        # reload skill modules
        MudderySkill.load_skill_modules()

        # build world
        builder.build_all()
        
        # set limbo's desc
        limbo_obj = search.search_object("#2", exact=True)
        if limbo_obj:
            limbo_obj[0].db.desc = LIMBO_DESC
            limbo_obj[0].position = None

        # set default locations
        builder.reset_default_locations()

        superuser = search.search_object("#1", exact=True)
        if superuser:
            superuser = superuser[0]

            # move the superuser to the start location
            start_location = search.search_object(settings.START_LOCATION, exact=True)
            if start_location:
                start_location = start_location[0]
                superuser.move_to(start_location, quiet=True)

            # set superuser's data
            superuser.set_data_key(GAME_SETTINGS.get("default_player_model_key"))
            superuser.set_level(1)
            superuser.set_nickname("superuser")

    except Exception, e:
        ostring = "Can't build world: %s" % e
        print(ostring)
        print(traceback.format_exc())
Exemple #10
0
def at_server_start():
    """
    This is called every time the server starts up, regardless of
    how it was shut down.
    """
    # reset settings
    GAME_SETTINGS.reset()

    # reload keys
    OBJECT_KEY_HANDLER.reload()

    # reload attributes
    CHARACTER_ATTRIBUTES_INFO.reload()
    EQUIPMENT_ATTRIBUTES_INFO.reload()
    FOOD_ATTRIBUTES_INFO.reload()

    # reset default locations
    builder.reset_default_locations()

    # clear dialogues
    DIALOGUE_HANDLER.clear()

    # clear quest dependencies
    QUEST_DEP_HANDLER.clear()

    # reload equipment types
    EQUIP_TYPE_HANDLER.reload()

    # reload local strings
    LOCALIZED_STRINGS_HANDLER.reload()

    # localize model fields
    localize_model_fields()

    # set character attribute field names
    CHARACTER_ATTRIBUTES_INFO.set_model_fields()
    EQUIPMENT_ATTRIBUTES_INFO.set_model_fields()
    FOOD_ATTRIBUTES_INFO.set_model_fields()

    # load condition descriptions
    DESC_HANDLER.reload()

    # load honours
    HONOURS_MAPPER.reload()
def at_initial_setup():
    """
    Build up the default world and set default locations.
    """

    try:
        # load world data
        importer.import_all()

        # reload skill modules
        MudderySkill.load_skill_modules()

        # build world
        builder.build_all()
        
        # set limbo's desc
        limbo_obj = search.search_object("#2", exact=True)
        if limbo_obj:
            limbo_obj[0].db.desc = LIMBO_DESC

        # set default locations
        builder.reset_default_locations()

        superuser = search.search_object("#1", exact=True)
        if superuser:
            superuser = superuser[0]

            # move the superuser to the start location
            start_location = search.search_object(settings.START_LOCATION, exact=True)
            if start_location:
                start_location = start_location[0]
                superuser.move_to(start_location, quiet=True)

            # set superuser's data
            superuser.set_data_key(settings.DEFAULT_PLAYER_CHARACTER_KEY)
            superuser.set_level(1)
            superuser.set_nickname("superuser")

    except Exception, e:
        ostring = "Can't build world: %s" % e
        print(ostring)
        print(traceback.format_exc())
Exemple #12
0
def at_initial_setup():
    """
    Build up the default world and set default locations.
    """

    try:
        # load world data
        importer.import_all()

        # build world
        builder.build_all()

        # set limbo's desc
        limbo_obj = search.search_object("#2", exact=True)
        if limbo_obj:
            limbo_obj[0].db.desc = LIMBO_DESC

        # set default locations
        builder.reset_default_locations()

        superuser = search.search_object("#1", exact=True)
        if superuser:
            superuser = superuser[0]

            # move the superuser to the start location
            start_location = search.search_object(settings.START_LOCATION,
                                                  exact=True)
            if start_location:
                start_location = start_location[0]
                superuser.move_to(start_location)

            # set superuser's data
            superuser.set_data_info(settings.DEFAULT_PLAYER_CHARACTER_KEY)
            superuser.set_level(1)

    except Exception, e:
        ostring = "Can't build world: %s" % e
        print ostring
        print traceback.format_exc()