Skip to content

Commit

Permalink
lang updates, mac/apple work, polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
efroemling committed Nov 7, 2023
1 parent 544e26f commit 0d2a9c1
Show file tree
Hide file tree
Showing 37 changed files with 404 additions and 127 deletions.
118 changes: 59 additions & 59 deletions .efrocachemap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 1.7.28 (build 21556, api 8, 2023-11-01)
### 1.7.28 (build 21570, api 8, 2023-11-07)

- Massively cleaned up code related to rendering and window systems (OpenGL,
SDL, etc). This code had been growing into a nasty tangle for 15 years
Expand Down Expand Up @@ -202,6 +202,9 @@
several hundred FPS, milliseconds per frame would drop to 0 which caused some
problems. Note that scenev1 will be remaining on milliseconds internally for
compatibility reasons. Scenev2 should move to microseconds though.
- The V2 account id for the signed in account is now available at
`ba*.app.plus.accounts.primary.accountid` (alongside some other existing
account info).

### 1.7.27 (build 21282, api 8, 2023-08-30)

Expand Down
47 changes: 24 additions & 23 deletions src/assets/ba_data/python/babase/_accountv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class AccountV2Subsystem:
"""

def __init__(self) -> None:
from babase._login import LoginAdapterGPGS

# Whether or not everything related to an initial login
# (or lack thereof) has completed. This includes things like
# workspace syncing. Completion of this is what flips the app
Expand All @@ -45,15 +47,7 @@ def __init__(self) -> None:
self._implicit_state_changed = False
self._can_do_auto_sign_in = True

if _babase.app.classic is None:
raise RuntimeError('Needs updating for no-classic case.')

if (
_babase.app.classic.platform == 'android'
and _babase.app.classic.subplatform == 'google'
):
from babase._login import LoginAdapterGPGS

if _babase.using_google_play_game_services():
self.login_adapters[LoginType.GPGS] = LoginAdapterGPGS()

def on_app_loading(self) -> None:
Expand All @@ -62,10 +56,6 @@ def on_app_loading(self) -> None:
for adapter in self.login_adapters.values():
adapter.on_app_loading()

def set_primary_credentials(self, credentials: str | None) -> None:
"""Set credentials for the primary app account."""
raise NotImplementedError('This should be overridden.')

def have_primary_credentials(self) -> bool:
"""Are credentials currently set for the primary app account?
Expand All @@ -80,10 +70,6 @@ def primary(self) -> AccountV2Handle | None:
"""The primary account for the app, or None if not logged in."""
return self.do_get_primary()

def do_get_primary(self) -> AccountV2Handle | None:
"""Internal - should be overridden by subclass."""
return None

def on_primary_account_changed(
self, account: AccountV2Handle | None
) -> None:
Expand Down Expand Up @@ -259,6 +245,14 @@ def on_cloud_connectivity_changed(self, connected: bool) -> None:
# We may want to auto-sign-in based on this new state.
self._update_auto_sign_in()

def do_get_primary(self) -> AccountV2Handle | None:
"""Internal - should be overridden by subclass."""
raise NotImplementedError('This should be overridden.')

def set_primary_credentials(self, credentials: str | None) -> None:
"""Set credentials for the primary app account."""
raise NotImplementedError('This should be overridden.')

def _update_auto_sign_in(self) -> None:
plus = _babase.app.plus
assert plus is not None
Expand Down Expand Up @@ -419,14 +413,21 @@ class AccountV2Handle:
used with some operations such as cloud messaging.
"""

def __init__(self) -> None:
self.tag = '?'
accountid: str
tag: str
workspacename: str | None
workspaceid: str | None
logins: dict[LoginType, str]

# def __init__(self) -> None:

# self.workspacename: str | None = None
# self.workspaceid: str | None = None

self.workspacename: str | None = None
self.workspaceid: str | None = None
# # Login types and their display-names associated with this account.
# self.logins: dict[LoginType, str] = {}

# Login types and their display-names associated with this account.
self.logins: dict[LoginType, str] = {}
# self.accountid: str =

def __enter__(self) -> None:
"""Support for "with" statement.
Expand Down
Loading

0 comments on commit 0d2a9c1

Please sign in to comment.