lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.96k stars 276 forks source link

Valheim plus incompatible version Client/Server #171

Closed twitram closed 3 years ago

twitram commented 3 years ago

Hi,

I have an issue when i enable Valheim plus. I have this error in client side : incompatible version and server side : Peer 76561198174318494 has incompatible version, mine:0.147.3 remote 0.147.3@0.9.3

Can you help me ?

Thanks

lloesche commented 3 years ago

mine:0.147.3 means that V+ is not enabled on the server.

twitram commented 3 years ago

I'm in docker mode and i use this env variable :

VALHEIM_PLUS | true VPCFG_Server_enabled | true VPCFG_Server_enforceMod | false VPCFG_Server_dataRate | 500

and log file :

2021-03-06 07:06:59,409 INFO spawned: 'valheim-bootstrap' with pid 13, 2021-03-06 07:06:59,917 - DEBUG - Reading ValheimPlus config from env variables prefixed with VPCFG_, 2021-03-06 07:06:59,917 INFO success: valheim-bootstrap entered RUNNING state, process has stayed up for > than 0 seconds (startsecs), 2021-03-06 07:06:59,919 - DEBUG - Reading existing ValheimPlus config /config/valheimplus/valheim_plus.cfg, 2021-03-06 07:06:59,936 - INFO - Writing ValheimPlus config /config/valheimplus/valheim_plus.cfg.tmp, 2021-03-06 07:06:59,937 - INFO - Moving old config /config/valheimplus/valheim_plus.cfg -> /config/valheimplus/valheim_plus.cfg.old, 2021-03-06 07:06:59,945 - INFO - Moving new config /config/valheimplus/valheim_plus.cfg.tmp -> /config/valheimplus/valheim_plus.cfg, 2021-03-06 07:06:59 [13] (DEBUG) Creating cron to restart valheim-server using schedule 0 5 *, 2021-03-06 07:07:02,531 INFO spawned: 'valheim-updater' with pid 37, 2021-03-06 07:07:02 [37] (DEBUG) Running Valheim Server updater as user root uid 0, 2021-03-06 07:07:02 [37] (DEBUG) Valheim updater was just started - skipping connected players check, 2021-03-06 07:07:02 [37] (INFO) Downloading/updating/validating Valheim server from Steam, 2021-03-06 07:07:03,756 INFO success: valheim-updater entered RUNNING state, process has stayed up for > than 1 seconds (startsecs), valheim-updater: started, 2021-03-06 07:07:03,879 INFO spawned: 'valheim-backup' with pid 64, 2021-03-06 07:07:03 [64] (INFO) Backing up Valheim server worlds to /config/backups/worlds-20210306-070703.zip, adding: worlds/Neotopia.db.old2021-03-06 07:07:05,864 INFO success: valheim-backup entered RUNNING state, process has stayed up for > than 1 seconds (startsecs), valheim-backup: started, 2021-03-06 07:07:05,876 INFO exited: valheim-bootstrap (exit status 0; expected), 2021-03-06 07:07:53 [37] (INFO) Valheim Server is already the latest version, 2021-03-06 07:07:53 [37] (DEBUG) ValheimPlus is enabled - running updater, 2021-03-06 07:07:53 [129] (DEBUG) Local ValheimPlus archive is identical to remote archive - no update required, 2021-03-06 07:07:53 [37] (DEBUG) Writing file to start Valheim server, 2021-03-06 07:07:54,010 INFO spawned: 'valheim-server' with pid 154, 2021-03-06 07:07:54 [154] (INFO) Running Valheim Server, Found path: /opt/valheim/plus/valheim_server.x86_64, Mono path[0] = '/opt/valheim/plus/valheim_server_Data/Managed', Mono config path = '/opt/valheim/plus/valheim_server_Data/MonoBleedingEdge/etc', Current root dir: /opt/valheim/plus/valheim_server_Data/Managed, New root path: /opt/valheim/plus/unstripped_corlib, Search path: /opt/valheim/plus/unstripped_corlib:/opt/valheim/plus/valheim_server_Data/Managed, Setting config paths; basedir: /opt/valheim/plus; config: /opt/valheim/plus/valheim_server.x86_64.config, Managed dir: /opt/valheim/plus/valheim_server_Data/Managed, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/data-0x564cc6054460.so, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libdl, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32.so, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/kernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32.so, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32.so, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/kernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32.so, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32.so, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/kernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32.so, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/libkernel32, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/data-0x7ff2c8104010.so, [Subsystems] Discovering subsystems at path /opt/valheim/plus/valheim_server_Data/UnitySubsystems, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.AIModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.AIModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.AndroidJNIModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.AndroidJNIModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.AnimationModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.AnimationModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.AssetBundleModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.AssetBundleModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.AudioModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.AudioModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.ClothModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.ClothModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.CoreModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.CoreModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.DirectorModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.DirectorModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.GridModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.GridModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.IMGUIModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.IMGUIModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.InputModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.InputModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.InputLegacyModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.InputLegacyModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.ParticleSystemModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.ParticleSystemModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.PhysicsModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.PhysicsModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.Physics2DModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.Physics2DModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.ScreenCaptureModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.ScreenCaptureModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.SharedInternalsModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.SharedInternalsModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.SubsystemsModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.SubsystemsModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.TerrainModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.TerrainModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.TextRenderingModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.TextRenderingModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.TilemapModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.TilemapModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.UIModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.UIModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.UIElementsModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.UIElementsModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.UnityAnalyticsModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.UnityAnalyticsModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.UnityWebRequestModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.UnityWebRequestModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.UnityWebRequestWWWModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.UnityWebRequestWWWModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.VFXModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.VFXModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.VRModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.VRModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.VideoModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.VideoModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.XRModule.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.XRModule.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_steamworks.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_lux.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_valheim.dll, se: assembly_valheim.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_guiutils.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/UnityEngine.UI.dll, Redirecting to /opt/valheim/plus/unstripped_corlib/UnityEngine.UI.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_sunshafts.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_googleanalytics.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_postprocessing.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_simplemeshcombine.dll, Load DLL: /opt/valheim/plus/valheim_server_Data/Managed/assembly_utils.dll, [Message: BepInEx] BepInEx 5.4.8.0 - valheim_server, [Info : BepInEx] Loading [Valheim Plus 0.9.3], [Info :Valheim Plus] Trying to load the configuration file, Fallback handler could not load library /opt/valheim/plus/valheim_server_Data/Mono/data-0x564cc74a3960.so, [Info :Valheim Plus] Configuration file loaded succesfully., [Info :Valheim Plus] ValheimPlus [0.9.3] is up to date., 2021-03-06 07:08:04,050 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 10 seconds (startsecs), valheim-server: started

