Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rlbot/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class SocketRelay:
from `rlbot.managers`.
"""

can_render = False
"""Indicates whether RLBotServer has given permission to send rendering commands"""
is_connected = False
_running = False
"""Indicates whether a messages are being handled by the `run` loop (potentially in a background thread)"""
Expand Down Expand Up @@ -296,6 +298,10 @@ def handle_incoming_message(self, incoming_message: bytes) -> MsgHandlingResult:
for handler in self.field_info_handlers:
handler(field_info)
case flat.MatchConfiguration() as match_config:
self.can_render = (
match_config.enable_rendering == flat.DebugRendering.OnByDefault
)

for handler in self.match_config_handlers:
handler(match_config)
case flat.MatchComm() as match_comm:
Expand Down
5 changes: 1 addition & 4 deletions rlbot/managers/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ def _try_initialize(self):
def _handle_match_config(self, match_config: flat.MatchConfiguration):
self.match_config = match_config
self._has_match_settings = True
self.can_render = (
match_config.enable_rendering == flat.DebugRendering.OnByDefault
)

self._try_initialize()

Expand Down Expand Up @@ -234,7 +231,7 @@ def rendering_status_update(self, update: flat.RenderingStatus):
By default, this will update `self.renderer.can_render` if appropriate.
"""
if update.is_bot and update.index == self.index:
self.renderer.can_render = update.status
self._game_interface.can_render = update.status

def update_rendering_status(
self,
Expand Down
2 changes: 1 addition & 1 deletion rlbot/managers/hivemind.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def rendering_status_update(self, update: flat.RenderingStatus):
By default, this will update `self.renderer.can_render` if appropriate.
"""
if update.is_bot and update.index in self.indices:
self.renderer.can_render = update.status
self._game_interface.can_render = update.status

def update_rendering_status(
self,
Expand Down
7 changes: 5 additions & 2 deletions rlbot/managers/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class Renderer:
purple = flat.Color(128, 0, 128)
teal = flat.Color(0, 128, 128)

can_render: bool = False

_logger = get_logger("renderer")

_used_group_ids: set[int] = set()
Expand All @@ -62,6 +60,11 @@ def __init__(self, game_interface: SocketRelay):
self._send_msg: Callable[[flat.RenderGroup | flat.RemoveRenderGroup], None] = (
game_interface.send_msg
)
self._game_interface = game_interface

@property
def can_render(self) -> bool:
return self._game_interface.can_render

def set_resolution(self, screen_width: float, screen_height: float):
"""
Expand Down
5 changes: 1 addition & 4 deletions rlbot/managers/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ def _try_initialize(self):
def _handle_match_config(self, match_config: flat.MatchConfiguration):
self.match_config = match_config
self._has_match_settings = True
self.can_render = (
match_config.enable_rendering == flat.DebugRendering.OnByDefault
)

self._try_initialize()

Expand Down Expand Up @@ -194,7 +191,7 @@ def rendering_status_update(self, update: flat.RenderingStatus):
By default, this will update `self.renderer.can_render` if appropriate.
"""
if not update.is_bot and update.index == self.index:
self.renderer.can_render = update.status
self._game_interface.can_render = update.status

def update_rendering_status(
self,
Expand Down
8 changes: 8 additions & 0 deletions rlbot/utils/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
"DFHStadium_Anniversary": "stadium_10a_p",
"Holyfield": "Labs_Holyfield_Space_P",
"DriftWoods_Night": "woods_night_p",
"BoostfieldMall": "Mall_Day_P",
"ParcDeParis": "Paname_Dusk_P",
"Roadblock": "Labs_Octagon_B2B_02_P",
"Mannfield_Quads": "Labs_4v4_Arena15_EuroStadium_Night_P",
"MidnightMetro_Quads": "Labs_4v4_Arena15_Blackout_P",
"SunsetDunes_Quads": "Labs_4v4_Arena15_Retro_P",
}

STANDARD_MAPS = [
Expand Down Expand Up @@ -140,4 +146,6 @@
"DFHStadium_Anniversary",
"DriftWoods_Night",
"NeoTokyo_Comic",
"BoostfieldMall",
"ParcDeParis",
]
2 changes: 1 addition & 1 deletion rlbot/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0-beta.50"
__version__ = "2.0.0-beta.51"