Ejemplo n.º 1
0
    def func(self):
        "Implement the command"
        caller = self.caller

        try:
            import_local_all()
            build_all(caller)
        except Exception, e:
            ostring = "Can't build world: %s" % e
            caller.msg(ostring)
            logger.log_tracemsg(ostring)
Ejemplo n.º 2
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())