lloesche commented 3 years ago

Ah in that case maybe enforceMod means forbidMod? Dunno, maybe a good question for the folks at ValheimPlus.

Generally speaking, the 0.147.3 in the version number is the Valheim version and the @0.9.3 is the version that the VahlheimPlus mod adds.

So when the log says mine:0.147.3 remote 0.147.3@0.9.3 it looks like ValheimPlus is turned off on the server but installed on the client. But maybe that enforceMod=false flag just removes the V+ version string from the server so normal clients can join, but then when a modded client comes along they can't log in because their version doesn't match now. Again, question that the ValheimPlus people can surely answer.

lloesche commented 3 years ago

@twitram were you able to get this sorted out? If you found the solution it would be great if you can post it here so others who run into the same issue can learn from your debugging work.

altrae commented 3 years ago

I've got the same problem with same setup, but the logs aren't showing that ValheimPlus is installing even tho is enabled.

Edit: think I may have found the issue. I was running a vanilla Valheim server in the original docker container and tried enabling Valheim plus after which didn't seem to work. I duplicated the container settings and started a fresh instance and that seemed to trigger the installation using the Valheim plus version. I couldn't connect tho and didn't have time to figure it out at that moment so switched it back for the time being, but it does seem to have something to do with whether or not the mod was enabled on initial container start.

