Factorio: move prints from /sc (silent command) to /ap-print, to prevent two warnings getting printed by Factorio
This commit is contained in:
parent
3759f4c644
commit
884dece54c
|
@ -185,8 +185,8 @@ class FactorioContext(CommonContext):
|
||||||
logger.info(args["text"])
|
logger.info(args["text"])
|
||||||
if self.rcon_client:
|
if self.rcon_client:
|
||||||
cleaned_text = args['text'].replace('"', '')
|
cleaned_text = args['text'].replace('"', '')
|
||||||
self.rcon_client.send_command(f"/sc game.print(\"[font=default-large-bold]Archipelago:[/font] "
|
self.rcon_client.send_command(f"/ap-print [font=default-large-bold]Archipelago:[/font] "
|
||||||
f"{cleaned_text}\")")
|
f"{cleaned_text}")
|
||||||
|
|
||||||
def on_print_json(self, args: dict):
|
def on_print_json(self, args: dict):
|
||||||
text = self.raw_json_text_parser(copy.deepcopy(args["data"]))
|
text = self.raw_json_text_parser(copy.deepcopy(args["data"]))
|
||||||
|
@ -194,8 +194,8 @@ class FactorioContext(CommonContext):
|
||||||
if self.rcon_client:
|
if self.rcon_client:
|
||||||
text = self.factorio_json_text_parser(args["data"])
|
text = self.factorio_json_text_parser(args["data"])
|
||||||
cleaned_text = text.replace('"', '')
|
cleaned_text = text.replace('"', '')
|
||||||
self.rcon_client.send_command(f"/sc game.print(\"[font=default-large-bold]Archipelago:[/font] "
|
self.rcon_client.send_command(f"/ap-print [font=default-large-bold]Archipelago:[/font] "
|
||||||
f"{cleaned_text}\")")
|
f"{cleaned_text}")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def savegame_name(self) -> str:
|
def savegame_name(self) -> str:
|
||||||
|
@ -280,11 +280,9 @@ async def factorio_server_watcher(ctx: FactorioContext):
|
||||||
factorio_server_logger.info(msg)
|
factorio_server_logger.info(msg)
|
||||||
if not ctx.rcon_client and "Starting RCON interface at IP ADDR:" in msg:
|
if not ctx.rcon_client and "Starting RCON interface at IP ADDR:" in msg:
|
||||||
ctx.rcon_client = factorio_rcon.RCONClient("localhost", rcon_port, rcon_password)
|
ctx.rcon_client = factorio_rcon.RCONClient("localhost", rcon_port, rcon_password)
|
||||||
# trigger lua interface confirmation
|
|
||||||
ctx.rcon_client.send_command("/sc game.print('Starting Archipelago Bridge')")
|
|
||||||
ctx.rcon_client.send_command("/sc game.print('Starting Archipelago Bridge')")
|
|
||||||
if not ctx.awaiting_bridge and "Archipelago Bridge Data available for game tick " in msg:
|
if not ctx.awaiting_bridge and "Archipelago Bridge Data available for game tick " in msg:
|
||||||
ctx.awaiting_bridge = True
|
ctx.awaiting_bridge = True
|
||||||
|
|
||||||
if ctx.rcon_client:
|
if ctx.rcon_client:
|
||||||
while ctx.send_index < len(ctx.items_received):
|
while ctx.send_index < len(ctx.items_received):
|
||||||
transfer_item: NetworkItem = ctx.items_received[ctx.send_index]
|
transfer_item: NetworkItem = ctx.items_received[ctx.send_index]
|
||||||
|
|
|
@ -217,6 +217,9 @@ commands.add_command("ap-sync", "Used by the Archipelago client to get progress
|
||||||
rcon.print(game.table_to_json({["slot_name"] = SLOT_NAME, ["seed_name"] = SEED_NAME, ["info"] = data_collection}))
|
rcon.print(game.table_to_json({["slot_name"] = SLOT_NAME, ["seed_name"] = SEED_NAME, ["info"] = data_collection}))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
commands.add_command("ap-print", "Used by the Archipelago client to print messages", function (call)
|
||||||
|
game.print(call.parameter)
|
||||||
|
end)
|
||||||
|
|
||||||
commands.add_command("ap-get-technology", "Grant a technology, used by the Archipelago Client.", function(call)
|
commands.add_command("ap-get-technology", "Grant a technology, used by the Archipelago Client.", function(call)
|
||||||
if global.index_sync == nil then
|
if global.index_sync == nil then
|
||||||
|
|
|
@ -118,7 +118,7 @@ class Factorio(World):
|
||||||
return super(Factorio, self).collect(state, item)
|
return super(Factorio, self).collect(state, item)
|
||||||
|
|
||||||
def get_required_client_version(self) -> tuple:
|
def get_required_client_version(self) -> tuple:
|
||||||
return max((0, 1, 5), super(Factorio, self).get_required_client_version())
|
return max((0, 1, 6), super(Factorio, self).get_required_client_version())
|
||||||
|
|
||||||
options = factorio_options
|
options = factorio_options
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue