From 85b01c72cc40ce2bb63d54925f15c45d35cbdef6 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Wed, 6 May 2020 23:43:14 -0700 Subject: [PATCH] Got stress testing working again (and a few bug fixes) --- .efrocachemap | 24 +++++++++---------- .../python/bastd/activity/multiteamscore.py | 3 +-- assets/src/ba_data/python/bastd/actor/spaz.py | 1 - .../src/ba_data/python/bastd/game/conquest.py | 7 ++---- assets/src/ba_data/python/bastd/game/race.py | 2 +- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index f02abcbe..434a8c4a 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4132,16 +4132,16 @@ "assets/build/windows/x64/python.exe": "https://files.ballistica.net/cache/ba1/25/a7/dc87c1be41605eb6fefd0145144c", "assets/build/windows/x64/python37.dll": "https://files.ballistica.net/cache/ba1/b9/e4/d912f56e42e9991bcbb4c804cfcb", "assets/build/windows/x64/pythonw.exe": "https://files.ballistica.net/cache/ba1/6c/bb/b6f52c306aa4e88061510e96cefe", - "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/5a/39/65d7a21f427d1f8c9b4716363d77", - "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e3/07/dd3a30df3e60bcb19314b7c11f64", - "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/ba/2e/986f46803c0a058dd3eace081150", - "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/60/f8/b1790f0b8142264a04bd3d9c9e08", - "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c0/f7/d8f95c83471c134f7cf5a058828c", - "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/60/49/570898c369fd388970bd086c0f76", - "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/c1/bf/43f1c52e319823ad6cea21a2c14c", - "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/52/90/4ad2ec0f1f81f87a6cc4971c5b8e", - "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/ac/a0/24b940d7c28d09285bef72bd8ccb", - "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/19/09/616270667d7e2356e417afa68533", - "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/bb/39/090582c57d942ad0eaf93abcf692", - "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/9b/74/0720f21b36250917496d50893e6e" + "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/10/99/352d39206f7d69fe6994cf76630f", + "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/1b/5c/5d51f9311bea060aff1ba78badf2", + "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/95/95/c3377070f58a64dbb0021a14c010", + "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/91/c2/9aa9ead87fe83ffc866b7eca2207", + "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/15/f8/91f9155b210027bf2c502ed92b5c", + "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ac/15/75f1062a7f6b72b5ef963a2b6526", + "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/b4/6f/6079d00d0b6e431112353487fdce", + "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/b2/c0/22f3df76593e0fbc468e5798dae9", + "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/29/28/cc1a0ce82174ae0f4c006e6bb703", + "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/56/64/e099012eb1cbe1db37b87b909933", + "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/55/3b/7774d86041fec2e13fa21576ced7", + "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/b1/db/7571aa0352b133e95a793f162a07" } \ No newline at end of file diff --git a/assets/src/ba_data/python/bastd/activity/multiteamscore.py b/assets/src/ba_data/python/bastd/activity/multiteamscore.py index 61a3d8a8..1f5a9a47 100644 --- a/assets/src/ba_data/python/bastd/activity/multiteamscore.py +++ b/assets/src/ba_data/python/bastd/activity/multiteamscore.py @@ -87,11 +87,10 @@ class MultiTeamScoreScreenActivity(ScoreScreenActivity): is_free_for_all = isinstance(self.session, ba.FreeForAllSession) - def _get_prec_score(p_rec: ba.PlayerRecord) -> int: + def _get_prec_score(p_rec: ba.PlayerRecord) -> Optional[int]: if is_free_for_all and results is not None: assert isinstance(results, ba.TeamGameResults) val = results.get_team_score(p_rec.team) - assert val is not None return val return p_rec.accumscore diff --git a/assets/src/ba_data/python/bastd/actor/spaz.py b/assets/src/ba_data/python/bastd/actor/spaz.py index 3f510b14..96c713c4 100644 --- a/assets/src/ba_data/python/bastd/actor/spaz.py +++ b/assets/src/ba_data/python/bastd/actor/spaz.py @@ -454,7 +454,6 @@ class Spaz(ba.Actor): Called to 'press punch' on this spaz; used for player or AI connections. """ - assert self.node if not self.node or self.frozen or self.node.knockout > 0.0: return t_ms = ba.time(timeformat=ba.TimeFormat.MILLISECONDS) diff --git a/assets/src/ba_data/python/bastd/game/conquest.py b/assets/src/ba_data/python/bastd/game/conquest.py index 33b5eaed..bf3f1731 100644 --- a/assets/src/ba_data/python/bastd/game/conquest.py +++ b/assets/src/ba_data/python/bastd/game/conquest.py @@ -46,9 +46,8 @@ class ConquestFlag(Flag): self.light: Optional[ba.Node] = None @property - def team(self) -> ba.Team: + def team(self) -> Optional[ba.Team]: """The team that owns this flag.""" - assert self._team is not None return self._team @team.setter @@ -185,10 +184,8 @@ class ConquestGame(ba.TeamGameActivity): for team in self.teams: team.gamedata['flags_held'] = 0 for flag in self._flags: - try: + if flag.team is not None: flag.team.gamedata['flags_held'] += 1 - except Exception: - pass for team in self.teams: # If a team finds themselves with no flags, cancel all diff --git a/assets/src/ba_data/python/bastd/game/race.py b/assets/src/ba_data/python/bastd/game/race.py index ce5dc1b1..bdf0a513 100644 --- a/assets/src/ba_data/python/bastd/game/race.py +++ b/assets/src/ba_data/python/bastd/game/race.py @@ -213,10 +213,10 @@ class RaceGame(ba.TeamGameActivity): player = playernode.getdelegate().getplayer() except Exception: player = None - assert isinstance(player, ba.Player) region = region_node.getdelegate() if not player or not region: return + assert isinstance(player, ba.Player) assert isinstance(region, RaceRegion) last_region = player.gamedata['last_region']