implement Factorio options max_science_pack and tech_cost

also give warnings about deprecated LttP options
also fix FactorioClient.py getting stuck if send an unknown item id
also fix !missing having an extra newline after each entry
also default to no webui
This commit is contained in:
Fabian Dill
2021-04-03 14:47:49 +02:00
parent d225eb9ca8
commit 91bcd59940
13 changed files with 177 additions and 42 deletions

View File

@@ -137,11 +137,12 @@ async def factorio_server_watcher(ctx: FactorioContext):
if ctx.rcon_client:
while ctx.send_index < len(ctx.items_received):
item_id = ctx.items_received[ctx.send_index].item
item_name = lookup_id_to_name[item_id]
factorio_server_logger.info(f"Sending {item_name} to Nauvis.")
response = ctx.rcon_client.send_command(f'/ap-get-technology {item_name}')
if response:
factorio_server_logger.info(response)
if item_id not in lookup_id_to_name:
logging.error(f"Unknown item ID: {item_id}")
else:
item_name = lookup_id_to_name[item_id]
factorio_server_logger.info(f"Sending {item_name} to Nauvis.")
ctx.rcon_client.send_command(f'/ap-get-technology {item_name}')
ctx.send_index += 1
await asyncio.sleep(1)