InB4DevOps commented 3 years ago

Same problem here

Unity Log] 03/08/2021 11:59:15: Peer xxx has incompatible version, mine:0.147.3@0.9 remote 0.147.3

I am using these env vars:

    -e VALHEIM_PLUS=true ^
    -e VPCFG_Server_enabled=true ^
    -e VPCFG_Server_enforceMod=false ^
    -e VPCFG_Server_dataRate=120 ^

Weird thing is that this worked without a problem and only started when I had to restart my server this morning..

In the ingame server list the server now shows as 0.147.3@0.9 but before the restart it showed as 0.147.3 My clients do not have the mod installed (as I only need it for the dataRate fix)

InB4DevOps commented 3 years ago

I found the solution: stop the container, open the file valheim_plus.cfg in /config/ValheimPlus, change enforceMod=true to enforceMod=false and start the container again

This is of course for the use case of server-only-ValheimPlus eg for the data rate fix.

@lloesche the environment variable VPCFG_Server_enforceMod doesn't seem to work any more or is overwritten by ValheimPlus.

lloesche commented 3 years ago

@InB4DevOps seems to work fine here.

What does your log say? It should output something like

2021-03-08 13:21:38,288 - DEBUG - Reading ValheimPlus config from env variables prefixed with VPCFG_
2021-03-08 13:21:38,288 - DEBUG - Found [Server] enforceMod = false in environment
2021-03-08 13:21:38,289 - DEBUG - Found [Server] enabled = true in environment
2021-03-08 13:21:38,290 - DEBUG - Reading existing ValheimPlus config /config/valheimplus/valheim_plus.cfg
2021-03-08 13:21:38,295 - DEBUG - Processing section Server
2021-03-08 13:21:38,296 - DEBUG - Setting enforceMod = false in config section Server
2021-03-08 13:21:38,296 - DEBUG - Setting enabled = true in config section Server
2021-03-08 13:21:38,297 - INFO - Writing ValheimPlus config /config/valheimplus/valheim_plus.cfg.tmp
2021-03-08 13:21:38,298 - INFO - Moving old config /config/valheimplus/valheim_plus.cfg -> /config/valheimplus/valheim_plus.cfg.old
2021-03-08 13:21:38,299 - INFO - Moving new config /config/valheimplus/valheim_plus.cfg.tmp -> /config/valheimplus/valheim_plus.cfg

When I check the generated cfg file the content is as expected.

lloesche commented 3 years ago

@altrae you should be able to switch V+ on/off at will. It is being installed into a dedicated directory so does not conflict with the vanilla server. If you are unsure you can always pass DEBUG_START_FRESH=true which will make the container wipe all downloaded and extracted server files. Your config and worlds remain untouched of course.

InB4DevOps commented 3 years ago

valheim_plus.cfg

Valheim 0.9.4 here I am seeing this:

2021-03-08 13:41:20,341 - DEBUG - Reading ValheimPlus config from env variables prefixed with VPCFG_

2021-03-08 13:41:20,342 INFO success: valheim-bootstrap entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)

2021-03-08 13:41:20,342 - DEBUG - Found [Server] enforceMod = false in environment

2021-03-08 13:41:20,342 - DEBUG - Found [Server] dataRate = 120 in environment

2021-03-08 13:41:20,342 - DEBUG - Found [Server] enabled = true in environment

2021-03-08 13:41:20,343 - DEBUG - Reading existing ValheimPlus config /config/valheimplus/valheim_plus.cfg

Traceback (most recent call last):

File "/usr/local/bin/vpenvconf", line 11, in <module>

load_entry_point('vpenvconf==0.0.1', 'console_scripts', 'vpenvconf')()

File "/usr/local/lib/python3.7/dist-packages/vpenvconf/__main__.py", line 22, in main

config = get_config(args.config_file)

