Page 1 of 1

Settings up a server ?

Posted: Thu Apr 13, 2017 7:02 pm
by notaduck
Hi guys I have some questions here. I'm trying to setup a Factorio server on a headlless linux box.
But I'm missing a token, and I can't seem to figure out where I should get this?

And then there is also something about a conflicting address?! And I'm not really sure what to do here? So I hope some of you could reach out to me to make my day a lot better ;)

Code: Select all

   0.988 Info ServerRouter.cpp:604: Asking pingpong servers (pingpong1.factorio.com:34197, pingpong2.factorio.com:34197) for own address
   1.043 Warning ServerRouter.cpp:492: Received own adddress message reply with conflicting address (got xx.xxx.xx.xxx:50915, expected xx.xxx.xx.xxx::41154)
   1.043 Warning ServerMultiplayerManager.cpp:551: Determining own address has failed. Best guess: xx.xxx.xx.xxx::41154
   1.060 Error ServerMultiplayerManager.cpp:592: Matching server connection failed: Error when creating server game: Missing token.
Full Output

Code: Select all

[factorio@Factorio factorio]$ factorio --start-server /opt/factorio/saves/testtest.zip --server-settings /opt/factorio/data/server-settings.json 
   0.000 2017-04-13 18:58:03; Factorio 0.14.22 (build 25342, linux64, headless)
   0.000 Operating system: Linux
   0.000 Program arguments: "/opt/factorio/bin/x64/factorio" "--start-server" "/opt/factorio/saves/testtest.zip" "--server-settings" "/opt/factorio/data/server-settings.json" 
   0.000 Read data path: /opt/factorio/data
   0.000 Write data path: /opt/factorio
   0.000 Binaries path: /opt/factorio/bin
   0.008 System info: [CPU: Intel(R) Xeon(R) CPU E3-1240L v3 @ 2.00GHz, 8 cores, RAM: 2094MB]
   0.009 Running in headless mode
   0.010 Loading mod core 0.0.0 (data.lua)
   0.013 Loading mod base 0.14.22 (data.lua)
   0.080 Checksum for core: 1291735968
   0.080 Checksum for mod base: 786624017
   0.412 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1492109845
   0.412 Info PlayerData.cpp:62: Cloud player-data.json unavailable
   0.413 Custom inputs active: 0
   0.414 Factorio initialised
   0.415 Info ServerSynchronizer.cpp:27: nextHeartbeatSequenceNumber(0) initialized Synchronizer nextTickClosureTick(0).
   0.415 Info ServerMultiplayerManager.cpp:658: mapTick(-1) changing state from(Ready) to(PreparedToHostGame)
   0.415 Info ServerMultiplayerManager.cpp:658: mapTick(-1) changing state from(PreparedToHostGame) to(CreatingGame)
   0.415 Loading map /opt/factorio/saves/testtest.zip
   0.416 Error FileUtil.cpp:284: Can't remove /opt/factorio/temp/currently-playing: No such file or directory
   0.430 Info Scenario.cpp:152: Map version 0.14.22-0
   0.465 Checksum for script /opt/factorio/temp/currently-playing/control.lua: 1057114497
   0.466 Info UDPSocket.cpp:27: Opening socket at (0.0.0.0:34197)
   0.466 Hosting game at 0.0.0.0:34197
   0.466 Info HttpSharedState.cpp:44: Downloading https://auth.factorio.com/generate-server-padlock
   0.988 Info HttpSharedState.cpp:111: Status code: 200
   0.988 Info AuthServerConnector.cpp:106: Obtained serverPadlock for serverHash (CMTARKf6IgXSQHy0lXVyFxPkLBZiXFQ5) from the auth server.
   0.988 Info ServerMultiplayerManager.cpp:658: mapTick(0) changing state from(CreatingGame) to(InGame)
   0.988 Info ServerRouter.cpp:604: Asking pingpong servers (pingpong1.factorio.com:34197, pingpong2.factorio.com:34197) for own address
   1.043 Warning ServerRouter.cpp:492: Received own adddress message reply with conflicting address (got xx.xxx.xx.xxx::50915, expected xx.xxx.xx.xxx::41154)
   1.043 Warning ServerMultiplayerManager.cpp:551: Determining own address has failed. Best guess: xx.xxx.xx.xxx::41154
   1.060 Error ServerMultiplayerManager.cpp:592: Matching server connection failed: Error when creating server game: Missing token.

Re: Settings up a server ?

