work on untanging scene_v1 from bastd

This commit is contained in:
Eric 2023-06-06 16:41:25 -07:00
parent c595e9114e
commit 1211c6787a
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
22 changed files with 205 additions and 101 deletions

88
.efrocachemap generated
View File

@ -4072,50 +4072,50 @@
"build/assets/workspace/ninjafightplug.py": "https://files.ballistica.net/cache/ba1/c5/09/4f10b8a21ba87aa5509cff7a164b",
"build/assets/workspace/onslaughtplug.py": "https://files.ballistica.net/cache/ba1/ff/0a/a354984f9c074dab0676ac7e4877",
"build/assets/workspace/runaroundplug.py": "https://files.ballistica.net/cache/ba1/2a/1c/9ee5db6d1bceca7fa6638fb8abde",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/56/f8/3e391602ed52353add34fc979a13",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/e0/a2/8b03150db9b96de68cd8dad51d54",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/4e/89/a9439db62906c218d00222ddc3ce",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/13/1e/9ed7ea1818f2f10d684e61a61f07",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/af/a4/d15d2722343a0552d2fe4eb1a65b",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/91/0a/eb63c3c20bb89f7a9715d0932105",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/53/15/c59b2881be1efcf4ca0b8cf80379",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/c5/3d/66047bf399d4924f89cbffc94297",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/3a/8d/2e0c7b1bc6b4030bb6866a52ec7a",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/99/68/bef0609a635fbbde5f2270fb3647",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/27/6d/decc07ca775736a5042f4469a07d",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3d/23/f3e9176c9559b9bb8bff378fdc44",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/1e/09/8ce0c6a3e9364a7c0e2bf727d500",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/e9/7f/b98f40165a76f7244501be62fa8f",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/94/8d/5b728d11719f067428697f01ad53",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/67/66/7ebcbd6caa80ffea36893294534f",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/05/48/cfa2856a73536ae4fb9c4f5b89f5",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/c4/be/7cd8fad79bfab24e8cb553d176dd",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/9e/51/c43e21ae635a3f757f25ab1708fb",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/61/a8/534b315691f982d4f21f5fb7d31e",
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/2e/ed/f8d8ce08728b131bc7aa4eef68c5",
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/71/91/9f054aa21607dbf2beeb951ce2b5",
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f1/de/dfb9e770ea8e22e51d44fdf420f0",
"build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/5b/b8/922f6a007e4572a0e10496f646b4",
"build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/de/e6/cb1b1b8be77d3d10d1575c491d80",
"build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f4/3f/f049a4bf04a5590caf6773ede160",
"build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ab/69/69229ae54785bacaa805dcb61f32",
"build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/df/f0/b0c037a4b182cd3cd3b294477bd0",
"build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/74/6c/b794767db8b9ed811b2c6e26a2ff",
"build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/dc/08/7f59dbc1bbd2485d9e22d41fc869",
"build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/79/e5/3db09dd0fb4498afbfabefb5480d",
"build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a1/37/d293b58ac45b038f4ff29762308a",
"build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/56/25/1fa2625de28827af199a95070db9",
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a8/3d/51cbe50290096fda531e53b20ec2",
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4c/5c/9ff93f6ef35ca107956bb0e081de",
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/cc/89/18b9d6d000ff6ee1b55f5bc1a46a",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/68/d6/1c5ca65403ff20bd010ec4703243",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/e8/0b/14dfabcba60f0f7bd85d5b7eb11c",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/c5/d1/58ef21c5b5f8ec82c1369a34c57f",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/0e/da/d221dae06de59730b82f37c0c9e3",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/dc/21/12f3d6c0e7f6ed433416eafad0a3",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/ce/a1/5dc03c0fef87a8a3f788f7fdee3d",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/2b/8b/1fc591dd174bb537884d7ddea803",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/e6/75/4c6b08a5212c8f51563cdfdf034e",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/50/2a/99c316ae5605f34de961e57b99b8",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/4c/9b/14991a9cc44edaa4c11376b586db",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/6d/51/aac3bb4940b17bb85c7d65fe8215",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e3/1c/672e0c37120e234641b1ec70ba8e",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/14/b9/169ebbb5a2a307a122d8c62850df",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/00/f1/983296ec4ecf069c174ded7d6e5d",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b7/38/a79b4fd357f9586f6f1f9a31cb6e",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/85/95/6c64b5f5bf1e1558d01cfa8c89ee",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/e2/f3/bd0fca834abbc706cdcc121df0d2",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/43/0a/d9ec4e8c194e08bb2146af7a8d53",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/8d/24/36d82f9aea5198e0674cd1f80e4d",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/ff/3a/216ae04c015938874c1a31db65c9",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/1c/35/4c45906734c00dfc0dcc0c8189cd",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/a5/27/4c7232faab170704a57b7be15442",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/7e/d3/3f9dc7c6f16e8247cecbe4398e16",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/fc/18/c23b046de337751bb865e1339990",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/8a/9e/38c140317a81d1f7b3e5f8badf8b",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/ed/34/0bb29f2de46782c7372ecf5e3f2e",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/28/5b/cb49185f4f34e07ada1dab8ca1b8",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/fc/32/86f631cb559888e84901b9f90982",
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/1e/7a/b0fcb7d586eb58087ab5bb84e553",
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b8/22/f9d3995d4d213cbc4fd7b2557065",
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/c5/5c/adaab9f771d775da294ac4098805",
"build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/da/d9/b5f1419047e1b1e0ceebea8d7dcf",
"build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/58/d1/ba04098b61a8c51095b57bb2b0bb",
"build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/40/16/6274450a7b639ae02288cbb17ca0",
"build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/41/20/977193b2eae712929b01e42e9e00",
"build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/93/40/13568452f463bcead1a7c7923247",
"build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/c0/56/f4c3aaee3262b857e87cdb135080",
"build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/5b/64/2b1a0999396f87fd808fc3d6583a",
"build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f6/7b/c5976f5a91b4f6168bfa007855df",
"build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/cc/96/b8a1558fde8da1e70dee20e830d9",
"build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/91/8f/18a61f013ebf513e3d2534d1b30e",
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ae/24/eaafd0f23ac832b592b1be8996a6",
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/18/ec/e8627a4f475fdf832b715ff4400a",
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/57/7c/5f0d634096ef11b0799685afd22e",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/bd/22/55ce34cb2fc68b0c0b78fb76acf2",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/ba/2c/b49589761585b340e5856b81df6e",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/c5/4b/11d8b3530a5e2bf12f67ff21891a",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/9f/2d/f341b595d55b5cb560ef6559963e",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/f7/69/718641c9a7d8ba47497f58169ac4",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/47/a2/5e43714104aa68fa60d508f98518",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/b7/ef/6d0a654dc9b88d61a8102401442d",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/d6/65/b27b037c7a74e76144f001e95d3e",
"src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa",
"src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1",
"src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/75/9f/bcf597b362c9f2480cb348188bdd",