File "/usr/local/lib/python3.7/dist-packages/vpenvconf/__init__.py", line 65, in get_config

config.read(config_file)

File "/usr/lib/python3.7/configparser.py", line 696, in read

self._read(fp, filename)

File "/usr/lib/python3.7/configparser.py", line 1091, in _read

fpname, lineno)

configparser.DuplicateOptionError: While reading from '/config/valheimplus/valheim_plus.cfg' [line 489]: option '; This also affects the cart and boat inventory' in section 'Inventory' already exists

I guess this parsing error exception isn't handled and thus the values are not written to the file. The file itself is untouched except for changing enforcemod=true to false.

InB4DevOps commented 3 years ago

This is my valheim_plus.cfg

[AdvancedBuildingMode]
; https://docs.unity3d.com/ScriptReference/KeyCode.html <- a list of keycodes

; Change false to true to enable this section, if you set this to false the mode will not be accesible
enabled=false

; Enter the advanced building mode with this key when building
enterAdvancedBuildingMode=F1

; Exit the advanced building mode with this key when building
exitAdvancedBuildingMode=F3

; Copy the object rotation of the currently selected object in ABM
copyObjectRotation=Keypad7

; Apply the copied object rotation to the currently selected object in ABM
pasteObjectRotation=Keypad8

[AdvancedEditingMode]

; Change false to true to enable this section, if you set this to false the mode will not be accesible
enabled=false

; https://docs.unity3d.com/ScriptReference/KeyCode.html <- a list of keycodes

; Enter the advanced editing mode with this key
enterAdvancedEditingMode=Keypad0

; Reset the object to its original position and rotation
resetAdvancedEditingMode=F7

; Exit the advanced editing mode with this key and reset the object
abortAndExitAdvancedEditingMode=F8

; Confirm the placement of the object and place it
confirmPlacementOfAdvancedEditingMode=KeypadEnter

; Copy the object rotation of the currently selected object in AEM
copyObjectRotation=Keypad7

; Apply the copied object rotation to the currently selected object in AEM
pasteObjectRotation=Keypad8

[Beehive]

; Change false to true to enable this section
enabled=false

; configure the speed at which the bees produce honey in seconds, 1200 seconds are 24 ingame hours
honeyProductionSpeed=1200

; configure the maximum amount of honey in beehives
maximumHoneyPerBeehive=4

[Building]

; Change false to true to enable this section
enabled=false

; Remove some of the Invalid placement messages, most notably provides the ability to place objects into other objects
noInvalidPlacementRestriction=false

; Removes the weather damage from rain
noWeatherDamage=false

; The maximum range that you can place build objects at
maximumPlacementDistance=5

[Camera]

; Change false to true to enable this section
enabled=false

; The maximum zoom distance to your character
cameraMaximumZoomDistance=6

; The maximum zoom distance to your character when in a boat
cameraBoatMaximumZoomDistance=6

; The game camera FOV
cameraFOV=65

[Experience]

; Change false to true to enable this section
enabled=false

; Each of these values represent the increase to experience gained by +/- %
; The value 50 would result in 50% increased experience gained for the respective skill by name.
; The value -50 would result in -50% experience gained for the respective skill by name.
swords=0
knives=0
clubs=0
polearms=0
spears=0
blocking=0
axes=0
bows=0
fireMagic=0
frostMagic=0
unarmed=0
pickaxes=0
woodCutting=0
jump=0
sneak=0
run=0
swim=0

[Fermenter]

; Change false to true to enable this section
enabled=false

; configure the time that the fermenter takes to produce its product, 2400 seconds are 48 ingame hours
fermenterDuration=2400

; configure the total amount of produced items from a fermenter
fermenterItemsProduced=6

; Display the minutes and seconds until the fermenter is done on hover
showFermenterDuration=false

[Fireplace]

; If changed to enabled all fireplaces do not need to be refilled.
enabled=false

; If you enable this option with the previous option to true, only placed torches do not need to be refilled.
; Apply to: wood torches, iron torches, green torches, sconces and brazier
onlyTorches=false

