fix compatibility with CringeLauncher
Some checks failed
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (push) Failing after 6s

This commit is contained in:
2024-12-12 19:44:27 -05:00
parent 4e728d823e
commit 7db71ab013
4 changed files with 91 additions and 139 deletions

44
.github/workflows/build.yml vendored Normal file
View File

@@ -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

View File

@@ -19,3 +19,7 @@ Simply install the plguin loader, and check this plugins box to be added to the
## Known issues ## 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. 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).

View File

@@ -1,4 +1,5 @@
using HarmonyLib; using CringePlugins.Utils;
using HarmonyLib;
using NLog.Fluent; using NLog.Fluent;
using Sandbox; using Sandbox;
using Sandbox.Game.Localization; using Sandbox.Game.Localization;
@@ -33,7 +34,6 @@ namespace SeamlessClient
public static ushort SeamlessClientNetId = 2936; public static ushort SeamlessClientNetId = 2936;
private List<ComponentBase> allComps = new List<ComponentBase>(); private List<ComponentBase> allComps = new List<ComponentBase>();
private Assembly thisAssembly => typeof(Seamless).Assembly;
private bool Initilized = false; private bool Initilized = false;
public static bool isSeamlessServer { get; private set; } = false; public static bool isSeamlessServer { get; private set; } = false;
public static bool isDebug = false; public static bool isDebug = false;
@@ -56,11 +56,9 @@ namespace SeamlessClient
private void GetComponents() private void GetComponents()
{ {
int failedCount = 0; int failedCount = 0;
foreach (Type type in thisAssembly.GetTypes()) foreach (Type type in IntrospectionContext.Global.CollectDerivedTypes<ComponentBase>(typeof(Seamless).Module))
{ {
if (type.BaseType != typeof(ComponentBase))
continue;
try try
{ {

View File

@@ -1,135 +1,41 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk">
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFramework>net8.0-windows</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ProjectGuid>{883B492D-823E-4CC3-BD35-07FEF06F8359}</ProjectGuid> <Nullable>disable</Nullable>
<OutputType>Library</OutputType> <EnableWindowsTargeting>true</EnableWindowsTargeting>
<AppDesignerFolder>Properties</AppDesignerFolder> <PackageType>CringePlugin</PackageType>
<RootNamespace>SeamlessClient</RootNamespace> <RestoreAdditionalProjectSources>https://ng.zznty.ru/v3/index.json</RestoreAdditionalProjectSources>
<AssemblyName>SeamlessClient</AssemblyName> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <Authors>Casimir</Authors>
<FileAlignment>512</FileAlignment> <PackageId>Plugin.Casimir255.SeamlessClient</PackageId>
<Deterministic>true</Deterministic> <AssemblyName>Plugin.Casimir255.SeamlessClient</AssemblyName>
<Title>Nexus Seamless Switcher</Title>
<Description>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!</Description>
<PackageProjectUrl>https://git.zznty.ru/PvE/SeamlessClient</PackageProjectUrl>
<RepositoryUrl>https://git.zznty.ru/PvE/SeamlessClient</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <ItemGroup>
<Optimize>false</Optimize> <PackageReference Include="CringePlugins" Version="*" ExcludeAssets="runtime; native"/>
<OutputPath>bin\Debug\</OutputPath> <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" ExcludeAssets="runtime; native" PrivateAssets="all"/>
<DefineConstants>DEBUG;TRACE</DefineConstants> <PackageReference Include="Steamworks.NET" Version="20.1.0" ExcludeAssets="runtime; native" PrivateAssets="all"/>
<ErrorReport>prompt</ErrorReport> </ItemGroup>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <Target Name="CopyFiles" AfterTargets="PostBuildEvent">
<DebugType>pdbonly</DebugType> <PropertyGroup>
<Optimize>true</Optimize> <AppdataPath>$([System.Environment]::GetFolderPath(SpecialFolder.ApplicationData))</AppdataPath>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony, Version=2.3.3.0, Culture=neutral, processorArchitecture=MSIL"> <OutputFiles Include="$(OutputPath)\*"/>
<HintPath>packages\Lib.Harmony.2.3.3\lib\net48\0Harmony.dll</HintPath>
</Reference>
<Reference Include="NLog">
<HintPath>GameBinaries\NLog.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ProtoBuf.Net">
<HintPath>GameBinaries\ProtoBuf.Net.dll</HintPath>
</Reference>
<Reference Include="ProtoBuf.Net.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>GameBinaries\ProtoBuf.Net.Core.dll</HintPath>
</Reference>
<Reference Include="Sandbox.Common">
<HintPath>GameBinaries\Sandbox.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sandbox.Game">
<HintPath>GameBinaries\Sandbox.Game.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sandbox.Game.XmlSerializers">
<HintPath>GameBinaries\Sandbox.Game.XmlSerializers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sandbox.Graphics">
<HintPath>GameBinaries\Sandbox.Graphics.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SpaceEngineers.Game">
<HintPath>GameBinaries\SpaceEngineers.Game.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="VRage">
<HintPath>GameBinaries\VRage.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VRage.Game">
<HintPath>GameBinaries\VRage.Game.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VRage.Input">
<HintPath>GameBinaries\VRage.Input.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VRage.Library, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Reference Include="VRage.Math">
<HintPath>GameBinaries\VRage.Math.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="VRage.Render">
<HintPath>GameBinaries\VRage.Render.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <Copy SourceFiles="@(OutputFiles)" DestinationFolder="$(AppdataPath)\CringeLauncher\plugins\$(ProjectName)" OverwriteReadOnlyFiles="true"/>
<Compile Include="Components\EntityPerformanceImprovements.cs" /> </Target>
<Compile Include="Components\LoadingScreenComponent.cs" />
<Compile Include="Components\MyGUIScreenMedicalsPatch.cs" />
<Compile Include="Components\MyHudTimeTracker.cs" />
<Compile Include="Components\ServerSwitcherComponentOLD.cs" />
<Compile Include="GUI\Screens\GUILoadingScreen.cs" />
<Compile Include="Messages\OnlinePlayerData.cs" />
<Compile Include="Utilities\UtilExtensions.cs" />
<Compile Include="Utilities\PatchUtils.cs" />
<Compile Include="Messages\ClientMessage.cs" />
<Compile Include="Messages\TransferData.cs" />
<Compile Include="Messages\WorldRequestData.cs" />
<Compile Include="OnlinePlayersWindow\OnlineNexusPlayersWindow.cs" />
<Compile Include="Components\PlayersWindowComponent.cs" />
<Compile Include="Seamless.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Components\ServerSwitcherComponent.cs" />
<Compile Include="Utilities\AsyncInvoke.cs" />
<Compile Include="Utilities\MessageUtils.cs" />
<Compile Include="Utilities\ComponentBase.cs" />
<Compile Include="Utilities\Types.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="SetupSolution.bat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="ServerSwitching\" />
</ItemGroup>
<ItemGroup>
<Content Include="SeamlessClient.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>