View File

@ -1,4 +1,4 @@
### 1.7.20 (build 21053, api 8, 2023-06-06)
### 1.7.20 (build 21054, api 8, 2023-06-06)
- This seems like a good time for a `refactoring` release in anticipation of
changes coming in 1.8. Basically this means that a lot of things will be

View File

@ -595,24 +595,31 @@ build/prefab/lib/windows/Release_%/BallisticaKitHeadlessPlus.pdb: .efrocachemap
# #
################################################################################
# Build and check a spinoff project including only the core feature-set.
spinoff-test-core:
tools/pcommand spinoff_test core $(SPINOFF_TEST_EXTRA_ARGS)
# Build and check a spinoff project including only the base feature-set.
spinoff-test-base:
tools/pcommand spinoff_test base $(SPINOFF_TEST_EXTRA_ARGS)
# Build and check a spinoff project including only the plus feature-set.
spinoff-test-plus:
tools/pcommand spinoff_test plus $(SPINOFF_TEST_EXTRA_ARGS)
# Build and check a spinoff project with only the template_fs feature-set.
spinoff-test-template_fs:
tools/pcommand spinoff_test template_fs $(SPINOFF_TEST_EXTRA_ARGS)
# Build and check a spinoff project with only the ui_v1 feature-set.
spinoff-test-ui_v1:
tools/pcommand spinoff_test ui_v1 $(SPINOFF_TEST_EXTRA_ARGS)
# Build and check a spinoff project with only the scene_v1 feature-set.
spinoff-test-scene_v1:
tools/pcommand spinoff_test scene_v1 $(SPINOFF_TEST_EXTRA_ARGS)
# Blow away all spinoff-test builds.
spinoff-test-clean:
rm -rf build/spinofftest

