Example #1
0
def load_player(player_uuid):
    return storage.load_file(config.path.player_file_pattern % convert.uuid_to_base32(player_uuid), entity.new_mobile)
Example #2
0
def player_name_exists(player_name):
    for filename in os.listdir(config.path.player_dir):
        p = storage.load_file(os.path.join(config.path.player_dir, filename), entity.new_mobile)
        if p.name == player_name:
            return True
    return False
Example #3
0
def load_universe(path):
    """
    Load the Universe data stored at the given path.
    """
    return storage.load_file(path, universe.Universe)
Example #4
0
def load_user(user_uuid):
    return storage.load_file(config.path.user_file_pattern % convert.uuid_to_base32(user_uuid), User)
Example #5
0
 def test_load_file(self):
     obj = storage.load_file(self.path1, Obj)
     self.assertTrue(isinstance(obj, Obj))
     obj.load_data.assert_called_once_with(self.d1)