[Server] Broadcast hint_cost and location_check_points update changes via RoomUpdate

This commit is contained in:
Jarno Westhof 2022-02-02 22:52:31 +01:00 committed by Fabian Dill
parent 60379d9ae6
commit 9fd6d1b81f
1 changed files with 4 additions and 0 deletions

View File

@ -1700,6 +1700,10 @@ class ServerCommandProcessor(CommonCommandProcessor):
self.output(f"Set option {option_name} to {getattr(self.ctx, option_name)}")
if option_name in {"forfeit_mode", "remaining_mode", "collect_mode"}:
self.ctx.broadcast_all([{"cmd": "RoomUpdate", 'permissions': get_permissions(self.ctx)}])
if option_name in {"hint_cost", "location_check_points"}:
room_update = {"cmd": "RoomUpdate"}
room_update[option_name] = getattr(self.ctx, option_name)
self.ctx.broadcast_all([room_update])
return True
else:
known = (f"{option}:{otype}" for option, otype in self.ctx.simple_options.items())