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.91k stars 269 forks source link

Implementation of BepInExPack #282

Closed lloesche closed 3 years ago

lloesche commented 3 years ago

Hello

Are there any plans to implement BepInExPack similar as the Valheim+ mod? That would be a great way for easy mod module loading.

Mod Link

Originally posted by @madhub0815 in https://github.com/lloesche/valheim-server-docker/discussions/279

lloesche commented 3 years ago

@madhub0815 check lloesche/valheim-server:dev and specify BEPINEX=true. It'll download and install BepInExPack. Right now after adding plugins to the plugins directory whenever there is a Valheim Server update or a BepInExPack update it would get overwritten. From your point of view, what would be better:

I can see use cases for both.

madhub0815 commented 3 years ago

First i will thank you for the quick implementation.

To set a list of plugin and get it auto updated and downloaded would be great.

Because some plugins for example equipment and quick slots have to be there when a player is joining the server because if there is a server update and the plugin would not be there the player can not use the equiped amor because the extra slots are not there.

Therefore the admin have to react manuel and install plugins again wich may be not always possible in time?

I will set up a test server later that day to test the general function.

lloesche commented 3 years ago

@madhub0815 ok makes sense. Maybe we should also build something that will make all plugins available to the user for download as one ZIP file? So that when the server auto updates like 50 plugins the user doesn't have to do that by themselves? Do you know if Valheim Plugins are always within the BepInEx/plugins/ folder? Or are some outside of this directory structure?

madhub0815 commented 3 years ago

@lloesche Yes plugins should be all in the mentioned folder. The idea of auto update and installing these to clients directly is good but if clients are using a mod manager like "Thunderstore" not practicable.

Because the folder of the modmanager is "C:\Users\WINDOWSUSER\AppData\Roaming\Thunderstore Mod Manager\DataFolder\Valheim\profiles\MODMANAGERPROFILE\BepInEx\plugins" and plugins have to be managed in the mod manager like turn on/off install or uninstall or just play vanilla without any mods. Because of that you can have mods without changing/editing files in the game directory itself.

Therefore i think it will be easier to give the responsibility of plugins are up to date to the clients themselves by using the mod manager.

I just set up a test server by pulling lloesche_valheim-server:dev but in the startup log i can not see any presence of BepInEx so far? Also there is no BeInEx folder in the server directory being created. I just used attached EVNs

image

lloesche commented 3 years ago

The BEPINEX=true is missing in your config. Also all the other true/false fields will all be ignored and using defaults because they have wrong capitalization. Which you likely never noticed because all the chosen values are the same as our defaults. It needs to be literally true not TRUE or True.

madhub0815 commented 3 years ago

WTF - i am sorry for that. Nevermind. Will try it out later.

madhub0815 commented 3 years ago

Just pulled the latest dev version. All seems to go fine until line 1396 of the attached log file lots of Fallback handler error come up.

_Valheim_Test_logs.txt

Maybe it will help you with your further development.

I copied 3 plugins to the server to test functionality and restarted the container. The plugin load starts in line 629 of the log file below with "Fallback handler could not load library" errors and they are not working. _Valheim_Test_logs (1).txt

i hope the information are helpful to you.

lloesche commented 3 years ago

Those Fallback handler messages don't mean anything. In ValheimPlus you'll see them all over the place.

lloesche commented 3 years ago

Actually in ValheimPlus you might have never seen them because there we just filter them away because they are so annoying: https://github.com/lloesche/valheim-server-docker/blob/e05ae2bf622866eb729a23a0b99b18cb42ca4470/defaults#L88-L90

I can add that for BepInEx as well to get rid of the noise.

lloesche commented 3 years ago

Okay the server will now install any plugins in /config/bepinex/plugins/ whenever BepInExPack is installed/updated. This allows you to use mod from any sources. Be it thunderstore, Nexus mods, local builds or anywhere else.

As a side effect this also allows ValheimPlus users to add additional plugins to /config/valheimplus/plugins/.

madhub0815 commented 3 years ago

Thank you for your great work. Will test it tomorrow. 👍