[Food]

; Change false to true to enable this section
enabled=false

; Increase or reduce the time that food lasts by %. The value 50 would cause food to run out 50% slower.
; Allows for - values to shorten food duration.
foodDurationMultiplier=0

[Furnace]

; Change false to true to enable this section
enabled=false

; Maximum amount of ore in a furnace
maximumOre=10

; Maximum amount of coal in a furnace
maximumCoal=20

; The total amount of coal used to produce a single smelted ingot.
coalUsedPerProduct=2

; The time it takes for the furnace to produce a single ingot in seconds.
productionSpeed=30

; Instead of dropping the items, they will be placed inside nearby chests instead.
autoDeposit=false

; The range of the chest detection for the auto deposit feature. (Maximum is 50)
autoDepositRange=10

[Game]

; Change false to true to enable this section
enabled=false

; The games damage multiplier per person nearby in difficultyScaleRange(m) radius.
gameDifficultyDamageScale=0.4

; The games health multiplier per person nearby in difficultyScaleRange(m) radius.
gameDifficultyHealthScale=0.4

; Adds additional players to the difficulty calculation in multiplayer unrelated to the actual amount
extraPlayerCountNearby=0

; Sets the nearby player count always to this value + extraPlayerCountNearby
setFixedPlayerCountTo=0

; The range in meters at which other players count towards nearby players for the difficulty scale
difficultyScaleRange=200

; If you set this to true, all portals will be disabled
disablePortals=false

[Hotkeys]
; https://docs.unity3d.com/ScriptReference/KeyCode.html <- a list of keycodes

; Change false to true to enable this section
enabled=false

; Roll forwards on key pressed
rollForwards=F9

; Roll backwards on key pressed
rollBackwards=F10

[Items]

; Change false to true to enable this section
enabled=false

; Enables you to teleport with ores and other usually restricted objects
noTeleportPrevention=false

; Increase or reduce item weight by % percent. The value -50 will reduce item weight of every object by 50%.
baseItemWeightReduction=0

; Increase the size of all item stacks by %. The value 50 would set a usual item stack of 100 to be 150.
itemStackMultiplier=0

; Set duration that dropped items live before despawning. Game default is 3600 seconds.
droppedItemOnGroundDurationInSeconds=3600

[Hud]

; Change false to true to enable this section
enabled=false

; Shows the required amount of items AND the amount of items in your inventory in build mode and while crafting.
showRequiredItems=false

; Shows small notifications about all skill experienced gained in the top left corner.
experienceGainedNotifications=false

; Shows current and max stamina numerically underneath the stamina bar.
displayStaminaValue=false

; Set to true to remove the red screen flash overlay when the player takes damage.
removeDamageFlash=false

[Gathering]

; Change false to true to enable this section
enabled=false

; Modify the chance to drop resources from resource nodes affected by this category
; This only works on resource nodes that do not have garuanteed drops
; As example by default scrap piles in dungeons have a 20% chance to drop a item, if you set this option to 200, you will then have a 60% chance to drop iron.
dropChance=0

; Each of these values increase or reduce the dropped items from destroyed objects with tools (Stones, Trees, Resource nodes, etc.) by %
; The value 50 will increase the dropped wood from trees from 10 to 15. The value -50 will reduce the amount of dropped wood from 10 to 5.
wood=0
stone=0
fineWood=0
coreWood=0
elderBark=0
ironScrap=0
tinOre=0
copperOre=0
silverOre=0
chitin=0

[Durability]

; Change false to true to enable this section
enabled=false

; Each of these values increase or reduce the durability of the specific item type by %
; The value 50 will increase the durability from 100 to 150. The value -50 will reduce the durability from 100 to 50.
axes=0
pickaxes=0
hammer=0
cultivator=0
hoe=0
weapons=0
armor=0
bows=0
shields=0

[Armor]

; Change false to true to enable this section
enabled=false

; Each of these values increase or reduce the armor of the specific item type by %
; The value 50 will increase the armor from 14 to 28. The value -50 will reduce the durability from 14 to 7.
helmets=0
chests=0
legs=0
capes=0