View File

@ -12,7 +12,7 @@ from batools.featureset import FeatureSet
# Grab the FeatureSet we should apply to.
fset = FeatureSet.get_active()
fset.requirements = {'base', 'scene_v1', 'ui_v1'}
fset.requirements = {'base', 'scene_v1', 'ui_v1', 'std'}
# We provide 'babase.app.classic'.
fset.has_python_app_subsystem = True

View File

@ -13,3 +13,4 @@ from batools.featureset import FeatureSet
fset = FeatureSet.get_active()
fset.requirements = {'base'}
fset.soft_requirements = {'classic'}

View File

@ -734,3 +734,29 @@ class ClassicSubsystem(AppSubsystem):
from bastd.ui.confirm import QuitWindow
QuitWindow()
def get_draw_score_screen_activity(self) -> type[bascenev1.Activity]:
"""(internal)"""
from bastd.activity.drawscore import DrawScoreScreenActivity
return DrawScoreScreenActivity
def get_team_series_victory_score_screen_activity(
self,
) -> type[bascenev1.Activity]:
"""(internal)"""
from bastd.activity.multiteamvictory import (
TeamSeriesVictoryScoreScreenActivity,
)
return TeamSeriesVictoryScoreScreenActivity
def get_free_for_all_victory_score_screen_activity(
self,
) -> type[bascenev1.Activity]:
"""(internal)"""
from bastd.activity.freeforallvictory import (
FreeForAllVictoryScoreScreenActivity,
)
return FreeForAllVictoryScoreScreenActivity

View File

@ -28,7 +28,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 21053
TARGET_BALLISTICA_BUILD = 21054
TARGET_BALLISTICA_VERSION = '1.7.20'
_g_env_config: EnvConfig | None = None

View File

@ -56,14 +56,16 @@ class FreeForAllSession(MultiTeamSession):
def _switch_to_score_screen(self, results: bascenev1.GameResults) -> None:
# pylint: disable=cyclic-import
from efro.util import asserttype
from bastd.activity.drawscore import DrawScoreScreenActivity
from bastd.activity.multiteamvictory import (
TeamSeriesVictoryScoreScreenActivity,
)
from bastd.activity.freeforallvictory import (
FreeForAllVictoryScoreScreenActivity,
)
classic = _babase.app.classic
assert classic is not None
draw_score_screen_activity = classic.get_draw_score_screen_activity()
team_series_victory_score_screen_activity = (
classic.get_team_series_victory_score_screen_activity()
)
free_for_all_victory_score_screen_activity = (
classic.get_free_for_all_victory_score_screen_activity()
)
winners = results.winnergroups
# If there's multiple players and everyone has the same score,
@ -71,7 +73,7 @@ class FreeForAllSession(MultiTeamSession):
if len(self.sessionplayers) > 1 and len(winners) < 2:
self.setactivity(
_bascenev1.newactivity(
DrawScoreScreenActivity, {'results': results}
draw_score_screen_activity, {'results': results}
)
)
else:
@ -100,14 +102,14 @@ class FreeForAllSession(MultiTeamSession):
):
self.setactivity(
_bascenev1.newactivity(
TeamSeriesVictoryScoreScreenActivity,
team_series_victory_score_screen_activity,
{'winner': series_winners[0]},
)
)
else:
self.setactivity(
_bascenev1.newactivity(
FreeForAllVictoryScoreScreenActivity,
free_for_all_victory_score_screen_activity,
{'results': results},
)
)

View File

