Skip to content

Commit

Permalink
Merge pull request #158 from DhextraS/main
Browse files Browse the repository at this point in the history
Update server_switch, pro_unlocker  to Api 8
  • Loading branch information
imayushsaini authored Jul 12, 2023
2 parents 3b6441b + bae5ca9 commit 038e47a
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 578 deletions.
12 changes: 12 additions & 0 deletions plugins/utilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@
}
],
"versions": {
"2.0.0": {
"api_version": 8,
"commit_sha": "a18a595",
"released_on": "08-07-2023",
"md5sum": "30a21cb1c739b098dcaa791e4a2cd481"
},
"1.0.1": {
"api_version": 7,
"commit_sha": "64e8a5c",
Expand Down Expand Up @@ -516,6 +522,12 @@
}
],
"versions": {
"2.0.0": {
"api_version": 8,
"commit_sha": "a18a595",
"released_on": "08-07-2023",
"md5sum": "7403fcea1855ddf561aa412d703fcc6e"
},
"1.0.0": {
"api_version": 7,
"commit_sha": "41e239c",
Expand Down
32 changes: 8 additions & 24 deletions plugins/utilities/pro_unlocker.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
# ba_meta require api 7
import _ba
import ba
# ba_meta require api 8
import bascenev1 as bs
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, ba.app.version.split(".")))
version = tuple(map(int, version.split(".")))
return game_version < version


if is_game_version_lower_than("1.7.7"):
original_get_purchased = _ba.get_purchased
else:
original_get_purchased = ba.internal.get_purchased
original_get_purchased = _baplus.get_purchased


def get_purchased(item):
Expand All @@ -27,10 +14,7 @@ def get_purchased(item):


# ba_meta export plugin
class Unlock(ba.Plugin):
class Unlock(babase.Plugin):
def on_app_running(self):
ba.app.accounts_v1.have_pro = lambda: True
if is_game_version_lower_than("1.7.7"):
_ba.get_purchased = get_purchased
else:
ba.internal.get_purchased = get_purchased
babase.app.classic.accounts.have_pro = lambda: True
_baplus.get_purchased = get_purchased
Loading

0 comments on commit 038e47a

Please sign in to comment.