diff --git a/.efrocachemap b/.efrocachemap index 3763543a..e206f443 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4135,16 +4135,16 @@ "assets/build/windows/x64/vc_redist.x64.exe": "https://files.ballistica.net/cache/ba1/ea/19/8b8787d81abcdce158ba608cd24f", "assets/build/windows/x64/vcruntime140_1d.dll": "https://files.ballistica.net/cache/ba1/11/d8/ff6344b429b00c24d9a1930d4338", "assets/build/windows/x64/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/20/33/0825e11e6518f87ece3009309933", - "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/57/f8/47526bddac42b974f4ce86d13166", - "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/0a/a9/46cb3927b667d67d8dc936b744b6", - "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/dd/f3/130eb5ddb320f11093ba92bfbe6a", - "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/53/a6/56310d64b07fb7aa1481e59a4d29", - "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/cd/6a/1518d0ebde22f06a679edf04002a", - "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/72/4f/f4d081f47a48ba940603a6825c1f", - "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/d9/1f/436439103f6ede3ec88f46b592a7", - "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/97/44/68715ff4f2208719f42e174db2e5", - "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/39/87/ce5cf695b6af229875b9c5ff757e", - "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/db/f1/50f277827b1b070dd3b4c5c97553", - "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/20/f3/6fb608d305279d5d8663f6b8cee6", - "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/71/a0/00ae9e235e28b18def6847d69c75" + "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/7c/92/8e0cbeffff273e5aa40fa584b602", + "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/41/4a/91a9073717d810d978101f035f75", + "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/13/cc/732f4cbdaa5ff318c7041b3cc46e", + "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/95/01/6e4e0ddd1b32d2a24267472811d9", + "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/63/ee/2230562fd122dbc68ace1959440a", + "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/18/0e/6aebdc438215b178618b209b3d38", + "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/a6/6e/7041677d14ff3445e678e85ed509", + "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/78/7f/27a790f133b341a47e0d286631f6", + "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/3f/7b/6548e30606ba52f274a72f123473", + "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/df/d8/b1bfd4a2de519276ae8b3498e64d", + "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/56/77/a0fcc90f8be8ac87b677ac0c983d", + "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/45/1e/d1a5697069c1719b962140d4815b" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ced1dff9..c96b13a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - The ba.Session.teams and ba.Session.players lists are now ba.Session.sessionteams and ba.Session.sessionplayers. This is to help keep it clear that a Team/Player and a SessionTeam/SessionPlayer are different things now. - Disconnecting an input-device now immediately removes the player instead of doing so in the next cycle; this prevents possible issues where code would try to access player.inputdevice before the removal happens which would lead to errors. - Updated mac prefab builds to point at homebrew's python@3.7 package now that 3.8 has been made the default. +- Fixed an issue where adding/deleting UI widgets within certain callbacks could cause a crash. ### 1.5.19 (20123) - Cleaned up some bomb logic to avoid weird corner-cases such as land-mine explosions behaving like punches when set off by punches or bombs potentially resulting in multiple explosions when triggered by multiple other bombs simultaneously. Holler if anything explosion-related seems off now. diff --git a/Makefile b/Makefile index 84cc0ca3..59dc4290 100644 --- a/Makefile +++ b/Makefile @@ -665,7 +665,7 @@ VERSION = $(shell tools/version_utils version) BUILD_NUMBER = $(shell tools/version_utils build) BUILD_DIR = ${PROJ_DIR}/build LAZYBUILDDIR = .cache/lazybuild -STAGE_ASSETS = ${PROJ_DIR}/tools/stage_assets +STAGE_ASSETS = ${PROJ_DIR}/tools/pcommand stage_assets # Things to ignore when doing root level cleans. ROOT_CLEAN_IGNORES = --exclude=assets/src_master \ diff --git a/assets/src/ba_data/python/ba/_session.py b/assets/src/ba_data/python/ba/_session.py index 1aea000a..65f9610c 100644 --- a/assets/src/ba_data/python/ba/_session.py +++ b/assets/src/ba_data/python/ba/_session.py @@ -592,7 +592,9 @@ class Session: lobby = chooser.lobby activity = self._activity_weak() - # It seems this can happen.. + # This happens sometimes. That seems like it shouldn't be happening; + # when would we have a session and a chooser with players but no + # active activity? if activity is None: print('_on_player_ready called with no activity.') return diff --git a/assets/src/ba_data/python/bastd/ui/partyqueue.py b/assets/src/ba_data/python/bastd/ui/partyqueue.py index e29e5ec1..68e1dc73 100644 --- a/assets/src/ba_data/python/bastd/ui/partyqueue.py +++ b/assets/src/ba_data/python/bastd/ui/partyqueue.py @@ -374,8 +374,15 @@ class PartyQueueWindow(ba.Window): def on_update_response(self, response: Optional[Dict[str, Any]]) -> None: """We've received a response from an update to the server.""" + # pylint: disable=too-many-branches if not self._root_widget: return + + # Seeing this in logs; debugging... + if not self._title_text: + print('PartyQueueWindows update: Have root but no title_text.') + return + if response is not None: should_show_field = (response.get('d') is not None) self._smoothing = response['s'] diff --git a/docs/ba_module.md b/docs/ba_module.md index 8953ba8c..e25260c5 100644 --- a/docs/ba_module.md +++ b/docs/ba_module.md @@ -1,5 +1,5 @@ -

