Mephi00 / v-rising-wine-docker-image

MIT License
53 stars 31 forks source link

No way to define admin IDs #4

Closed dtupper closed 2 years ago

dtupper commented 2 years ago

Putting an adminlist.txt with newline-delimited Steam64IDs into the Settings folder next to the ServerGame and ServerHostSettings.json files would assumedly allow admins to be defined, but it does not seem to respect that file.

Mephi00 commented 2 years ago

strange, in which location do you store the file?

dtupper commented 2 years ago

In my user home dir:

tupper@adityas Settings $ ls
adminlist.txt  ServerGameSettings.json  ServerHostSettings.json
tupper@adityas Settings $ pwd
/home/tupper/morb/Settings
tupper@adityas Settings $ cd ..
tupper@adityas morb $ ls
Saves  Settings  v-rising-wine-docker-image

Could be a permissions thing but I also created ServerGame and ServerHost from my tupper user. All three files in Settings have identical permissions.

Mephi00 commented 2 years ago

are you mounting the settings files to /saves/Settings ?

dtupper commented 2 years ago

I must be, because the server is respecting the settings I'm setting.

dtupper commented 2 years ago

I just verified that the server is respecting the settings by changing the MOTD in ServerHost and restarting. adminauth still results in an error.

Mephi00 commented 2 years ago

Strange, according to the documentation of Stunlock Studios, the server should respect all Settings in the mount path. I will test if it needs to be saved in the default location and cannot be used by specifying the path.

Mephi00 commented 2 years ago

I want to correct myself and say, that I have misread the documentation and will add support for this behaviour in the next version.

dtupper commented 2 years ago

Awesome! Thanks for taking a look Mephi.

RealityWinner commented 2 years ago

Thanks I have this issue as well and came here for this purpose. A temporary solution you can use is: docker exec VRISING bash -c 'echo "STEAM_ID_HERE" >> /home/steam/Steam/steamapps/common/VRisingDedicatedServer/VRisingServer_Data/StreamingAssets/Settings/adminlist.txt'

Mephi00 commented 2 years ago

RealityWinner has the easiest workaround so far. I still want to enable this by simply using a symlink to the adminlist.txt from the Settings folder.

saltydk commented 2 years ago

Not sure this should be closed as the current implementation just resets the file on restarts.

Mephi00 commented 2 years ago

Can you tell me more about that, I haven‘t seen this behavior in any of my tests. The script creates an empty file if the file doesn‘t exist, but won‘t overwrite it.

saltydk commented 2 years ago

Example of it happening:

➜  Settings cat adminlist.txt
76561197960353982
➜  Settings docker restart v-risingtest
v-risingtest
➜  Settings cat adminlist.txt
➜  Settings
saltydk commented 2 years ago

Couldn't you just copy the file to the internal directory instead when starting? I suppose the game might be overwriting the file due to it being a symlink. Since the startup actions always fire the symlink doesn't make any sense to me regardless.

Mephi00 commented 2 years ago

I wanted it to be a symlink, so you can edit the files on the fly and it works.

From my testing, the game doesn‘t overwrite the content. I didn‘t use the latest version for testing tho, maybe an update broke the functionality. I‘ll look into this further.

saltydk commented 2 years ago

Don't you have to restart the container for it to pick up this configuration anyway?

saltydk commented 2 years ago

A cleaner solution is probably just to symlink the relevant folders instead of dealing with the files, then you can do it in the image and not have to deal with it during runtime outside of producing the templates if they don't exist the first time around.

saltydk commented 2 years ago

Additionally this https://github.com/StunlockStudios/vrising-dedicated-server-instructions confuses me more as it seems to suggest that the game would be loading the configuration from /saves/Settings/ by default when you change the data directory. So is the symlinking even needed?

Mephi00 commented 2 years ago

Additionally this https://github.com/StunlockStudios/vrising-dedicated-server-instructions confuses me more as it seems to suggest that the game would be loading the configuration from /saves/Settings/ by default when you change the data directory. So is the symlinking even needed?

