MMBN3: Fixes hint spam when receiving a hint (#2087)
* Only sends hints whenever the list changes * Further reduces hint spam by not re-sending the entire list when one new thing is added
This commit is contained in:
parent
64d1722acd
commit
d0c6eaf239
|
@ -71,6 +71,7 @@ class MMBN3Context(CommonContext):
|
||||||
self.auth_name = None
|
self.auth_name = None
|
||||||
self.slot_data = dict()
|
self.slot_data = dict()
|
||||||
self.patching_error = False
|
self.patching_error = False
|
||||||
|
self.sent_hints = []
|
||||||
|
|
||||||
async def server_auth(self, password_requested: bool = False):
|
async def server_auth(self, password_requested: bool = False):
|
||||||
if password_requested and not self.password:
|
if password_requested and not self.password:
|
||||||
|
@ -175,13 +176,16 @@ async def parse_payload(payload: dict, ctx: MMBN3Context, force: bool):
|
||||||
|
|
||||||
# If trade hinting is enabled, send scout checks
|
# If trade hinting is enabled, send scout checks
|
||||||
if ctx.slot_data.get("trade_quest_hinting", 0) == 2:
|
if ctx.slot_data.get("trade_quest_hinting", 0) == 2:
|
||||||
scouted_locs = [loc.id for loc in scoutable_locations
|
trade_bits = [loc.id for loc in scoutable_locations
|
||||||
if check_location_scouted(loc, payload["locations"])]
|
if check_location_scouted(loc, payload["locations"])]
|
||||||
await ctx.send_msgs([{
|
scouted_locs = [loc for loc in trade_bits if loc not in ctx.sent_hints]
|
||||||
"cmd": "LocationScouts",
|
if len(scouted_locs) > 0:
|
||||||
"locations": scouted_locs,
|
ctx.sent_hints.extend(scouted_locs)
|
||||||
"create_as_hint": 2
|
await ctx.send_msgs([{
|
||||||
}])
|
"cmd": "LocationScouts",
|
||||||
|
"locations": scouted_locs,
|
||||||
|
"create_as_hint": 2
|
||||||
|
}])
|
||||||
|
|
||||||
|
|
||||||
def check_location_packet(location, memory):
|
def check_location_packet(location, memory):
|
||||||
|
|
Loading…
Reference in New Issue