Posted: Thu Apr 13, 2017 7:17 pm
by noliVe
your TOKEN is missinig if you want to run the server PUBLIC you need that token

written in player-data.json in your %appdata%/factorio folder at the bottom line.

"SERVICE-TOKEN"

Re: Settings up a server ?

Posted: Thu Apr 13, 2017 7:21 pm
by notaduck
noliVe wrote:your TOKEN is missinig if you want to run the server PUBLIC you need that token

written in player-data.json in your %appdata%/factorio folder at the bottom line.

"SERVICE-TOKEN"
Right know that file looks like this, and the "service-token" is empty?

Code: Select all

{
    "available-campaign-levels": {
        "demo": {
            "level-01": "hard"
        },
        "tight-spot": {
            "level-01": "hard"
        },
        "transport-belt-madness": {
            "level-01": "hard"
        }
    },
    "console-history": "",
    "latest-multiplayer-connections": "",
    "service-username": "",
    "service-token": ""
}

Re: Settings up a server ?

Posted: Thu Apr 13, 2017 7:33 pm
by daniel34
Your token is only in that file after you verified your credentials within the game. You should be able to do this after any of the following tasks:
  • Try to install mods in Mods --> Install mods
  • Try to see the current multiplayer games in Play --> Multiplayer --> Browse Public Games
  • Check for updates in About --> Check updates
In any of these cases a dialog will pop up and ask you for your username and password, after you entered them successfully and exited the game your username and token should be present in the player-data.json.

Re: Settings up a server ?

Posted: Thu Apr 13, 2017 8:40 pm
by notaduck
daniel34 wrote:Your token is only in that file after you verified your credentials within the game. You should be able to do this after any of the following tasks:
  • Try to install mods in Mods --> Install mods
  • Try to see the current multiplayer games in Play --> Multiplayer --> Browse Public Games
  • Check for updates in About --> Check updates
In any of these cases a dialog will pop up and ask you for your username and password, after you entered them successfully and exited the game your username and token should be present in the player-data.json.
I could start the game on my windows machine to get the token, and it is not because I'm lazy. But isn't it possible to obatin the token on a headless linux machine?
I'm currently trying to write a guide on how to setup a factorio server oon a linux headless system. So I'm just trying to udnerstand everything here ;)

Re: Settings up a server ?

Posted: Thu Apr 13, 2017 8:58 pm
by prg
https://wiki.factorio.com/Web_Authentication_API

Code: Select all

curl https://auth.factorio.com/api-login -d username=$USERNAME -d password=$PASSWORD
or pass @- to the second -d and type password=$PASSWORD into the terminal yourself if you don't want to see your password end up in .bash_history.

Re: Settings up a server ?

Posted: Sat Apr 15, 2017 11:52 am
by notaduck
prg wrote:https://wiki.factorio.com/Web_Authentication_API

Code: Select all

curl https://auth.factorio.com/api-login -d username=$USERNAME -d password=$PASSWORD
or pass @- to the second -d and type password=$PASSWORD into the terminal yourself if you don't want to see your password end up in .bash_history.
Thanks! That helped a lot.....

I can start the server, and see it in the public game list. But for some reason I'm unable to join the game, due to a connection fail and I'm still seeing this error

Code: Select all

   1.959 Info ServerRouter.cpp:604: Asking pingpong servers (pingpong1.factorio.com:34197, pingpong2.factorio.com:34197) for own address

   2.032 Warning ServerRouter.cpp:492: Received own adddress message reply with conflicting address (got xx.xxx.xx.xxx:53185, expected xx.xxx.xx.xxx:39051)

   2.032 Warning ServerMultiplayerManager.cpp:551: Determining own address has failed. Best guess: xx.xxx.xx.xxx:39051

   2.435 Info ServerMultiplayerManager.cpp:587: Matching server connection resumed



Re: Settings up a server ?

Posted: Sun Apr 16, 2017 1:29 am
by noliVe
you cannot connect to your own server on your own pc because of the same port you need or something like this.

just install/create another folder to start this or use the system inside the game > Multiplayer > create a game > start

Re: Settings up a server ?

Posted: Sun Apr 16, 2017 7:26 am
by notaduck
noliVe wrote:you cannot connect to your own server on your own pc because of the same port you need or something like this.

just install/create another folder to start this or use the system inside the game > Multiplayer > create a game > start
Ther server is all ready running on another machine, and port 34197 is portforrwared in my firewall(external).