Bisa / factorio-init

Factorio init script
MIT License
415 stars 82 forks source link

Wait until pingpong servers are reachable before starting factorio #135

Closed jadoc closed 5 years ago

jadoc commented 6 years ago

Before listing a multiplayer game on the matching server, the Factorio game server tries to contact "pingpong" servers to determine its external IP in case it's behind some sort of NAT. When launching a Factorio server on a cloud provider, it's possible for the game server to start before virtual networking has been fully plumbed. The game server will fail to contact either pingpong server, and will list the incorrect IP on the matching server, generally the internal RFC 1918 IP of the VM rather than the dynamically allocated, ephemeral, Internet routable IP to which the cloud provider will transparently perform a static NAT.

Currently, the game servier will never retry to contact the pingpong servers and will never update it's IP on the matching server after starting. As a workaround, this script optionally delays startup of the game server until the pingpong servers are reachable. This is only meaningful for Internet accessible servers, as private servers without Internet reachability will fail to complete startup.

https://www.factorio.com/blog/post/fff-143

jadoc commented 6 years ago

Ooops. Forgot to include the code that makes waiting on the pingpong servers optional. It's now part of this pull request.