Yes symlinking is needed because the directory change for the settings is only applicable for the settings.json files. I was very confused about this too until I read the instructions a third time.

saltydk commented 2 years ago

You mean not the admin and ban files?

Mephi00 commented 2 years ago

You mean not the admin and ban files?

Exactly, was a very strange 2 evenings I spent to figure that out.

And btw, the server reads the adminlist and banlist everytime someone tries to use adminauth or tries to connect. So it does allow you to change the admins without a restart.

saltydk commented 2 years ago

You mean not the admin and ban files?

Exactly, was a very strange 2 evenings I spent to figure that out.

And btw, the server reads the adminlist and banlist everytime someone tries to use adminauth or tries to connect. So it does allow you to change the admins without a restart.

So I did a quick fork and messed about while half asleep https://github.com/saltydk/docker-v-rising and the result pretty much confirmed what I read on their instructions page. It'll load them after the default ones are loaded without any problems, so unless this is something that happened with an older build of the game then this should simplify your setup.

saltydk commented 2 years ago

Log which shows the banlist being loaded

[FileUserList] Loaded FileUserList from: Z:\home\steam\Steam\steamapps\common\VRisingDedicatedServer\VRisingServer_Data\StreamingAssets\Settings\banlist.txt, Added: 0

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:Log(Object)

ProjectM.FileUserList:RefreshLocal(Boolean)

ProjectM.KickBanSystem_Server:OnUpdate()

Unity.Entities.SystemBase:Update()

Unity.Entities.ComponentSystemGroup:UpdateAllSystems()

Unity.Entities.ComponentSystem:Update()

Unity.Entities.ComponentSystemGroup:UpdateAllSystems()

ProjectM.ServerSimulationSystemGroup:OnUpdate()

Unity.Entities.ComponentSystem:Update()

Unity.Entities.ComponentSystemGroup:UpdateAllSystems()

Unity.Entities.ComponentSystem:Update()

Unity.Entities.ComponentSystemGroup:UpdateAllSystems()

Unity.Entities.ComponentSystem:Update()

UnityEngine.LowLevel.UpdateFunction:Invoke()

[FileUserList] Loaded FileUserList from: Z:\saves\Settings\banlist.txt, Added: 0

adminlist was tested with just authing.

saltydk commented 2 years ago

Image is here if you want to validate it yourself. https://hub.docker.com/r/saltydk/v-rising

Mephi00 commented 2 years ago

Log which shows the banlist being loaded

[FileUserList] Loaded FileUserList from: Z:\home\steam\Steam\steamapps\common\VRisingDedicatedServer\VRisingServer_Data\StreamingAssets\Settings\banlist.txt, Added: 0

UnityEngine.Logger:Log(LogType, Object)

UnityEngine.Debug:Log(Object)

ProjectM.FileUserList:RefreshLocal(Boolean)

ProjectM.KickBanSystem_Server:OnUpdate()

Unity.Entities.SystemBase:Update()

Unity.Entities.ComponentSystemGroup:UpdateAllSystems()

Unity.Entities.ComponentSystem:Update()

Unity.Entities.ComponentSystemGroup:UpdateAllSystems()

ProjectM.ServerSimulationSystemGroup:OnUpdate()

Unity.Entities.ComponentSystem:Update()

Unity.Entities.ComponentSystemGroup:UpdateAllSystems()

Unity.Entities.ComponentSystem:Update()

Unity.Entities.ComponentSystemGroup:UpdateAllSystems()

Unity.Entities.ComponentSystem:Update()

UnityEngine.LowLevel.UpdateFunction:Invoke()

[FileUserList] Loaded FileUserList from: Z:\saves\Settings\banlist.txt, Added: 0

adminlist was tested with just authing.

Thank you very much, I've just removed the whole symlinking thing if it just works now. I have tested it and it is working now.