Can't become admin on hosted server

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Jaque_Thay
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 14, 2013 3:46 pm
Contact:

Can't become admin on hosted server

Post by Jaque_Thay »

Hi, I'm having trouble with my home internet (whole other story...) and while I can play on servers I can't host from my home PC anymore (lag is too bad for other players). Thought I'd get around this by hiring a server and chose Clanforge/Multiplay as the managing service.

The headless server comes pre-installed and I have limited access to files (I do have access to server-settings.json and config.ini as well as logs but that's about it) so anything that requires other files I'll have to submit a ticket to their tech support for them to resolve. They don't have much documentation for Factorio but with trial and error I've managed to start a game, and get it onto the public list. Hooray! Except... I can't figure out how to become admin of my own game.

I've tried adding Jaque_Thay to the server-settings.json file

Code: Select all

  "admins": ["Jaque_Thay"]
but this doesn't auto-promote me on joining, and the game doesn't make the first player (or any player) to enter the game admin either. I was able to enable commands with

Code: Select all

   "allow_commands": "true",
(I've now reset it to admin-only) but this didn't solve the problem as I can't use /promote without first being an admin! So it currently feels like I'm stuck in a circle where I can't become admin unless I'm already admin.

Google hasn't proved particularly helpful so I was hoping that someone here might either have experience with Clanforge or know what simple and foolish mistake I'm making.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Can't become admin on hosted server

Post by impetus maximus »

i think you'll need to restart the server for the json file to give you admin.
Jaque_Thay
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu Feb 14, 2013 3:46 pm
Contact:

Re: Can't become admin on hosted server

Post by Jaque_Thay »

Done that a few times over the last eight hours and it hasn't had any effect. The json file is being read because it uses my username/password to make the game appear in public list, but it's not responding to the admin bit (or I've got it wrong somehow) for some reason.
borbra
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Jan 23, 2016 11:51 am
Contact:

Re: Can't become admin on hosted server

Post by borbra »

Did you ever find a solution to this? I'm having the exact same issue myself.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14341
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Can't become admin on hosted server

Post by Rseding91 »

The JSON file is only applied when a player is first created when joining a game.

If you're hosting the server just enter /promote *name* into the server and it will promote whoever you want.
If you want to get ahold of me I'm almost always on Discord.
jimmydont
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Mar 08, 2019 9:15 pm
Contact:

Re: Can't become admin on hosted server

Post by jimmydont »

If you're hosting the server just enter /promote *name* into the server and it will promote whoever you want.
I am hosting my server, headless, on a Linux box. There is no factorio console, so to speak. When I play, I connect from a Windows client.

When I do a "/promote jimmydont" from the client, it tells me I must be an admin.

Where would I enter the command?

Do I need to set up to start a Client on the linux machine and connect from there? Just trying to turn off the 120 second abort in LTN.
User avatar
TheBloke
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon Dec 03, 2018 2:48 am
Contact:

Re: Can't become admin on hosted server

Post by TheBloke »

jimmydont wrote: Mon Jul 29, 2019 12:02 pm Where would I enter the command?

Do I need to set up to start a Client on the linux machine and connect from there? Just trying to turn off the 120 second abort in LTN.
You can type it directly on the Factorio headless server, from the command line in which you started the server. When Factorio is in server mode it has a built-in console that you can type directly into.

In other words:
* On the headless server you presumably logged in via SSH or similar, and then you could start the server with a command like: "/opt/factorio/bin/x64/factorio --start-server <savename>"
* After doing that, you see log messages printed to your terminal. Once the server is running you will see a message like "1.862 Info ServerMultiplayerManager.cpp:776: updateTick(17727) changing state from(CreatingGame) to(InGame)" - indicating the server is running the save game specified.
* Now you can just type "/promote jimmydont" (without the "s)
* If you're running it through something like screen or tmux, you'd need to re-attach to that, then type into the running server
* If you're running it through Docker, then I'm not sure where that puts the console.
* If in doubt, you could simply shut down the server, then run it from a new SSH command line once so you can type /promote, then shut that down (Control-C in the terminal) and then start it your usual way again.

Here's an example log of me starting my server, then running /promote in it:

Code: Select all

tomj@ubuntufactorio:/opt/factorio$ /opt/factorio/bin/x64/factorio --start-server saves/UPS-CLXG-single-GT-BS12-DB29-CI-100R-825B
   0.000 2019-07-29 13:14:59; Factorio 0.17.58 (build 46193, linux64, headless)
   0.049 Operating system: Linux (Ubuntu 19.04)
   0.049 Program arguments: "/opt/factorio/bin/x64/factorio" "--start-server" "saves/UPS-CLXG-single-GT-BS12-DB29-CI-100R-825B"
   0.049 Read data path: /opt/factorio/data
   0.049 Write data path: /opt/factorio [13798/24059MB]
   0.049 Binaries path: /opt/factorio/bin
   0.064 System info: [CPU: Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz, 4 cores, RAM: 24102 MB]
   0.064 Environment: DISPLAY=<unset> WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=<unset> XDG_SESSION_DESKTOP=<unset> XDG_CURRENT_DESKTOP=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.064 Running in headless mode
   0.067 Loading mod core 0.0.0 (data.lua)
   0.159 Loading mod base 0.17.58 (data.lua)
   0.463 Loading mod base 0.17.58 (data-updates.lua)
   0.628 Checksum for core: 716058110
   0.628 Checksum of base: 2272799319
   0.906 Info PlayerData.cpp:67: Local player-data.json available, timestamp 1564406061
   0.906 Info PlayerData.cpp:74: Cloud player-data.json unavailable
   0.908 Custom inputs active: 0
   0.983 Factorio initialised
   0.983 Warning FileUtil.cpp:527: saves/UPS-CLXG-single-GT-BS12-DB29-CI-100R-825B not found; using saves/UPS-CLXG-single-GT-BS12-DB29-CI-100R-825B.zip
   0.983 Info ServerSynchronizer.cpp:30: nextHeartbeatSequenceNumber(0) initialized Synchronizer nextTickClosureTick(0).
   0.983 Info ServerMultiplayerManager.cpp:776: updateTick(4294967295) changing state from(Ready) to(PreparedToHostGame)
   0.983 Info ServerMultiplayerManager.cpp:776: updateTick(4294967295) changing state from(PreparedToHostGame) to(CreatingGame)
   0.984 Loading map /opt/factorio/saves/UPS-CLXG-single-GT-BS12-DB29-CI-100R-825B.zip: 1764944 bytes.
   1.031 Loading level.dat: 8147839 bytes.
   1.039 Info Scenario.cpp:187: Map version 0.17.58-0
   1.271 Loading script.dat: 34471 bytes.
   1.276 Checksum for script /opt/factorio/temp/currently-playing/control.lua: 4258127462
   1.278 Info UDPSocket.cpp:27: Opening socket at (IP ADDR:({0.0.0.0:34197}))
   1.279 Hosting game at IP ADDR:({0.0.0.0:34197})
   1.327 Info HttpSharedState.cpp:54: Downloading https://auth.factorio.com/generate-server-padlock-2
   1.862 Info AuthServerConnector.cpp:109: Obtained serverPadlock for serverHash (vE4ped3UJlQvH08245TfOhKDSqNb8Ve9) from the auth server.
   1.862 Info ServerMultiplayerManager.cpp:776: updateTick(17727) changing state from(CreatingGame) to(InGame)
/promote The-Bloke
The-Bloke is already an admin.
Alternatively, if all you want to do is /promote, then I believe you can just create/edit the file server-adminlist.json in the Factorio root directory (probably /opt/factorio), with the following format:

Code: Select all

[ 
  "jimmydont"
]
Then restart the server.
Last edited by TheBloke on Mon Jul 29, 2019 1:50 pm, edited 1 time in total.
jimmydont
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Mar 08, 2019 9:15 pm
Contact:

Re: Can't become admin on hosted server

Post by jimmydont »

Hey, thanks alot, AGAIN.

I had tried typing into the shell with the log output. BUT, I was running the server from a one liner .sh script, so it wasn't taking any input.

Ran it without the sh wrapper and its all good.

Cheers,
Jim
Post Reply

Return to “Technical Help”