closing in on mac app store update finally

This commit is contained in:
Eric 2023-11-09 12:59:19 -08:00
parent 0d2a9c19b5
commit 310660403b
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
27 changed files with 373 additions and 217 deletions

116
.efrocachemap generated
View File

@ -421,41 +421,41 @@
"build/assets/ba_data/audio/zoeOw.ogg": "74befe45a8417e95b6a2233c51992a26",
"build/assets/ba_data/audio/zoePickup01.ogg": "48ab8cddfcde36a750856f3f81dd20c8",
"build/assets/ba_data/audio/zoeScream01.ogg": "2b468aedfa8741090247f04eb9e6df55",
"build/assets/ba_data/data/langdata.json": "d3d2ff5c566f5ebbfd4c2cb838bddec8",
"build/assets/ba_data/data/languages/arabic.json": "cb5ad1bc4ce57a43902ef2f8770d3721",
"build/assets/ba_data/data/languages/belarussian.json": "4d89ed5f9c615771d4fa2bb1834942d3",
"build/assets/ba_data/data/langdata.json": "dca47b4976752e76e852f7a4be2c7aa3",
"build/assets/ba_data/data/languages/arabic.json": "e0001d8542c904bc3c98a174f256efd9",
"build/assets/ba_data/data/languages/belarussian.json": "7fe38341815ca6ff4d95224196e7a67e",
"build/assets/ba_data/data/languages/chinese.json": "a87b1ebef100d9cdce0d29123735e90c",
"build/assets/ba_data/data/languages/chinesetraditional.json": "f858da49be0a5374157c627857751078",
"build/assets/ba_data/data/languages/croatian.json": "766532c67af5bd0144c2d63cab0516fa",
"build/assets/ba_data/data/languages/czech.json": "93c5fe0d884d95435da6c675f64e30e0",
"build/assets/ba_data/data/languages/danish.json": "3fd69080783d5c9dcc0af737f02b6f1e",
"build/assets/ba_data/data/languages/dutch.json": "22b44a33bf81142ba2befad14eb5746e",
"build/assets/ba_data/data/languages/english.json": "0e84003f1d3ebf3d48e00ec962c96de4",
"build/assets/ba_data/data/languages/english.json": "2fa464db3fe6bffa16a50c18dfbdc1a6",
"build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880",
"build/assets/ba_data/data/languages/filipino.json": "afbda3adf14555e1567ee63c32e340e7",
"build/assets/ba_data/data/languages/french.json": "49ff6d211537b8003b8241438dca661d",
"build/assets/ba_data/data/languages/german.json": "450fa41ae264f29a5d1af22143d0d0ad",
"build/assets/ba_data/data/languages/gibberish.json": "efcc8b133365c9080f99decb75acde02",
"build/assets/ba_data/data/languages/gibberish.json": "1ade258922bcee1544c9c6015eeb8324",
"build/assets/ba_data/data/languages/greek.json": "287c0ec437b38772284ef9d3e4fb2fc3",
"build/assets/ba_data/data/languages/hindi.json": "8ea0c58a44a24edb131d0e53b074d1f6",
"build/assets/ba_data/data/languages/hungarian.json": "796a290a8c44a1e7635208c2ff5fdc6e",
"build/assets/ba_data/data/languages/indonesian.json": "d7e06971ae1df89ac070593d6ca5cd10",
"build/assets/ba_data/data/languages/italian.json": "840a44facc3f203be505e97ce517e008",
"build/assets/ba_data/data/languages/indonesian.json": "ba39cade3c965b2ddbee122880b6f0db",
"build/assets/ba_data/data/languages/italian.json": "b19a9f0b868a6c89e13a04609bf377dd",
"build/assets/ba_data/data/languages/korean.json": "ca1122a9ee551da3f75ae632012bd0e2",
"build/assets/ba_data/data/languages/malay.json": "832562ce997fc70704b9234c95fb2e38",
"build/assets/ba_data/data/languages/persian.json": "07162e160abd7452d1b25d069425653b",
"build/assets/ba_data/data/languages/polish.json": "5e25428554893155a5f81f3eeb418bae",
"build/assets/ba_data/data/languages/portuguese.json": "a1af6ebf382969cbe16083fbfdb445da",
"build/assets/ba_data/data/languages/persian.json": "89f5c6f900317aaa20ec520e5fd65d32",
"build/assets/ba_data/data/languages/polish.json": "8bb8f7baa5efcf6cdd627140d209c2b2",
"build/assets/ba_data/data/languages/portuguese.json": "7374b6a5cadcf573ee4ab4a5b4bc8c0a",
"build/assets/ba_data/data/languages/romanian.json": "aeebdd54f65939c2facc6ac50c117826",
"build/assets/ba_data/data/languages/russian.json": "a88a107d9643084ecec41649c1d6300e",
"build/assets/ba_data/data/languages/russian.json": "9e068a3afdec43b207c83aedfb812e82",
"build/assets/ba_data/data/languages/serbian.json": "d7452dd72ac0e51680cb39b5ebaa1c69",
"build/assets/ba_data/data/languages/slovak.json": "27962d53dc3f7dd4e877cd40faafeeef",
"build/assets/ba_data/data/languages/spanish.json": "af2d0fd078144dc649da0bb10bb1f5cd",
"build/assets/ba_data/data/languages/swedish.json": "77d671f10613291ebf9c71da66f18a18",
"build/assets/ba_data/data/languages/spanish.json": "0fca8361c6873e6445f0bea34a211b78",
"build/assets/ba_data/data/languages/swedish.json": "5142a96597d17d8344be96a603da64ac",
"build/assets/ba_data/data/languages/tamil.json": "b4de1a2851afe4869c82e9acd94cd89c",
"build/assets/ba_data/data/languages/thai.json": "33f63753c9af9a5b238d229a0bf23fbc",
"build/assets/ba_data/data/languages/turkish.json": "c3674336e746bf7b23617a6ff296c69a",
"build/assets/ba_data/data/languages/ukrainian.json": "f72eb51abfbbb56e27866895d7e947d2",
"build/assets/ba_data/data/languages/ukrainian.json": "e5c861187c4c6db37d1a033f4ef3dd5a",
"build/assets/ba_data/data/languages/venetian.json": "9fe1a58d9e5dfb00f31ce3b2eb9993f4",
"build/assets/ba_data/data/languages/vietnamese.json": "921cd1e50f60fe3e101f246e172750ba",
"build/assets/ba_data/data/maps/big_g.json": "1dd301d490643088a435ce75df971054",
@ -4056,50 +4056,50 @@
"build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1",
"build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae",
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "19845a4215bc313b1a4dd9d69942265a",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "40617b9787763afac039ad0d4fc6eadd",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "f824e95be076fe725529fade8e67c7bf",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b9fc05ff4ea772b67d13e4fa502d7e96",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "94ab7152a2e807a0a5a86f15fa994ef1",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "2b8826ec31f972d3695f3cc764c2d948",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "e4c860d74e777557c7450ad2768397a3",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "95aadd6ff910cc97d713d89e7b4b7204",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "f9716cc12cd895de300a0e2f4081d26c",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "27b743836b3026b1188fbc61e88ac63f",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "33fded513bdfc0a71e58c29f5f491b2e",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "71c7005881cff6ff7746d5727c2707a5",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "ee418012d124c7f3268e9f533a865d74",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "8653169242b6f5b1fdb3649585da37ed",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "d02f8dd537b65dcd1580f97dc215a2f4",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "7da065b3e1a360df7bc0f0b047e26a8d",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "8845c707fa5c004f33b84e6515d7de27",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "91cfbdc3c4ed14bb7febd1ebee73a652",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "34fb266dcb2900931232fc4807d646ad",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "7820f6e29bf5f06ca395ca0e939bb24c",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "542350a6380ee39396048bf7e311492e",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "55e5254a8d2b7a57a70daf0e49c9f3de",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "542350a6380ee39396048bf7e311492e",
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "55e5254a8d2b7a57a70daf0e49c9f3de",
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "e5f96639a0806a7c6a7e76c3c602d71e",
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "aa334ef3a0b9883c64a979abfac03614",
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "e5f96639a0806a7c6a7e76c3c602d71e",
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "aa334ef3a0b9883c64a979abfac03614",
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "d8e77274adbd49f54cb0ae10932a1cd4",
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "00d78e3bd28bb2d151f6b2dabb28bf6b",
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "d8e77274adbd49f54cb0ae10932a1cd4",
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "00d78e3bd28bb2d151f6b2dabb28bf6b",
"build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "7062c43dfcb22a4dab751d4d63a77bcc",
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d5d54553e6069cb258bc2aee960de714",
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "aad9457aaa3f0d12be511fcec6168090",
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d5d54553e6069cb258bc2aee960de714",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "ab4eae4c6dff6e748e67017d21f1e8c8",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "f5eac099166269081a9ba49b354979d5",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "52ae423620dede6bfd35face89277298",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "0fa3164cb9bedac84418c5223b1c8b05",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "b4051c8e3eca5a9d2b1d1fd613c0e563",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "0a3fed54d59a681df074d56c3dc76268",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "42f69e30b6cf087bbc01fa5e508f1e6c",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "08d7f5d30a2c84e2f325d51f08e0611a",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "64292918215b9d3e6fc3d470db4c92b1",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "84c840b57ed000407a8b34e9c5015b54",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "bc6fc246d6e0551a18f161183ee89ad5",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "bc87c32aee50fbc67ca0531c536e7f10",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "bcf55f1a1e8e317dc355ebf2ea301d10",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "0ad6f5cea06d4c0754d1763610c7be90",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "2c1c99e0850749741e23e5db7fb45b22",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "960dee8cee9d2fe500629583668eee14",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "1eb609e4f8ba0cf740d9c7b8cbbbf4d3",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "80418b80ad17e283a65b85142b0b490d",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "1527e8235b808c6bdf5f2850875d1843",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "0e8c85459f90cc0a1355aecad5b5306e",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "6c718c797dfaf2b85ce7bd5d6c7f9d8a",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "5eefb534d193a9fa06b413a9d5a05969",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "2dedf11d5e4ffa9ec02eb6025a9b3460",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "3a3075f5f28cbfe9cd302e9c371b9ed4",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "275342bb44f1f5edde893a9775eb0130",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "4866c1b244b493b99da24aa1bc965bb7",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "c2181a4564b675762f89e2bc3314332f",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "ac4a176d550b219aa3cb1f46ad738a66",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "f812111f1eb4ea76e99558305ce3980f",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "c16c1b360b27850f1ac4d3dc55194b0a",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "f812111f1eb4ea76e99558305ce3980f",
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "c16c1b360b27850f1ac4d3dc55194b0a",
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "473c84d44b472d3ae73df6a2f1b56839",
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "970c415cbb7a3087a163fa6e96e634a1",
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "473c84d44b472d3ae73df6a2f1b56839",
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "970c415cbb7a3087a163fa6e96e634a1",
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "86498db547380838a1c95b45ef17d28b",
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "bf11ae92718ae3dd5116d623799dd27f",
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "86498db547380838a1c95b45ef17d28b",
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "bf11ae92718ae3dd5116d623799dd27f",
"build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "147c5a5210a55978060381cc44a122db",
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "380d456bc409849174a36c5d2f61aa1b",
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "4fae9b286a6d1c5c729c49c483c1422a",
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "380d456bc409849174a36c5d2f61aa1b",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "5bee4eaf62c401c65c94513eb3ac18fd",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "69438fa6a8c70381f355ff3fb94c5a13",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "ad27b9e1e63733ba10c34ae5fd8246df",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "5b1b8ac6e3022b633477c3989957fa81",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "d2364a2d49ba3268691fb7e1134c9359",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "a6436bf9a9fb5531b837d9be20c2834b",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "a502732d3df4e7ff6b5086cb1f9bbb08",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "5470de767289dca9b88678e69a1ecca4",
"src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c",
"src/assets/ba_data/python/babase/_mgen/enums.py": "28323912b56ec07701eda3d41a6a4101",
"src/ballistica/base/mgen/pyembed/binding_base.inc": "72bfed2cce8ff19741989dec28302f3f",

