@@ -707,15 +707,18 @@ def on_goal_achieved(self, client: Client):
707
707
self .save () # save goal completion flag
708
708
709
709
def on_new_hint (self , team : int , slot : int ):
710
- key : str = f"_read_hints_{ team } _{ slot } "
711
- targets : typing .Set [Client ] = set (self .stored_data_notification_clients [key ])
712
- if targets :
713
- self .broadcast (targets , [{"cmd" : "SetReply" , "key" : key , "value" : self .hints [team , slot ]}])
710
+ self .on_changed_hints (team , slot )
714
711
self .broadcast (self .clients [team ][slot ], [{
715
712
"cmd" : "RoomUpdate" ,
716
713
"hint_points" : get_slot_points (self , team , slot )
717
714
}])
718
715
716
+ def on_changed_hints (self , team : int , slot : int ):
717
+ key : str = f"_read_hints_{ team } _{ slot } "
718
+ targets : typing .Set [Client ] = set (self .stored_data_notification_clients [key ])
719
+ if targets :
720
+ self .broadcast (targets , [{"cmd" : "SetReply" , "key" : key , "value" : self .hints [team , slot ]}])
721
+
719
722
def on_client_status_change (self , team : int , slot : int ):
720
723
key : str = f"_read_client_status_{ team } _{ slot } "
721
724
targets : typing .Set [Client ] = set (self .stored_data_notification_clients [key ])
@@ -975,7 +978,10 @@ def register_location_checks(ctx: Context, team: int, slot: int, locations: typi
975
978
"hint_points" : get_slot_points (ctx , team , slot ),
976
979
"checked_locations" : new_locations , # send back new checks only
977
980
}])
978
-
981
+ old_hints = ctx .hints [team , slot ].copy ()
982
+ ctx .recheck_hints (team , slot )
983
+ if old_hints != ctx .hints [team , slot ]:
984
+ ctx .on_changed_hints (team , slot )
979
985
ctx .save ()
980
986
981
987
0 commit comments