ArchipelagoMW / Archipelago

Archipelago Multi-Game Randomizer and Server
https://archipelago.gg
Other
480 stars 634 forks source link

Bug: FactorioClient does not respect --connect flag #3602

Open itepastra opened 3 months ago

itepastra commented 3 months ago

What happened?

I start FactorioClient.py with the --connect flag and it does not connect to the archipelago server.

It seems to connect and instantly disconnects again from the MultiServer.

the logs: FactorioClient_2024_07_01_23_16_47.txt

What were the expected results?

The client connects to the archipelago server at the specified host when it's ready.

Software

While playing

NewSoupVi commented 3 months ago

I believe this is what this PR addresses: https://github.com/ArchipelagoMW/Archipelago/pull/3568

qwint commented 3 months ago

FactorioClient.py does not seem to go through the Launcher Component, so unlikely 3568 fixes this issue

itepastra commented 3 months ago

I just tried, it does indeed not fix the issue. I think the FactorioClient tries to connect to the multiworld server while it isn't ready for the connection yet. So it instantly disconnects and throws an Exception: Cannot connect to a server with unknown own identity, bridge to Factorio first.. I found out while trying to make a docker file for it so I can host multiple on my pc more easily

NewSoupVi commented 3 months ago

My bad

sshipsey commented 2 months ago

I am also having this issue trying to run ArchipelagoFactorioClient on a headless linux server with systemd and connect to a multiworld. I am trying to create a workaround where I can wait some time and input the /connect string via TTY but struggling.

sshipsey commented 2 months ago
#!/bin/bash

PIPE="/opt/Archipelago/pipe"

if [[ ! -p $PIPE ]]; then
        mkfifo $PIPE
fi

/opt/Archipelago/ArchipelagoFactorioClient --rcon-port xxxxx --rcon-password xxxxx --server-settings /opt/Archipelago/factorio/data/server-settings.json < $PIPE &

DAEMON_PID=$!

echo $DAEMON_PID
echo \r > $PIPE

sleep 10
echo "/connect archipelago.gg:xxxxx" > $PIPE

wait $DAEMON_PID
rm -f $PIPE

@itepastra rather than running the client directly, i have created this bash script is it janky? absolutely do i fully understand it? absolutely not does it work? it does seems to work