Пример #1
0
def get_unowned_maps() -> List[str]:
    """Return the list of local maps not owned by the current account.

    Category: Asset Functions
    """
    from ba import _store
    unowned_maps: Set[str] = set()
    if not _ba.app.headless_build:
        for map_section in _store.get_store_layout()['maps']:
            for mapitem in map_section['items']:
                if not _ba.get_purchased(mapitem):
                    m_info = _store.get_store_item(mapitem)
                    unowned_maps.add(m_info['map_type'].name)
    return sorted(unowned_maps)
Пример #2
0
def get_unowned_game_types() -> Set[Type[ba.GameActivity]]:
    """Return present game types not owned by the current account."""
    try:
        from ba import _store
        unowned_games: Set[Type[ba.GameActivity]] = set()
        if not _ba.app.headless_build:
            for section in _store.get_store_layout()['minigames']:
                for mname in section['items']:
                    if not _ba.get_purchased(mname):
                        m_info = _store.get_store_item(mname)
                        unowned_games.add(m_info['gametype'])
        return unowned_games
    except Exception:
        from ba import _error
        _error.print_exception('error calcing un-owned games')
        return set()