TrueOsiris / docker-vrising

Container for V-Rising dedicated server
217 stars 57 forks source link

How to get BepInEx to work #45

Open SyndZ opened 6 months ago

SyndZ commented 6 months ago

Hi, I'd like to install mods on the server (starting with BepInEx etc.), but i cant manage to make it work on the server : Where do i need to drop the files in /mnt/vrising/server ? Is there some extra steps needed ? Thanks for your time.

TrueOsiris commented 2 months ago

I have no idea. I would assume this should be in /persistentdata somewhere. (so the equivalent volume path on your host). Please keep us posted if you figured this out.

DameonK commented 2 months ago

Hi TrueOsiris, The docker image needs to have the Wine load order for the winhttp DLL changed to "Native then Builtin". Winecfg can be used to easily make this change. This should allow BepInEx to load.

Alternatively a new environment variable can be added in the container settings: WINEDLLOVERRIDES=winhttp=n,b

Keep in mind BepInEx is still in active development for the 1.0 release and the developers have not released a stable build yet.

jobsidi commented 2 months ago

Hi TrueOsiris, The docker image needs to have the Wine load order for the winhttp DLL changed to "Native then Builtin". Winecfg can be used to easily make this change. This should allow BepInEx to load.

have you made it? i tried some actions including editing start.sh by editing "DISPLAY=:0.0 wine64 /mnt/vrising/server/VRisingServer.exe -persistentDataP..." with "--doorstop-enabled true" but it got nothing

srmeier commented 2 months ago

Also curious if anyone has got this to work

TrueOsiris commented 2 months ago

Native then Builtin

This ought to be the default. And I have trouble finding out how to use winecfg command line. Still need some assistance with this.

jobsidi commented 2 months ago

check the status and wait. Development in progress https://wiki.vrisingmods.com/user/game_update

srmeier commented 2 months ago

@jobsidi What are we waiting for? BepInEx already works with v1.0 if you leverage their pre-release: https://github.com/Odjit/BepInEx/releases/tag/vrising-release

jobsidi commented 2 months ago

@jobsidi What are we waiting for? BepInEx already works with v1.0 if you leverage their pre-release: https://github.com/Odjit/BepInEx/releases/tag/vrising-release check how it works pls. Its bepinex only. No working addons.

srmeier commented 2 months ago

There are a lot of different addons, which one are you waiting for?

I am fine if we can get BepInEx working alone. Then I can load my own addon.

jobsidi commented 2 months ago

my minimum is

DameonK commented 2 months ago

I've had no luck so far getting BepInEx to load correctly in a docker container in v1.0. Loads fine in native Windows, but in a container I can get as far as BepInEx creating the config and subfolders, then crashes with the attached error. ErrorLog.log

Server log shows: 0024:err:eventlog:ReportEventW L"Description: The process was terminated due to an internal error in the .NET Runtime at IP 00006FFFECC81FDD (00006FFFECAB0000) with exit code c0000005.\n"

TrueOsiris commented 1 month ago

ah ... we would need to add .Net dlls. I did this a couple of years ago. A ton of work. I'll look in to it.

DameonK commented 1 month ago

Hey TrueOsiris, thanks for looking into it. BepInEx is using .NET 6.0.7. The latest version of winetricks has dotnet6 available. Also here's a link to how avivace implemented BepInEx into their RoR2 container config, if it's helpful.

jobsidi commented 1 month ago

ya. Anyway its in rc2 state atm

jobsidi commented 1 month ago

rc3 open beta release. i've tried winetricks --self-update winetricks -q dotnetdesktop6 but it didnt work i think bcs of 20210206 build of wine. its too old. There are some community of main developers of mods and bepinex https://discord.com/channels/978094827830915092/1242632756920586351

AndrewSav commented 1 month ago

I got it to run by doing these things:

This is the image changes I tried it on:

https://github.com/AndrewSav/docker-vrising/commit/c3b48e183dbec4a28df70f31365a0ec1410f915d