last updated on 2020-07-09 for Ballistica version 1.5.20 build 20128

+

last updated on 2020-07-11 for Ballistica version 1.5.20 build 20132

This page documents the Python classes and functions in the 'ba' module, which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please let me know. Happy modding!


@@ -2219,7 +2219,7 @@ its time with lingering corpses, sound effects, etc.

<all methods inherited from ba.Team>


ba.Existable

-

Inherits from: typing.Protocol, typing.Generic

+

Inherits from: typing_extensions.Protocol

A Protocol for objects supporting an exists() method.

Category: Protocols diff --git a/tools/stage_assets b/tools/batools/assetstaging.py similarity index 92% rename from tools/stage_assets rename to tools/batools/assetstaging.py index d412ee20..1fa0ed07 100755 --- a/tools/stage_assets +++ b/tools/batools/assetstaging.py @@ -30,7 +30,6 @@ import subprocess from functools import partial from typing import TYPE_CHECKING -from efro.error import CleanError from efrotools.pybuild import PYTHON_VERSION_MAJOR if TYPE_CHECKING: @@ -48,10 +47,10 @@ OPT_PYC_SUFFIX = ('cpython-' + PYTHON_VERSION_MAJOR.replace('.', '') + class Config: """Encapsulates command options.""" - def __init__(self) -> None: + def __init__(self, projroot: str) -> None: + self.projroot = projroot # We always calc src relative to this script. - self.src = os.path.abspath( - os.path.dirname(sys.argv[0]) + '/../assets/build') + self.src = self.projroot + '/assets/build' self.dst: Optional[str] = None self.win_extras_src: Optional[str] = None self.win_platform: Optional[str] = None @@ -71,7 +70,7 @@ class Config: self.is_payload_full = False self.debug = False - def _parse_android_args(self) -> None: + def _parse_android_args(self, args: List[str]) -> None: # On Android we get nitpicky with what # we want to copy in since we can speed up # iterations by installing stripped down @@ -89,7 +88,7 @@ class Config: self.include_fonts = False self.include_json = False self.include_pylib = False - for arg in sys.argv[1:]: + for arg in args: if arg == '-full': self.include_audio = True self.include_models = True @@ -118,13 +117,13 @@ class Config: elif arg == '-audio': self.include_audio = True - def _parse_win_platform(self, platform: str) -> None: + def _parse_win_platform(self, platform: str, args: List[str]) -> None: """Parse sub-args in the windows platform string.""" winempty, wintype, winplt, wincfg = platform.split('-') self.win_platform = winplt self.win_type = wintype assert winempty == '' - self.dst = sys.argv[2] + self.dst = args[1] self.tex_suffix = '.dds' if wintype == 'win': @@ -137,12 +136,9 @@ class Config: raise RuntimeError(f'Invalid wintype: "{wintype}"') if winplt == 'Win32': - self.win_extras_src = os.path.abspath( - os.path.dirname(sys.argv[0]) + - '/../assets/build/windows/Win32') + self.win_extras_src = self.projroot + '/assets/build/windows/Win32' elif winplt == 'x64': - self.win_extras_src = os.path.abspath( - os.path.dirname(sys.argv[0]) + '/../assets/build/windows/x64') + self.win_extras_src = self.projroot + '/assets/build/windows/x64' else: raise RuntimeError(f'Invalid winplt: "{winplt}"') @@ -153,31 +149,31 @@ class Config: else: raise RuntimeError(f'Invalid wincfg: "{wincfg}"') - def parse_args(self) -> None: + def parse_args(self, args: List[str]) -> None: """Parse args and apply to the cfg.""" - if len(sys.argv) < 2: + if len(args) < 1: raise RuntimeError('Expected a platform argument.') - platform = sys.argv[1] + platform = args[0] if platform == '-android': - self._parse_android_args() + self._parse_android_args(args) elif platform.startswith('-win'): - self._parse_win_platform(platform) + self._parse_win_platform(platform, args) elif platform == '-cmake': - self.dst = sys.argv[2] + self.dst = args[1] self.tex_suffix = '.dds' - elif '-cmakeserver' in sys.argv: - self.dst = sys.argv[2] + elif '-cmakeserver' in args: + self.dst = args[1] self.include_textures = False self.include_audio = False self.include_models = False - elif '-xcode-mac' in sys.argv: + elif '-xcode-mac' in args: self.src = os.environ['SOURCE_ROOT'] + '/assets/build' self.dst = (os.environ['TARGET_BUILD_DIR'] + '/' + os.environ['UNLOCALIZED_RESOURCES_FOLDER_PATH']) self.include_pylib = True self.pylib_src_name = 'pylib-apple' self.tex_suffix = '.dds' - elif '-xcode-ios' in sys.argv: + elif '-xcode-ios' in args: self.src = os.environ['SOURCE_ROOT'] + '/assets/build' self.dst = (os.environ['TARGET_BUILD_DIR'] + '/' + os.environ['UNLOCALIZED_RESOURCES_FOLDER_PATH']) @@ -323,11 +319,14 @@ def _sync_pylib(cfg: Config) -> None: _run(cmd) -def main() -> None: +def main(projroot: str, args: Optional[List[str]] = None) -> None: """Stage assets for a build.""" - cfg = Config() - cfg.parse_args() + if args is None: + args = sys.argv + + cfg = Config(projroot) + cfg.parse_args(args) # Ok, now for every top level dir in src, come up with a nice single # command to sync the needed subset of it to dst. @@ -386,9 +385,9 @@ def main() -> None: _write_payload_file(cfg.dst, cfg.is_payload_full) -if __name__ == '__main__': - try: - main() - except CleanError as exc: - exc.pretty_print() - sys.exit(1) +# if __name__ == '__main__': +# try: +# main() +# except CleanError as exc: +# exc.pretty_print() +# sys.exit(1) diff --git a/tools/batools/pcommand.py b/tools/batools/pcommand.py index 7e904c7e..196c31cf 100644 --- a/tools/batools/pcommand.py +++ b/tools/batools/pcommand.py @@ -692,3 +692,14 @@ def efro_gradle() -> None: if errored: sys.exit(1) + + +def stage_assets() -> None: + """Stage assets for a build.""" + from batools.assetstaging import main + from efro.error import CleanError + try: + main(projroot=str(PROJROOT), args=sys.argv[2:]) + except CleanError as exc: + exc.pretty_print() + sys.exit(1) diff --git a/tools/pcommand b/tools/pcommand index 481e3366..6351f9c6 100755 --- a/tools/pcommand +++ b/tools/pcommand @@ -55,7 +55,7 @@ from batools.pcommand import ( get_modern_make, warm_start_asset_build, update_docs_md, list_pip_reqs, install_pip_reqs, checkenv, ensure_prefab_platform, prefab_run_var, make_prefab, update_makebob, lazybuild, android_archive_unstripped_libs, - efro_gradle) + efro_gradle, stage_assets) # pylint: enable=unused-import if TYPE_CHECKING: