From 5183aaf42227a8cf6b756e5bdbc650b2432f03d6 Mon Sep 17 00:00:00 2001 From: Fexty12573 Date: Thu, 5 Dec 2024 12:52:18 +0100 Subject: [PATCH] Update install instructions + bump version to 0.0.7.2 --- README.md | 5 +++- SharpPluginLoader.Core/PluginManager.cs | 15 ++++++++++ .../SharpPluginLoader.Core.csproj | 4 +-- docs/Install/Installation.md | 29 +++++++++++++++++-- 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7198c44..e495931 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,7 @@ If you would like to contribute, feel free to fork the repository and make a PR. - [DirectXTK\[12\]](https://github.com/microsoft/DirectXTK) - DirectX Toolkit, used for loading and managing textures ## **Credits** -- Thanks to Lyra for creating the logo +- Lyra: Creating the logo +- ImDevinC: Lots of testing and feedback to get Linux support working +- jn64: Writing the complete Linux installation instructions +- Ando: Writing the preloader and generally improving the native side diff --git a/SharpPluginLoader.Core/PluginManager.cs b/SharpPluginLoader.Core/PluginManager.cs index 57689fd..4eee181 100644 --- a/SharpPluginLoader.Core/PluginManager.cs +++ b/SharpPluginLoader.Core/PluginManager.cs @@ -227,6 +227,12 @@ public void LoadPlugins(string directory) // After all plugins are loaded, we can save the plugin records cache. AddressRepository.SavePluginRecords(); + + // Start a task to periodically save the plugin records cache. + SavePluginRecords(TimeSpan.FromSeconds(7)).ContinueWith(t => + { + Log.Error($"Failed to save plugin records cache: {t.Exception}"); + }, TaskContinuationOptions.OnlyOnFaulted); } /// @@ -575,5 +581,14 @@ private void UnloadPlugin(string pluginPath) _contexts.Remove(key); } } + + private async Task SavePluginRecords(TimeSpan interval) + { + var timer = new PeriodicTimer(interval); + while (await timer.WaitForNextTickAsync()) + { + AddressRepository.SavePluginRecords(); + } + } } } diff --git a/SharpPluginLoader.Core/SharpPluginLoader.Core.csproj b/SharpPluginLoader.Core/SharpPluginLoader.Core.csproj index eee2164..6e96c70 100644 --- a/SharpPluginLoader.Core/SharpPluginLoader.Core.csproj +++ b/SharpPluginLoader.Core/SharpPluginLoader.Core.csproj @@ -10,14 +10,14 @@ True SharpPluginLoader.Core SharpPluginLoader - 0.0.7 + 0.0.7.2 Fexty, Ando SharpPluginLoader.Core A C# Plugin loader and framework for Monster Hunter World https://fexty12573.github.io/SharpPluginLoader/ README.md https://github.com/Fexty12573/SharpPluginLoader - 0.0.7 + 0.0.7.2 diff --git a/docs/Install/Installation.md b/docs/Install/Installation.md index aa756d2..c1b0e3b 100644 --- a/docs/Install/Installation.md +++ b/docs/Install/Installation.md @@ -1,5 +1,6 @@ # Installation -The mod is based on .NET 8. You will need to install the [.NET 8.0 Runtime](https://dotnet.microsoft.com/download/dotnet/8.0/runtime) to use it. +## Windows +The mod is based on .NET 8. You will need to install the [.NET 8.0 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/8.0/runtime) to use it. Grab the x64 Desktop Runtime and install it. Once you have the .NET runtime installed you can grab the latest release from the [Releases Page](https://github.com/Fexty12573/SharpPluginLoader/releases). @@ -7,6 +8,28 @@ Extract the contents of the archive into the game's root directory (where `Monst If you installed everything correctly you should now find `winmm.dll` in the same folder as `MonsterHunterWorld.exe`, and a `CSharp` directory in `nativePC\plugins`. +## Linux (Proton/Wine) +As of version 0.0.7.2, SPL officially supports Linux through Proton/Wine. Below are the steps to install and run SPL on Linux. + +1. Download the latest **.NET Desktop Runtime** for x64 from [here](https://dotnet.microsoft.com/en-us/download/dotnet/8.0#runtime-desktop-8.0.10). +2. Install the downloaded installer using [protontricks](https://github.com/Matoking/protontricks): +```bash +protontricks-launch --appid 582010 path/to/windowsdesktop-runtime-8.x.xx-win-x64.exe +``` +3. Install the Direct 3D Shader Compiler using protontricks: +```bash +protontricks 582010 d3dcompiler_47 +``` +4. Download the latest linux release of SPL (`SharpPluginLoader--linux.zip`) from the [Releases Page](https://github.com/Fexty12573/SharpPluginLoader/releases) and extract it into the game's root directory. After doing so you should have a `msvcrt.dll` file in the same folder as `MonsterHunterWorld.exe`. +5. Set the steam launch options for MHW as follows: +```bash +# Use this for SPL only +WINEDLLOVERRIDES="msvcrt=n,b" %command% + +# Or this for SPL together with Stracker's Loader +WINEDLLOVERRIDES="msvcrt,dinput8=n,b" %command% +``` + ## Usage Any C# plugins will be placed directly into the `CSharp` directory. The plugin loader will automatically load all DLLs in this directory. Subdirectories are also supported, so you can organize your plugins however you want. @@ -21,7 +44,7 @@ Depending on the plugins you have installed you might also see an overlay/UI app ## Directory Structure Examples ``` -└── winmm.dll +└── winmm.dll/msvcrt.dll └── nativePC └── plugins └── CSharp @@ -34,7 +57,7 @@ Depending on the plugins you have installed you might also see an overlay/UI app Conversely, the following is **not** valid, as `Plugin1.dll` is inside the `Loader` directory. The plugin loader will not load it. ``` -└── winmm.dll +└── winmm.dll/msvcrt.dll └── nativePC └── plugins └── CSharp