mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
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:
@@ -166,6 +166,7 @@ class CommonContext:
|
||||
server_address: typing.Optional[str]
|
||||
password: typing.Optional[str]
|
||||
hint_cost: typing.Optional[int]
|
||||
hint_points: typing.Optional[int]
|
||||
player_names: typing.Dict[int, str]
|
||||
|
||||
finished_game: bool
|
||||
@@ -711,6 +712,7 @@ async def process_server_cmd(ctx: CommonContext, args: dict):
|
||||
ctx.slot = args["slot"]
|
||||
# int keys get lost in JSON transfer
|
||||
ctx.slot_info = {int(pid): data for pid, data in args["slot_info"].items()}
|
||||
ctx.hint_points = args.get("hint_points", 0)
|
||||
ctx.consume_players_package(args["players"])
|
||||
msgs = []
|
||||
if ctx.locations_checked:
|
||||
|
Reference in New Issue
Block a user