FactorioClient: ><

This commit is contained in:
Fabian Dill 2021-10-19 01:49:51 +02:00
parent 89c05cfcae
commit 4b5e36ebf2
1 changed files with 3 additions and 3 deletions

View File

@ -111,11 +111,11 @@ class FactorioContext(CommonContext):
async def game_watcher(ctx: FactorioContext):
bridge_logger = logging.getLogger("FactorioWatcher")
from worlds.factorio.Technologies import lookup_id_to_name
last_bridge = time.perf_counter()
next_bridge = time.perf_counter() + 1
try:
while not ctx.exit_event.is_set():
if ctx.awaiting_bridge and ctx.rcon_client and time.perf_counter() + 1 < last_bridge:
last_bridge = time.perf_counter()
if ctx.awaiting_bridge and ctx.rcon_client and time.perf_counter() > next_bridge:
next_bridge = time.perf_counter() + 1
ctx.awaiting_bridge = False
data = json.loads(ctx.rcon_client.send_command("/ap-sync"))
if data["slot_name"] != ctx.auth: