Permissions denied MP-Save File on Headless

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.
GluAp
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Mon Jan 07, 2019 6:28 am
Contact:

Permissions denied MP-Save File on Headless

Post by GluAp »

Hi there everyone.

I'm a big Factorio fan and already spent several hundreds of hours on playing the game. I recently started looking into multiplayer and found a huge vanilla factory on an online server. Problem: I can't do anything but look and walk over the map on this server, because it has permissions denied for practically every action (well - duh).
So I thought - "I'm a genius" - just went and saved the game locally so i can start it offline.

(actual) Problem: Still can't do anything, because .. no permissions.

I did a little research finding that this is just the way factorio works (as stated by Rseding91 here).

He had the solution:
If you want to override the permissions in the game you need to load it on a headless instance or use RCON [...]
Since I don't run Linux (yet ^_^), I went for headless. By mostly doing the things described here and here, I set up headless on Windows by using two installations of factorio, running the headless server as .bat:

Code: Select all

start /wait Factorio.exe --start-server WTF.zip --server-settings D:\server-settings.json
server-settings.json:

Code: Select all

{
  "name": "Name of the game as it will appear in the game listing",
  "description": "TEST",
  "tags": ["game", "tags"],

  "_comment_max_players": "Maximum number of players allowed, admins can join even a full server. 0 means unlimited.",
  "max_players": 0,

  "_comment_visibility": ["public: Game will be published on the official Factorio matching server",
                          "lan: Game will be broadcast on LAN"],
  "visibility":
  {
    "public": false,
    "lan": true
  },

  "_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public",
  "username": "",
  "password": "",

  "_comment_token": "Authentication token. May be used instead of 'password' above.",
  "token": "",

  "game_password": "",

  "_comment_require_user_verification": "When set to true, the server will only allow clients that have a valid Factorio.com account",
  "require_user_verification": false,

  "_comment_max_upload_in_kilobytes_per_second" : "optional, default value is 0. 0 means unlimited.",
  "max_upload_in_kilobytes_per_second": 0,

  "_comment_minimum_latency_in_ticks": "optional one tick is 16ms in default speed, default value is 0. 0 means no minimum.",
  "minimum_latency_in_ticks": 0,

  "_comment_ignore_player_limit_for_returning_players": "Players that played on this map already can join even when the max player limit was reached.",
  "ignore_player_limit_for_returning_players": false,

  "_comment_allow_commands": "possible values are, true, false and admins-only",
  "allow_commands": "true",

  "_comment_autosave_interval": "Autosave interval in minutes",
  "autosave_interval": 10,

  "_comment_autosave_slots": "server autosave slots, it is cycled through when the server autosaves.",
  "autosave_slots": 5,

  "_comment_afk_autokick_interval": "How many minutes until someone is kicked when doing nothing, 0 for never.",
  "afk_autokick_interval": 0,

  "_comment_auto_pause": "Whether should the server be paused when no players are present.",
  "auto_pause": true,

  "only_admins_can_pause_the_game": true,

  "_comment_autosave_only_on_server": "Whether autosaves should be saved only on server or also on all connected clients. Default is true.",
  "autosave_only_on_server": true,
  
  "_comment_non_blocking_saving": "Highly experimental feature, enable only at your own risk of losing your saves. On UNIX systems, server will fork itself to create an autosave. Autosaving on connected Windows clients will be disabled regardless of autosave_only_on_server option.",
  "non_blocking_saving": false,

  "_comment_admins": "List of case insensitive usernames, that will be promoted immediately",
  "admins": ["GluAp"]
}
As you can see, I set the server-settings to accept commands by everyone (option: YES) and even put my username in the list of users getting promoted immediately.

The Setup for itself runs perfectly. The second factorio instance connects to the server. But still - no permissions.
Generally I'm somewhat proud that I made it that far, but now I'm out of knowledge / options and somewhat pissed, mostly because I can't unterstand why this mechanic was implemented that way (I can't imagine a good reason).

I hope, I described my problem properly. Now it's up to you. Please ;)
Rseding91
Factorio Staff
Factorio Staff
Posts: 15985
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Permissions denied MP-Save File on Headless

Post by Rseding91 »

You've started it as a headless server however you skipped the part that makes it work: enter the command in the server console *not* in game.

As for why it works that way: because that's how permissions work. If they where just ignored when you're playing single player then they might as well not exist in single player. If you open up the permissions system and tell it "I don't want to be able to hand craft" that's exactly what it does.
If you want to get ahold of me I'm almost always on Discord.
GluAp
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Mon Jan 07, 2019 6:28 am
Contact:

Re: Permissions denied MP-Save File on Headless

Post by GluAp »

Thank you very much, for your answer.

I really feel I'm being very stupid here, because I can't figure out what you mean by "server console" :?

What I think it should work like:

I launch the headless server via (windows) commandline arguments as put into the .bat file. With the --server-setting json I'm telling the server what options it should start with ==> set "allow_commands": "true" in the server-settings. Meaning every player connecting to this server should be allowed to do commands through the ingame (Lua) console, e.g. "/permissions reset".

Now - what is this "server console" that you speak of? You said, it's not the ingame Lua console. But it can't be the commandline paramters can it?
I found this topic where Oxyd said to start headless with the command line

Code: Select all

factorio --start-server saves/map.zip --allow-commands admins-only
but when I do the same, the commandline doesn't start the server, because "Option 'allow-commands' does not exist".
I can't find any other options, which indicate similar functionality for the server commandline start parameters.

Could you please tell me, how to do what you proposed I should do.

As for the general idea behind permissions in Single Player:
If they where just ignored when you're playing single player then they might as well not exist in single player.
Exactly my point. Why does one need this feature in Single Player? As far as i can imagine, most players would not need this (?) in SP, since you obsiously can just restrict your own behaviour playing the game. But I can figurativly see hundreds of players joining a permissions restricted MP game and wanting to play the same map in unrestricted SP locally. There is no harm to it, i think. To me it feels somewhat like unnecessary DRM. It's like DRM on a digital picture. Just take a picture of your screen and the DRM invalidated. ;)

But this is off topic and I really don't want to step on your feet, since i believe you Devs had a good reason for doing it like this. Anyway - thank you again.
Bilka
Factorio Staff
Factorio Staff
Posts: 3464
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Permissions denied MP-Save File on Headless

Post by Bilka »

Start the server without any options that you made up. Just start it via the command line.

Then *in the commandline* use /permissions reset. In the commandline means *not in game*.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Technical Help”