Projektdateien hinzufügen.

This commit is contained in:
tbS
2025-08-01 23:17:07 +02:00
parent e4ab99fcf3
commit 33a0eadba9
17 changed files with 1251 additions and 0 deletions

13
.idea/.idea.ValehimModSync/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/contentModel.xml
/.idea.ValehimModSync.iml
/modules.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

25
ValehimModSync.sln Normal file
View File

@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32106.194
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ValheimModSync", "ValehimModSync\ValheimModSync.csproj", "{022144A5-19AC-4CAE-BD99-8FB81D031521}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{022144A5-19AC-4CAE-BD99-8FB81D031521}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{022144A5-19AC-4CAE-BD99-8FB81D031521}.Debug|Any CPU.Build.0 = Debug|Any CPU
{022144A5-19AC-4CAE-BD99-8FB81D031521}.Release|Any CPU.ActiveCfg = Release|Any CPU
{022144A5-19AC-4CAE-BD99-8FB81D031521}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9F3EABF9-531D-4A27-AF73-BBAE68CB48A5}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,20 @@
using System.Runtime.InteropServices;
// In Projekten im SDK-Stil wie dem vorliegenden, bei dem verschiedene Assemblyattribute
// üblicherweise in dieser Datei definiert wurden, werden diese Attribute jetzt während
// der Builderstellung automatisch hinzugefügt und mit Werten aufgefüllt, die in den
// Projekteigenschaften definiert sind. Informationen dazu, welche Attribute einbezogen
// werden und wie dieser Prozess angepasst werden kann, finden Sie unter https://aka.ms/assembly-info-properties.
// Wenn "ComVisible" auf FALSE festgelegt wird, sind die Typen in dieser Assembly
// für COM-Komponenten nicht sichtbar. Wenn Sie von COM aus auf einen Typ in dieser
// Assembly zugreifen müssen, legen Sie das ComVisible-Attribut für den betreffenden
// Typ auf TRUE fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM
// bereitgestellt wird.
[assembly: Guid("376b28cd-26b6-454b-a231-4dcaac6fa23c")]

View File

@@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
public class EmbeddedAssembly
{
// Version 1.3
static Dictionary<string, Assembly> dic = null;
public static void Load(string embeddedResource, string fileName)
{
if (dic == null)
dic = new Dictionary<string, Assembly>();
byte[] ba = null;
Assembly asm = null;
Assembly curAsm = Assembly.GetExecutingAssembly();
using (Stream stm = curAsm.GetManifestResourceStream(embeddedResource))
{
// Either the file is not existed or it is not mark as embedded resource
if (stm == null)
throw new Exception(embeddedResource + " is not found in Embedded Resources.");
// Get byte[] from the file from embedded resource
ba = new byte[(int)stm.Length];
stm.Read(ba, 0, (int)stm.Length);
try
{
asm = Assembly.Load(ba);
// Add the assembly/dll into dictionary
dic.Add(asm.FullName, asm);
return;
}
catch
{
// Purposely do nothing
// Unmanaged dll or assembly cannot be loaded directly from byte[]
// Let the process fall through for next part
}
}
bool fileOk = false;
string tempFile = "";
using (SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider())
{
string fileHash = BitConverter.ToString(sha1.ComputeHash(ba)).Replace("-", string.Empty); ;
tempFile = Path.GetTempPath() + fileName;
if (File.Exists(tempFile))
{
byte[] bb = File.ReadAllBytes(tempFile);
string fileHash2 = BitConverter.ToString(sha1.ComputeHash(bb)).Replace("-", string.Empty);
if (fileHash == fileHash2)
{
fileOk = true;
}
else
{
fileOk = false;
}
}
else
{
fileOk = false;
}
}
if (!fileOk)
{
System.IO.File.WriteAllBytes(tempFile, ba);
}
asm = Assembly.LoadFile(tempFile);
dic.Add(asm.FullName, asm);
}
public static Assembly Get(string assemblyFullName)
{
if (dic == null || dic.Count == 0)
return null;
if (dic.ContainsKey(assemblyFullName))
return dic[assemblyFullName];
return null;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AssemblyName>ValheimModSync</AssemblyName>
<Description>Plugin for the Valheim Mod Sync Client. More information under https://tbs-server.de</Description>
<Version>1.0.0.5</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>Valheim Mod Sync Plugin</PackageId>
<Authors>Tobias Röhrich</Authors>
<Company>tbs-server.de</Company>
<Product>Valheim Mod Sync Plugin</Product>
<Copyright>tbS-server.de</Copyright>
<PackageProjectUrl>https://tbs-server.de</PackageProjectUrl>
</PropertyGroup>
<ItemGroup>
<None Remove="Lib\Ionic.Zip.Unity.dll" />
<None Remove="Lib\Newtonsoft.Json.dll" />
<None Remove="Lib\System.Data.dll" />
<None Remove="Lib\System.Runtime.Serialization.dll" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Lib\Ionic.Zip.Unity.dll" />
<EmbeddedResource Include="Lib\Newtonsoft.Json.dll" />
<EmbeddedResource Include="Lib\System.Data.dll" />
<EmbeddedResource Include="Lib\System.Runtime.Serialization.dll" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>Lib\0Harmony.dll</HintPath>
</Reference>
<Reference Include="assembly_valheim">
<HintPath>Lib\assembly_valheim.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>Lib\BepInEx.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip.Unity">
<HintPath>Lib\Ionic.Zip.Unity.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json">
<HintPath>Lib\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>Lib\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>Lib\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>
</Project>