[Kiln]

; Change false to true to enable this section
enabled=false

; Maximum amount of wood in a Kiln
maximumWood=20

; The time it takes for the Kiln to produce a single piece of coal in seconds.
productionSpeed=30

; Instead of dropping the items, they will be placed inside nearby chests instead.
autoDeposit=false

; The range of the chest detection for the auto deposit feature. (Maximum is 50)
autoDepositRange=10

[Map]

; Change false to true to enable this section
enabled=false

; With this enabled you will receive the same exploration progression as other players on the server
shareMapProgression=false

; The radius of the map that you explore when moving
exploreRadius=100

; Prevents you and other people on the server to turn off their map sharing option
preventPlayerFromTurningOffPublicPosition=false

[Player]

; Change false to true to enable this section
enabled=false

; The base amount of carry weight of your character
baseMaximumWeight=300

; Increase the buff you receive to your carry weight from Megingjord's girdle
baseMegingjordBuff=150

; Increase auto pickup range of all items
baseAutoPickUpRange=2

; Disable all types of camera shake
disableCameraShake=false

; The base unarmed damage multiplied by your skill level.
; 120 will result in a maximum of 12 damage when you have a skill level of 10.
baseUnarmedDamage=120

; When changed to true, you will not be permitted to place a crop within the grow radius of another crop
cropNotifier=false

[Server]

; Change false to true to enable this section
enabled=true

; Modify the amount of players on your Server
maxPlayers=10

; Removes the requirement to have a server password
disableServerPassword=false

; This settings add a version control check to make sure that people that try to join your game or the server you try to join has V+ installed
enforceMod=false

; Changes whether the server will force it's config on clients that connect. Only affects servers.
serverSyncsConfig=true

; The total amount of data that the server and client can send per second in kilobyte
dataRate=60

[Stamina]
; Each of these values allow for - values, 50 will increase the stamina cost by 50%, -50 will reduce the stamina cost by 50%
; Change false to true to enable this section
enabled=false

; Changes the amount of stamina cost of using the dodge roll by %
dodgeStaminaUsage=0

; Changes the stamina drain of being overweight by %
encumberedStaminaDrain=0

; Changes the stamina cost of jumping by %
jumpStaminaDrain=0

; Changes the stamina cost of running by %
runStaminaDrain=0

; Changes the stamina drain by sneaking by %
sneakStaminaDrain=0

; Changes the total amount of stamina recovered per second by %
staminaRegen=0

; Changes the delay until stamina regeneration sets in by %
staminaRegenDelay=0

; Changes the stamina drain of swimming by %
swimStaminaDrain=0

[StaminaUsage]
; Change false to true to enable this section
enabled=false
; Each of these values modifies the stamina drain by %.
; The value 50 would result in 50% more stamina cost.
; The value -50 would result in 50% less stamina cost.
axes=0
blocking=0
bows=0
clubs=0
knives=0
pickaxes=0
polearms=0
spears=0
swords=0
unarmed=0
hammer=0
hoe=0
cultivator=0

[StructuralIntegrity]

; Change false to true to enable this section
enabled=false

; Disables the entire structural integrity system and allows for placement in free air, does not prevent building damage.
disableStructuralIntegrity=false

; Disables any damage from anything to all player built structures
disableDamageToPlayerStructures=false

; Each of these values reduce the loss of structural integrity by % less. The value 100 would result in disabled structural integrity and allow placement in free air.
wood=0
stone=0
iron=0
hardWood=0

[Time]

; --- > THIS FEATURE IS STILL IN DEVELOPMENT AND IS RIGHT NOW DISABLED UNTIL FURTHER NOTICE

; Change false to true to enable this section
; enabled=false
; Total amount of time one complete day and night circle takes to complete
; totalDayTimeInSeconds=1800
; Increase the speed at which time passes at night by %. The value 50 would result in a 50% reduced amount of night time. The value 0 would result in a 0% reduced amount (normal amount).
; nightTimeSpeedMultiplier=0

