U-1F31A / BepInEx_Valheim_Full

3 stars 1 forks source link

[Issue] valheim.sh script doesn't like spaces in variables #5

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hey, I recently tried upgrading to the Full BepInEx pack on my Linux server, and all is seemingly well. I used the BepInEx_Valheim_Full_Updater plugin, which worked fine according to the logs.

Except the included valheim.sh. I tried editing the variables at the top, like so:

SERVER_NAME="Test Server"
# NOTE: UDP ports 2456-2458 must be forwarded by your firewall/router
SERVER_PORT=2456
WORLD_NAME="Test World"
# NOTE: Minimum password length is 5 characters & Password cannot exist as part of the server name.
# if a password is not selected, a new, random one will be generated on startup
SERVER_PASS="test123"
SERVER_PUBLIC=1

But the world-file name gets saved as: Test.db instead of TestWorld.db, and the server name is named as Test, and not Test Server. It creates the new Test.db / Test.fwl file, instead of recognizing the old TestWorld.db file. Here's the ls -alh output of the world folder:

drwxr-xr-x 2 steam steam 4.0K Mar 11 15:48 .
drwxr-xr-x 3 steam steam 4.0K Feb 26 18:38 ..
-rw-r--r-- 1 steam steam  99M Mar 11 15:47 Test World.db
-rw-r--r-- 1 steam steam  99M Mar 11 15:45 Test World.db.old
-rw-r--r-- 1 steam steam   47 Mar 11 15:47 Test World.fwl
-rw-r--r-- 1 steam steam   47 Mar 11 15:45 Test World.fwl.old
-rw-r--r-- 1 steam steam 4.1M Mar 11 15:47 Test World.mod.serversidemap.explored
-rw-r--r-- 1 steam steam   74 Mar 11 15:48 Test.db
-rw-r--r-- 1 steam steam   40 Mar 11 15:48 Test.fwl
-rw-r--r-- 1 steam steam   40 Mar 11 15:48 Test.fwl.old
-rw-r--r-- 1 steam steam 4.1M Mar 11 15:48 Test.mod.serversidemap.explored

I had to edit my old FWL file (which included a space, like Test World) to TestWorld in order for the script (and server) to register my old file.

CodeMason commented 3 years ago

Hi!

Likely, the reason is the space between the words is not escaped, and so changing it to Test\ World would fix the issue. I will double check this, and make appropriate changes to the .sh scripts so they are literal instead.

Thanks for the info and report

ghost commented 3 years ago

Tried changing it to Test\ World, which just made these new files:

drwxr-xr-x 2 steam steam 4.0K Mar 11 16:29  .
drwxr-xr-x 3 steam steam 4.0K Feb 26 18:38  ..
-rw-r--r-- 1 steam steam 183K Mar 11 16:29 'Test\.db'
-rw-r--r-- 1 steam steam   74 Mar 11 16:29 'Test\.db.old'
-rw-r--r-- 1 steam steam   43 Mar 11 16:29 'Test\.fwl'
-rw-r--r-- 1 steam steam   43 Mar 11 16:29 'Test\.fwl.old'
-rw-r--r-- 1 steam steam 4.1M Mar 11 16:29 'Test\.mod.serversidemap.explored'
-rw-r--r-- 1 steam steam  99M Mar 11 14:33 'Test World.db'
-rw-r--r-- 1 steam steam  99M Mar 11 14:24 'Test World.db.old'
-rw-r--r-- 1 steam steam   48 Mar 11 14:33 'Test World.fwl'
-rw-r--r-- 1 steam steam   48 Mar 11 14:24 'Test World.fwl.old'
-rw-r--r-- 1 steam steam 4.1M Mar 11 14:33 'Test World.mod.serversidemap.explored'
CodeMason commented 3 years ago

Yikes!

I'll see what's going on. Thanks for testing that too!

ghost commented 3 years ago

Sweet 👍 . If you find any fix, keep me posted!

sebastienvercammen commented 3 years ago

Fixed in the latest release, with the new start_server_bepinex.sh: https://valheim.thunderstore.io/package/1F31A/BepInEx_Valheim_Full/

ghost commented 3 years ago

That's nice. Will the updater plugin update everything then?

sebastienvercammen commented 3 years ago

Hey @VP-EN, we're releasing the latest version of the updater plugin later today, while we test it for a couple of hours on our virtual machines. Grab that one when it drops.

ghost commented 3 years ago

Very nice, thanks for the quick reply! 👍