Ejemplo n.º 1
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()

    # reload skill modules
    MudderySkill.load_skill_modules()
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
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())
Ejemplo n.º 4
0
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())