[Ward]

; Change false to true to enable this section
enabled=false

; The range of wards by meters
wardRange=20

[Workbench]
; Change false to true to enable this section
enabled=false

; Set the workbench radius in meters
workbenchRange=20

; Disables the roof and exposure requirement to use a workbench
disableRoofCheck=false

[Wagon]

; Change false to true to enable this section
enabled=false

; Change the base vagon physical mass of the vagon object
wagonBaseMass=20

; This value changes the game physical weight of Vagons by +/- more/less from item weight inside. The value 50 would increase the weight by 50% more. The value -100 would remove the entire extra weight.
wagonExtraMassFromItems=0

[Inventory]

; Change false to true to enable this section
enabled=false

; Player inventory number of rows (inventory is resized up to 6 rows, higher values will add a scrollbar)
; min 4, max 20
playerInventoryRows=15
; Wood chest number of columns
; 5 min, 8 max
woodChestColumns=5
; Wood chest number of rows (more than 4 rows will add a scrollbar)
; min 2, 10 max
woodChestRows=2
; Iron chests already have 8 columns by default but now you can lower it 
; This also affects the cart and boat inventory
; min 6, max 8
ironChestColumns=8
; Iron chest number of rows (more than 4 rows will add a scrollbar)
; This also affects the cart and boat inventory
; min 3, max 20
ironChestRows=3
; By default tools and weapons go into inventories top to bottom and other materials bottom to top. Set to true to make all items go into the inventory top to bottom.
inventoryFillTopToBottom=false
InB4DevOps commented 3 years ago

Ok, here's a workaround: remove line 489 ; This also affects the cart and boat inventory from the config file. (again, this is the default file from ValheimPlus 0.9.4) This allows the container to do its magic and write the values from the env vars to the file instead of failing due to the parsing exception.