This is the BepInEx I used: https://thunderstore.io/c/v-rising/p/BepInEx/BepInExPack_V_Rising/

jobsidi commented 1 month ago

@AndrewSav nice tyvm. I suppose "m=/mnt/vrising/mods" is /BepInEx/plugins ? upd ahh no, its just BepInEx, ok

AndrewSav commented 1 month ago

@AndrewSav nice tyvm. I suppose "m=/mnt/vrising/mods" is /BepInEx/plugins ? upd ahh no, its just BepInEx, ok

The idea here is to be able to quickly enable/disable mods with an env var. So on each start the containers first wipes the old BepInEx and then if the var ENABLE_MODS is set copies the entire /mods in its place

services:
  vrising:
    restart: unless-stopped
    container_name: vrising2
    image: fork
    network_mode: bridge
    environment:
      - ENABLE_MODS=1
    volumes:
      - './server:/mnt/vrising/server'
      - './data:/mnt/vrising/persistentdata'
      - './mods:/mnt/vrising/mods'
    ports:
      - '27019:27019/udp'
      - '27020:27020/udp'

Also used https://github.com/mpawlowski/r2modman-headless to download the mods easily, but that's obviously optional.

r2modman-headless --install-dir=mods --profile-zip ~/vrising-server-1_1717367773349.r2z  -thunderstore-metadata-url=https://thunderstore.io/c/v-rising/api/v1/package/ --work-dir /tmp
jobsidi commented 1 month ago

@AndrewSav ty but cp -r "$m/BepInEx" "$s/BepInEx" in start.sh and you write - './mods:/mnt/vrising/mods' shouldn't it be something like cp -r "$m/mods" "$s/BepInEx" in start.sh in this case?

AndrewSav commented 1 month ago

@jobsidi $m is defined at the top: m=/mnt/vrising/mods so the mods segment is already included in that path we just need BepInEx

Update, ah I just noticed, that https://thunderstore.io/c/v-rising/p/BepInEx/BepInExPack_V_Rising/ also has a dotnet directory which I initially copied manually, but I'm not doing that in the start.sh. Let me fix that https://github.com/AndrewSav/docker-vrising/commit/4f80581a04c57af9a12eca53882488b5d0422d38

This is my directory structure for reference:

2024-06-03_12-34-06

jobsidi commented 1 month ago