View File

@ -1,4 +1,4 @@
### 1.7.28 (build 21570, api 8, 2023-11-07)
### 1.7.28 (build 21578, api 8, 2023-11-09)
- 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

View File

@ -103,6 +103,7 @@ ctx.src_unchecked_paths = {
'ballisticakit-xcode/BallisticaKit Shared/Assets.xcassets/*/*.png',
'ballisticakit-xcode/BallisticaKit Shared/Assets.xcassets/*/*/*.png',
'ballisticakit-xcode/BallisticaKit Shared/Assets.xcassets/*/*/*/*/*.png',
'ballisticakit-xcode/BallisticaKit.xcodeproj/xcuserdata',
'ballisticakit-android/BallisticaKit/src/*/res/*/*.png',
'ballisticakit-android/BallisticaKit/src/*/assets/ballistica_files',
'ballisticakit-android/local.properties',

View File

@ -31,7 +31,7 @@ class AccountV2Subsystem:
"""
def __init__(self) -> None:
from babase._login import LoginAdapterGPGS
from babase._login import LoginAdapterGPGS, LoginAdapterGameCenter
# Whether or not everything related to an initial login
# (or lack thereof) has completed. This includes things like
@ -47,8 +47,13 @@ class AccountV2Subsystem:
self._implicit_state_changed = False
self._can_do_auto_sign_in = True
adapter: LoginAdapter
if _babase.using_google_play_game_services():
self.login_adapters[LoginType.GPGS] = LoginAdapterGPGS()
adapter = LoginAdapterGPGS()
self.login_adapters[adapter.login_type] = adapter
if _babase.using_game_center():
adapter = LoginAdapterGameCenter()
self.login_adapters[adapter.login_type] = adapter
def on_app_loading(self) -> None:
"""Should be called at standard on_app_loading time."""
@ -128,6 +133,8 @@ class AccountV2Subsystem:
"""An implicit sign-in happened (called by native layer)."""
from babase._login import LoginAdapter
assert _babase.in_logic_thread()
with _babase.ContextRef.empty():
self.login_adapters[login_type].set_implicit_login_state(
LoginAdapter.ImplicitLoginState(
@ -137,6 +144,7 @@ class AccountV2Subsystem:
def on_implicit_sign_out(self, login_type: LoginType) -> None:
"""An implicit sign-out happened (called by native layer)."""
assert _babase.in_logic_thread()
with _babase.ContextRef.empty():
self.login_adapters[login_type].set_implicit_login_state(None)
@ -260,7 +268,7 @@ class AccountV2Subsystem:
# If implicit state has changed, try to respond.
if self._implicit_state_changed:
if self._implicit_signed_in_adapter is None:
# If implicit back-end is signed out, follow suit
# If implicit back-end has signed out, we follow suit
# immediately; no need to wait for network connectivity.
if DEBUG_LOG:
logging.debug(

View File

@ -3,6 +3,7 @@
"""Dev-Console functionality."""
from __future__ import annotations
import os
from typing import TYPE_CHECKING
from dataclasses import dataclass
import logging
@ -154,9 +155,10 @@ class DevConsoleSubsystem:
# All tabs in the dev-console. Add your own stuff here via
# plugins or whatnot.
self.tabs: list[DevConsoleTabEntry] = [
DevConsoleTabEntry('Python', DevConsoleTabPython),
DevConsoleTabEntry('Test', DevConsoleTabTest),
DevConsoleTabEntry('Python', DevConsoleTabPython)
]
if os.environ.get('BA_DEV_CONSOLE_TEST_TAB', '0') == '1':
self.tabs.append(DevConsoleTabEntry('Test', DevConsoleTabTest))
self.is_refreshing = False
def do_refresh_tab(self, tabname: str) -> None:

View File

@ -337,6 +337,7 @@ def implicit_sign_in(
from bacommon.login import LoginType
assert _babase.app.plus is not None
_babase.app.plus.accounts.on_implicit_sign_in(
login_type=LoginType(login_type_str),
login_id=login_id,

View File

@ -17,7 +17,7 @@ if TYPE_CHECKING:
from typing import Callable
DEBUG_LOG = False
DEBUG_LOG = True
class LoginAdapter:
@ -149,7 +149,7 @@ class LoginAdapter:
result_cb: Callable[[LoginAdapter, SignInResult | Exception], None],
description: str,
) -> None:
"""Attempt an explicit sign in via this adapter.
"""Attempt to sign in via this adapter.
This can be called even if the back-end is not implicitly signed in;
the adapter will attempt to sign in if possible. An exception will
@ -161,7 +161,7 @@ class LoginAdapter:
# Have been seeing multiple sign-in attempts come through
# nearly simultaneously which can be problematic server-side.
# Let's error if a sign-in attempt is made within a few seconds
# of the last one to address this.
# of the last one to try and address this.
now = time.monotonic()
appnow = _babase.apptime()
if self._last_sign_in_time is not None:
@ -229,6 +229,7 @@ class LoginAdapter:
def _got_sign_in_response(
response: bacommon.cloud.SignInResponse | Exception,
) -> None:
# This likely means we couldn't communicate with the server.
if isinstance(response, Exception):
if DEBUG_LOG:
logging.debug(
@ -239,20 +240,18 @@ class LoginAdapter:
)
_babase.pushcall(Call(result_cb, self, response))
else:
if DEBUG_LOG:
logging.debug(
'LoginAdapter: %s adapter got successful'
' sign-in response',
self.login_type.name,
)
# This means our credentials were explicitly rejected.
if response.credentials is None:
result2: LoginAdapter.SignInResult | Exception = (
RuntimeError(
'No credentials returned after'
' submitting sign-in-token.'
)
RuntimeError('Sign-in-token was rejected.')
)
else:
if DEBUG_LOG:
logging.debug(
'LoginAdapter: %s adapter got successful'
' sign-in response',
self.login_type.name,
)
result2 = self.SignInResult(
credentials=response.credentials
)
@ -269,7 +268,7 @@ class LoginAdapter:
on_response=_got_sign_in_response,
)
# Kick off the process by fetching a sign-in token.
# Kick off the sign-in process by fetching a sign-in token.
self.get_sign_in_token(completion_cb=_got_sign_in_token_result)
def is_back_end_active(self) -> bool:
@ -282,11 +281,10 @@ class LoginAdapter:
"""Get a sign-in token from the adapter back end.
This token is then passed to the master-server to complete the
login process.
The adapter can use this opportunity to bring up account creation
UI, call its internal sign_in function, etc. as needed.
The provided completion_cb should then be called with either a token
or None if sign in failed or was cancelled.
sign-in process. The adapter can use this opportunity to bring
up account creation UI, call its internal sign_in function, etc.
as needed. The provided completion_cb should then be called with
either a token or None if sign in failed or was cancelled.
"""
from babase._general import Call
@ -378,3 +376,10 @@ class LoginAdapterGPGS(LoginAdapterNative):
def __init__(self) -> None:
super().__init__(LoginType.GPGS)
class LoginAdapterGameCenter(LoginAdapterNative):
"""Apple Game Center adapter."""
def __init__(self) -> None:
super().__init__(LoginType.GAME_CENTER)

View File

@ -52,7 +52,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 21570
TARGET_BALLISTICA_BUILD = 21578
TARGET_BALLISTICA_VERSION = '1.7.28'

View File

@ -64,12 +64,13 @@ class AccountSettingsWindow(bui.Window):
)
# Currently we can only reset achievements on game-center.
v1_account_type: str | None
if self._v1_signed_in:
v1_account_type = plus.get_v1_account_type()
else:
v1_account_type = None
self._can_reset_achievements = v1_account_type == 'Game Center'
# v1_account_type: str | None
# if self._v1_signed_in:
# v1_account_type = plus.get_v1_account_type()
# else:
# v1_account_type = None
# self._can_reset_achievements = v1_account_type == 'Game Center'
self._can_reset_achievements = False
app = bui.app
assert app.classic is not None
@ -98,6 +99,9 @@ class AccountSettingsWindow(bui.Window):
if LoginType.GPGS in plus.accounts.login_adapters:
self._show_sign_in_buttons.append('Google Play')
if LoginType.GAME_CENTER in plus.accounts.login_adapters:
self._show_sign_in_buttons.append('Game Center')
# Always want to show our web-based v2 login option.
self._show_sign_in_buttons.append('V2Proxy')
@ -242,6 +246,16 @@ class AccountSettingsWindow(bui.Window):
False if gpgs_adapter is None else gpgs_adapter.is_back_end_active()
)
# Ditto for Game Center.
game_center_adapter = plus.accounts.login_adapters.get(
LoginType.GAME_CENTER
)
is_game_center = (
False
if game_center_adapter is None
else game_center_adapter.is_back_end_active()
)
show_signed_in_as = self._v1_signed_in
signed_in_as_space = 95.0
@ -258,6 +272,11 @@ class AccountSettingsWindow(bui.Window):
and self._signing_in_adapter is None
and 'Google Play' in self._show_sign_in_buttons
)
show_game_center_sign_in_button = (
v1_state == 'signed_out'
and self._signing_in_adapter is None
and 'Game Center' in self._show_sign_in_buttons
)
show_v2_proxy_sign_in_button = (
v1_state == 'signed_out'
and self._signing_in_adapter is None
@ -281,11 +300,9 @@ class AccountSettingsWindow(bui.Window):
show_linked_accounts_text = self._v1_signed_in
linked_accounts_text_space = 60.0
show_achievements_button = self._v1_signed_in and v1_account_type in (
'Google Play',
'Local',
'V2',
)
# Always show achievements except in the game-center case where
# its unified UI covers them.
show_achievements_button = self._v1_signed_in and not is_game_center
achievements_button_space = 60.0
show_achievements_text = (
@ -353,6 +370,8 @@ class AccountSettingsWindow(bui.Window):
self._sub_height += signing_in_text_space
if show_google_play_sign_in_button:
self._sub_height += sign_in_button_space
if show_game_center_sign_in_button:
self._sub_height += sign_in_button_space
if show_v2_proxy_sign_in_button:
self._sub_height += sign_in_button_space
if show_device_sign_in_button:
@ -477,22 +496,6 @@ class AccountSettingsWindow(bui.Window):
if show_sign_in_benefits:
v -= sign_in_benefits_space
app = bui.app
assert app.classic is not None
extra: str | bui.Lstr | None
if (
app.classic.platform in ['mac', 'ios']
and app.classic.subplatform == 'appstore'
):
extra = bui.Lstr(
value='\n${S}',
subs=[
('${S}', bui.Lstr(resource='signInWithGameCenterText'))
],
)
else:
extra = ''
bui.textwidget(
parent=self._subcontainer,
position=(
@ -500,16 +503,7 @@ class AccountSettingsWindow(bui.Window):
v + sign_in_benefits_space * 0.4,
),
size=(0, 0),
text=bui.Lstr(
value='${A}${B}',
subs=[
(
'${A}',
bui.Lstr(resource=self._r + '.signInInfoText'),
),
('${B}', extra),
],
),
text=bui.Lstr(resource=self._r + '.signInInfoText'),
max_height=sign_in_benefits_space * 0.9,
scale=0.9,
color=(0.75, 0.7, 0.8),
@ -554,7 +548,13 @@ class AccountSettingsWindow(bui.Window):
(
'${B}',
bui.Lstr(
resource=self._r + '.signInWithGooglePlayText'
resource=self._r + '.signInWithText',
subs=[
(
'${SERVICE}',
bui.Lstr(resource='googlePlayText'),
)
],
),
),
],
@ -572,6 +572,45 @@ class AccountSettingsWindow(bui.Window):
bui.widget(edit=btn, show_buffer_bottom=40, show_buffer_top=100)
self._sign_in_text = None
if show_game_center_sign_in_button:
button_width = 350
v -= sign_in_button_space
self._sign_in_google_play_button = btn = bui.buttonwidget(
parent=self._subcontainer,
position=((self._sub_width - button_width) * 0.5, v - 20),
autoselect=True,
size=(button_width, 60),
label=bui.Lstr(
value='${A}${B}',
subs=[
(
'${A}',
bui.charstr(bui.SpecialChar.GAME_CENTER_LOGO),
),
(
'${B}',
bui.Lstr(
resource=self._r + '.signInWithText',
subs=[('${SERVICE}', 'Game Center')],
),
),
],
),
on_activate_call=lambda: self._sign_in_press(
LoginType.GAME_CENTER
),
)
if first_selectable is None:
first_selectable = btn
if bui.app.ui_v1.use_toolbars:
bui.widget(
edit=btn,
right_widget=bui.get_special_widget('party_button'),
)
bui.widget(edit=btn, left_widget=bbtn)
bui.widget(edit=btn, show_buffer_bottom=40, show_buffer_top=100)
self._sign_in_text = None
if show_v2_proxy_sign_in_button:
button_width = 350
v -= sign_in_button_space
@ -748,7 +787,11 @@ class AccountSettingsWindow(bui.Window):
v -= game_service_button_space * 0.85
v1_account_type = plus.get_v1_account_type()
if v1_account_type == 'Game Center':
v1_account_type_name = bui.Lstr(resource='gameCenterText')
# Update: Apparently Game Center is just called 'Game Center'
# in all languages. Can revisit if not true.
# https://developer.apple.com/forums/thread/725779
v1_account_type_name = bui.Lstr(value='Game Center')
# v1_account_type_name = bui.Lstr(resource='gameCenterText')
else:
raise ValueError(
"unknown account type: '" + str(v1_account_type) + "'"
@ -1469,8 +1512,11 @@ class AccountSettingsWindow(bui.Window):
if isinstance(result, Exception):
# For now just make a bit of noise if anything went wrong;
# can get more specific as needed later.
logging.warning('Got error in v2 sign-in result: %s.', result)
bui.screenmessage(bui.Lstr(resource='errorText'), color=(1, 0, 0))
logging.warning('Got error in v2 sign-in result: %s', result)
bui.screenmessage(
bui.Lstr(resource='internal.signInNoConnectionText'),
color=(1, 0, 0),
)
bui.getsound('error').play()
else:
# Success! Plug in these credentials which will begin

View File

@ -807,6 +807,8 @@ class AdvancedSettingsWindow(bui.Window):
sel_name = 'ModdingGuide'
elif sel == self._language_inform_checkbox:
sel_name = 'LangInform'
elif sel == self._show_dev_console_button_check_box.widget:
sel_name = 'ShowDevConsole'
else:
raise ValueError(f'unrecognized selection \'{sel}\'')
elif sel == self._back_button:
@ -870,6 +872,8 @@ class AdvancedSettingsWindow(bui.Window):
sel = self._modding_guide_button
elif sel_name == 'LangInform':
sel = self._language_inform_checkbox
elif sel_name == 'ShowDevConsole':
sel = self._show_dev_console_button_check_box.widget
else:
sel = None
if sel is not None:

View File

@ -48,7 +48,7 @@ auto AppAdapterApple::ManagesMainThreadEventLoop() const -> bool {
void AppAdapterApple::DoPushMainThreadRunnable(Runnable* runnable) {
// Kick this along to swift.
BallisticaKit::FromCpp::PushRawRunnableToMain(runnable);
BallisticaKit::FromCpp::pushRawRunnableToMain(runnable);
}
void AppAdapterApple::OnMainThreadStartApp() {
@ -56,6 +56,9 @@ void AppAdapterApple::OnMainThreadStartApp() {
#if BA_USE_STORE_KIT
BallisticaKit::StoreKitContext::onAppStart();
#endif
#if BA_USE_GAME_CENTER
BallisticaKit::GameCenterContext::onAppStart();
#endif
}
void AppAdapterApple::DoApplyAppConfig() { assert(g_base->InLogicThread()); }
@ -196,13 +199,13 @@ void AppAdapterApple::SetHardwareCursorVisible(bool visible) {
assert(g_core->InMainThread());
#if BA_OSTYPE_MACOS
BallisticaKit::CocoaFromCpp::SetCursorVisible(visible);
BallisticaKit::CocoaFromCpp::setCursorVisible(visible);
#endif
}
void AppAdapterApple::TerminateApp() {
#if BA_OSTYPE_MACOS
BallisticaKit::CocoaFromCpp::TerminateApp();
BallisticaKit::CocoaFromCpp::terminateApp();
#else
AppAdapter::TerminateApp();
#endif
@ -219,7 +222,7 @@ auto AppAdapterApple::FullscreenControlAvailable() const -> bool {
auto AppAdapterApple::FullscreenControlGet() const -> bool {
#if BA_OSTYPE_MACOS
return BallisticaKit::CocoaFromCpp::GetMainWindowIsFullscreen();
return BallisticaKit::CocoaFromCpp::getMainWindowIsFullscreen();
#else
return false;
#endif
@ -227,7 +230,7 @@ auto AppAdapterApple::FullscreenControlGet() const -> bool {
void AppAdapterApple::FullscreenControlSet(bool fullscreen) {
#if BA_OSTYPE_MACOS
return BallisticaKit::CocoaFromCpp::SetMainWindowFullscreen(fullscreen);
return BallisticaKit::CocoaFromCpp::setMainWindowFullscreen(fullscreen);
#endif
}
@ -240,7 +243,7 @@ auto AppAdapterApple::HasDirectKeyboardInput() -> bool { return true; };
auto AppAdapterApple::GetKeyRepeatDelay() -> float {
#if BA_OSTYPE_MACOS
return BallisticaKit::CocoaFromCpp::GetKeyRepeatDelay();
return BallisticaKit::CocoaFromCpp::getKeyRepeatDelay();
#else
return AppAdapter::GetKeyRepeatDelay();
#endif
@ -248,7 +251,7 @@ auto AppAdapterApple::GetKeyRepeatDelay() -> float {
auto AppAdapterApple::GetKeyRepeatInterval() -> float {
#if BA_OSTYPE_MACOS
return BallisticaKit::CocoaFromCpp::GetKeyRepeatInterval();
return BallisticaKit::CocoaFromCpp::getKeyRepeatInterval();
#else
return AppAdapter::GetKeyRepeatDelay();
#endif
@ -256,7 +259,7 @@ auto AppAdapterApple::GetKeyRepeatInterval() -> float {
auto AppAdapterApple::DoClipboardIsSupported() -> bool {
#if BA_OSTYPE_MACOS
return BallisticaKit::CocoaFromCpp::ClipboardIsSupported();
return BallisticaKit::CocoaFromCpp::clipboardIsSupported();
#else
return AppAdapter::DoClipboardIsSupported();
#endif
@ -264,7 +267,7 @@ auto AppAdapterApple::DoClipboardIsSupported() -> bool {
auto AppAdapterApple::DoClipboardHasText() -> bool {
#if BA_OSTYPE_MACOS
return BallisticaKit::CocoaFromCpp::ClipboardHasText();
return BallisticaKit::CocoaFromCpp::clipboardHasText();
#else
return AppAdapter::DoClipboardHasText();
#endif
@ -272,7 +275,7 @@ auto AppAdapterApple::DoClipboardHasText() -> bool {
void AppAdapterApple::DoClipboardSetText(const std::string& text) {
#if BA_OSTYPE_MACOS
BallisticaKit::CocoaFromCpp::ClipboardSetText(text);
BallisticaKit::CocoaFromCpp::clipboardSetText(text);
#else
AppAdapter::DoClipboardSetText(text);
#endif
@ -280,7 +283,7 @@ void AppAdapterApple::DoClipboardSetText(const std::string& text) {
auto AppAdapterApple::DoClipboardGetText() -> std::string {
#if BA_OSTYPE_MACOS
auto contents = BallisticaKit::CocoaFromCpp::ClipboardGetText();
auto contents = BallisticaKit::CocoaFromCpp::clipboardGetText();
if (contents) {
return std::string(contents.get());
}

View File

@ -453,44 +453,51 @@ void RendererGL::CheckGLCapabilities_() {
}
auto RendererGL::GetMSAASamplesForFramebuffer_(int width, int height) -> int {
#if BA_RIFT_BUILD
return 4;
#else
// We currently aim for 4 up to 800 height and 2 beyond that.
if (height > 800) {
return 2;
if (g_buildconfig.ostype_android()) {
// We currently aim for 4 up to 800 height and 2 beyond that.
if (height > 800) {
return 2;
} else {
return 4;
}
} else {
return 4;
}
#endif
}
void RendererGL::UpdateMSAAEnabled_() {
#if BA_RIFT_BUILD
if (msaa_max_samples_rgb8_ > 0) {
if (g_buildconfig.ostype_macos()) {
// Let's go ahead and flip this on for Apple Silicon Macs.
#if __aarch64__
enable_msaa_ = true;
#else
enable_msaa_ = false;
#endif
} else if (g_buildconfig.rift_build()) {
if (msaa_max_samples_rgb8_ > 0) {
enable_msaa_ = true;
} else {
enable_msaa_ = false;
}
} else if (g_buildconfig.ostype_android()) {
// lets allow full 1080p msaa with newer stuff..
int max_msaa_res = is_tegra_k1_ ? 1200 : 800;
// To start, see if it looks like we support msaa on paper.
enable_msaa_ =
((screen_render_target()->physical_height()
<= static_cast<float>(max_msaa_res))
&& (msaa_max_samples_rgb8_ > 0) && (msaa_max_samples_rgb565_ > 0));
// Ok, lets be careful here; msaa blitting/etc seems to be particular in
// terms of supported formats/etc so let's only enable it on
// explicitly-tested hardware for now.
if (!is_tegra_4_ && !is_tegra_k1_ && !is_recent_adreno_) {
enable_msaa_ = false;
}
} else {
enable_msaa_ = false;
}
#else
// lets allow full 1080p msaa with newer stuff..
int max_msaa_res = is_tegra_k1_ ? 1200 : 800;
// To start, see if it looks like we support msaa on paper.
enable_msaa_ =
((screen_render_target()->physical_height()
<= static_cast<float>(max_msaa_res))
&& (msaa_max_samples_rgb8_ > 0) && (msaa_max_samples_rgb565_ > 0));
// Ok, lets be careful here; msaa blitting/etc seems to be particular in
// terms of supported formats/etc so let's only enable it on
// explicitly-tested hardware for now.
if (!is_tegra_4_ && !is_tegra_k1_ && !is_recent_adreno_) {
enable_msaa_ = false;
}
#endif // BA_RIFT_BUILD
}
auto RendererGL::IsMSAAEnabled() const -> bool { return enable_msaa_; }

View File

@ -54,9 +54,9 @@ void BasePlatformApple::PurchaseAck(const std::string& purchase,
void BasePlatformApple::DoOpenURL(const std::string& url) {
#if BA_XCODE_BUILD
#if BA_OSTYPE_MACOS
BallisticaKit::CocoaFromCpp::OpenURL(url);
BallisticaKit::CocoaFromCpp::openURL(url);
#else
BallisticaKit::UIKitFromCpp::OpenURL(url);
BallisticaKit::UIKitFromCpp::openURL(url);
#endif // BA_OSTYPE_MACOS
#else
@ -65,6 +65,34 @@ void BasePlatformApple::DoOpenURL(const std::string& url) {
#endif // BA_XCODE_BUILD
}
void BasePlatformApple::LoginAdapterGetSignInToken(
const std::string& login_type, int attempt_id) {
#if BA_USE_GAME_CENTER
if (login_type == "game_center") {
BallisticaKit::GameCenterContext::getSignInToken(attempt_id);
} else {
Log(LogLevel::kError,
"Got unexpected get-sign-in-token login-type: " + login_type);
}
#else
BasePlatform::LoginAdapterGetSignInToken(login_type, attempt_id);
#endif
}
void BasePlatformApple::LoginAdapterBackEndActiveChange(
const std::string& login_type, bool active) {
#if BA_USE_GAME_CENTER
if (login_type == "game_center") {
BallisticaKit::GameCenterContext::backEndActiveChange(active);
} else {
Log(LogLevel::kError,
"Got unexpected back-end-active-change login-type: " + login_type);
}
#else
BasePlatform::LoginAdapterBackEndActiveChange(login_type, active);
#endif
}
} // namespace ballistica::base
#endif // BA_OSTYPE_MACOS || BA_OSTYPE_IOS_TVOS

View File

@ -16,6 +16,10 @@ class BasePlatformApple : public BasePlatform {
void PurchaseAck(const std::string& purchase,
const std::string& order_id) override;
void DoOpenURL(const std::string& url) override;
void LoginAdapterGetSignInToken(const std::string& login_type,
int attempt_id) override;
void LoginAdapterBackEndActiveChange(const std::string& login_type,
bool active) override;
};
} // namespace ballistica::base

View File

@ -64,10 +64,12 @@ class BasePlatform {
#pragma mark ACCOUNTS ----------------------------------------------------------
/// Called when a Python LoginAdapter is requesting an explicit sign-in.
/// See the LoginAdapter class in Python for usage details.
virtual void LoginAdapterGetSignInToken(const std::string& login_type,
int attempt_id);
/// Called when a Python LoginAdapter is informing us that a back-end is
/// active/inactive.
/// active/inactive. See the LoginAdapter class in Python for usage
/// details.
virtual void LoginAdapterBackEndActiveChange(const std::string& login_type,
bool active);

View File

@ -1703,6 +1703,27 @@ static PyMethodDef PyUsingGooglePlayGameServicesDef = {
"(internal)",
};
// ---------------------------- using_game_center ------------------------------
static auto PyUsingGameCenter(PyObject* self) -> PyObject* {
BA_PYTHON_TRY;
if (g_buildconfig.use_game_center()) {
Py_RETURN_TRUE;
}
Py_RETURN_FALSE;
BA_PYTHON_CATCH;
}
static PyMethodDef PyUsingGameCenterDef = {
"using_game_center", // name
(PyCFunction)PyUsingGameCenter, // method
METH_NOARGS, // flags
"using_game_center() -> bool\n"
"\n"
"(internal)",
};
// -----------------------------------------------------------------------------
auto PythonMethodsMisc::GetMethods() -> std::vector<PyMethodDef> {
@ -1767,6 +1788,7 @@ auto PythonMethodsMisc::GetMethods() -> std::vector<PyMethodDef> {
PyDevConsoleRequestRefreshDef,
PyAssetLoadsAllowedDef,
PyUsingGooglePlayGameServicesDef,
PyUsingGameCenterDef,
};
}

View File

@ -37,26 +37,26 @@ auto CorePlatformApple::GetDeviceV1AccountUUIDPrefix() -> std::string {
auto CorePlatformApple::DoGetDeviceName() -> std::string {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
// Ask swift for a pretty name if possible.
auto val = BallisticaKit::CocoaFromCpp::GetDeviceName();
auto val = BallisticaKit::CocoaFromCpp::getDeviceName();
if (val) {
return val.get();
}
#elif BA_OSTYPE_IOS_TVOS && BA_XCODE_BUILD
return BallisticaKit::UIKitFromCpp::GetDeviceName();
return BallisticaKit::UIKitFromCpp::getDeviceName();
#endif
return CorePlatform::DoGetDeviceName();
}
auto CorePlatformApple::DoGetDeviceDescription() -> std::string {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
return BallisticaKit::CocoaFromCpp::GetDeviceModelName();
return BallisticaKit::CocoaFromCpp::getDeviceModelName();
#endif
return CorePlatform::DoGetDeviceDescription();
}
auto CorePlatformApple::GetOSVersionString() -> std::string {
#if BA_XCODE_BUILD
return BallisticaKit::FromCpp::GetOSVersion();
return BallisticaKit::FromCpp::getOSVersion();
#endif
return CorePlatform::GetOSVersionString();
}
@ -64,11 +64,11 @@ auto CorePlatformApple::GetOSVersionString() -> std::string {
// Legacy for device-accounts; don't modify this code.
auto CorePlatformApple::GetRealLegacyDeviceUUID(std::string* uuid) -> bool {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
*uuid = std::string(BallisticaKit::CocoaFromCpp::GetLegacyDeviceUUID());
*uuid = std::string(BallisticaKit::CocoaFromCpp::getLegacyDeviceUUID());
return true;
#endif
#if BA_OSTYPE_IOS_TVOS
*uuid = std::string(BallisticaKit::UIKitFromCpp::GetLegacyDeviceUUID());
*uuid = std::string(BallisticaKit::UIKitFromCpp::getLegacyDeviceUUID());
// *uuid = base::AppleUtils::GetIOSUUID();
return true;
#endif
@ -104,7 +104,7 @@ auto CorePlatformApple::GetDeviceUUIDInputs() -> std::list<std::string> {
#if BA_OSTYPE_MACOS
#if BA_XCODE_BUILD
out.push_back(
std::string(BallisticaKit::CocoaFromCpp::GetLegacyDeviceUUID()));
std::string(BallisticaKit::CocoaFromCpp::getLegacyDeviceUUID()));
#else // BA_XCODE_BUILD
out.push_back(GetMacUUIDFallback());
#endif // BA_XCODE_BUILD
@ -113,7 +113,7 @@ auto CorePlatformApple::GetDeviceUUIDInputs() -> std::list<std::string> {
#if BA_OSTYPE_IOS_TVOS
// out.push_back(base::AppleUtils::GetIOSUUID());
out.push_back(
std::string(BallisticaKit::UIKitFromCpp::GetLegacyDeviceUUID()));
std::string(BallisticaKit::UIKitFromCpp::getLegacyDeviceUUID()));
#endif
return out;
}
@ -133,7 +133,7 @@ auto CorePlatformApple::DoGetConfigDirectoryMonolithicDefault()
printf("FIXME: get proper default-config-dir\n");
return std::string(getenv("HOME")) + "/Library";
#elif BA_OSTYPE_MACOS && BA_XCODE_BUILD
return std::string(BallisticaKit::CocoaFromCpp::GetApplicationSupportPath())
return std::string(BallisticaKit::CocoaFromCpp::getApplicationSupportPath())
+ "/BallisticaKit";
#else
return CorePlatform::DoGetConfigDirectoryMonolithicDefault();
@ -150,7 +150,7 @@ auto CorePlatformApple::DoHasTouchScreen() -> bool {
auto CorePlatformApple::GetDefaultUIScale() -> UIScale {
#if BA_OSTYPE_IOS
if (BallisticaKit::UIKitFromCpp::IsTablet()) {
if (BallisticaKit::UIKitFromCpp::isTablet()) {
// if (base::AppleUtils::IsTablet()) {
return UIScale::kMedium;
} else {
@ -186,7 +186,7 @@ void CorePlatformApple::EmitPlatformLog(const std::string& name, LogLevel level,
auto CorePlatformApple::DoGetDataDirectoryMonolithicDefault() -> std::string {
#if BA_XCODE_BUILD
return BallisticaKit::FromCpp::GetResourcesPath();
return BallisticaKit::FromCpp::getResourcesPath();
#else
// Fall back to default.
return CorePlatform::DoGetDataDirectoryMonolithicDefault();
@ -267,7 +267,8 @@ void CorePlatformApple::FreeTextTexture(void* tex) {
void CorePlatformApple::SubmitScore(const std::string& game,
const std::string& version, int64_t score) {
#if BA_USE_GAME_CENTER
base::AppleUtils::SubmitScore(game, version, score);
BallisticaKit::GameCenterContext::submitScore(game, version, score);
// base::AppleUtils::SubmitScore(game, version, score);
#else
CorePlatform::SubmitScore(game, version, score);
#endif
@ -275,7 +276,8 @@ void CorePlatformApple::SubmitScore(const std::string& game,
void CorePlatformApple::ReportAchievement(const std::string& achievement) {
#if BA_USE_GAME_CENTER
base::AppleUtils::ReportAchievement(achievement);
BallisticaKit::GameCenterContext::reportAchievement(achievement);
// base::AppleUtils::ReportAchievement(achievement);
#else
CorePlatform::ReportAchievement(achievement);
#endif
@ -283,7 +285,8 @@ void CorePlatformApple::ReportAchievement(const std::string& achievement) {
void CorePlatformApple::ResetAchievements() {
#if BA_USE_GAME_CENTER
base::AppleUtils::ResetGameCenterAchievements();
BallisticaKit::GameCenterContext::resetAchievements();
// base::AppleUtils::ResetGameCenterAchievements();
#else
CorePlatform::ResetAchievements();
#endif
@ -292,7 +295,8 @@ void CorePlatformApple::ResetAchievements() {
auto CorePlatformApple::HaveLeaderboard(const std::string& game,
const std::string& config) -> bool {
#if BA_USE_GAME_CENTER
return base::AppleUtils::HaveGameCenterLeaderboard(game, config);
return BallisticaKit::GameCenterContext::haveLeaderboard(game, config);
// return base::AppleUtils::HaveGameCenterLeaderboard(game, config);
#else
return CorePlatform::HaveLeaderboard(game, config);
#endif
@ -302,7 +306,8 @@ void CorePlatformApple::ShowOnlineScoreUI(const std::string& show,
const std::string& game,
const std::string& game_version) {
#if BA_USE_GAME_CENTER
base::AppleUtils::ShowOnlineScoreUI(show, game, game_version);
BallisticaKit::GameCenterContext::showOnlineScoreUI(show, game, game_version);
// base::AppleUtils::ShowOnlineScoreUI(show, game, game_version);
#else
CorePlatform::ShowOnlineScoreUI(show, game, game_version);
#endif
@ -324,13 +329,14 @@ void CorePlatformApple::ShowOnlineScoreUI(const std::string& show,
// #endif
// }
void CorePlatformApple::GameCenterLogin() {
#if BA_USE_GAME_CENTER
base::AppleUtils::DoGameCenterLogin();
#else
CorePlatform::GameCenterLogin();
#endif
}
// void CorePlatformApple::GameCenterLogin() {
// #if BA_USE_GAME_CENTER
// BallisticaKit::GameCenterContext::signIn();
// // base::AppleUtils::DoGameCenterLogin();
// #else
// CorePlatform::GameCenterLogin();
// #endif
// }
auto CorePlatformApple::IsOSPlayingMusic() -> bool {
#if BA_XCODE_BUILD
@ -345,7 +351,7 @@ auto CorePlatformApple::IsOSPlayingMusic() -> bool {
void CorePlatformApple::OpenFileExternally(const std::string& path) {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
BallisticaKit::CocoaFromCpp::OpenFileExternally(path);
BallisticaKit::CocoaFromCpp::openFileExternally(path);
#else
CorePlatform::OpenFileExternally(path);
#endif
@ -353,7 +359,7 @@ void CorePlatformApple::OpenFileExternally(const std::string& path) {
void CorePlatformApple::OpenDirExternally(const std::string& path) {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
BallisticaKit::CocoaFromCpp::OpenDirExternally(path);
BallisticaKit::CocoaFromCpp::openDirExternally(path);
#else
CorePlatform::OpenDirExternally(path);
#endif
@ -361,7 +367,7 @@ void CorePlatformApple::OpenDirExternally(const std::string& path) {
void CorePlatformApple::MacMusicAppInit() {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
BallisticaKit::CocoaFromCpp::MacMusicAppInit();
BallisticaKit::CocoaFromCpp::macMusicAppInit();
// base::AppleUtils::MacMusicAppInit();
#else
CorePlatform::MacMusicAppInit();
@ -369,7 +375,7 @@ void CorePlatformApple::MacMusicAppInit() {
}
auto CorePlatformApple::MacMusicAppGetVolume() -> int {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
return BallisticaKit::CocoaFromCpp::MacMusicAppGetVolume();
return BallisticaKit::CocoaFromCpp::macMusicAppGetVolume();
// return static_cast<int>(base::AppleUtils::MacMusicAppGetVolume());
#else
return CorePlatform::MacMusicAppGetVolume();
@ -377,7 +383,7 @@ auto CorePlatformApple::MacMusicAppGetVolume() -> int {
}
void CorePlatformApple::MacMusicAppSetVolume(int volume) {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
return BallisticaKit::CocoaFromCpp::MacMusicAppSetVolume(volume);
return BallisticaKit::CocoaFromCpp::macMusicAppSetVolume(volume);
// base::AppleUtils::MacMusicAppSetVolume(volume);
#else
CorePlatform::MacMusicAppSetVolume(volume);
@ -386,7 +392,7 @@ void CorePlatformApple::MacMusicAppSetVolume(int volume) {
void CorePlatformApple::MacMusicAppStop() {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
return BallisticaKit::CocoaFromCpp::MacMusicAppStop();
return BallisticaKit::CocoaFromCpp::macMusicAppStop();
// base::AppleUtils::MacMusicAppStop();
#else
CorePlatform::MacMusicAppStop();
@ -396,7 +402,7 @@ void CorePlatformApple::MacMusicAppStop() {
auto CorePlatformApple::MacMusicAppPlayPlaylist(const std::string& playlist)
-> bool {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
return BallisticaKit::CocoaFromCpp::MacMusicAppPlayPlaylist(playlist);
return BallisticaKit::CocoaFromCpp::macMusicAppPlayPlaylist(playlist);
// return base::AppleUtils::MacMusicAppPlayPlaylist(playlist.c_str());
#else
return CorePlatform::MacMusicAppPlayPlaylist(playlist);
@ -405,7 +411,7 @@ auto CorePlatformApple::MacMusicAppPlayPlaylist(const std::string& playlist)
auto CorePlatformApple::MacMusicAppGetPlaylists() -> std::list<std::string> {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD
BallisticaKit::CocoaFromCpp::MacMusicAppGetPlaylists();
BallisticaKit::CocoaFromCpp::macMusicAppGetPlaylists();
// mac_music_app_playlists_.clear();
// mac_music_app_playlists_.push_back("foof");
// mac_music_app_playlists_.push_back("barf");
@ -443,7 +449,7 @@ auto CorePlatformApple::GetSubplatformName() -> std::string {
auto CorePlatformApple::GetLocale() -> std::string {
#if BA_XCODE_BUILD
if (!locale_.has_value()) {
locale_ = std::string(BallisticaKit::FromCpp::GetLocaleString());
locale_ = std::string(BallisticaKit::FromCpp::getLocaleString());
}
return *locale_;
#else

View File

@ -44,7 +44,7 @@ class CorePlatformApple : public CorePlatform {
void ShowOnlineScoreUI(const std::string& show, const std::string& game,
const std::string& game_version) override;
void ResetAchievements() override;
void GameCenterLogin() override;
// void GameCenterLogin() override;
auto IsOSPlayingMusic() -> bool override;
void OpenFileExternally(const std::string& path) override;
void OpenDirExternally(const std::string& path) override;

View File

@ -740,7 +740,7 @@ void CorePlatform::ResetAchievements() {
Log(LogLevel::kError, "ResetAchievements() unimplemented");
}
void CorePlatform::GameCenterLogin() { throw Exception(); }
// void CorePlatform::GameCenterLogin() { throw Exception(); }
void CorePlatform::RunEvents() {}

View File

@ -239,7 +239,7 @@ class CorePlatform {
virtual void SignInV1(const std::string& account_type);
virtual void SignOutV1();
virtual void GameCenterLogin();
// virtual void GameCenterLogin();
virtual void V1LoginDidChange();
/// Returns the ID to use for the device account.

View File

@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
namespace ballistica {
// These are set automatically via script; don't modify them here.
const int kEngineBuildNumber = 21570;
const int kEngineBuildNumber = 21578;
const char* kEngineVersion = "1.7.28";
const int kEngineApiVersion = 8;

View File

@ -11,6 +11,12 @@ if TYPE_CHECKING:
pass
# NOTE TO SELF:
# Whenever adding login types here, make sure to update all
# basn nodes before trying to send values through to bamaster,
# as they need to be extractable by basn en route.
class LoginType(Enum):
"""Types of logins available."""

View File

@ -590,4 +590,8 @@ def check_misc(self: ProjectUpdater) -> None:
if (
'// V2 Master Server:\n' '\n' '// PROD\n' '#if 1\n'
) not in msconfig:
raise CleanError('Not using prod v2 master server.')
if (
os.environ.get('BA_ALLOW_NON_PROD_V2_MASTER_SERVER', '0')
!= '1'
):
raise CleanError('Not using prod v2 master server.')

View File

@ -424,7 +424,7 @@ class Updater:
f'{self.pnameu} macOS Steam',
]
# A few things only for AppStore bound builds.
if filename == 'StoreKitContext.swift':
if filename in {'StoreKitContext.swift', 'GameCenterContext.swift'}:
return [
f'{self.pnameu} iOS',
f'{self.pnameu} tvOS',

View File

@ -107,7 +107,7 @@ class AuthenticationError(Exception):
def is_urllib_communication_error(exc: BaseException, url: str | None) -> bool:
"""Is the provided exception from urllib a communication-related error?
Url, if provided can provide extra context for when to treat an error
Url, if provided, can provide extra context for when to treat an error
as such an error.
This should be passed an exception which resulted from opening or

View File

@ -310,7 +310,9 @@ class MessageReceiver:
msgtype.__qualname__,
)
else:
logging.exception('Error in efro.message handling.')
logging.exception(
'Error handling raw efro.message. msg=%s', msg
)
return rstr
def handle_raw_message_async(
@ -367,7 +369,12 @@ class MessageReceiver:
msgtype.__qualname__,
)
else:
logging.exception('Error in efro.message handling.')
logging.exception(
'Error handling raw async efro.message.'
' msgtype=%s msg_decoded=%s.',
msgtype,
msg_decoded,
)
return rstr
async def _handle_raw_message_async(

View File

@ -14,7 +14,7 @@ from efrotools import readfile, writefile, replace_exact
# Python version we build here (not necessarily same as we use in repo).
PY_VER_ANDROID = '3.11'
PY_VER_EXACT_ANDROID = '3.11.5'
PY_VER_EXACT_ANDROID = '3.11.6'
PY_VER_APPLE = '3.11'
PY_VER_EXACT_APPLE = '3.11.5'
@ -36,25 +36,25 @@ VERSION_MIN_TVOS = '9.0'
# See https://stackoverflow.com/questions/74059978/
# why-is-lldb-generating-exc-bad-instruction-with-user-compiled-library-on-macos
#
# For now will try to ride out this LTS version as long as possible.
OPENSSL_VER_APPLE = '3.0.10'
OPENSSL_VER_ANDROID = '3.0.10'
# For now will try to ride out this 3.0 LTS version as long as possible.
OPENSSL_VER_APPLE = '3.0.12'
OPENSSL_VER_ANDROID = '3.0.12'
LIBFFI_VER_APPLE = '3.4.4'
BZIP2_VER_APPLE = '1.0.8'
XZ_VER_APPLE = '5.4.4'
XZ_VER_APPLE = '5.4.5'
# Android repo doesn't seem to be getting updated much so manually
# bumping various versions to keep things up to date.
ZLIB_VER_ANDROID = '1.3'
XZ_VER_ANDROID = '5.4.4'
XZ_VER_ANDROID = '5.4.5'
BZIP2_VER_ANDROID = '1.0.8'
GDBM_VER_ANDROID = '1.23'
LIBFFI_VER_ANDROID = '3.4.4'
LIBUUID_VER_ANDROID = ('2.38', '2.38.1')
NCURSES_VER_ANDROID = '6.3'
LIBUUID_VER_ANDROID = ('2.39', '2.39.2')
NCURSES_VER_ANDROID = '6.4'
READLINE_VER_ANDROID = '8.2'
SQLITE_VER_ANDROID = ('2023', '3430000')
SQLITE_VER_ANDROID = ('2023', '3440000')
# Filenames we prune from Python lib dirs in source repo to cut down on
# size.