@@ -33,6 +33,8 @@ class SocketRelay:
3333 from `rlbot.managers`.
3434 """
3535
36+ can_render = False
37+ """Indicates whether RLBotServer has given permission to send rendering commands"""
3638 is_connected = False
3739 _running = False
3840 """Indicates whether a messages are being handled by the `run` loop (potentially in a background thread)"""
@@ -46,7 +48,6 @@ class SocketRelay:
4648 controllable_team_info_handlers : list [
4749 Callable [[flat .ControllableTeamInfo ], None ]
4850 ] = []
49- rendering_status_handlers : list [Callable [[flat .RenderingStatus ], None ]] = []
5051 raw_handlers : list [Callable [[flat .CorePacket ], None ]] = []
5152
5253 socket : sock | None = None
@@ -296,6 +297,10 @@ def handle_incoming_message(self, incoming_message: bytes) -> MsgHandlingResult:
296297 for handler in self .field_info_handlers :
297298 handler (field_info )
298299 case flat .MatchConfiguration () as match_config :
300+ self .can_render = (
301+ match_config .enable_rendering == flat .DebugRendering .OnByDefault
302+ )
303+
299304 for handler in self .match_config_handlers :
300305 handler (match_config )
301306 case flat .MatchComm () as match_comm :
@@ -308,8 +313,7 @@ def handle_incoming_message(self, incoming_message: bytes) -> MsgHandlingResult:
308313 for handler in self .controllable_team_info_handlers :
309314 handler (controllable_team_info )
310315 case flat .RenderingStatus () as rendering_status :
311- for handler in self .rendering_status_handlers :
312- handler (rendering_status )
316+ self .can_render = rendering_status .status
313317 case _:
314318 self .logger .warning (
315319 "Received unknown message type: %s" ,
0 commit comments