@AndrewSav I made an image. It dosnt work (

LOG Starting V Rising Dedicated Server with name maslo Trying to remove /tmp/.X0-lock Generating initial Wine configuration... Starting Xvfb Launching wine64 V Rising 0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005 [UnityMemory] Configuration Parameters - Can be set up in boot.config "memorysetup-bucket-allocator-granularity=16" "memorysetup-bucket-allocator-bucket-count=8" "memorysetup-bucket-allocator-block-size=4194304" "memorysetup-bucket-allocator-block-count=1" "memorysetup-main-allocator-block-size=16777216" "memorysetup-thread-allocator-block-size=16777216" "memorysetup-gfx-main-allocator-block-size=16777216" "memorysetup-gfx-thread-allocator-block-size=16777216" "memorysetup-cache-allocator-block-size=4194304" "memorysetup-typetree-allocator-block-size=2097152" "memorysetup-profiler-bucket-allocator-granularity=16" "memorysetup-profiler-bucket-allocator-bucket-count=8" "memorysetup-profiler-bucket-allocator-block-size=4194304" "memorysetup-profiler-bucket-allocator-block-count=1" "memorysetup-profiler-allocator-block-size=16777216" "memorysetup-profiler-editor-allocator-block-size=1048576" "memorysetup-temp-allocator-size-main=16777216" "memorysetup-job-temp-allocator-block-size=33554432" "memorysetup-job-temp-allocator-block-size-background=1048576" "memorysetup-job-temp-allocator-reduction-small-platforms=262144" "memorysetup-allocator-temp-initial-block-size-main=262144" "memorysetup-allocator-temp-initial-block-size-worker=262144" "memorysetup-temp-allocator-size-background-worker=32768" "memorysetup-temp-allocator-size-job-worker=262144" "memorysetup-temp-allocator-size-preload-manager=262144" "memorysetup-temp-allocator-size-nav-mesh-worker=65536" "memorysetup-temp-allocator-size-audio-worker=65536" "memorysetup-temp-allocator-size-cloud-worker=32768" "memorysetup-temp-allocator-size-gfx=262144" 0024:fixme:combase:RoSetErrorReportingFlags (00000004): stub 0024:fixme:combase:RoGetActivationFactory (L"Windows.System.DispatcherQueue", {00000035-0000-0000-c000-000000000046}, 00007FFFFE1EF318): semi-stub 0024:err:combase:RoGetActivationFactory Failed to find library for L"Windows.System.DispatcherQueue" 0024:fixme:heap:GetNumaHighestNodeNumber semi-stub: 00007FFFFE1EEFFC 0024:fixme:seh:WerRegisterRuntimeExceptionModule (L"Z:\\mnt\\vrising\\server\\dotnet\\mscordaccore.dll", 00006FFFEC2F0000) stub 0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 0024:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 0000000100561018, 34) stub 0024:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 000000010055DCC0, 38) stub 0024:fixme:ntdll:NtQuerySystemInformation (0x000000ce,0x7ffffe1ede40,0x00000008,(nil)) stub 0024:fixme:nls:get_dummy_preferred_ui_language (0x8 0x409 00007FFFFE1EDC70 0000000000000000 00007FFFFE1EDC68) returning a dummy value (current locale) 0024:fixme:nls:get_dummy_preferred_ui_language (0x8 0x409 00007FFFFE1EDC70 00007FFFFE1EDBC0 00007FFFFE1EDC68) returning a dummy value (current locale) 0024:fixme:ntdll:RtlGetCurrentProcessorNumberEx (00007FFFFE1EDDE0) :semi-stub ... ... ... 0024:fixme:file:parse_samba_dos_attrib_data Unhandled user.DOSATTRIB extended attribute value. 0024:fixme:ver:GetFileVersionInfoExW flags 0x2 ignored 0024:fixme:amsi:AmsiInitialize L"coreclr", 00007FFFFE1ED1C8 0024:fixme:amsi:AmsiScanBuffer 00000000DEADBEEF, 00007F47C7089620, 3072, (null), 0000000000000000, 00007FFFFE1ED1C0 0024:fixme:amsi:AmsiScanBuffer 00000000DEADBEEF, 00007F47C7284250, 8192, (null), 0000000000000000, 00007FFFFE1ED4D0 0024:fixme:virtual:NtFlushProcessWriteBuffers stub

seems something is wrong with wine

AndrewSav commented 1 month ago

@jobsidi looks very similar to what I'm seeing, but it's loading the mods and server is functional with them after that for me

jobsidi commented 1 month ago

@AndrewSav my one nope. I cannot connect to the server :(

lordtgm commented 3 weeks ago

any update on this?

AndrewSav commented 3 weeks ago

To me this is a solved problem. Running well in the past couple of weeks for me. Maybe someone can make these changes and update this image. I updated my own copy, because could not resist cleaning this one up a bit, and everyone's writing style differ, so whatever I did would not be eligible for merging here.

lordtgm commented 3 weeks ago

To me this is a solved problem. Running well in the past couple of weeks for me. Maybe someone can make these changes and update this image. I updated my own copy, because could not resist cleaning this one up a bit, and everyone's writing style differ, so whatever I did would not be eligible for merging here.

well I'm not that experienced with docker or wine, can you please explain what you did?

AndrewSav commented 3 weeks ago

well I'm not that experienced with docker or wine, can you please explain what you did?

I explained above, but happy to answer if anything in particular is not clear