From 7db71ab0131e3a615094e6658fc439d13311a7b1 Mon Sep 17 00:00:00 2001 From: pas2704 Date: Thu, 12 Dec 2024 19:44:27 -0500 Subject: [PATCH] fix compatibility with CringeLauncher --- .github/workflows/build.yml | 44 +++++++++ README.md | 4 + Seamless.cs | 8 +- SeamlessClient.csproj | 174 +++++++++--------------------------- 4 files changed, 91 insertions(+), 139 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cbb8337 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +name: Build + +on: + push: + branches: [master] + +jobs: + compute-version: + name: Compute Version + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - uses: actions/checkout@master + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + + - id: version + uses: paulhatch/semantic-version@v5.3.0 + with: + tag_prefix: '' + major_pattern: 'Add project files' + minor_pattern: 'feature:' + bump_each_commit: true + enable_prerelease_mode: false + + build-nuget: + name: Build Nuget package + runs-on: ubuntu-latest + needs: [compute-version] + steps: + - uses: actions/checkout@master + + - uses: actions/setup-dotnet@v4 + + - run: dotnet restore ./SeamlessClient.csproj --locked-mode + name: Restore Project + + - run: dotnet pack -c Release -o ./pub ./SeamlessClient.csproj --no-restore -p:Version="${{ needs.compute-version.outputs.version }}" + name: Pack Project + + - name: Push Project + run: dotnet nuget push -s https://ng.zznty.ru/v3/index.json -k ${{ secrets.NUGET_API_KEY }} ./pub/*.nupkg diff --git a/README.md b/README.md index 046d0fb..0483d28 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,7 @@ Simply install the plguin loader, and check this plugins box to be added to the ## Known issues Obviously this is not an issue free-system. Currently since im doing no mod unloading or loading there could be issues if your servers dont have the exact same mods, or the mods dont properly work right. Please do not swarm mod authors with faults if seamless doesnt play nice with it. ***Its not their fault*** its ***mine***. I will be trying to implement mod unloading and loading switching between servers, just no ETA. + + +## Fork Changes +This fork changes how components are loaded to be compatible with [CringeLauncher](https://git.zznty.ru/PvE/se-launcher). \ No newline at end of file diff --git a/Seamless.cs b/Seamless.cs index 0014fa2..c6bcb55 100644 --- a/Seamless.cs +++ b/Seamless.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +using CringePlugins.Utils; +using HarmonyLib; using NLog.Fluent; using Sandbox; using Sandbox.Game.Localization; @@ -33,7 +34,6 @@ namespace SeamlessClient public static ushort SeamlessClientNetId = 2936; private List allComps = new List(); - private Assembly thisAssembly => typeof(Seamless).Assembly; private bool Initilized = false; public static bool isSeamlessServer { get; private set; } = false; public static bool isDebug = false; @@ -56,11 +56,9 @@ namespace SeamlessClient private void GetComponents() { int failedCount = 0; - foreach (Type type in thisAssembly.GetTypes()) + foreach (Type type in IntrospectionContext.Global.CollectDerivedTypes(typeof(Seamless).Module)) { - if (type.BaseType != typeof(ComponentBase)) - continue; try { diff --git a/SeamlessClient.csproj b/SeamlessClient.csproj index a018d0c..9ea35ec 100644 --- a/SeamlessClient.csproj +++ b/SeamlessClient.csproj @@ -1,135 +1,41 @@ - - - - - Debug - AnyCPU - {883B492D-823E-4CC3-BD35-07FEF06F8359} - Library - Properties - SeamlessClient - SeamlessClient - v4.8 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - packages\Lib.Harmony.2.3.3\lib\net48\0Harmony.dll - - - GameBinaries\NLog.dll - False - - - GameBinaries\ProtoBuf.Net.dll - - - False - GameBinaries\ProtoBuf.Net.Core.dll - - - GameBinaries\Sandbox.Common.dll - False - - - GameBinaries\Sandbox.Game.dll - False - - - GameBinaries\Sandbox.Game.XmlSerializers.dll - False - - - GameBinaries\Sandbox.Graphics.dll - False - - - GameBinaries\SpaceEngineers.Game.dll - False - - - - - - - - - - - GameBinaries\VRage.dll - False - - - GameBinaries\VRage.Game.dll - False - - - GameBinaries\VRage.Input.dll - False - - - - GameBinaries\VRage.Math.dll - False - - - GameBinaries\VRage.Render.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - - - - - - PreserveNewest - - - + + + + net8.0-windows + win-x64 + disable + true + CringePlugin + https://ng.zznty.ru/v3/index.json + true + Casimir + Plugin.Casimir255.SeamlessClient + Plugin.Casimir255.SeamlessClient + Nexus Seamless Switcher + This plugin allows seamless transfers between Nexus enabled servers. Some mods or plugins may not play nice with switching between servers. Be cautious when using! + https://git.zznty.ru/PvE/SeamlessClient + https://git.zznty.ru/PvE/SeamlessClient + git + false + + + + + + + + + + + + + $([System.Environment]::GetFolderPath(SpecialFolder.ApplicationData)) + + + + + + + + \ No newline at end of file