From af4033371ffbef8338f54204b93954474507d25f Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 25 Aug 2022 13:46:34 -0700 Subject: [PATCH] net-testing improvements, slightly longer timeouts, and general tidying --- .efrocachemap | 90 +++++++++---------- .idea/dictionaries/ericf.xml | 1 + CHANGELOG.md | 4 +- assets/src/ba_data/python/._ba_sources_hash | 2 +- assets/src/ba_data/python/_ba.py | 11 ++- .../python/bastd/ui/settings/nettesting.py | 16 ++-- .../.idea/dictionaries/ericf.xml | 1 + src/ballistica/ballistica.cc | 2 +- src/ballistica/platform/platform.h | 12 --- .../python/methods/python_methods_app.cc | 37 ++------ .../python/methods/python_methods_gameplay.cc | 17 ---- .../python/methods/python_methods_graphics.cc | 15 ---- .../python/methods/python_methods_input.cc | 13 --- .../python/methods/python_methods_media.cc | 24 ----- .../methods/python_methods_networking.cc | 21 ----- .../python/methods/python_methods_system.cc | 43 --------- .../python/methods/python_methods_ui.cc | 46 ---------- src/meta/bameta/python_embedded/bootstrap.py | 13 ++- tools/efrotools/ios.py | 12 +-- tools/efrotools/xcode.py | 13 ++- 20 files changed, 104 insertions(+), 289 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 567cc7de..7ba4ed36 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -3995,50 +3995,50 @@ "assets/src/ba_data/python/ba/_generated/__init__.py": "https://files.ballistica.net/cache/ba1/ee/e8/cad05aa531c7faf7ff7b96db7f6e", "assets/src/ba_data/python/ba/_generated/enums.py": "https://files.ballistica.net/cache/ba1/b2/e5/0ee0561e16257a32830645239f34", "ballisticacore-windows/Generic/BallisticaCore.ico": "https://files.ballistica.net/cache/ba1/89/c0/e32c7d2a35dc9aef57cc73b0911a", - "build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/45/47/fb254ef158db997c8858b8d22110", - "build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/57/d4/698ae0730185dc7b7ac67a4eb767", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c3/35/7a097fc2a74127408db6ef1f47c3", - "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/d7/45/2a73e60be67fa3b47e437de2dd59", - "build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/d1/5e/4717b474342d111ebaaf75567771", - "build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/41/3c/a340c70e6d32bfaa3cdddacfd794", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/fe/b9/f14330bc6f50ead6a987b709ce49", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f4/29/6d43741658433b7e453b126522fb", - "build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/99/8e/8d1e949f963730fd010ba37ef1c1", - "build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/a8/23/efc279aba0a7e31051eb2b325135", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/a8/b4/512c8fe46bad4eb92884de2a800e", - "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/6f/f0/2ff2bd477a10fdca8b4bbe1b510f", - "build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/49/c9/7a40eaa2371e0cde1222958203b5", - "build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/69/a8/55da2cea8f0842b6de56a9961548", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c7/3f/6fa9153308706bcfe343a48148a3", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/31/88/648298b5cc58e52a10ca09cf9dfa", - "build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/9b/5c/0d84219feeaeb77160cd0140d9f4", - "build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/64/a1/4ba65fc65600b4aadffa51a9b058", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/ef/01/c8ca7b64000fbd40b7180a6ed270", - "build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/ff/d6/c40d9fdb7da84a5a6318cf3148af", - "build/prefab/lib/linux_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/df/71/b03ed5409d2f309df6772b89d248", - "build/prefab/lib/linux_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/63/de/a4ec3d43b4ccfe5608e591a926ce", - "build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/60/fc/d52dccc029e90bd99dc5316cf160", - "build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1f/64/eeeca6533b60550b5382c4ab6d5b", - "build/prefab/lib/linux_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/9b/d2/877dec731ae577ea5b3a06e4543a", - "build/prefab/lib/linux_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3c/c6/68a405010eeccd6a64521ef1ef95", - "build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/0e/37/3cd14b51f07eafed10c5f787959e", - "build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/f1/32/74879e7503c6e94bef60ece0f8e8", - "build/prefab/lib/mac_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/9c/80/7ddf9a84c115842f3318acd23bf2", - "build/prefab/lib/mac_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6d/4b/144a4ab37e8bb9d8d58659c2b8d2", - "build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/cb/3b/8a943b30a373621900aec4843d79", - "build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/7a/f4/0293b3d6a83bf728809c1884c9d3", - "build/prefab/lib/mac_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b3/e1/b4a9628161e9d61f78485d04af6b", - "build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/e7/9c/355d07676fd2f48f8f93c22eebf5", - "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6e/98/36e66faa41265566dea6d6ec611c", - "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d1/68/e24da1a4246069b2f41f726e277e", - "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/9d/a7/90dbf73fd64f428b1441d181166a", - "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/da/ea/aac2b051d87fc689f937822965b1", - "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/74/77/3d5601600667a480f3fc0d3fbb1a", - "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/d9/71/dd83dde3b9dcfd748279e1b2e207", - "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/4e/ef/c1eca3a8fa8c1cf704a783e96437", - "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/8a/69/a03e4bf365a546054feb102e37ef", - "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/1b/cb/16b16ceeb8d3626ba93ff46f281f", - "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/a1/40/b8e93c410a15ec6203547ee37949", + "build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/b1/e9/ba5381975b4e92d9a5504f019fdc", + "build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/1e/7b/81aa748d1f4be31a9d091006d6a5", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/13/0e/55dc1e5bff8641dff330663d67d1", + "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/87/8e/cef433031d30964d83b7389d2631", + "build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/9c/ab/457bd16b8cf7bd8f7b3272d614fe", + "build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/1c/f7/2ec681ff4e39532c62512951264e", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/b4/20/695235b5f081ea141a27e330181d", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/28/87/aeb2b7ed56ae315a12d0e34cb8c3", + "build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/0e/99/9c006fa14db50cf99ddc1f80e6c1", + "build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/d0/e6/214891f87b3372e60eb8cbb9753c", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ff/9d/17e3c9eb193ec20734bc14fdf0ca", + "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cd/65/5185aadf1a4389ae0a37e04e7cf6", + "build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/05/c7/15b00532cfdf155400bf1d5e4803", + "build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/ef/c7/d77da265a66c887b716ca3a700a8", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f7/5e/9846a65d6f2ee4fa9dbc21efd253", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/60/23/a2b9f17f6c900a05544219731db2", + "build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/8d/ba/5a1fd21db35212cf5065d0259525", + "build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/c3/2c/b3eb86b93f25990dbb186baa3a54", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/d0/d7/e5bc844aa59c28a34b5d0a1d003c", + "build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/b7/73/6383e03af109ea9ae4de72f076a4", + "build/prefab/lib/linux_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3b/0c/2f4061ab877d415a1c30e0e736db", + "build/prefab/lib/linux_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3c/5a/2b0714af254c64954ccfe51c70b3", + "build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1f/ae/c8a885b1a1868b6846b606cdb456", + "build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/a8/f7/5076f509e31ac616815b094a7ef8", + "build/prefab/lib/linux_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/02/94/9a3f49a8cafa51751a53515ed805", + "build/prefab/lib/linux_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b4/64/33bac83d512e30ad625dbf78203d", + "build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/ce/61/5685c4876a8fb81129982bcc13a6", + "build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/46/c8/f1649944e6f6cc9d2c2dd8bd2d19", + "build/prefab/lib/mac_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/7c/da/9787df7e37481f76011134020772", + "build/prefab/lib/mac_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/bd/0b/255c8b6098f9185f8b4b56ad94b0", + "build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/7a/5f/a84d7a8b97401b814de63d1c0dec", + "build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/2f/1c/88c1537599fa83d6bbd1a0d70096", + "build/prefab/lib/mac_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/d2/da/f8494cc0118eec16f3d6481562a1", + "build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/44/df/efb51d1c226eac613d48e2cbf0b8", + "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1c/f6/357fe951c86c9fc5b1b737cd91ae", + "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/04/17/e2de0ab5df6b938d828e8662ce6d", + "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/43/12/99b9029b31f9abcede32734e9a83", + "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/f0/27/523ae5d573666078314cbbd988b1", + "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/41/bb/1326d20b151d47d67969d4525e4a", + "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/77/3f/6e98ac94c728a0f210b8ce05c418", + "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/90/28/8c0aec847a6ebb6e2977e7b50d21", + "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/65/fc/f7c1c6c6208814d721687fa08c5f", + "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/a7/6b/148a238b89c17790b9dedc481031", + "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/41/9d/61822652055f9319630ea3611cad", "src/ballistica/generated/python_embedded/binding.inc": "https://files.ballistica.net/cache/ba1/7d/3e/229a581cb2454ed856f1d8b564a7", - "src/ballistica/generated/python_embedded/bootstrap.inc": "https://files.ballistica.net/cache/ba1/d3/db/e73d4dcf1280d5f677c3cf8b47c3" + "src/ballistica/generated/python_embedded/bootstrap.inc": "https://files.ballistica.net/cache/ba1/2a/2a/3bb342b3ec8e748a7f6437b610c7" } \ No newline at end of file diff --git a/.idea/dictionaries/ericf.xml b/.idea/dictionaries/ericf.xml index f9c4cdbc..a679acc7 100644 --- a/.idea/dictionaries/ericf.xml +++ b/.idea/dictionaries/ericf.xml @@ -273,6 +273,7 @@ bottlenecked bottype bpos + bpresult brandassets bridgit bsac diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a76af97..f5462ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.7 (build 20711, api 7, 2022-08-23) +### 1.7.7 (build 20715, api 7, 2022-08-25) - Added `ba.app.meta.load_exported_classes()` for loading classes discovered by the meta subsystem cleanly in a background thread. - Improved logging of missing playlist game types. - Some ba.Lstr functionality can now be used in background threads. @@ -6,6 +6,8 @@ - Simplified logic for C++ `Platform::GetDeviceName()` and made it accessible to Python via `ba.app.device_name`. - Default device name now uses gethostname() instead of being hard coded to 'Untitled Device' (though many platforms override this). - Added support for the console tool in the new devices section on ballistica.net. +- Increased timeouts in net-testing gui and a few other places to be able to better diagnose/handle places with very poor connectivity. +- Removed `Platform::SetLastPyCall()` which was just for debugging and which has not been useful in a while. ### 1.7.6 (build 20687, api 7, 2022-08-11) - Cleaned up da MetaSubsystem code. diff --git a/assets/src/ba_data/python/._ba_sources_hash b/assets/src/ba_data/python/._ba_sources_hash index 035fa4c3..e221099f 100644 --- a/assets/src/ba_data/python/._ba_sources_hash +++ b/assets/src/ba_data/python/._ba_sources_hash @@ -1 +1 @@ -120978581248089054368878884309615767758 \ No newline at end of file +255596494167977704690488419471262730072 \ No newline at end of file diff --git a/assets/src/ba_data/python/_ba.py b/assets/src/ba_data/python/_ba.py index 6e72b9f2..d00b2810 100644 --- a/assets/src/ba_data/python/_ba.py +++ b/assets/src/ba_data/python/_ba.py @@ -2511,12 +2511,19 @@ def print_load_info() -> None: def print_stderr(message: str) -> None: - """(internal)""" + """(internal) + + Print to system stderr. + Also forwards to the internal console, etc. + """ return None def print_stdout(message: str) -> None: - """(internal)""" + """(internal) + Print to system stdout. + Also forwards to the internal console, etc. + """ return None diff --git a/assets/src/ba_data/python/bastd/ui/settings/nettesting.py b/assets/src/ba_data/python/bastd/ui/settings/nettesting.py index 9c2700f0..ab2e693d 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/nettesting.py +++ b/assets/src/ba_data/python/bastd/ui/settings/nettesting.py @@ -18,6 +18,10 @@ from bastd.ui.settings.testing import TestingWindow if TYPE_CHECKING: from typing import Callable, Any +# We generally want all net tests to timeout on their own, but we add +# sort of sane max in case they don't. +MAX_TEST_SECONDS = 60 * 2 + class NetTestingWindow(ba.Window): """Window that runs a networking test suite to help diagnose issues.""" @@ -272,8 +276,9 @@ def _test_v1_transaction() -> None: while results[0] is False: time.sleep(0.01) - if time.monotonic() - starttime > 10.0: - raise RuntimeError('timed out') + if time.monotonic() - starttime > MAX_TEST_SECONDS: + raise RuntimeError( + f'test timed out after {MAX_TEST_SECONDS} seconds') # If we got left a string, its an error. if isinstance(results[0], str): @@ -313,8 +318,9 @@ def _test_v2_cloud_message() -> None: if results.response_time is not None: break time.sleep(0.01) - if time.monotonic() - wait_start_time > 10.0: - raise RuntimeError('Timeout waiting for cloud message response') + if time.monotonic() - wait_start_time > MAX_TEST_SECONDS: + raise RuntimeError(f'Timeout ({MAX_TEST_SECONDS} seconds)' + f' waiting for cloud message response') if results.errstr is not None: raise RuntimeError(results.errstr) @@ -339,7 +345,7 @@ def _test_fetch(baseaddr: str) -> None: urllib.request.Request(f'{baseaddr}/ping', None, {'User-Agent': _ba.app.user_agent_string}), context=ba.app.net.sslcontext, - timeout=10.0, + timeout=MAX_TEST_SECONDS, ) if response.getcode() != 200: raise RuntimeError( diff --git a/ballisticacore-cmake/.idea/dictionaries/ericf.xml b/ballisticacore-cmake/.idea/dictionaries/ericf.xml index 76bdc888..b9d0ddbe 100644 --- a/ballisticacore-cmake/.idea/dictionaries/ericf.xml +++ b/ballisticacore-cmake/.idea/dictionaries/ericf.xml @@ -149,6 +149,7 @@ bootsubprocess bouyancy bppv + bpresult bresult bridgit broadcom diff --git a/src/ballistica/ballistica.cc b/src/ballistica/ballistica.cc index 62c9d6d8..83eb9857 100644 --- a/src/ballistica/ballistica.cc +++ b/src/ballistica/ballistica.cc @@ -21,7 +21,7 @@ namespace ballistica { // These are set automatically via script; don't modify them here. -const int kAppBuildNumber = 20711; +const int kAppBuildNumber = 20715; const char* kAppVersion = "1.7.7"; // Our standalone globals. diff --git a/src/ballistica/platform/platform.h b/src/ballistica/platform/platform.h index b9f54601..66dc65c2 100644 --- a/src/ballistica/platform/platform.h +++ b/src/ballistica/platform/platform.h @@ -444,17 +444,6 @@ class Platform { } } - /// Shortcut to set last native Python call we made. - static auto SetLastPyCall(const std::string& name) { - if (g_platform) { - g_platform->py_call_num_++; - g_platform->SetDebugKey( - "LastPyCall" + std::to_string(g_platform->py_call_num_ % 10), - std::to_string(g_platform->py_call_num_) + ":" + name + "@" - + std::to_string(GetCurrentMilliseconds())); - } - } - #pragma mark MISC -------------------------------------------------------------- // Return a monotonic time measurement in milliseconds since launch. @@ -568,7 +557,6 @@ class Platform { virtual auto DoClipboardGetText() -> std::string; private: - int py_call_num_{}; bool using_custom_app_python_dir_{}; bool have_config_dir_{}; bool have_has_touchscreen_value_{}; diff --git a/src/ballistica/python/methods/python_methods_app.cc b/src/ballistica/python/methods/python_methods_app.cc index b7e45bc6..cd743867 100644 --- a/src/ballistica/python/methods/python_methods_app.cc +++ b/src/ballistica/python/methods/python_methods_app.cc @@ -27,7 +27,6 @@ namespace ballistica { auto PyAppName(PyObject* self) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("app_name"); // This will get subbed out by standard filtering. return PyUnicode_FromString("ballisticacore"); @@ -36,7 +35,6 @@ auto PyAppName(PyObject* self) -> PyObject* { auto PyAppNameUpper(PyObject* self) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("app_name_upper"); // This will get subbed out by standard filtering. return PyUnicode_FromString("BallisticaCore"); @@ -45,7 +43,6 @@ auto PyAppNameUpper(PyObject* self) -> PyObject* { auto PyIsXCodeBuild(PyObject* self) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("is_xcode_build"); if (g_buildconfig.xcode_build()) { Py_RETURN_TRUE; } @@ -55,7 +52,6 @@ auto PyIsXCodeBuild(PyObject* self) -> PyObject* { auto PyCanDisplayFullUnicode(PyObject* self) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("can_display_full_unicode"); if (g_buildconfig.enable_os_font_rendering()) { Py_RETURN_TRUE; } @@ -66,7 +62,6 @@ auto PyCanDisplayFullUnicode(PyObject* self) -> PyObject* { auto PyGetSession(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_session"); int raise = true; static const char* kwlist[] = {"doraise", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "|i", @@ -91,7 +86,6 @@ auto PyGetSession(PyObject* self, PyObject* args, PyObject* keywds) auto PyNewHostSession(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("new_host_session"); const char* benchmark_type_str = nullptr; static const char* kwlist[] = {"sessiontype", "benchmark_type", nullptr}; PyObject* sessiontype_obj; @@ -120,7 +114,6 @@ auto PyNewHostSession(PyObject* self, PyObject* args, PyObject* keywds) auto PyNewReplaySession(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("new_replay_session"); std::string file_name; PyObject* file_name_obj; static const char* kwlist[] = {"file_name", nullptr}; @@ -137,7 +130,6 @@ auto PyNewReplaySession(PyObject* self, PyObject* args, PyObject* keywds) auto PyIsInReplay(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("is_in_replay"); BA_PRECONDITION(InGameThread()); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -155,7 +147,6 @@ auto PyIsInReplay(PyObject* self, PyObject* args, PyObject* keywds) auto PyRegisterSession(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("register_session"); assert(InGameThread()); PyObject* session_obj; static const char* kwlist[] = {"session", nullptr}; @@ -178,7 +169,6 @@ auto PyRegisterSession(PyObject* self, PyObject* args, PyObject* keywds) auto PyRegisterActivity(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("register_activity"); assert(InGameThread()); PyObject* activity_obj; static const char* kwlist[] = {"activity", nullptr}; @@ -200,7 +190,6 @@ auto PyRegisterActivity(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetForegroundHostSession(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_foreground_host_session"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -223,7 +212,6 @@ auto PyGetForegroundHostSession(PyObject* self, PyObject* args, auto PyNewActivity(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("new_activity"); static const char* kwlist[] = {"activity_type", "settings", nullptr}; PyObject* activity_type_obj; @@ -263,7 +251,6 @@ auto PyNewActivity(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetActivity(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_activity"); int raise = true; static const char* kwlist[] = {"doraise", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "|i", @@ -291,7 +278,6 @@ auto PyGetActivity(PyObject* self, PyObject* args, PyObject* keywds) auto PyPushCall(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("push_call"); PyObject* call_obj; int from_other_thread{}; int suppress_warning{}; @@ -329,7 +315,6 @@ auto PyPushCall(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyTime(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("time"); PyObject* time_type_obj = nullptr; PyObject* time_format_obj = nullptr; @@ -377,7 +362,6 @@ auto PyTime(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyTimer(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; assert(InGameThread()); - Platform::SetLastPyCall("timer"); PyObject* length_obj; int64_t length; @@ -450,7 +434,6 @@ auto PyTimer(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyScreenMessage(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("screen_message"); const char* message = nullptr; PyObject* color_obj = Py_None; int top = 0; @@ -585,7 +568,6 @@ auto PyScreenMessage(PyObject* self, PyObject* args, PyObject* keywds) auto PyQuit(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("quit"); static const char* kwlist[] = {"soft", "back", nullptr}; int soft = 0; int back = 0; @@ -636,7 +618,6 @@ auto PyQuit(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { #if BA_DEBUG_BUILD auto PyBless(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("bless"); ScreenMessage("WOULD BLESS BUILD " + std::to_string(kAppBuildNumber)); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -645,7 +626,6 @@ auto PyBless(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyApplyConfig(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("apply_config"); // Hmm; python runs in the game thread; technically we could just run // ApplyConfig() immediately (though pushing is probably safer). @@ -657,7 +637,6 @@ auto PyApplyConfig(PyObject* self, PyObject* args) -> PyObject* { auto PyCommitConfig(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("commit_config"); PyObject* config_obj; static const char* kwlist[] = {"config", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "O", @@ -721,7 +700,6 @@ auto PyCommitConfig(PyObject* self, PyObject* args, PyObject* keywds) auto PyEnv(PyObject* self) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("env"); static PyObject* env_obj = nullptr; @@ -816,7 +794,6 @@ auto PyEnv(PyObject* self) -> PyObject* { auto PySetStressTesting(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_stress_testing"); int testing; int player_count; if (!PyArg_ParseTuple(args, "pi", &testing, &player_count)) { @@ -829,7 +806,6 @@ auto PySetStressTesting(PyObject* self, PyObject* args) -> PyObject* { auto PyPrintStdout(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("print_stdout"); const char* s; if (!PyArg_ParseTuple(args, "s", &s)) { return nullptr; @@ -841,7 +817,6 @@ auto PyPrintStdout(PyObject* self, PyObject* args) -> PyObject* { auto PyPrintStderr(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("print_stderr"); const char* s; if (!PyArg_ParseTuple(args, "s", &s)) { return nullptr; @@ -853,7 +828,6 @@ auto PyPrintStderr(PyObject* self, PyObject* args) -> PyObject* { auto PyLog(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("log"); static const char* kwlist[] = {"message", "to_stdout", "to_server", nullptr}; int to_server = 1; int to_stdout = 1; @@ -873,7 +847,6 @@ auto PyLog(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyTimeFormatCheck(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("time_format_check"); static const char* kwlist[] = {"time_format", "length", nullptr}; PyObject* time_format_obj; PyObject* length_obj; @@ -945,12 +918,18 @@ auto PythonMethodsApp::GetMethods() -> std::vector { {"print_stdout", PyPrintStdout, METH_VARARGS, "print_stdout(message: str) -> None\n" "\n" - "(internal)"}, + "(internal)" + "\n" + "Print to system stdout.\n" + "Also forwards to the internal console, etc."}, {"print_stderr", PyPrintStderr, METH_VARARGS, "print_stderr(message: str) -> None\n" "\n" - "(internal)"}, + "(internal)\n" + "\n" + "Print to system stderr.\n" + "Also forwards to the internal console, etc."}, {"set_stress_testing", PySetStressTesting, METH_VARARGS, "set_stress_testing(testing: bool, player_count: int) -> None\n" diff --git a/src/ballistica/python/methods/python_methods_gameplay.cc b/src/ballistica/python/methods/python_methods_gameplay.cc index 811a8aac..2ccb5b7c 100644 --- a/src/ballistica/python/methods/python_methods_gameplay.cc +++ b/src/ballistica/python/methods/python_methods_gameplay.cc @@ -33,7 +33,6 @@ namespace ballistica { auto PyNewNode(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("new_node"); Node* n = g_python->DoNewNode(args, keywds); if (!n) { return nullptr; @@ -44,7 +43,6 @@ auto PyNewNode(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyPrintNodes(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("print_nodes"); HostActivity* host_activity = g_game->GetForegroundContext().GetHostActivity(); if (!host_activity) { @@ -67,7 +65,6 @@ auto PyPrintNodes(PyObject* self, PyObject* args) -> PyObject* { auto PyGetNodes(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_nodes"); HostActivity* host_activity = Context::current().GetHostActivity(); if (!host_activity) { throw Exception(PyExcType::kContext); @@ -132,7 +129,6 @@ static auto DoGetCollideValue(Dynamics* dynamics, const Collision* c, auto PyGetCollisionInfo(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_collision_info"); HostActivity* host_activity = Context::current().GetHostActivity(); if (!host_activity) { throw Exception(PyExcType::kContext); @@ -186,7 +182,6 @@ auto PyGetCollisionInfo(PyObject* self, PyObject* args) -> PyObject* { auto PyCameraShake(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("camera_shake"); assert(InGameThread()); float intensity = 1.0f; static const char* kwlist[] = {"intensity", nullptr}; @@ -202,7 +197,6 @@ auto PyCameraShake(PyObject* self, PyObject* args, PyObject* keywds) auto PyPlaySound(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("play_sound"); assert(InGameThread()); PyObject* sound_obj; @@ -248,7 +242,6 @@ auto PyPlaySound(PyObject* self, PyObject* args, PyObject* keywds) auto PyEmitFx(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("emit_fx"); static const char* kwlist[] = {"position", "velocity", "count", "scale", "spread", "chunk_type", "emit_type", "tendril_type", nullptr}; @@ -363,7 +356,6 @@ auto PyEmitFx(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PySetMapBounds(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_map_bounds"); HostActivity* host_activity = Context::current().GetHostActivity(); if (!host_activity) { throw Exception(PyExcType::kContext); @@ -382,7 +374,6 @@ auto PySetMapBounds(PyObject* self, PyObject* args) -> PyObject* { auto PyGetForegroundHostActivity(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_foreground_host_activity"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -405,7 +396,6 @@ auto PyGetForegroundHostActivity(PyObject* self, PyObject* args, auto PyGetGameRoster(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_game_roster"); BA_PRECONDITION(InGameThread()); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -501,7 +491,6 @@ auto PyGetGameRoster(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetScoresToBeat(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_scores_to_beat"); const char* level; const char* config; PyObject* callback_obj = Py_None; @@ -522,7 +511,6 @@ auto PyGetScoresToBeat(PyObject* self, PyObject* args, PyObject* keywds) auto PySetDebugSpeedExponent(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_debug_speed_exponent"); int speed; if (!PyArg_ParseTuple(args, "i", &speed)) { return nullptr; @@ -542,7 +530,6 @@ auto PySetDebugSpeedExponent(PyObject* self, PyObject* args) -> PyObject* { auto PyGetReplaySpeedExponent(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_replay_speed_exponent"); assert(g_game); return PyLong_FromLong(g_game->replay_speed_exponent()); BA_PYTHON_CATCH; @@ -550,7 +537,6 @@ auto PyGetReplaySpeedExponent(PyObject* self, PyObject* args) -> PyObject* { auto PySetReplaySpeedExponent(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_replay_speed_exponent"); int speed; if (!PyArg_ParseTuple(args, "i", &speed)) return nullptr; assert(g_game); @@ -562,7 +548,6 @@ auto PySetReplaySpeedExponent(PyObject* self, PyObject* args) -> PyObject* { auto PyResetGameActivityTracking(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("reset_game_activity_tracking"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -578,7 +563,6 @@ auto PyResetGameActivityTracking(PyObject* self, PyObject* args, auto PyResetRandomPlayerNames(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("reset_random_player_names"); InputDevice::ResetRandomNames(); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -586,7 +570,6 @@ auto PyResetRandomPlayerNames(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetRandomNames(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_random_names"); PyObject* list = PyList_New(0); const std::list& random_name_list = Utils::GetRandomNameList(); for (const auto& i : random_name_list) { diff --git a/src/ballistica/python/methods/python_methods_graphics.cc b/src/ballistica/python/methods/python_methods_graphics.cc index 3ae7f913..87f72ca9 100644 --- a/src/ballistica/python/methods/python_methods_graphics.cc +++ b/src/ballistica/python/methods/python_methods_graphics.cc @@ -20,7 +20,6 @@ namespace ballistica { auto PyGetCameraPosition(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_camera_position"); float x = 0.0f; float y = 0.0f; float z = 0.0f; @@ -33,7 +32,6 @@ auto PyGetCameraPosition(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetCameraTarget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_camera_target"); float x = 0.0f; float y = 0.0f; float z = 0.0f; @@ -46,7 +44,6 @@ auto PyGetCameraTarget(PyObject* self, PyObject* args, PyObject* keywds) auto PySetCameraPosition(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_camera_position"); float x = 0.0f; float y = 0.0f; float z = 0.0f; @@ -64,7 +61,6 @@ auto PySetCameraPosition(PyObject* self, PyObject* args, PyObject* keywds) auto PySetCameraTarget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_camera_target"); float x = 0.0f; float y = 0.0f; float z = 0.0f; @@ -82,7 +78,6 @@ auto PySetCameraTarget(PyObject* self, PyObject* args, PyObject* keywds) auto PySetCameraManual(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_camera_manual"); bool value = false; static const char* kwlist[] = {"value", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "b", @@ -97,7 +92,6 @@ auto PySetCameraManual(PyObject* self, PyObject* args, PyObject* keywds) auto PyCharStr(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("charstr"); PyObject* name_obj; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "O", @@ -114,7 +108,6 @@ auto PyCharStr(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PySafeColor(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("safecolor"); PyObject* color_obj; float red, green, blue; float target_intensity = 0.6f; @@ -152,7 +145,6 @@ auto PySafeColor(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetMaxGraphicsQuality(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_max_graphics_quality"); if (g_graphics && g_graphics->has_supports_high_quality_graphics_value() && g_graphics->supports_high_quality_graphics()) { return Py_BuildValue("s", "High"); @@ -165,7 +157,6 @@ auto PyGetMaxGraphicsQuality(PyObject* self, PyObject* args) -> PyObject* { auto PyEvaluateLstr(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("evaluate_lstr"); const char* value; static const char* kwlist[] = {"value", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -180,7 +171,6 @@ auto PyEvaluateLstr(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetStringHeight(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_string_height"); std::string s; int suppress_warning = 0; PyObject* s_obj; @@ -211,7 +201,6 @@ auto PyGetStringHeight(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetStringWidth(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_string_width"); std::string s; PyObject* s_obj; int suppress_warning = 0; @@ -242,7 +231,6 @@ auto PyGetStringWidth(PyObject* self, PyObject* args, PyObject* keywds) auto PyHaveChars(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("have_chars"); std::string text; PyObject* text_obj; static const char* kwlist[] = {"text", nullptr}; @@ -262,7 +250,6 @@ auto PyHaveChars(PyObject* self, PyObject* args, PyObject* keywds) auto PyAddCleanFrameCallback(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("add_clean_frame_callback"); PyObject* call_obj; static const char* kwlist[] = {"call", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "O", @@ -276,7 +263,6 @@ auto PyAddCleanFrameCallback(PyObject* self, PyObject* args, PyObject* keywds) auto PyHasGammaControl(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("has_gamma_control"); // phasing this out; our old non-sdl2 mac has gamma controls but nothing newer // does... #if BA_OSTYPE_MACOS && !BA_SDL2_BUILD @@ -289,7 +275,6 @@ auto PyHasGammaControl(PyObject* self, PyObject* args) -> PyObject* { auto PyGetDisplayResolution(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_display_resolution"); int x = 0; int y = 0; bool have_res = g_platform->GetDisplayResolution(&x, &y); diff --git a/src/ballistica/python/methods/python_methods_input.cc b/src/ballistica/python/methods/python_methods_input.cc index d1ffdf2f..39fb0e48 100644 --- a/src/ballistica/python/methods/python_methods_input.cc +++ b/src/ballistica/python/methods/python_methods_input.cc @@ -20,7 +20,6 @@ namespace ballistica { auto PyGetConfigurableGamePads(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_configurable_game_pads"); std::vector gamepads = g_input->GetConfigurableGamePads(); PyObject* list = PyList_New(0); for (auto&& i : gamepads) { @@ -34,7 +33,6 @@ auto PyGetConfigurableGamePads(PyObject* self, PyObject* args) -> PyObject* { auto PyHaveTouchScreenInput(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("have_touch_screen_input"); if (g_app_globals->touch_input) { Py_RETURN_TRUE; } else { @@ -45,7 +43,6 @@ auto PyHaveTouchScreenInput(PyObject* self, PyObject* args) -> PyObject* { auto PySetTouchscreenEditing(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_touchscreen_editing"); int editing; if (!PyArg_ParseTuple(args, "p", &editing)) { return nullptr; @@ -59,7 +56,6 @@ auto PySetTouchscreenEditing(PyObject* self, PyObject* args) -> PyObject* { auto PyCaptureGamePadInput(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("capture_gamepad_input"); assert(InGameThread()); assert(g_python); PyObject* obj; @@ -73,7 +69,6 @@ auto PyCaptureGamePadInput(PyObject* self, PyObject* args) -> PyObject* { auto PyReleaseGamePadInput(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("release_gamepad_input"); assert(InGameThread()); assert(g_python); g_python->ReleaseGamePadInput(); @@ -83,7 +78,6 @@ auto PyReleaseGamePadInput(PyObject* self, PyObject* args) -> PyObject* { auto PyCaptureKeyboardInput(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("capture_keyboard_input"); assert(InGameThread()); if (!g_python) { return nullptr; @@ -99,7 +93,6 @@ auto PyCaptureKeyboardInput(PyObject* self, PyObject* args) -> PyObject* { auto PyReleaseKeyboardInput(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("release_keyboard_input"); assert(InGameThread()); if (!g_python) { return nullptr; @@ -111,7 +104,6 @@ auto PyReleaseKeyboardInput(PyObject* self, PyObject* args) -> PyObject* { auto PyLockAllInput(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("lock_all_input"); assert(InGameThread()); assert(g_input); g_input->LockAllInput(false, Python::GetPythonFileLocation()); @@ -121,7 +113,6 @@ auto PyLockAllInput(PyObject* self, PyObject* args) -> PyObject* { auto PyUnlockAllInput(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("unlock_all_input"); assert(InGameThread()); assert(g_input); g_input->UnlockAllInput(false, Python::GetPythonFileLocation()); @@ -132,7 +123,6 @@ auto PyUnlockAllInput(PyObject* self, PyObject* args) -> PyObject* { auto PyGetUIInputDevice(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_ui_input_device"); assert(InGameThread()); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -151,7 +141,6 @@ auto PyGetUIInputDevice(PyObject* self, PyObject* args, PyObject* keywds) auto PySetUIInputDevice(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_ui_input_device"); assert(InGameThread()); static const char* kwlist[] = {"input", nullptr}; PyObject* input_device_obj = Py_None; @@ -170,7 +159,6 @@ auto PySetUIInputDevice(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetInputDevice(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_input_device"); assert(InGameThread()); const char* name; const char* unique_id; @@ -199,7 +187,6 @@ auto PyGetInputDevice(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetLocalActiveInputDevicesCount(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_local_active_input_devices_count"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { diff --git a/src/ballistica/python/methods/python_methods_media.cc b/src/ballistica/python/methods/python_methods_media.cc index 00f72e3b..98d73a24 100644 --- a/src/ballistica/python/methods/python_methods_media.cc +++ b/src/ballistica/python/methods/python_methods_media.cc @@ -27,7 +27,6 @@ namespace ballistica { auto PyGetTexture(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("gettexture"); const char* name; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -41,7 +40,6 @@ auto PyGetTexture(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetPackageTexture(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getpackagetexture"); const char* name; PyObject* package_obj; static const char* kwlist[] = {"package", "name", nullptr}; @@ -57,7 +55,6 @@ auto PyGetPackageTexture(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetSound(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getsound"); const char* name; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -71,7 +68,6 @@ auto PyGetSound(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyGetPackageSound(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getpackagesound"); const char* name; PyObject* package_obj; static const char* kwlist[] = {"package", "name", nullptr}; @@ -87,7 +83,6 @@ auto PyGetPackageSound(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetData(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getdata"); const char* name; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -101,7 +96,6 @@ auto PyGetData(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyGetPackageData(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getpackagedata"); const char* name; PyObject* package_obj; static const char* kwlist[] = {"package", "name", nullptr}; @@ -117,7 +111,6 @@ auto PyGetPackageData(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetModel(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getmodel"); const char* name; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -131,7 +124,6 @@ auto PyGetModel(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyGetPackageModel(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getpackagemodel"); const char* name; PyObject* package_obj; static const char* kwlist[] = {"package", "name", nullptr}; @@ -148,7 +140,6 @@ auto PyGetPackageModel(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetCollideModel(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getcollidemodel"); const char* name; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -162,7 +153,6 @@ auto PyGetCollideModel(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetPackageCollideModel(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getpackagecollidemodel"); const char* name; PyObject* package_obj; static const char* kwlist[] = {"package", "name", nullptr}; @@ -179,7 +169,6 @@ auto PyGetPackageCollideModel(PyObject* self, PyObject* args, PyObject* keywds) auto PyMusicPlayerStop(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("musicplayerstop"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -193,7 +182,6 @@ auto PyMusicPlayerStop(PyObject* self, PyObject* args, PyObject* keywds) auto PyMusicPlayerPlay(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("musicplayerplay"); PyObject* files_obj; static const char* kwlist[] = {"files", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "O", @@ -208,7 +196,6 @@ auto PyMusicPlayerPlay(PyObject* self, PyObject* args, PyObject* keywds) auto PyMusicPlayerSetVolume(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("musicplayersetvolume"); float volume; static const char* kwlist[] = {"volume", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "f", @@ -223,7 +210,6 @@ auto PyMusicPlayerSetVolume(PyObject* self, PyObject* args, PyObject* keywds) auto PyMusicPlayerShutdown(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("musicplayershutdown"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -236,7 +222,6 @@ auto PyMusicPlayerShutdown(PyObject* self, PyObject* args, PyObject* keywds) auto PyReloadMedia(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("reloadmedia"); assert(g_graphics_server); g_graphics_server->PushReloadMediaCall(); Py_RETURN_NONE; @@ -246,7 +231,6 @@ auto PyReloadMedia(PyObject* self, PyObject* args) -> PyObject* { auto PyGetQRCodeTexture(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getqrcodetexture"); const char* url; static const char* kwlist[] = {"url", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -268,7 +252,6 @@ auto PyGetQRCodeTexture(PyObject* self, PyObject* args, PyObject* keywds) auto PyMacMusicAppInit(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("macmusicappinit"); g_platform->MacMusicAppInit(); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -277,7 +260,6 @@ auto PyMacMusicAppInit(PyObject* self, PyObject* args, PyObject* keywds) auto PyMacMusicAppGetVolume(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("macmusicappgetvolume"); return PyLong_FromLong(g_platform->MacMusicAppGetVolume()); BA_PYTHON_CATCH; } @@ -285,7 +267,6 @@ auto PyMacMusicAppGetVolume(PyObject* self, PyObject* args, PyObject* keywds) auto PyMacMusicAppSetVolume(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("macmusicappsetvolume"); int volume; static const char* kwlist[] = {"volume", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "i", @@ -300,7 +281,6 @@ auto PyMacMusicAppSetVolume(PyObject* self, PyObject* args, PyObject* keywds) auto PyMacMusicAppGetLibrarySource(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("macmusicappgetlibrarysource"); g_platform->MacMusicAppGetLibrarySource(); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -309,7 +289,6 @@ auto PyMacMusicAppGetLibrarySource(PyObject* self, PyObject* args, auto PyMacMusicAppStop(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("macmusicappstop"); g_platform->MacMusicAppStop(); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -318,7 +297,6 @@ auto PyMacMusicAppStop(PyObject* self, PyObject* args, PyObject* keywds) auto PyMacMusicAppPlayPlaylist(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("macmusicappplayplaylist"); std::string playlist; PyObject* playlist_obj; static const char* kwlist[] = {"playlist", nullptr}; @@ -338,7 +316,6 @@ auto PyMacMusicAppPlayPlaylist(PyObject* self, PyObject* args, PyObject* keywds) auto PyMacMusicAppGetPlaylists(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("macmusicappgetplaylists"); PyObject* py_list = PyList_New(0); std::list playlists = g_platform->MacMusicAppGetPlaylists(); for (auto&& i : playlists) { @@ -353,7 +330,6 @@ auto PyMacMusicAppGetPlaylists(PyObject* self, PyObject* args, PyObject* keywds) auto PyIsOSPlayingMusic(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("isosplayingmusic"); if (g_platform->IsOSPlayingMusic()) { Py_RETURN_TRUE; } else { diff --git a/src/ballistica/python/methods/python_methods_networking.cc b/src/ballistica/python/methods/python_methods_networking.cc index fe77dd7d..749fc56b 100644 --- a/src/ballistica/python/methods/python_methods_networking.cc +++ b/src/ballistica/python/methods/python_methods_networking.cc @@ -25,7 +25,6 @@ namespace ballistica { auto PyGetPublicPartyEnabled(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getpublicpartyenabled"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) @@ -42,7 +41,6 @@ auto PyGetPublicPartyEnabled(PyObject* self, PyObject* args, PyObject* keywds) auto PySetPublicPartyEnabled(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("setpublicpartyenabled"); int enable; static const char* kwlist[] = {"enabled", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "p", @@ -58,7 +56,6 @@ auto PySetPublicPartyEnabled(PyObject* self, PyObject* args, PyObject* keywds) auto PySetPublicPartyName(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("setpublicpartyname"); PyObject* name_obj; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "O", @@ -75,7 +72,6 @@ auto PySetPublicPartyName(PyObject* self, PyObject* args, PyObject* keywds) auto PySetPublicPartyStatsURL(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("setpublicpartystatsurl"); PyObject* url_obj; static const char* kwlist[] = {"url", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "O", @@ -93,7 +89,6 @@ auto PySetPublicPartyStatsURL(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetPublicPartyMaxSize(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("getpublicpartymaxsize"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -107,7 +102,6 @@ auto PyGetPublicPartyMaxSize(PyObject* self, PyObject* args, PyObject* keywds) auto PySetPublicPartyMaxSize(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("setpublicpartymaxsize"); int max_size; static const char* kwlist[] = {"max_size", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "i", @@ -123,7 +117,6 @@ auto PySetPublicPartyMaxSize(PyObject* self, PyObject* args, PyObject* keywds) auto PySetAuthenticateClients(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_authenticate_clients"); int enable; static const char* kwlist[] = {"enable", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "p", @@ -139,7 +132,6 @@ auto PySetAuthenticateClients(PyObject* self, PyObject* args, PyObject* keywds) auto PySetAdmins(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_admins"); PyObject* admins_obj; static const char* kwlist[] = {"admins", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "O", @@ -162,7 +154,6 @@ auto PySetAdmins(PyObject* self, PyObject* args, PyObject* keywds) auto PySetEnableDefaultKickVoting(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_enable_default_kick_voting"); int enable; static const char* kwlist[] = {"enable", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "p", @@ -178,7 +169,6 @@ auto PySetEnableDefaultKickVoting(PyObject* self, PyObject* args, auto PyConnectToParty(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("connect_to_party"); std::string address; PyObject* address_obj; int port = kDefaultPort; @@ -225,7 +215,6 @@ auto PyConnectToParty(PyObject* self, PyObject* args, PyObject* keywds) auto PyClientInfoQueryResponse(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("client_info_query_response"); const char* token; PyObject* response_obj; static const char* kwlist[] = {"token", "response", nullptr}; @@ -242,7 +231,6 @@ auto PyClientInfoQueryResponse(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetConnectionToHostInfo(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_connection_to_host_info"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -262,7 +250,6 @@ auto PyGetConnectionToHostInfo(PyObject* self, PyObject* args, PyObject* keywds) auto PyDisconnectFromHost(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("disconnect_from_host"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -276,7 +263,6 @@ auto PyDisconnectFromHost(PyObject* self, PyObject* args, PyObject* keywds) auto PyDisconnectClient(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("disconnect_client"); int client_id; int ban_time = 300; // Old default before we exposed this. static const char* kwlist[] = {"client_id", "ban_time", nullptr}; @@ -297,7 +283,6 @@ auto PyDisconnectClient(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetClientPublicDeviceUUID(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_client_public_device_uuid"); int client_id; static const char* kwlist[] = {"client_id", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "i", @@ -325,7 +310,6 @@ auto PyGetClientPublicDeviceUUID(PyObject* self, PyObject* args, auto PyGetGamePort(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_game_port"); int port = 0; if (g_network_reader != nullptr) { // Hmmm; we're just fetching the ipv4 port here; 6 could be different. @@ -337,7 +321,6 @@ auto PyGetGamePort(PyObject* self, PyObject* args) -> PyObject* { auto PySetMasterServerSource(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_master_server_source"); int source; if (!PyArg_ParseTuple(args, "i", &source)) return nullptr; if (source != 0 && source != 1) { @@ -353,7 +336,6 @@ auto PySetMasterServerSource(PyObject* self, PyObject* args) -> PyObject* { auto PySetTelnetAccessEnabled(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_telnet_access_enabled"); assert(InGameThread()); int enable; static const char* kwlist[] = {"enable", nullptr}; @@ -373,7 +355,6 @@ auto PySetTelnetAccessEnabled(PyObject* self, PyObject* args, PyObject* keywds) auto PyHostScanCycle(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("host_scan_cycle"); g_networking->HostScanCycle(); std::vector results = g_networking->GetScanResults(); @@ -390,7 +371,6 @@ auto PyHostScanCycle(PyObject* self, PyObject* args, PyObject* keywds) auto PyEndHostScanning(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("end_host_scanning"); g_networking->EndHostScanning(); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -399,7 +379,6 @@ auto PyEndHostScanning(PyObject* self, PyObject* args, PyObject* keywds) auto PyHaveConnectedClients(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("have_connected_clients"); if (g_game->connections()->GetConnectedClientCount() > 0) { Py_RETURN_TRUE; } else { diff --git a/src/ballistica/python/methods/python_methods_system.cc b/src/ballistica/python/methods/python_methods_system.cc index be4c7beb..878af6cb 100644 --- a/src/ballistica/python/methods/python_methods_system.cc +++ b/src/ballistica/python/methods/python_methods_system.cc @@ -50,7 +50,6 @@ auto PyClipboardHasText(PyObject* self) -> PyObject* { auto PyClipboardSetText(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("clipboard_set_text"); const char* value; static const char* kwlist[] = {"value", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -71,14 +70,12 @@ auto PyClipboardGetText(PyObject* self) -> PyObject* { auto PyIsRunningOnOuya(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("is_running_on_ouya"); Py_RETURN_FALSE; BA_PYTHON_CATCH; } auto PySetUpSigInt(PyObject* self) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_up_sig_int"); if (g_app) { g_platform->SetupInterruptHandling(); } else { @@ -90,7 +87,6 @@ auto PySetUpSigInt(PyObject* self) -> PyObject* { auto PyIsRunningOnFireTV(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("is_running_on_fire_tv"); if (g_platform->IsRunningOnFireTV()) { Py_RETURN_TRUE; } @@ -101,7 +97,6 @@ auto PyIsRunningOnFireTV(PyObject* self, PyObject* args) -> PyObject* { auto PyHavePermission(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("have_permission"); BA_PRECONDITION(InGameThread()); Permission permission; PyObject* permission_obj; @@ -123,7 +118,6 @@ auto PyHavePermission(PyObject* self, PyObject* args, PyObject* keywds) auto PyRequestPermission(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("request_permission"); BA_PRECONDITION(InGameThread()); Permission permission; PyObject* permission_obj; @@ -143,7 +137,6 @@ auto PyRequestPermission(PyObject* self, PyObject* args, PyObject* keywds) auto PyInGameThread(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("in_game_thread"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -159,7 +152,6 @@ auto PyInGameThread(PyObject* self, PyObject* args, PyObject* keywds) auto PySetThreadName(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_thread_name"); const char* name; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -174,7 +166,6 @@ auto PySetThreadName(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetThreadName(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_thread_name"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -189,7 +180,6 @@ auto PyGetThreadName(PyObject* self, PyObject* args, PyObject* keywds) auto PyExtraHashValue(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("extra_hash_value"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -205,7 +195,6 @@ auto PyExtraHashValue(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetIdleTime(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_idle_time"); return PyLong_FromLong(static_cast_check_fit( // NOLINT g_input ? g_input->input_idle_time() : 0)); BA_PYTHON_CATCH; @@ -213,7 +202,6 @@ auto PyGetIdleTime(PyObject* self, PyObject* args) -> PyObject* { auto PyHasUserRunCommands(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("has_user_run_commands"); if (g_app_globals->user_ran_commands) { Py_RETURN_TRUE; } @@ -223,7 +211,6 @@ auto PyHasUserRunCommands(PyObject* self, PyObject* args) -> PyObject* { auto PyWorkspacesInUse(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("workspaces_in_use"); if (g_app_globals->workspaces_in_use) { Py_RETURN_TRUE; } @@ -233,7 +220,6 @@ auto PyWorkspacesInUse(PyObject* self, PyObject* args) -> PyObject* { auto PyContainsPythonDist(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("contains_python_dist"); if (g_platform->ContainsPythonDist()) { Py_RETURN_TRUE; } @@ -244,7 +230,6 @@ auto PyContainsPythonDist(PyObject* self, PyObject* args) -> PyObject* { auto PyValueTest(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("value_test"); const char* arg; double change = 0.0f; double absolute = 0.0f; @@ -354,7 +339,6 @@ auto PyValueTest(PyObject* self, PyObject* args, PyObject* keywds) } auto PyDebugPrintPyErr(PyObject* self, PyObject* args) -> PyObject* { - Platform::SetLastPyCall("debug_print_py_err"); if (PyErr_Occurred()) { // we pass zero here to avoid grabbing references to this exception // which can cause objects to stick around and trip up our deletion checks @@ -368,7 +352,6 @@ auto PyDebugPrintPyErr(PyObject* self, PyObject* args) -> PyObject* { auto PyPrintContext(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("print_context"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -382,7 +365,6 @@ auto PyPrintContext(PyObject* self, PyObject* args, PyObject* keywds) auto PyPrintLoadInfo(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("print_load_info"); g_media->PrintLoadInfo(); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -391,7 +373,6 @@ auto PyPrintLoadInfo(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetReplaysDir(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_replays_dir"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -404,7 +385,6 @@ auto PyGetReplaysDir(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetAppConfigDefaultValue(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_app_config_default_value"); const char* key = ""; static const char* kwlist[] = {"key", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -438,7 +418,6 @@ auto PyGetAppConfigDefaultValue(PyObject* self, PyObject* args, auto PyAppConfigGetBuiltinKeys(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("app_config_get_builtin_keys"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -455,7 +434,6 @@ auto PyAppConfigGetBuiltinKeys(PyObject* self, PyObject* args, PyObject* keywds) auto PyResolveAppConfigValue(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("resolve_app_config_value"); const char* key; static const char* kwlist[] = {"key", nullptr}; @@ -490,7 +468,6 @@ auto PyResolveAppConfigValue(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetLowLevelConfigValue(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_low_level_config_value"); const char* key; int default_value; static const char* kwlist[] = {"key", "default_value", nullptr}; @@ -505,7 +482,6 @@ auto PyGetLowLevelConfigValue(PyObject* self, PyObject* args, PyObject* keywds) auto PySetLowLevelConfigValue(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_low_level_config_value"); const char* key; int value; static const char* kwlist[] = {"key", "value", nullptr}; @@ -520,7 +496,6 @@ auto PySetLowLevelConfigValue(PyObject* self, PyObject* args, PyObject* keywds) auto PySetPlatformMiscReadVals(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_platform_misc_read_vals"); PyObject* vals_obj; static const char* kwlist[] = {"mode", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "O", @@ -535,7 +510,6 @@ auto PySetPlatformMiscReadVals(PyObject* self, PyObject* args, PyObject* keywds) auto PyGetLogFilePath(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_log_file_path"); std::string config_dir = g_platform->GetConfigDirectory(); std::string logpath = config_dir + BA_DIRSLASH + "log.json"; return PyUnicode_FromString(logpath.c_str()); @@ -544,14 +518,12 @@ auto PyGetLogFilePath(PyObject* self, PyObject* args) -> PyObject* { auto PyGetVolatileDataDirectory(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_volatile_data_directory"); return PyUnicode_FromString(g_platform->GetVolatileDataDirectory().c_str()); BA_PYTHON_CATCH; } auto PyIsLogFull(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("is_log_full"); if (g_app_globals->log_full) { Py_RETURN_TRUE; } @@ -561,7 +533,6 @@ auto PyIsLogFull(PyObject* self, PyObject* args) -> PyObject* { auto PyGetLog(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_log"); std::string log_fin; { std::lock_guard lock(g_app_globals->log_mutex); @@ -577,7 +548,6 @@ auto PyGetLog(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyMarkLogSent(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("mark_log_sent"); // this way we won't try to send it at shutdown time and whatnot g_app_globals->put_log = true; Py_RETURN_NONE; @@ -587,7 +557,6 @@ auto PyMarkLogSent(PyObject* self, PyObject* args, PyObject* keywds) auto PyIncrementAnalyticsCount(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("increment_analytics_count"); const char* name; int increment = 1; static const char* kwlist[] = {"name", "increment", nullptr}; @@ -603,7 +572,6 @@ auto PyIncrementAnalyticsCount(PyObject* self, PyObject* args, PyObject* keywds) auto PyIncrementAnalyticsCountRaw(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("increment_analytics_count_raw"); const char* name; int increment = 1; static const char* kwlist[] = {"name", "increment", nullptr}; @@ -619,7 +587,6 @@ auto PyIncrementAnalyticsCountRaw(PyObject* self, PyObject* args, auto PyIncrementAnalyticsCountRaw2(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("increment_analytics_count_raw2"); const char* name; int uses_increment = 1; int increment = 1; @@ -638,7 +605,6 @@ auto PyIncrementAnalyticsCountRaw2(PyObject* self, PyObject* args, auto PySubmitAnalyticsCounts(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("submit_analytics_counts"); g_platform->SubmitAnalyticsCounts(); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -647,7 +613,6 @@ auto PySubmitAnalyticsCounts(PyObject* self, PyObject* args, PyObject* keywds) auto PySetAnalyticsScreen(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_analytics_screen"); const char* screen; static const char* kwlist[] = {"screen", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -661,7 +626,6 @@ auto PySetAnalyticsScreen(PyObject* self, PyObject* args, PyObject* keywds) auto PySetInternalLanguageKeys(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_internal_language_keys"); PyObject* list_obj; PyObject* random_names_list_obj; if (!PyArg_ParseTuple(args, "OO", &list_obj, &random_names_list_obj)) { @@ -699,7 +663,6 @@ auto PySetInternalLanguageKeys(PyObject* self, PyObject* args) -> PyObject* { auto PyIsOuyaBuild(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("is_ouya_builds"); Py_RETURN_FALSE; BA_PYTHON_CATCH; } @@ -707,7 +670,6 @@ auto PyIsOuyaBuild(PyObject* self, PyObject* args) -> PyObject* { auto PyAndroidMediaScanFile(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("android_media_scan_file"); const char* file_name; static const char* kwlist[] = {"file_name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -725,7 +687,6 @@ auto PyAndroidMediaScanFile(PyObject* self, PyObject* args, PyObject* keywds) auto PyAndroidGetExternalFilesDir(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("android_get_external_files_dir"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -750,7 +711,6 @@ auto PyAndroidGetExternalFilesDir(PyObject* self, PyObject* args, auto PyAndroidShowWifiSettings(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("android_show_wifi_settings"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -764,7 +724,6 @@ auto PyAndroidShowWifiSettings(PyObject* self, PyObject* args, PyObject* keywds) auto PyPrintObjects(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("print_objects"); Object::PrintObjects(); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -772,7 +731,6 @@ auto PyPrintObjects(PyObject* self, PyObject* args, PyObject* keywds) auto PyDoOnce(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("do_once"); if (g_python->DoOnce()) { Py_RETURN_TRUE; } @@ -782,7 +740,6 @@ auto PyDoOnce(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyApp(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("app"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { diff --git a/src/ballistica/python/methods/python_methods_ui.cc b/src/ballistica/python/methods/python_methods_ui.cc index 093da960..606feffe 100644 --- a/src/ballistica/python/methods/python_methods_ui.cc +++ b/src/ballistica/python/methods/python_methods_ui.cc @@ -34,7 +34,6 @@ namespace ballistica { auto PyButtonWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("buttonwidget"); PyObject* size_obj = Py_None; PyObject* pos_obj = Py_None; PyObject* label_obj = Py_None; @@ -339,7 +338,6 @@ auto PyButtonWidget(PyObject* self, PyObject* args, PyObject* keywds) auto PyCheckBoxWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("checkboxwidget"); PyObject* size_obj = Py_None; PyObject* pos_obj = Py_None; PyObject* text_obj = Py_None; @@ -478,7 +476,6 @@ auto PyCheckBoxWidget(PyObject* self, PyObject* args, PyObject* keywds) auto PyImageWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("imagewidget"); PyObject* size_obj = Py_None; PyObject* pos_obj = Py_None; PyObject* texture_obj = Py_None; @@ -638,8 +635,6 @@ auto PyColumnWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("columnwidget"); - PyObject* size_obj{Py_None}; PyObject* pos_obj{Py_None}; PyObject* background_obj{Py_None}; @@ -780,7 +775,6 @@ auto PyColumnWidget(PyObject* self, PyObject* args, PyObject* keywds) auto PyContainerWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("containerwidget"); PyObject* size_obj = Py_None; PyObject* pos_obj = Py_None; PyObject* background_obj = Py_None; @@ -1059,8 +1053,6 @@ auto PyRowWidget(PyObject* /* self */, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("rowwidget"); - PyObject* size_obj{Py_None}; PyObject* pos_obj{Py_None}; PyObject* background_obj{Py_None}; @@ -1159,7 +1151,6 @@ auto PyRowWidget(PyObject* /* self */, PyObject* args, PyObject* keywds) auto PyScrollWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("scrollwidget"); PyObject* size_obj{Py_None}; PyObject* pos_obj{Py_None}; PyObject* background_obj{Py_None}; @@ -1309,8 +1300,6 @@ auto PyHScrollWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("hscrollwidget"); - PyObject* size_obj = Py_None; PyObject* pos_obj = Py_None; PyObject* background_obj = Py_None; @@ -1451,7 +1440,6 @@ auto PyHScrollWidget(PyObject* self, PyObject* args, PyObject* keywds) auto PyTextWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("textwidget"); PyObject* size_obj = Py_None; PyObject* pos_obj = Py_None; PyObject* text_obj = Py_None; @@ -1735,8 +1723,6 @@ auto PyWidgetCall(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("widget"); - PyObject* edit_obj = Py_None; PyObject* down_widget_obj = Py_None; PyObject* up_widget_obj = Py_None; @@ -1831,7 +1817,6 @@ auto PyWidgetCall(PyObject* self, PyObject* args, PyObject* keywds) auto PyUIBounds(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("uibounds"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -1851,8 +1836,6 @@ auto PyFocusWindow(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("focuswindow"); - static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -1871,7 +1854,6 @@ auto PyFocusWindow(PyObject* self, PyObject* args, PyObject* keywds) auto PyShowOnlineScoreUI(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("show_online_score_ui"); const char* show = "general"; PyObject* game_obj = Py_None; PyObject* game_version_obj = Py_None; @@ -1898,8 +1880,6 @@ auto PyFadeScreen(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("fade_screen"); - // This can only be called in the UI context. int fade = 0; float time = 0.25; @@ -1918,7 +1898,6 @@ auto PyFadeScreen(PyObject* self, PyObject* args, PyObject* keywds) auto PyShowAd(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("show_ad"); BA_PRECONDITION(InGameThread()); const char* purpose; PyObject* on_completion_call_obj = Py_None; @@ -1949,7 +1928,6 @@ auto PyShowAd(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyShowAd2(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("show_ad_2"); BA_PRECONDITION(InGameThread()); const char* purpose; PyObject* on_completion_call_obj = Py_None; @@ -1979,7 +1957,6 @@ auto PyShowAd2(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { auto PyShowAppInvite(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("show_app_invite"); std::string title; std::string message; std::string code; @@ -2004,8 +1981,6 @@ auto PyShowProgressBar(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("show_progress_bar"); - g_graphics->EnableProgressBar(false); Py_RETURN_NONE; BA_PYTHON_CATCH; @@ -2015,8 +1990,6 @@ auto PySetPartyIconAlwaysVisible(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_party_icon_always_visible"); - int value; static const char* kwlist[] = {"value", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "p", @@ -2032,7 +2005,6 @@ auto PySetPartyIconAlwaysVisible(PyObject* self, PyObject* args, auto PyChatMessage(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("chat_message"); std::string message; PyObject* message_obj; PyObject* clients_obj = Py_None; @@ -2068,8 +2040,6 @@ auto PyGetChatMessages(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_chat_messages"); - BA_PRECONDITION(InGameThread()); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -2087,7 +2057,6 @@ auto PyGetChatMessages(PyObject* self, PyObject* args, PyObject* keywds) auto PySetPartyWindowOpen(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("set_party_window_open"); int value; static const char* kwlist[] = {"value", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "p", @@ -2104,8 +2073,6 @@ auto PyGetSpecialWidget(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("get_special_widget"); - const char* name; static const char* kwlist[] = {"name", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -2129,7 +2096,6 @@ auto PyGetSpecialWidget(PyObject* self, PyObject* args, PyObject* keywds) auto PyHaveIncentivizedAd(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("have_incentivized_ad"); static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -2148,8 +2114,6 @@ auto PyCanShowAd(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("can_show_ad"); - BA_PRECONDITION(InGameThread()); // if we've got any network connections, no ads.. // (don't want to make someone on the other end wait or risk disconnecting @@ -2168,7 +2132,6 @@ auto PyCanShowAd(PyObject* self, PyObject* args, PyObject* keywds) auto PyHasVideoAds(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("has_video_ads"); if (g_platform->GetHasVideoAds()) { Py_RETURN_TRUE; } else { @@ -2181,8 +2144,6 @@ auto PyBackPress(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("back_press"); - static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", const_cast(kwlist))) { @@ -2195,7 +2156,6 @@ auto PyBackPress(PyObject* self, PyObject* args, PyObject* keywds) auto PyOpenURL(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("open_url"); const char* address = nullptr; static const char* kwlist[] = {"address", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -2212,8 +2172,6 @@ auto PyOpenFileExternally(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("open_file_externally"); - char* path = nullptr; static const char* kwlist[] = {"path", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -2228,7 +2186,6 @@ auto PyOpenFileExternally(PyObject* self, PyObject* args, PyObject* keywds) auto PyOpenDirExternally(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("open_dir_externally"); char* path = nullptr; static const char* kwlist[] = {"path", nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "s", @@ -2243,8 +2200,6 @@ auto PyOpenDirExternally(PyObject* self, PyObject* args, PyObject* keywds) auto PyConsolePrint(PyObject* self, PyObject* args) -> PyObject* { BA_PYTHON_TRY; - Platform::SetLastPyCall("console_print"); - #if !BA_HEADLESS_BUILD Py_ssize_t tuple_size = PyTuple_GET_SIZE(args); PyObject* obj; @@ -2266,7 +2221,6 @@ auto PyConsolePrint(PyObject* self, PyObject* args) -> PyObject* { auto PyIsPartyIconVisible(PyObject* self, PyObject* args, PyObject* keywds) -> PyObject* { - Platform::SetLastPyCall("is_party_icon_visible"); BA_PYTHON_TRY; bool party_button_active = (g_game->connections()->GetConnectedClientCount() > 0 diff --git a/src/meta/bameta/python_embedded/bootstrap.py b/src/meta/bameta/python_embedded/bootstrap.py index b24cfa9d..bfd9fb7a 100644 --- a/src/meta/bameta/python_embedded/bootstrap.py +++ b/src/meta/bameta/python_embedded/bootstrap.py @@ -25,7 +25,7 @@ class _BAConsoleRedirect: self._pending_ship = False def write(self, sval: Any) -> None: - """Override standard stdout write.""" + """Override standard write call.""" self._call(sval) @@ -66,9 +66,13 @@ class _BAConsoleRedirect: return self._original.isatty() +# The very first thing we set up is redirecting Python stdout/stderr so +# we can at least debug problems on systems where native stdout/stderr +# is not easily accessible (looking at you, Android). sys.stdout = _BAConsoleRedirect(sys.stdout, _ba.print_stdout) # type: ignore sys.stderr = _BAConsoleRedirect(sys.stderr, _ba.print_stderr) # type: ignore +# Now get access to our various script files. # Let's lookup mods first (so users can do whatever they want). # and then our bundled scripts last (don't want bundled site-package # stuff overwriting system versions) @@ -77,9 +81,10 @@ sys.path.append(_ba.env()['python_directory_app']) sys.path.append(_ba.env()['python_directory_app_site']) # Tell Python to not handle SIGINT itself (it normally generates -# KeyboardInterrupts which make a mess; we want to do a simple -# clean exit). We capture interrupts per-platform in the C++ layer. -# I tried creating a handler in Python but it seemed to often have +# KeyboardInterrupts which make a mess; we want to intercept them +# for simple clean exitt). We capture interrupts per-platform in +# the C++ layer. +# Note: I tried creating a handler in Python but it seemed to often have # a delay of up to a second before getting called. (not a huge deal # but I'm picky). signal.signal(signal.SIGINT, signal.SIG_DFL) # Do default handling. diff --git a/tools/efrotools/ios.py b/tools/efrotools/ios.py index d70d9b7f..64f35a64 100644 --- a/tools/efrotools/ios.py +++ b/tools/efrotools/ios.py @@ -58,7 +58,7 @@ def push_ipa(root: pathlib.Path, modename: str) -> None: The use case for this is quick build iteration on a device that is not physically near the build machine. """ - + from efrotools.xcode import project_build_path # Load both the local and project config data. cfg = Config(**getconfig(root)['push_ipa_config']) lcfg = LocalConfig(**getlocalconfig(root)['push_ipa_local_config']) @@ -67,12 +67,12 @@ def push_ipa(root: pathlib.Path, modename: str) -> None: raise Exception('invalid mode: "' + str(modename) + '"') mode = MODES[modename] - pcommand_path = pathlib.Path(root, 'tools/pcommand') xcprojpath = pathlib.Path(root, cfg.projectpath) - app_dir = subprocess.run( - [pcommand_path, 'xcode_build_path', xcprojpath, mode['configuration']], - check=True, - capture_output=True).stdout.decode().strip() + app_dir = project_build_path(projroot=str(root), + project_path=str(xcprojpath), + scheme='BallisticaCore iOS Legacy', + configuration=mode['configuration'], + executable=False) built_app_path = pathlib.Path(app_dir, cfg.app_bundle_name) workdir = pathlib.Path(root, 'build', 'push_ipa') diff --git a/tools/efrotools/xcode.py b/tools/efrotools/xcode.py index 21334a23..c0511eed 100644 --- a/tools/efrotools/xcode.py +++ b/tools/efrotools/xcode.py @@ -486,8 +486,11 @@ class XCodeBuild: sys.stdout.write(line) -def project_build_path(projroot: str, project_path: str, scheme: str, - configuration: str) -> str: +def project_build_path(projroot: str, + project_path: str, + scheme: str, + configuration: str, + executable: bool = True) -> str: """Get build paths for an xcode project (cached for efficiency).""" # pylint: disable=too-many-locals @@ -566,5 +569,7 @@ def project_build_path(projroot: str, project_path: str, scheme: str, outfile.write(json.dumps(config)) assert build_dir is not None - assert executable_path is not None - return os.path.join(build_dir, executable_path) + if executable: + assert executable_path is not None + return os.path.join(build_dir, executable_path) + return build_dir