updated server switch

This commit is contained in:
Ayush Saini 2023-07-08 15:21:36 +05:30
parent 7f0fd37dde
commit c2832136aa
8 changed files with 352 additions and 870 deletions

View file

@ -4,23 +4,8 @@ import _baplus
import babase
def is_game_version_lower_than(version):
"""
Returns a boolean value indicating whether the current game
version is lower than the passed version. Useful for addressing
any breaking changes within game versions.
"""
game_version = tuple(map(int, babase.app.version.split(".")))
version = tuple(map(int, version.split(".")))
return game_version < version
if is_game_version_lower_than("1.7.20"):
original_get_purchased = _baplus.get_purchased
else:
assert bs.app.plus is not None
original_get_purchased = bs.app.plus.get_purchased
original_get_purchased = _baplus.get_purchased
def get_purchased(item):
if item.startswith('characters.') or item.startswith('icons.'):
@ -32,8 +17,5 @@ def get_purchased(item):
class Unlock(babase.Plugin):
def on_app_running(self):
babase.app.classic.accounts.have_pro = lambda: True
if is_game_version_lower_than("1.7.20"):
_baplus.get_purchased = get_purchased
else:
assert bs.app.plus is not None
bs.app.plus.get_purchased = get_purchased
_baplus.get_purchased = get_purchased