@ -74,7 +74,9 @@ void BasePython::ImportPythonAppObjs() {
void BasePython::SoftImportPlus() {
// To keep our init order clean, we want to root out any attempted uses
// of plus before _babase has been fully inited.
// of this before _babase/babase has been fully imported.
assert(g_base);
assert(g_base->IsBaseCompletelyImported());
auto gil{Python::ScopedInterpreterLock()};
auto result = PythonRef::StolenSoft(PyImport_ImportModule("_baplus"));
@ -86,6 +88,11 @@ void BasePython::SoftImportPlus() {
}
void BasePython::SoftImportClassic() {
// To keep our init order clean, we want to root out any attempted uses
// of this before _babase/babase has been fully imported.
assert(g_base);
assert(g_base->IsBaseCompletelyImported());
auto gil{Python::ScopedInterpreterLock()};
auto result = PythonRef::StolenSoft(PyImport_ImportModule("_baclassic"));
if (!result.Exists()) {
@ -96,6 +103,11 @@ void BasePython::SoftImportClassic() {
}
void BasePython::SoftImportUIV1() {
// To keep our init order clean, we want to root out any attempted uses
// of this before _babase/babase has been fully imported.
assert(g_base);
assert(g_base->IsBaseCompletelyImported());
auto gil{Python::ScopedInterpreterLock()};
auto result = PythonRef::StolenSoft(PyImport_ImportModule("_bauiv1"));
if (!result.Exists()) {

View File

@ -10,7 +10,7 @@
namespace ballistica::base {
/// 'Soft' interface to the classic feature-set.
/// 'Soft' interface to the classic feature-set, managed by base.
/// Feature-sets listing classic as a soft requirement must limit their use of
/// it to these methods and should be prepared to handle the not-present
/// case.
@ -29,6 +29,7 @@ class ClassicSoftInterface {
virtual auto GetV1AccountExtra() -> std::string = 0;
virtual auto GetV1AccountExtra2() -> std::string = 0;
virtual auto GetV1AccountLoginName() -> std::string = 0;
virtual auto GetV1AccountType() -> int = 0;
virtual auto GetV1AccountTypeString() -> std::string = 0;
virtual auto GetV1AccountLoginStateString() -> std::string = 0;
virtual auto GetV1AccountLoginStateNum() -> int = 0;
@ -41,6 +42,10 @@ class ClassicSoftInterface {
virtual auto GetClientInfoQueryResponseCall() -> PyObject* = 0;
virtual auto BuildPublicPartyStateVal() -> PyObject* = 0;
virtual auto GetV1AccountDisplayString(bool full) -> std::string = 0;
virtual auto GetV1AccountTypeFromString(const char* value) -> int = 0;
virtual auto GetV1AccountTypeIconString(int account_type) -> std::string = 0;
virtual auto V1AccountTypeToString(int account_type) -> std::string = 0;
virtual void PlayMusic(const std::string& music_type, bool continuous) = 0;
};
} // namespace ballistica::base

View File

@ -12,7 +12,7 @@
namespace ballistica::base {
/// 'Soft' interface to the plus feature-set.
/// 'Soft' interface to the plus feature-set, managed by base.
/// Feature-sets listing plus as a soft requirement must limit their use of
/// plus to these methods and should be prepared to handle the not-present
/// case.

View File

@ -13,7 +13,7 @@ class Widget;
namespace ballistica::base {
/// 'Soft' interface to the ui_v1 feature-set.
/// 'Soft' interface to the ui_v1 feature-set, managed by base.
/// Feature-sets listing ui_v1 as a soft requirement must limit their use of
/// it to these methods and should be prepared to handle the not-present
/// case.

View File

@ -86,11 +86,12 @@ auto ClassicFeatureSet::IsV1AccountSignedIn() -> bool {
auto ClassicFeatureSet::HandleSignOutV1() -> bool {
// For particular account types we can simply set our state; no need to
// bring any other parties in to play.
if (g_classic->account_type == classic::V1AccountType::kDevice
|| g_classic->account_type == classic::V1AccountType::kServer
|| g_classic->account_type == classic::V1AccountType::kV2) {
g_classic->v1_account->PushSetV1LoginCall(
g_classic->account_type, classic::V1LoginState::kSignedOut, "", "");
if (g_classic->v1_account_type() == classic::V1AccountType::kDevice
|| g_classic->v1_account_type() == classic::V1AccountType::kServer
|| g_classic->v1_account_type() == classic::V1AccountType::kV2) {
g_classic->v1_account->PushSetV1LoginCall(g_classic->v1_account_type(),
classic::V1LoginState::kSignedOut,
"", "");
return true; // We handled it.
}
// We didn't handle it.
@ -128,7 +129,7 @@ auto ClassicFeatureSet::GetV1AccountLoginName() -> std::string {
}
auto ClassicFeatureSet::GetV1AccountTypeString() -> std::string {
return V1Account::AccountTypeToString(g_classic->account_type);
return V1Account::AccountTypeToString(g_classic->v1_account_type());
}
auto ClassicFeatureSet::GetV1AccountLoginStateString() -> std::string {
@ -202,7 +203,7 @@ auto ClassicFeatureSet::BuildPublicPartyStateVal() -> PyObject* {
return python->BuildPublicPartyStateVal();
}
std::string ClassicFeatureSet::GetV1AccountDisplayString(bool full) {
auto ClassicFeatureSet::GetV1AccountDisplayString(bool full) -> std::string {
if (full) {
assert(Utils::IsValidUTF8(
scene_v1::PlayerSpec::GetAccountPlayerSpec().GetDisplayString()));
@ -214,4 +215,29 @@ std::string ClassicFeatureSet::GetV1AccountDisplayString(bool full) {
}
}
auto ClassicFeatureSet::GetV1AccountTypeFromString(const char* value) -> int {
return static_cast<int>(V1Account::AccountTypeFromString(value));
}
auto ClassicFeatureSet::GetV1AccountTypeIconString(int account_type_in)
-> std::string {
return V1Account::AccountTypeToIconString(
static_cast<V1AccountType>(account_type_in));
}
auto ClassicFeatureSet::V1AccountTypeToString(int account_type_in)
-> std::string {
return V1Account::AccountTypeToString(
static_cast<V1AccountType>(account_type_in));
}
auto ClassicFeatureSet::GetV1AccountType() -> int {
return static_cast<int>(v1_account_type());
}
void ClassicFeatureSet::PlayMusic(const std::string& music_type,
bool continuous) {
python->PlayMusic(music_type, continuous);
}
} // namespace ballistica::classic

View File

@ -95,14 +95,21 @@ class ClassicFeatureSet : public FeatureSetNativeComponent,
auto GetClientInfoQueryResponseCall() -> PyObject* override;
auto BuildPublicPartyStateVal() -> PyObject* override;
auto GetV1AccountDisplayString(bool full) -> std::string override;
auto GetV1AccountTypeFromString(const char* value) -> int override;
auto GetV1AccountTypeIconString(int account_type) -> std::string override;
auto V1AccountTypeToString(int account_type) -> std::string override;
auto GetV1AccountType() -> int override;
ClassicPython* const python;
V1Account* const v1_account;
V1AccountType account_type{V1AccountType::kInvalid};
auto v1_account_type() const { return v1_account_type_; }
void set_v1_account_type(V1AccountType tp) { v1_account_type_ = tp; }
void PlayMusic(const std::string& music_type, bool continuous) override;
private:
ClassicFeatureSet();
V1AccountType v1_account_type_{V1AccountType::kInvalid};
};
} // namespace ballistica::classic

View File

@ -166,22 +166,23 @@ void V1Account::SetLogin(V1AccountType account_type, V1LoginState login_state,
assert(g_base->InLogicThread());
// We want redundant sets to be no-ops.
if (login_state_ != login_state || g_classic->account_type != account_type
|| login_id_ != login_id || login_name_ != login_name) {
if (login_state_ != login_state
|| g_classic->v1_account_type() != account_type || login_id_ != login_id
|| login_name_ != login_name) {
// Special case: if they sent a sign-out for an account type that is
// currently not signed in, ignore it.
if (login_state == V1LoginState::kSignedOut
&& (account_type != g_classic->account_type)) {
&& (account_type != g_classic->v1_account_type())) {
// No-op.
} else {
login_state_ = login_state;
g_classic->account_type = account_type;
g_classic->set_v1_account_type(account_type);
login_id_ = login_id;
login_name_ = Utils::GetValidUTF8(login_name.c_str(), "gthm");
// If they signed out of an account, account type switches to invalid.
if (login_state == V1LoginState::kSignedOut) {
g_classic->account_type = V1AccountType::kInvalid;
g_classic->set_v1_account_type(V1AccountType::kInvalid);
}
login_state_num_ += 1;
call_login_did_change = true;

View File

@ -6,7 +6,7 @@
#include "ballistica/base/dynamics/bg/bg_dynamics.h"
#include "ballistica/base/graphics/graphics.h"
#include "ballistica/base/graphics/support/camera.h"
#include "ballistica/classic/python/classic_python.h"
#include "ballistica/base/support/classic_soft.h"
#include "ballistica/core/core.h"
#include "ballistica/scene_v1/node/node_attribute.h"
#include "ballistica/scene_v1/node/node_type.h"
@ -180,7 +180,12 @@ void GlobalsNode::SetAsForeground() {
g_base->audio->SetSoundPitch(slow_motion_ ? 0.4f : 1.0f);
// Tell the scripting layer to play our current music.
g_classic->python->PlayMusic(music_, music_continuous_);
if (g_base->HaveClassic()) {
g_base->classic()->PlayMusic(music_, music_continuous_);
} else {
BA_LOG_ONCE(LogLevel::kWarning,
"Classic not present; music will not play.");
}
}
auto GlobalsNode::IsCurrentGlobals() const -> bool {
@ -464,7 +469,14 @@ void GlobalsNode::SetUseFixedVROverlay(bool val) {
void GlobalsNode::SetMusicCount(int val) {
if (music_count_ != val && IsCurrentGlobals()) {
g_classic->python->PlayMusic(music_, music_continuous_);
// Tell the scripting layer to play our current music.
if (g_base->HaveClassic()) {
g_base->classic()->PlayMusic(music_, music_continuous_);
} else {
BA_LOG_ONCE(LogLevel::kWarning,
"Classic not present; music will not play (b).");
}
// g_classic->python->PlayMusic(music_, music_continuous_);
}
music_count_ = val;
}

View File

@ -2,7 +2,6 @@
#include "ballistica/scene_v1/scene_v1.h"
#include "ballistica/classic/classic.h"
#include "ballistica/scene_v1/node/anim_curve_node.h"
#include "ballistica/scene_v1/node/bomb_node.h"
#include "ballistica/scene_v1/node/combine_node.h"
@ -35,7 +34,6 @@ namespace ballistica::scene_v1 {
core::CoreFeatureSet* g_core{};
base::BaseFeatureSet* g_base{};
SceneV1FeatureSet* g_scene_v1{};
classic::ClassicFeatureSet* g_classic{};
void SceneV1FeatureSet::OnModuleExec(PyObject* module) {
// Ok, our feature-set's Python module is getting imported.
@ -66,8 +64,6 @@ void SceneV1FeatureSet::OnModuleExec(PyObject* module) {
// Import any other C++ feature-set-front-ends we use.
assert(g_base == nullptr);
g_base = base::BaseFeatureSet::Import();
assert(g_classic == nullptr);
g_classic = classic::ClassicFeatureSet::Import();
g_core->LifecycleLog("_bascenev1 exec end");
}

View File

@ -22,9 +22,6 @@ class CoreFeatureSet;
namespace ballistica::base {
class BaseFeatureSet;
}
namespace ballistica::classic {
class ClassicFeatureSet;
}
namespace ballistica::scene_v1 {
@ -313,7 +310,6 @@ enum class NodeAttributeType {
extern core::CoreFeatureSet* g_core;
extern base::BaseFeatureSet* g_base;
extern SceneV1FeatureSet* g_scene_v1;
extern classic::ClassicFeatureSet* g_classic;
class SceneV1FeatureSet : public FeatureSetNativeComponent {
public:

View File

@ -2,7 +2,7 @@
#include "ballistica/scene_v1/support/player_spec.h"
#include "ballistica/classic/support/v1_account.h"
#include "ballistica/base/support/classic_soft.h"
#include "ballistica/core/platform/core_platform.h"
#include "ballistica/scene_v1/support/scene_v1_app_mode.h"
#include "ballistica/shared/generic/json.h"
@ -25,8 +25,13 @@ PlayerSpec::PlayerSpec(const std::string& s) {
// Account type may technically be something we don't recognize,
// but that's ok.. it'll just be 'invalid' to us in that case
account_type_ =
classic::V1Account::AccountTypeFromString(account_obj->valuestring);
if (g_base->HaveClassic()) {
v1_account_type_ = g_base->classic()->GetV1AccountTypeFromString(
account_obj->valuestring);
// classic::V1Account::AccountTypeFromString(account_obj->valuestring);
} else {
v1_account_type_ = 0; // kInvalid.
}
success = true;
}
cJSON_Delete(root_obj);
@ -35,12 +40,18 @@ PlayerSpec::PlayerSpec(const std::string& s) {
Log(LogLevel::kError, "Error creating PlayerSpec from string: '" + s + "'");
name_ = "<error>";
short_name_ = "";
account_type_ = classic::V1AccountType::kInvalid;
// account_type_ = classic::V1AccountType::kInvalid;
v1_account_type_ = 0; // kInvalid.
}
}
auto PlayerSpec::GetDisplayString() const -> std::string {
return classic::V1Account::AccountTypeToIconString(account_type_) + name_;
if (g_base->HaveClassic()) {
return g_base->classic()->GetV1AccountTypeIconString(v1_account_type_)
+ name_;
}
return name_;
// return classic::V1Account::AccountTypeToIconString(account_type_) + name_;
}
auto PlayerSpec::GetShortName() const -> std::string {
@ -53,7 +64,7 @@ auto PlayerSpec::GetShortName() const -> std::string {
auto PlayerSpec::operator==(const PlayerSpec& spec) const -> bool {
// NOTE: need to add account ID in here once that's available
return (spec.name_ == name_ && spec.short_name_ == short_name_
&& spec.account_type_ == account_type_);
&& spec.v1_account_type_ == v1_account_type_);
}
auto PlayerSpec::GetSpecString() const -> std::string {
@ -62,7 +73,10 @@ auto PlayerSpec::GetSpecString() const -> std::string {
cJSON_AddStringToObject(root, "n", name_.c_str());
cJSON_AddStringToObject(
root, "a",
classic::V1Account::AccountTypeToString(account_type_).c_str());
// classic::V1Account::AccountTypeToString(account_type_).c_str()
g_base->HaveClassic()
? g_base->classic()->V1AccountTypeToString(v1_account_type_).c_str()
: "");
cJSON_AddStringToObject(root, "sn", short_name_.c_str());
char* out = cJSON_PrintUnformatted(root);
std::string out_s = out;
@ -78,11 +92,11 @@ auto PlayerSpec::GetSpecString() const -> std::string {
auto PlayerSpec::GetAccountPlayerSpec() -> PlayerSpec {
auto* appmode = SceneV1AppMode::GetActiveOrThrow();
PlayerSpec spec;
if (g_classic->v1_account->GetLoginState()
== classic::V1LoginState::kSignedIn) {
spec.account_type_ = g_classic->account_type;
if (g_base->HaveClassic() && g_base->classic()->IsV1AccountSignedIn()) {
spec.v1_account_type_ = g_base->classic()->GetV1AccountType();
// g_classic->v1_account_type();
spec.name_ = Utils::GetValidUTF8(
g_classic->v1_account->GetLoginName().c_str(), "bsgaps");
g_base->classic()->GetV1AccountLoginName().c_str(), "bsgaps");
} else {
// Headless builds fall back to V1 public-party name if that's available.
if (g_buildconfig.headless_build()

View File

@ -5,8 +5,6 @@
#include <string>
#include "ballistica/classic/classic.h"
namespace ballistica::scene_v1 {
/// a PlayerSpec is a portable description of an entity such as a player or
@ -51,7 +49,7 @@ class PlayerSpec {
private:
std::string name_;
std::string short_name_;
classic::V1AccountType account_type_{classic::V1AccountType::kInvalid};
int v1_account_type_{};
};
} // namespace ballistica::scene_v1

View File

@ -7,10 +7,12 @@
#include "ballistica/base/audio/audio.h"
#include "ballistica/base/audio/audio_source.h"
#include "ballistica/base/graphics/graphics.h"
#include "ballistica/base/graphics/support/frame_def.h"
#include "ballistica/base/networking/network_writer.h"
#include "ballistica/base/python/base_python.h"
#include "ballistica/base/support/plus_soft.h"
#include "ballistica/base/ui/ui.h"
#include "ballistica/core/platform/core_platform.h"
#include "ballistica/scene_v1/connection/connection_set.h"
#include "ballistica/scene_v1/connection/connection_to_client_udp.h"
#include "ballistica/scene_v1/connection/connection_to_host.h"
@ -24,7 +26,6 @@
#include "ballistica/shared/foundation/event_loop.h"
#include "ballistica/shared/generic/json.h"
#include "ballistica/shared/generic/utils.h"
#include "ballistica/ui_v1/support/root_ui.h"
namespace ballistica::scene_v1 {

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 = 21053;
const int kEngineBuildNumber = 21054;
const char* kEngineVersion = "1.7.20";
auto MonolithicMain(const core::CoreConfig& core_config) -> int {