A real fix would require to use configparser in a way that it allows duplicate lines? (not even sure why it would see that line as an option since there's no = in the line)

lloesche commented 3 years ago

Hmm I knew trying to retain those comments is going to cause trouble down the line. I'll just wipe everything from the config that isn't actual config. Either somebody modifies their config file and doesn't use VPCFG env vars and then the file is not touched anyways or they use VPCFG env vars and the file is fully under control of the config generator. If somebody wants to know the meaning of any of those values there's always the .default file parallel to the actual config.

InB4DevOps commented 3 years ago

@lloesche might be enough to change line 61 in vpenvconf\vpenvconf\__init__.py from

config = ConfigParser(comment_prefixes="/", allow_no_value=True)

to

config = ConfigParser(comment_prefixes=";", allow_no_value=True)

lloesche commented 3 years ago

@InB4DevOps no it's not... ; and # are the defaults. ConfigParser will remove all comments in the generated output file. That's why the "trick" if you want is to tell it to consider some other character the comment character and treat those lines as actual values. But I'll just wipe all comments from generated files now. It's the right and safe thing to do for auto generated files.

InB4DevOps commented 3 years ago

@InB4DevOps no it's not... ; and # are the defaults.

Then why does it treat line 489 as an option?

lloesche commented 3 years ago

@InB4DevOps no it's not... ; and # are the defaults. Then why does it treat line 489 as an option?

Because it starts with a ; and not a /.

By default it considers everything that starts with ; or # a comment. It will DELETE all comments. So in an attempt to retain all comments I told it that only lines starting with / are comments and it can safely remove them. So from ConfigParser's view all lines starting with ; were actual values/options and had to be retained. Mostly it wouldn't know how to parse those lines and not be able to figure out their value, which is why allow_no_value=True was needed. Through the combination of those two options comment_prefixes="/", allow_no_value=True it would retain comments in the generated config file because it didn't treat them as comments but as values instead.

But now the ' in that line that was introduced in the new valheim_plus default config tripped it up. So instead of trying to retain comments at all cost I just do what ConfigParser() would like to do and let it remove all comments.

altrae commented 3 years ago

Okay for me the incompatible version has been fixed after duplicating/recreating the docker container. One thing to note is that after this I had to go to the previous container and set the ports to auto or something else if I want to use the same local ports for the plus version.

@lloesche you are correct that you should be able to switch it on/off after creation, but for some reason the plus version only seemed to be created on the initial container setup for me. Initially I created a vanilla server and wasn't then able to enable plus, but after creating a plus version I have been able to turn it off/on via the environment variables.

Hope this helps!

altrae commented 3 years ago

I may have spoken to soon. It seems I can only connect to the plus version if I have the plus mod enabled on client as well because I just tried turning that off and can't connect even tho I have set the environment variable VPCFG_Server_enforceMod to false.

lloesche commented 3 years ago

@altrae and you are running on the latest version of the container? The one from like an hour ago where we fixed the config parser bug?

If so paste the log output. Everything between Reading ValheimPlus config from env and Moving new config as well as the mine:0.147.3 remote 0.147.3@0.9.3 line the server outputs when it rejects the client.

lloesche commented 3 years ago

@altrae also try to work with only one container, there really shouldn't be any reason to run multiple for Vanilla/V+ unless you actually want to run multiple servers in parallel. Let's rather fix the reason why it doesn't work with one container. That way we don't have any port confusion.

lloesche commented 3 years ago

@altrae oh and like I mentioned in that one container I would run with DEBUG_START_FRESH=true once just to make sure the download and installation directories are in order.

altrae commented 3 years ago

I'm a bit at a loss currently. I'm not seeing a line for Moving new config anywhere in the logs for any container. Also, now I'm having difficulty turning V+ on/off. I've been trying to test having it turned on/off in different variations on client/server, but now even tho V+ is enabled on the server and the server logs show it loaded it is using the non+ version for some reason:

2021-03-08 10:00:06,632 - DEBUG - Reading ValheimPlus config from env variables prefixed with VPCFG_ | stdout
03/08/2021 10:06:47: Peer 76561197973608711 has incompatible version, mine:0.147.3 remote 0.147.3@0.9.4 | stdout

image

altrae commented 3 years ago

I added the DEBUG_START_FRESH=true variable and here are the logs from that: lloesche-valheim-plus-server.zip

I'm not sure what to look for.

lloesche commented 3 years ago

@altrae no worries we will figure this out. I'm reading the log you attached right now. First I was a bit confused by it until I realized it is written in reverse direction with the newest entries at the top instead of the bottom 🙂

In the log I can see the configparser.DuplicateOptionError that we fixed earlier which is likely the reason V+ does not work as expected.

From the screenshot I can see that you're on a Synology. Follow these instructions: https://github.com/lloesche/valheim-server-docker#updating-the-container-image-to-the-latest-version to update the image to the latest version. In Step 4 on the Registry screen just download the container again and choose "latest" when it asks for the tag.

altrae commented 3 years ago

Sorry for the reverse logs and thanks for your patience trying to help me figure this out. I cleared the container, deleted and redownloaded the image using latest tag, and renamed the valheimplus folder in the local so that it would be recreated on install, but I'm unable to connect still using V+.

Here are the newest logs. lloesche-valheim-plus-server.zip

lloesche commented 3 years ago

Okay just went through the log. The config generation works now. So that is great.

Here's the problematic line

mine:0.147.3 remote 0.147.3@0.9.4

This is caused by VPCFG_Server_enforceMod=false.

The logic of this ValheimPlus flag works like this: If enforceMod = true then the client must have the mod too. If enforceMod = false then the client must not have the mod.

And if VALHEIM_PLUS=false then the client must also not have the mod.

Try setting VPCFG_Server_enforceMod=true and you should be good to go.

altrae commented 3 years ago

This worked, thanks so much! I read enforceMod as allowing client to run vanilla or V+ while server is running V+ itself. If you have to have this enabled then it seems to be a redundant flag with the regular Server enabled flag so that's odd to me.

lloesche commented 3 years ago

I know right? I assumed the same and was surprised when I found out that's not how it works. I'm glad it is working for you now!