MultiServer: Notify clients of hint points (#1548)

* notify clients of their amount of hint points on initial connection and when hinting

* send in connect packet instead of sending a RoomUpdate on connect

* send hint_points update in `on_new_hint`

* add to connected packet docs

* hint_points isn't a new variable on RoomUpdate now

* note roomupdate can contain connected members

* add the hint point stuff to commonclient

* only show hint points when relevant and default to 0

* Revert "note roomupdate can contain connected members"

* remove hint_points from roomupdate args list and condense explanation of possible packet args

* updates from phar's review

* Small tweak to wording in RoomUpdate

---------

Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
Co-authored-by: Phar <zach@alliware.com>
This commit is contained in:
alwaysintreble
2023-04-10 14:44:20 -05:00
committed by GitHub
parent c7284f90d9
commit 77fbd0eb2b
4 changed files with 21 additions and 14 deletions

View File

@@ -700,6 +700,10 @@ class Context:
targets: typing.Set[Client] = set(self.stored_data_notification_clients[key])
if targets:
self.broadcast(targets, [{"cmd": "SetReply", "key": key, "value": self.hints[team, slot]}])
self.broadcast(self.clients[team][slot], [{
"cmd": "RoomUpdate",
"hint_points": get_slot_points(self, team, slot)
}])
def update_aliases(ctx: Context, team: int):
@@ -1639,7 +1643,8 @@ async def process_client_cmd(ctx: Context, client: Client, args: dict):
"players": ctx.get_players_package(),
"missing_locations": get_missing_checks(ctx, team, slot),
"checked_locations": get_checked_checks(ctx, team, slot),
"slot_info": ctx.slot_info
"slot_info": ctx.slot_info,
"hint_points": get_slot_points(ctx, team, slot),
}
reply = [connected_packet]
start_inventory = get_start_inventory(ctx, slot, client.remote_start_inventory)