Compare commits
84 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1d852d4bd9 | ||
![]() |
b76af4a8b0 | ||
![]() |
28e26dbf5e | ||
![]() |
46ee2b61a5 | ||
![]() |
bfa3604524 | ||
ab092125b0 | |||
e320d8fbd5 | |||
2d28ce7415 | |||
fd64c77aed | |||
aeaf755d08 | |||
667f52f33b | |||
![]() |
4c5751fccf | ||
![]() |
bd11bc223d | ||
![]() |
ccd04585c4 | ||
![]() |
88ad741f3b | ||
![]() |
29bfcced62 | ||
![]() |
5fac281f37 | ||
![]() |
6698359c08 | ||
![]() |
7bbdb79257 | ||
![]() |
afa40d3532 | ||
![]() |
4afae0fe56 | ||
![]() |
f43e61c7bb | ||
![]() |
646916dc7b | ||
![]() |
563c611e3e | ||
![]() |
579b090c85 | ||
![]() |
f49748da9f | ||
![]() |
534fdd0e49 | ||
![]() |
6070bddd7d | ||
![]() |
d8e2d9fcec | ||
![]() |
615defabb6 | ||
![]() |
0d719ee01f | ||
22c4cfb039 | |||
5f0ffb6f9a | |||
1b2a989441 | |||
![]() |
83dfc7152f | ||
d7e5f53e4f | |||
9b08b39a1f | |||
![]() |
8011f9eed7 | ||
1df791e7a8 | |||
![]() |
bbc2f9046f | ||
117ea7df91 | |||
6ec355f931 | |||
![]() |
343420f1d8 | ||
![]() |
1396c8b1da | ||
![]() |
9900f92133 | ||
![]() |
3be524d169 | ||
ed694ae95b | |||
e9a9e180a8 | |||
a8dfaf6239 | |||
bbdd1c7e01 | |||
e70e1ca4e6 | |||
![]() |
d65c20a05d | ||
f21976cf2d | |||
0c918106bc | |||
6c9ec57d87 | |||
![]() |
b0f491ac88 | ||
![]() |
a426ad9e02 | ||
![]() |
ba75b1583a | ||
![]() |
45068ea932 | ||
![]() |
181e9297a1 | ||
![]() |
e0417d3235 | ||
![]() |
17a244a536 | ||
![]() |
bd27360655 | ||
![]() |
b24eee3ecf | ||
![]() |
9068558a53 | ||
![]() |
9c22948ce9 | ||
![]() |
2b1a5d4c6e | ||
![]() |
2860dda41b | ||
![]() |
5483728a4e | ||
![]() |
32d318be5e | ||
![]() |
f349366b58 | ||
![]() |
73ce979b54 | ||
![]() |
73b95472bc | ||
![]() |
9b832a998d | ||
![]() |
b1087822c9 | ||
![]() |
ef2d35879c | ||
![]() |
83d8eea9ef | ||
![]() |
8cdd992350 | ||
![]() |
b9cb71e11f | ||
![]() |
1a1a7e779a | ||
![]() |
6bcd2ea58e | ||
![]() |
b8a06f7bd7 | ||
![]() |
d44b1a592c | ||
![]() |
d7d556d2f2 |
122
.github/workflows/release.yaml
vendored
122
.github/workflows/release.yaml
vendored
@@ -2,68 +2,100 @@ name: Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches: [master]
|
||||||
- '*'
|
|
||||||
|
env:
|
||||||
|
BUILD_CONFIGURATION: Release
|
||||||
|
DOTNET_NOLOGO: true
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
get-version:
|
||||||
name: Build
|
name: Get Version
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
outputs:
|
||||||
TORCH_VERSION: ${{ github.ref_name }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
BUILD_CONFIGURATION: Release
|
|
||||||
DOTNET_NOLOGO: true
|
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
name: Checkout
|
name: Checkout
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Git Version
|
||||||
|
id: version
|
||||||
|
uses: paulhatch/semantic-version@v5.3.0
|
||||||
|
with:
|
||||||
|
tag_prefix: ''
|
||||||
|
major_pattern: 'breaking:'
|
||||||
|
minor_pattern: 'feature:'
|
||||||
|
|
||||||
|
build-nuget:
|
||||||
|
name: Build and Publish Nuget
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [get-version]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
name: Checkout
|
||||||
|
|
||||||
- uses: actions/setup-dotnet@v3
|
- uses: actions/setup-dotnet@v3
|
||||||
name: Setup dotnet
|
name: Setup dotnet
|
||||||
with:
|
with:
|
||||||
dotnet-version: '7.0.x'
|
dotnet-version: '8.0.x'
|
||||||
- name: Add Gh Packages Nuget Source
|
|
||||||
run: dotnet nuget add source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github
|
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
run: dotnet restore Torch.Server/Torch.Server.csproj --locked-mode
|
run: dotnet restore Torch.Server/Torch.Server.csproj --locked-mode
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build Torch.Server/Torch.Server.csproj --no-restore -c ${{ env.BUILD_CONFIGURATION }} /p:AssemblyVersion=${{ env.TORCH_VERSION }} /p:Version=${{ env.TORCH_VERSION }}
|
run: dotnet build Torch.Server/Torch.Server.csproj --no-restore -c ${{ env.BUILD_CONFIGURATION }} -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}"
|
||||||
|
|
||||||
|
- run: dotnet pack -c Release ./Torch.API/Torch.API.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build
|
||||||
|
- run: dotnet pack -c Release ./Torch/Torch.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build
|
||||||
|
- run: dotnet pack -c Release ./Torch.Server/Torch.Server.csproj -o pack -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}" --no-build
|
||||||
|
|
||||||
|
- name: Install Sleet
|
||||||
|
run: dotnet tool install -g sleet --version 5.1.3
|
||||||
|
- name: Push Nuget Package
|
||||||
|
env:
|
||||||
|
SLEET_FEED_TYPE: s3
|
||||||
|
SLEET_FEED_PATH: https://nuget.storage.yandexcloud.net
|
||||||
|
SLEET_FEED_BUCKETNAME: nuget
|
||||||
|
SLEET_FEED_SERVICEURL: https://storage.yandexcloud.net
|
||||||
|
SLEET_FEED_ACCESSKEYID: ${{ secrets.S3_KEY_ID }}
|
||||||
|
SLEET_FEED_SECRETACCESSKEY: ${{ secrets.S3_KEY }}
|
||||||
|
run: /root/.dotnet/tools/sleet push ./pack
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build and Publish Package
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [get-version]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
name: Checkout
|
||||||
|
|
||||||
|
- uses: actions/setup-dotnet@v3
|
||||||
|
name: Setup dotnet
|
||||||
|
with:
|
||||||
|
dotnet-version: '8.0.x'
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: dotnet restore Torch.Server/Torch.Server.csproj --locked-mode -r win-x64
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: dotnet publish Torch.Server/Torch.Server.csproj --no-build -r win-x64 --sc -c ${{ env.BUILD_CONFIGURATION }} -o ./publish
|
run: dotnet publish Torch.Server/Torch.Server.csproj --no-restore --sc -r win-x64 -c ${{ env.BUILD_CONFIGURATION }} -o ./publish -p:Version="${{ needs.get-version.outputs.version }}" -p:AssemblyVersion="${{ needs.get-version.outputs.version }}"
|
||||||
|
|
||||||
- uses: vimtor/action-zip@v1
|
- uses: vimtor/action-zip@v1
|
||||||
name: Zip Release
|
name: Zip Release
|
||||||
with:
|
with:
|
||||||
files: publish/
|
files: publish/
|
||||||
dest: release.zip
|
dest: torch-server.zip
|
||||||
- name: Build Changelog
|
|
||||||
id: build_changelog
|
- name: Create Release
|
||||||
uses: mikepenz/release-changelog-builder-action@v3
|
uses: akkuman/gitea-release-action@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
||||||
with:
|
with:
|
||||||
commitMode: true
|
tag_name: ${{ needs.get-version.outputs.version }}
|
||||||
- name: Create release
|
name: Release v${{ needs.get-version.outputs.version }}
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ env.TORCH_VERSION }}
|
|
||||||
release_name: Release v${{ env.TORCH_VERSION }}
|
|
||||||
body: ${{ steps.github_release.outputs.changelog }}
|
body: ${{ steps.github_release.outputs.changelog }}
|
||||||
draft: true
|
files: |-
|
||||||
prerelease: false
|
./torch-server.zip
|
||||||
- name: Upload release asset
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: release.zip
|
|
||||||
asset_name: torch-server.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
- name: Publish release
|
|
||||||
uses: StuYarrow/publish-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
id: ${{ steps.create_release.outputs.id }}
|
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -159,10 +159,6 @@ publish/
|
|||||||
|
|
||||||
# NuGet Packages
|
# NuGet Packages
|
||||||
*.nupkg
|
*.nupkg
|
||||||
# The packages folder can be ignored because of Package Restore
|
|
||||||
**/packages/*
|
|
||||||
# except build/, which is used as an MSBuild target.
|
|
||||||
!**/packages/build/
|
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
#!**/packages/repositories.config
|
#!**/packages/repositories.config
|
||||||
# NuGet v3's project.json files produces more ignoreable files
|
# NuGet v3's project.json files produces more ignoreable files
|
||||||
|
8
Directory.Build.props
Normal file
8
Directory.Build.props
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||||
|
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
@@ -1,11 +1,4 @@
|
|||||||
using System;
|
namespace Torch.API
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using VRage.Game.ModAPI;
|
|
||||||
|
|
||||||
namespace Torch.API
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a player on the server.
|
/// Represents a player on the server.
|
||||||
|
@@ -1,12 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
using Torch.API.Session;
|
using Torch.API.Session;
|
||||||
using VRage.Game.ModAPI;
|
|
||||||
using Version = SemanticVersioning.Version;
|
using Version = SemanticVersioning.Version;
|
||||||
|
|
||||||
namespace Torch.API
|
namespace Torch.API
|
||||||
@@ -25,6 +22,11 @@ namespace Torch.API
|
|||||||
/// Configuration for the current instance.
|
/// Configuration for the current instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ITorchConfig Config { get; }
|
ITorchConfig Config { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Extended Configuration for the current instance.
|
||||||
|
/// </summary>
|
||||||
|
IConfiguration Configuration { get; }
|
||||||
|
|
||||||
/// <inheritdoc cref="IPluginManager"/>
|
/// <inheritdoc cref="IPluginManager"/>
|
||||||
[Obsolete]
|
[Obsolete]
|
||||||
|
@@ -33,7 +33,8 @@ namespace Torch
|
|||||||
bool EntityManagerEnabled { get; set; }
|
bool EntityManagerEnabled { get; set; }
|
||||||
string LoginToken { get; set; }
|
string LoginToken { get; set; }
|
||||||
UpdateSource UpdateSource { get; set; }
|
UpdateSource UpdateSource { get; set; }
|
||||||
|
List<string> Packages { get; set; }
|
||||||
|
|
||||||
void Save(string path = null);
|
void Save(string path = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,17 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Sandbox.Engine.Multiplayer;
|
using Sandbox.Engine.Multiplayer;
|
||||||
using Sandbox.Game.Gui;
|
using Sandbox.Game.Gui;
|
||||||
using Sandbox.Game.Multiplayer;
|
|
||||||
using Torch.Utils;
|
using Torch.Utils;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using VRage.Network;
|
|
||||||
using VRage.Replication;
|
|
||||||
using VRageMath;
|
using VRageMath;
|
||||||
using VRageRender;
|
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
namespace Torch.API.Managers
|
||||||
{
|
{
|
||||||
|
@@ -1,11 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using VRage.Collections;
|
using VRage.Collections;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using VRage.Network;
|
|
||||||
using VRageMath;
|
using VRageMath;
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
namespace Torch.API.Managers
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
namespace Torch.API.Managers
|
||||||
{
|
{
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
namespace Torch.API.Managers
|
||||||
{
|
{
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Torch.API.Managers
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base interface for Torch managers.
|
/// Base interface for Torch managers.
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using VRage.Game;
|
|
||||||
using VRage.Game.ModAPI;
|
using VRage.Game.ModAPI;
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
namespace Torch.API.Managers
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Torch.API.Managers
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
|
||||||
{
|
{
|
||||||
public interface IMultiplayerManagerClient : IMultiplayerManagerBase
|
public interface IMultiplayerManagerClient : IMultiplayerManagerBase
|
||||||
{
|
{
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using VRage.Game.ModAPI;
|
using VRage.Game.ModAPI;
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
namespace Torch.API.Managers
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using VRage;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using VRage;
|
|
||||||
using VRage.Library.Collections;
|
using VRage.Library.Collections;
|
||||||
using VRage.Network;
|
using VRage.Network;
|
||||||
|
|
||||||
|
13
Torch.API/Managers/IPackageManager.cs
Normal file
13
Torch.API/Managers/IPackageManager.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Reflection;
|
||||||
|
using Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
namespace Torch.API.Managers;
|
||||||
|
|
||||||
|
public interface IPackageManager : IManager
|
||||||
|
{
|
||||||
|
IReadOnlySet<Package> Packages { get; }
|
||||||
|
|
||||||
|
bool TryGetPackageAssemblies(Package package, [MaybeNullWhen(false)] out Assembly[] assemblies);
|
||||||
|
}
|
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Torch.API.Plugins;
|
using Torch.API.Plugins;
|
||||||
using VRage.Collections;
|
|
||||||
using VRage.Plugins;
|
|
||||||
|
|
||||||
namespace Torch.API.Managers
|
namespace Torch.API.Managers
|
||||||
{
|
{
|
||||||
@@ -14,6 +12,9 @@ namespace Torch.API.Managers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fired when plugins are loaded.
|
/// Fired when plugins are loaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Fired when plugins are loaded and immediately if subscribed after the plugins are loaded.
|
||||||
|
/// </remarks>
|
||||||
event Action<IReadOnlyCollection<ITorchPlugin>> PluginsLoaded;
|
event Action<IReadOnlyCollection<ITorchPlugin>> PluginsLoaded;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
using System;
|
namespace Torch.API.ModAPI.Ingame
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Sandbox.Game.Entities.Blocks;
|
|
||||||
using Sandbox.ModAPI.Ingame;
|
|
||||||
using VRage.Game.ModAPI.Ingame;
|
|
||||||
|
|
||||||
namespace Torch.API.ModAPI.Ingame
|
|
||||||
{
|
{
|
||||||
public static class GridExtensions
|
public static class GridExtensions
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
//Needed so Torch can set the instance here without exposing anything bad to mods or creating a circular dependency.
|
//Needed so Torch can set the instance here without exposing anything bad to mods or creating a circular dependency.
|
||||||
[assembly: InternalsVisibleTo("Torch")]
|
[assembly: InternalsVisibleTo("Torch")]
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Cryptography.X509Certificates;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API.Plugins
|
namespace Torch.API.Plugins
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.Windows.Controls;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
|
|
||||||
namespace Torch.API.Plugins
|
namespace Torch.API.Plugins
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API.Plugins
|
namespace Torch.API.Plugins
|
||||||
{
|
{
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Torch.API
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to indicate the state of the dedicated server.
|
/// Used to indicate the state of the dedicated server.
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Torch.API.Session
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API.Session
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The result of a save operation
|
/// The result of a save operation
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using Sandbox.Game.World;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Sandbox.Game.World;
|
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
|
|
||||||
namespace Torch.API.Session
|
namespace Torch.API.Session
|
||||||
|
@@ -1,9 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
|
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Torch.API.Session
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.API.Session
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the state of a <see cref="ITorchSession"/>
|
/// Represents the state of a <see cref="ITorchSession"/>
|
||||||
|
@@ -1,14 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7-windows</TargetFramework>
|
|
||||||
<AssemblyTitle>Torch API</AssemblyTitle>
|
<AssemblyTitle>Torch API</AssemblyTitle>
|
||||||
<Product>Torch</Product>
|
<Product>Torch</Product>
|
||||||
<Copyright>Copyright © Torch API 2017</Copyright>
|
<Copyright>Copyright © Torch API 2017</Copyright>
|
||||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
||||||
<OutputPath>..\bin\$(Platform)\$(Configuration)\</OutputPath>
|
|
||||||
<UseWpf>True</UseWpf>
|
<UseWpf>True</UseWpf>
|
||||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
|
||||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="$(Configuration) == 'Release'">
|
<PropertyGroup Condition="$(Configuration) == 'Release'">
|
||||||
@@ -16,12 +12,16 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="JorgeSerrano.Json.JsonSnakeCaseNamingPolicy" Version="0.9.0" />
|
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
|
||||||
<PackageReference Include="NLog" Version="5.1.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
|
||||||
|
<PackageReference Include="NLog" Version="5.3.2" />
|
||||||
|
<PackageReference Include="NuGet.Commands" Version="6.9.1" />
|
||||||
|
<PackageReference Include="NuGet.DependencyResolver.Core" Version="6.9.1" />
|
||||||
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
|
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
|
||||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.201.13">
|
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.204.15">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<ExcludeAssets>runtime</ExcludeAssets>
|
||||||
<IncludeAssets>compile</IncludeAssets>
|
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
|
||||||
|
<PackageReference Include="System.Text.Json" Version="8.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using Sandbox;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Sandbox;
|
|
||||||
|
|
||||||
namespace Torch.API
|
namespace Torch.API
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.Utils
|
namespace Torch.Utils
|
||||||
{
|
{
|
||||||
|
11
Torch.API/WebAPI/Plugins/IPackageItem.cs
Normal file
11
Torch.API/WebAPI/Plugins/IPackageItem.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#nullable enable
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public interface IPackageItem
|
||||||
|
{
|
||||||
|
Task<Stream> OpenFileAsync();
|
||||||
|
public string FileName { get; }
|
||||||
|
}
|
10
Torch.API/WebAPI/Plugins/IPackageReader.cs
Normal file
10
Torch.API/WebAPI/Plugins/IPackageReader.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#nullable enable
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public interface IPackageReader
|
||||||
|
{
|
||||||
|
Task<(IEnumerable<IPackageItem> Root, IReadOnlyDictionary<PackageDependency, IEnumerable<IPackageItem>> Dependencies)> GetItemsAsync();
|
||||||
|
}
|
11
Torch.API/WebAPI/Plugins/IPackageResolver.cs
Normal file
11
Torch.API/WebAPI/Plugins/IPackageResolver.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#nullable enable
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public interface IPackageResolver
|
||||||
|
{
|
||||||
|
Task<IEnumerable<Package>> ResolvePackagesAsync(IReadOnlyDictionary<string, string> packages);
|
||||||
|
Task<IPackageReader> GetPackageAsync(Package package);
|
||||||
|
}
|
87
Torch.API/WebAPI/Plugins/NLogLogger.cs
Normal file
87
Torch.API/WebAPI/Plugins/NLogLogger.cs
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
#nullable enable
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NuGet.Common;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
internal class NLogLogger : ILogger
|
||||||
|
{
|
||||||
|
private readonly NLog.ILogger _logger;
|
||||||
|
|
||||||
|
public NLogLogger(NLog.ILogger logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogDebug(string data)
|
||||||
|
{
|
||||||
|
_logger.Debug(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogVerbose(string data)
|
||||||
|
{
|
||||||
|
_logger.Trace(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogInformation(string data)
|
||||||
|
{
|
||||||
|
_logger.Info(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogMinimal(string data)
|
||||||
|
{
|
||||||
|
_logger.Debug(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogWarning(string data)
|
||||||
|
{
|
||||||
|
_logger.Warn(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogError(string data)
|
||||||
|
{
|
||||||
|
_logger.Error(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LogInformationSummary(string data)
|
||||||
|
{
|
||||||
|
_logger.Info(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Log(LogLevel level, string data)
|
||||||
|
{
|
||||||
|
_logger.Log(ToNLogLevel(level), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static NLog.LogLevel ToNLogLevel(LogLevel level)
|
||||||
|
{
|
||||||
|
return level switch
|
||||||
|
{
|
||||||
|
LogLevel.Debug => NLog.LogLevel.Debug,
|
||||||
|
LogLevel.Verbose => NLog.LogLevel.Trace,
|
||||||
|
LogLevel.Information => NLog.LogLevel.Info,
|
||||||
|
LogLevel.Minimal => NLog.LogLevel.Debug,
|
||||||
|
LogLevel.Warning => NLog.LogLevel.Warn,
|
||||||
|
LogLevel.Error => NLog.LogLevel.Error,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(level), level, null)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task LogAsync(LogLevel level, string data)
|
||||||
|
{
|
||||||
|
Log(level, data);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Log(ILogMessage message)
|
||||||
|
{
|
||||||
|
_logger.Log(ToNLogLevel(message.Level), message.FormatWithCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task LogAsync(ILogMessage message)
|
||||||
|
{
|
||||||
|
Log(message);
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
10
Torch.API/WebAPI/Plugins/Package.cs
Normal file
10
Torch.API/WebAPI/Plugins/Package.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using NuGet.DependencyResolver;
|
||||||
|
using SemanticVersioning;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public record Package(string Name, Version Version, IReadOnlySet<PackageDependency> Dependencies)
|
||||||
|
{
|
||||||
|
internal GraphItem<RemoteResolveResult> Graph { get; init; }
|
||||||
|
}
|
9
Torch.API/WebAPI/Plugins/PackageDependency.cs
Normal file
9
Torch.API/WebAPI/Plugins/PackageDependency.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using NuGet.DependencyResolver;
|
||||||
|
using SemanticVersioning;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public record PackageDependency(string Name, Version Version, PackageDependencyKind Kind)
|
||||||
|
{
|
||||||
|
internal RemoteMatch Match { get; init; }
|
||||||
|
}
|
8
Torch.API/WebAPI/Plugins/PackageDependencyKind.cs
Normal file
8
Torch.API/WebAPI/Plugins/PackageDependencyKind.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public enum PackageDependencyKind
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Transitive,
|
||||||
|
Direct
|
||||||
|
}
|
91
Torch.API/WebAPI/Plugins/PackageReader.cs
Normal file
91
Torch.API/WebAPI/Plugins/PackageReader.cs
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
#nullable enable
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NuGet.Common;
|
||||||
|
using NuGet.DependencyResolver;
|
||||||
|
using NuGet.Frameworks;
|
||||||
|
using NuGet.Packaging;
|
||||||
|
using NuGet.Protocol.Core.Types;
|
||||||
|
using NuGet.Versioning;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public class PackageReader : IPackageReader
|
||||||
|
{
|
||||||
|
private readonly Package _package;
|
||||||
|
private readonly SourceCacheContext _cacheContext;
|
||||||
|
private readonly ILogger _logger;
|
||||||
|
private readonly NuGetFramework _framework;
|
||||||
|
private readonly IFrameworkCompatibilityProvider _compatibilityProvider;
|
||||||
|
private readonly DirectoryInfo _packagesDirectory;
|
||||||
|
|
||||||
|
public PackageReader(Package package, SourceCacheContext cacheContext, ILogger logger, NuGetFramework framework,
|
||||||
|
IFrameworkCompatibilityProvider compatibilityProvider, DirectoryInfo packagesDirectory)
|
||||||
|
{
|
||||||
|
_package = package;
|
||||||
|
_cacheContext = cacheContext;
|
||||||
|
_logger = logger;
|
||||||
|
_framework = framework;
|
||||||
|
_compatibilityProvider = compatibilityProvider;
|
||||||
|
_packagesDirectory = packagesDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<(IEnumerable<IPackageItem> Root, IReadOnlyDictionary<PackageDependency, IEnumerable<IPackageItem>>
|
||||||
|
Dependencies)>
|
||||||
|
GetItemsAsync()
|
||||||
|
{
|
||||||
|
async Task<IEnumerable<IPackageItem>> GetPackageItemsAsync(string id, NuGetVersion version,
|
||||||
|
IRemoteDependencyProvider provider)
|
||||||
|
{
|
||||||
|
var downloader =
|
||||||
|
await provider.GetPackageDownloaderAsync(new(id, version), _cacheContext, _logger,
|
||||||
|
CancellationToken.None);
|
||||||
|
|
||||||
|
await downloader.CopyNupkgFileToAsync(Path.Combine(_packagesDirectory.FullName, $"{id}.{version}.nupkg"),
|
||||||
|
CancellationToken.None);
|
||||||
|
|
||||||
|
var frameworks = await downloader.ContentReader.GetReferenceItemsAsync(CancellationToken.None);
|
||||||
|
var items = frameworks.Where(b => _compatibilityProvider.IsCompatible(_framework, b.TargetFramework))
|
||||||
|
.MaxBy(b => b.TargetFramework.Version)?.Items;
|
||||||
|
|
||||||
|
return items?.Select(b => new PackageItem(b, downloader)) ?? ImmutableArray<PackageItem>.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
var rootIdentity = _package.Graph.Key;
|
||||||
|
return (await GetPackageItemsAsync(rootIdentity.Name, rootIdentity.Version, _package.Graph.Data.Match.Provider),
|
||||||
|
await _package.Dependencies.ToAsyncEnumerable().SelectManyAwait(async b =>
|
||||||
|
(await GetPackageItemsAsync(
|
||||||
|
b.Match.Library.Name,
|
||||||
|
b.Match.Library.Version,
|
||||||
|
b.Match.Provider))
|
||||||
|
.ToAsyncEnumerable()
|
||||||
|
.Select(c => (b, c)))
|
||||||
|
.GroupBy(b => b.b, b => b.c)
|
||||||
|
.ToDictionaryAwaitAsync<IAsyncGrouping<PackageDependency, IPackageItem>, PackageDependency,
|
||||||
|
IEnumerable<IPackageItem>>(b => ValueTask.FromResult(b.Key),
|
||||||
|
async b => await b.ToArrayAsync()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file class PackageItem : IPackageItem
|
||||||
|
{
|
||||||
|
private readonly string _path;
|
||||||
|
private readonly IPackageDownloader _downloader;
|
||||||
|
|
||||||
|
public string FileName => Path.GetFileName(_path);
|
||||||
|
|
||||||
|
public PackageItem(string path, IPackageDownloader downloader)
|
||||||
|
{
|
||||||
|
_path = path;
|
||||||
|
_downloader = downloader;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<Stream> OpenFileAsync()
|
||||||
|
{
|
||||||
|
return _downloader.CoreReader.GetStreamAsync(_path, CancellationToken.None);
|
||||||
|
}
|
||||||
|
}
|
104
Torch.API/WebAPI/Plugins/PackageResolver.cs
Normal file
104
Torch.API/WebAPI/Plugins/PackageResolver.cs
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
#nullable enable
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NLog;
|
||||||
|
using NuGet.Commands;
|
||||||
|
using NuGet.Configuration;
|
||||||
|
using NuGet.DependencyResolver;
|
||||||
|
using NuGet.Frameworks;
|
||||||
|
using NuGet.LibraryModel;
|
||||||
|
using NuGet.Protocol;
|
||||||
|
using NuGet.Protocol.Core.Types;
|
||||||
|
using NuGet.Versioning;
|
||||||
|
using Version = SemanticVersioning.Version;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public class PackageResolver : IPackageResolver
|
||||||
|
{
|
||||||
|
private static readonly ILogger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
private readonly NuGetFramework _framework = NuGetFramework.Parse("net7.0-windows7.0");
|
||||||
|
private readonly NLogLogger _logger = new(Log);
|
||||||
|
private readonly SourceCacheContext _sourceCacheContext = new();
|
||||||
|
private readonly RemoteWalkContext _remoteWalkContext;
|
||||||
|
private readonly DirectoryInfo _packagesDirectory;
|
||||||
|
private readonly IFrameworkCompatibilityProvider _compatibilityProvider = DefaultCompatibilityProvider.Instance;
|
||||||
|
|
||||||
|
public PackageResolver(IEnumerable<PackageSource> sources, DirectoryInfo packagesDirectory)
|
||||||
|
{
|
||||||
|
_packagesDirectory = packagesDirectory;
|
||||||
|
IReadOnlySet<PackageSource> packageSources = sources.Where(b => b.Type is PackageSourceType.NuGet).ToImmutableHashSet();
|
||||||
|
|
||||||
|
var mapping = new PackageSourceMapping(packageSources.ToDictionary(b => b.Name, b => b.Patterns));
|
||||||
|
_remoteWalkContext = new RemoteWalkContext(_sourceCacheContext, mapping, _logger);
|
||||||
|
|
||||||
|
foreach (var (name, url, _, _) in packageSources)
|
||||||
|
{
|
||||||
|
var packageSource = new NuGet.Configuration.PackageSource(url, name);
|
||||||
|
var sourceRepository = new SourceRepository(packageSource, new INuGetResourceProvider[]
|
||||||
|
{
|
||||||
|
new DownloadResourceV3Provider(),
|
||||||
|
new DependencyInfoResourceV3Provider(),
|
||||||
|
new ServiceIndexResourceV3Provider(),
|
||||||
|
new RemoteV3FindPackageByIdResourceProvider(),
|
||||||
|
new V3FeedListResourceProvider(),
|
||||||
|
new HttpSourceResourceProvider(),
|
||||||
|
new RegistrationResourceV3Provider(),
|
||||||
|
new HttpHandlerResourceV3Provider()
|
||||||
|
}.Select(b => new Lazy<INuGetResourceProvider>(b)), FeedType.HttpV3);
|
||||||
|
|
||||||
|
_remoteWalkContext.RemoteLibraryProviders.Add(
|
||||||
|
new SourceRepositoryDependencyProvider(sourceRepository, _logger, _sourceCacheContext, true, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<IEnumerable<Package>> ResolvePackagesAsync(
|
||||||
|
IReadOnlyDictionary<string, string> packages)
|
||||||
|
{
|
||||||
|
Log.Info("Restoring {0} packages", packages.Count);
|
||||||
|
|
||||||
|
var graphs = await Task.WhenAll(packages.Select(b =>
|
||||||
|
{
|
||||||
|
var (key, versionRange) = b;
|
||||||
|
var libraryRange = new LibraryRange(key, VersionRange.Parse(versionRange), LibraryDependencyTarget.All);
|
||||||
|
return ResolverUtility.FindLibraryEntryAsync(libraryRange, _framework, "win-x64",
|
||||||
|
_remoteWalkContext, CancellationToken.None);
|
||||||
|
}));
|
||||||
|
|
||||||
|
return await graphs.ToAsyncEnumerable().SelectAwait(async graph =>
|
||||||
|
{
|
||||||
|
return new Package(graph.Key.Name, Version.Parse(graph.Key.Version.ToFullString()),
|
||||||
|
await graph.Data.Dependencies
|
||||||
|
.ToAsyncEnumerable()
|
||||||
|
.SelectAwait(async b =>
|
||||||
|
{
|
||||||
|
var match = await ResolverUtility.FindLibraryByVersionAsync(
|
||||||
|
b.LibraryRange, _framework, _remoteWalkContext.RemoteLibraryProviders,
|
||||||
|
_sourceCacheContext, _logger, CancellationToken.None);
|
||||||
|
|
||||||
|
return new PackageDependency(
|
||||||
|
b.Name, Version.Parse(match.Library.Version.ToFullString()),
|
||||||
|
(PackageDependencyKind)b.ReferenceType)
|
||||||
|
{
|
||||||
|
Match = match
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.ToHashSetAsync())
|
||||||
|
{
|
||||||
|
Graph = graph
|
||||||
|
};
|
||||||
|
}).ToArrayAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<IPackageReader> GetPackageAsync(Package package)
|
||||||
|
{
|
||||||
|
var reader = new PackageReader(package, _sourceCacheContext, _logger, _framework, _compatibilityProvider, _packagesDirectory);
|
||||||
|
return Task.FromResult<IPackageReader>(reader);
|
||||||
|
}
|
||||||
|
}
|
8
Torch.API/WebAPI/Plugins/PackageSource.cs
Normal file
8
Torch.API/WebAPI/Plugins/PackageSource.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
public record PackageSource
|
||||||
|
#nullable restore
|
||||||
|
(string Name, string Url, IReadOnlyList<string> Patterns, PackageSourceType Type);
|
8
Torch.API/WebAPI/Plugins/PackageSourceType.cs
Normal file
8
Torch.API/WebAPI/Plugins/PackageSourceType.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#nullable enable
|
||||||
|
namespace Torch.API.WebAPI.Plugins;
|
||||||
|
|
||||||
|
public enum PackageSourceType
|
||||||
|
{
|
||||||
|
NuGet,
|
||||||
|
LegacyTorch
|
||||||
|
}
|
@@ -5,7 +5,6 @@ using System.Net.Http;
|
|||||||
using System.Net.Http.Json;
|
using System.Net.Http.Json;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using JorgeSerrano.Json;
|
|
||||||
using Version = SemanticVersioning.Version;
|
using Version = SemanticVersioning.Version;
|
||||||
|
|
||||||
namespace Torch.API.WebAPI.Update;
|
namespace Torch.API.WebAPI.Update;
|
||||||
@@ -38,7 +37,7 @@ public class GithubQuery : IUpdateQuery
|
|||||||
{
|
{
|
||||||
var response = await _client.GetFromJsonAsync<Release>($"/repos/{repository}/releases/latest", new JsonSerializerOptions(JsonSerializerDefaults.Web)
|
var response = await _client.GetFromJsonAsync<Release>($"/repos/{repository}/releases/latest", new JsonSerializerOptions(JsonSerializerDefaults.Web)
|
||||||
{
|
{
|
||||||
PropertyNamingPolicy = new JsonSnakeCaseNamingPolicy()
|
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response is null)
|
if (response is null)
|
||||||
|
@@ -1,18 +1,50 @@
|
|||||||
{
|
{
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"net7.0-windows7.0": {
|
"net8.0-windows7.0": {
|
||||||
"JorgeSerrano.Json.JsonSnakeCaseNamingPolicy": {
|
"JetBrains.Annotations": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[0.9.0, )",
|
"requested": "[2023.3.0, )",
|
||||||
"resolved": "0.9.0",
|
"resolved": "2023.3.0",
|
||||||
"contentHash": "xCqODS+wzpUXNtg4bMMvXG5PLbP0iTwRzRn2R+zWHKm83E6tbV2bCagawXp1EnZeNpd5OXpMxehulZWns8efzQ=="
|
"contentHash": "PHfnvdBUdGaTVG9bR/GEfxgTwWM0Z97Y6X3710wiljELBISipSfF5okn/vz+C2gfO+ihoEyVPjaJwn8ZalVukA=="
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration.Binder": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[8.0.1, )",
|
||||||
|
"resolved": "8.0.1",
|
||||||
|
"contentHash": "2UKFJnLiBt7Od6nCnTqP9rTIUNhzmn9Hv1l2FchyKbz8xieB9ULwZTbQZMw+M24Qw3F5dzzH1U9PPleN0LNLOQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"NLog": {
|
"NLog": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[5.1.0, )",
|
"requested": "[5.3.2, )",
|
||||||
"resolved": "5.1.0",
|
"resolved": "5.3.2",
|
||||||
"contentHash": "oW7ekrkRG9okpDMUcEglunWj8Qf2RY8qkgl+/chJoavzg3dbT13y32t19R54FKkmq80fKzw4ZekZkCrRGanKgQ=="
|
"contentHash": "cQRQZuDMjSyMe9EQBnI9v55YAMMz8GAfFd6fFJ6tc/kXnG7Hze8p1I8MgvWSBG6E36wA8vSxRrlm8uSIG+SENg=="
|
||||||
|
},
|
||||||
|
"NuGet.Commands": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[6.9.1, )",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "pI2X+KRQYsVcmjJUIAXT+8fvUCZgNWBQiSizKCOltRqaMjtUHLetfADfz7jfreOBohsDxNzhBnNqPQ8MU/Gjxw==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.FileProviders.Abstractions": "6.0.0",
|
||||||
|
"Microsoft.Extensions.FileSystemGlobbing": "6.0.0",
|
||||||
|
"NuGet.Credentials": "6.9.1",
|
||||||
|
"NuGet.ProjectModel": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.DependencyResolver.Core": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[6.9.1, )",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "gVWIEScv1K40H2Fvs6HGaOzRMpG+r1RUqYpBdh7gqQ18kgsswWUSr90jCNtBb7PUYKkMU1oAhxTslj/gQjO+Vw==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Configuration": "6.9.1",
|
||||||
|
"NuGet.LibraryModel": "6.9.1",
|
||||||
|
"NuGet.Protocol": "6.9.1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"SemanticVersioning": {
|
"SemanticVersioning": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
@@ -22,17 +54,191 @@
|
|||||||
},
|
},
|
||||||
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[1.201.13, )",
|
"requested": "[1.204.15, )",
|
||||||
"resolved": "1.201.13",
|
"resolved": "1.204.15",
|
||||||
"contentHash": "FRXuNLENsz5jGQvL0QkogAGsxEJyUQlXhvWHBWfZiHCnCrAWMD60nEis6yt0xCQpazszfMtHonbxz72XMxnFoQ==",
|
"contentHash": "xq1quPCVGi1d4D/iH2iwd8B+1OH5Lqi9H/ld8kaZN8fZ9axz2wtqdq3jYbe9r/FKdSaMhqaERD5W62sHuI9tPA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"SharpDX": "4.2.0-keen-cringe",
|
||||||
"protobuf-net": "1.0.0"
|
"protobuf-net": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"System.Linq.Async": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[6.0.1, )",
|
||||||
|
"resolved": "6.0.1",
|
||||||
|
"contentHash": "0YhHcaroWpQ9UCot3Pizah7ryAzQhNvobLMSxeDIGmnXfkQn8u5owvpOH0K6EVB+z9L7u6Cc4W17Br/+jyttEQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Bcl.AsyncInterfaces": "6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Text.Json": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[8.0.3, )",
|
||||||
|
"resolved": "8.0.3",
|
||||||
|
"contentHash": "hpagS9joOwv6efWfrMmV9MjQXpiXZH72PgN067Ysfr6AWMSD1/1hEcvh/U5mUpPLezEWsOJSuVrmqDIVD958iA==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Text.Encodings.Web": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Bcl.AsyncInterfaces": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.0.0",
|
||||||
|
"contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.FileProviders.Abstractions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.0.0",
|
||||||
|
"contentHash": "0pd4/fho0gC12rQswaGQxbU34jOS1TPS8lZPpkFCH68ppQjHNHYle9iRuHeev1LhrJ94YPvzcRd8UmIuFk23Qw==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Primitives": "6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.FileSystemGlobbing": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.0.0",
|
||||||
|
"contentHash": "ip8jnL1aPiaPeKINCqaTEbvBFDmVx9dXQEBZ2HOBRXPD1eabGNqP/bKlsIcp7U2lGxiXd5xIhoFcmY8nM4Hdiw=="
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Primitives": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g=="
|
||||||
|
},
|
||||||
|
"Newtonsoft.Json": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "13.0.3",
|
||||||
|
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
|
||||||
|
},
|
||||||
|
"NuGet.Common": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "FbuWZBjQ1NJXBDqCwSddN2yvw3Plq3sTCIh0nc66Hu8jrNr+BOaxlKZv78jvJ+pSy8BvurYOdF9sl9KoORjrtg==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Frameworks": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Configuration": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "GM06pcUzWdNsizeGciqCjAhryfI1F/rQPETLDF+8pDRgzVpA+wKAR01/4aFU+IXzugnQ9LqOb5YyCRuR1OVZiQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Common": "6.9.1",
|
||||||
|
"System.Security.Cryptography.ProtectedData": "4.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Credentials": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "elTErAznCWoqOLILVDN4FTa3+rpVVdUbHUaOUqJkk9+Z/ZSqyDPbCIhLaqTkPkWqoKa93gqzX9IFwURkMphPnw==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Protocol": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Frameworks": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "DaKh3lenPUvzGccPkbI97BIvA27z+/UsL3ankfoZlX/4vBVDK5N1sheFTQ+GuJf+IgSzsJz/A21SPUpQLHwUtA=="
|
||||||
|
},
|
||||||
|
"NuGet.LibraryModel": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "xlOpbZTc4862vKHkZHLJ5VgDteo+78ftVkajB8rKgSpevnBqwPKv2Y5OfUxct9HCqWYw0ikVfNf/qfjqnQCV1Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Common": "6.9.1",
|
||||||
|
"NuGet.Versioning": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Packaging": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "6FyasOxKInCELJ+pGy8f17ub9st6ofFeNcBNTo7CRiPJlxyhJfKGKNpfe3HHYwvnZhc3Vdfr0kSR+f1BVGDuTA==",
|
||||||
|
"dependencies": {
|
||||||
|
"Newtonsoft.Json": "13.0.3",
|
||||||
|
"NuGet.Configuration": "6.9.1",
|
||||||
|
"NuGet.Versioning": "6.9.1",
|
||||||
|
"System.Security.Cryptography.Pkcs": "6.0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.ProjectModel": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "x98QkS3oloaJfdSsDFOGTH5oeoHHTDoyTO7oyg/7g60be14AQowLqgPQV52Kuscl4lknx/3259RTxyDcbkdifQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.DependencyResolver.Core": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Protocol": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "h3bdjqUY4jvwM02D/7QM4FR8x/bbf4Pyjrc1Etw7an2OrWKPUSx0vJPdapKzioxIw7GXl/aVUM/DCeIc3S9brA==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Packaging": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Versioning": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "ypnSvEtpNGo48bAWn95J1oHChycCXcevFSbn53fqzLxlXFSZP7dawu8p/7mHAfGufZQSV2sBpW80XQGIfXO8kQ=="
|
||||||
|
},
|
||||||
"protobuf-net": {
|
"protobuf-net": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "1.0.0",
|
"resolved": "1.0.0",
|
||||||
"contentHash": "kTGOK0E87473sOImOjgZOnz3kTC2aMLffoRWQLYNuBLJnwNNmjanF9IkevZ9Q7yYLeABQfcF3BpeepuMntMVNw=="
|
"contentHash": "kTGOK0E87473sOImOjgZOnz3kTC2aMLffoRWQLYNuBLJnwNNmjanF9IkevZ9Q7yYLeABQfcF3BpeepuMntMVNw=="
|
||||||
|
},
|
||||||
|
"SharpDX": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "4.2.0-keen-cringe",
|
||||||
|
"contentHash": "LaJN3h1Gi1FWVdef2I5WtOH9gwzKCBniH0CragarbkN2QheYY6Lqm+91PcOfp1w/4wdVb+k8Kjv3sO393Tphtw=="
|
||||||
|
},
|
||||||
|
"System.Formats.Asn1": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.0.0",
|
||||||
|
"contentHash": "T6fD00dQ3NTbPDy31m4eQUwKW84s03z0N2C8HpOklyeaDgaJPa/TexP4/SkORMSOwc7WhKifnA6Ya33AkzmafA=="
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.Pkcs": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.0.4",
|
||||||
|
"contentHash": "LGbXi1oUJ9QgCNGXRO9ndzBL/GZgANcsURpMhNR8uO+rca47SZmciS3RSQUvlQRwK3QHZSHNOXzoMUASKA+Anw==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Formats.Asn1": "6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.ProtectedData": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "4.4.0",
|
||||||
|
"contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog=="
|
||||||
|
},
|
||||||
|
"System.Text.Encodings.Web": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"net8.0-windows7.0/win-x64": {
|
||||||
|
"System.Security.Cryptography.Pkcs": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.0.4",
|
||||||
|
"contentHash": "LGbXi1oUJ9QgCNGXRO9ndzBL/GZgANcsURpMhNR8uO+rca47SZmciS3RSQUvlQRwK3QHZSHNOXzoMUASKA+Anw==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Formats.Asn1": "6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.ProtectedData": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "4.4.0",
|
||||||
|
"contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog=="
|
||||||
|
},
|
||||||
|
"System.Text.Encodings.Web": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
using Sandbox.ModAPI;
|
using Sandbox.ModAPI;
|
||||||
|
|
||||||
|
@@ -1,26 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Torch.Mod.Messages
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// shim to store incoming message data
|
|
||||||
/// </summary>
|
|
||||||
internal class IncomingMessage : MessageBase
|
|
||||||
{
|
|
||||||
public IncomingMessage()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void ProcessClient()
|
|
||||||
{
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void ProcessServer()
|
|
||||||
{
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using ProtoBuf;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using ProtoBuf;
|
|
||||||
using Sandbox.ModAPI;
|
using Sandbox.ModAPI;
|
||||||
|
|
||||||
namespace Torch.Mod.Messages
|
namespace Torch.Mod.Messages
|
||||||
@@ -32,11 +29,6 @@ namespace Torch.Mod.Messages
|
|||||||
|
|
||||||
public override void ProcessClient()
|
public override void ProcessClient()
|
||||||
{
|
{
|
||||||
if (TorchModCore.Debug)
|
|
||||||
{
|
|
||||||
MyAPIGateway.Utilities.ShowMessage("Torch", $"Joining server {Address} with delay {Delay}");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Delay <= 0)
|
if (Delay <= 0)
|
||||||
{
|
{
|
||||||
MyAPIGateway.Multiplayer.JoinServer(Address);
|
MyAPIGateway.Multiplayer.JoinServer(Address);
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using ProtoBuf;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using ProtoBuf;
|
|
||||||
|
|
||||||
namespace Torch.Mod.Messages
|
namespace Torch.Mod.Messages
|
||||||
{
|
{
|
||||||
@@ -17,36 +12,9 @@ namespace Torch.Mod.Messages
|
|||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public abstract class MessageBase
|
public abstract class MessageBase
|
||||||
{
|
{
|
||||||
[ProtoMember(101)]
|
|
||||||
public ulong SenderId;
|
public ulong SenderId;
|
||||||
|
|
||||||
public abstract void ProcessClient();
|
public abstract void ProcessClient();
|
||||||
public abstract void ProcessServer();
|
public abstract void ProcessServer();
|
||||||
|
|
||||||
//members below not serialized, they're just metadata about the intended target(s) of this message
|
|
||||||
internal MessageTarget TargetType;
|
|
||||||
internal ulong Target;
|
|
||||||
internal ulong[] Ignore;
|
|
||||||
internal byte[] CompressedData;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum MessageTarget
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Send to Target
|
|
||||||
/// </summary>
|
|
||||||
Single,
|
|
||||||
/// <summary>
|
|
||||||
/// Send to Server
|
|
||||||
/// </summary>
|
|
||||||
Server,
|
|
||||||
/// <summary>
|
|
||||||
/// Send to all Clients (only valid from server)
|
|
||||||
/// </summary>
|
|
||||||
AllClients,
|
|
||||||
/// <summary>
|
|
||||||
/// Send to all except those steam ID listed in Ignore
|
|
||||||
/// </summary>
|
|
||||||
AllExcept,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
using Sandbox.ModAPI;
|
using Sandbox.ModAPI;
|
||||||
|
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using ProtoBuf;
|
using ProtoBuf;
|
||||||
using Sandbox.ModAPI;
|
using Sandbox.ModAPI;
|
||||||
using VRage.ModAPI;
|
using VRage.ModAPI;
|
||||||
|
@@ -1,161 +1,50 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Sandbox.ModAPI;
|
using Sandbox.ModAPI;
|
||||||
using Torch.Mod.Messages;
|
using Torch.Mod.Messages;
|
||||||
using VRage;
|
using VRage.Game.Components;
|
||||||
using VRage.Collections;
|
|
||||||
using VRage.Game.ModAPI;
|
using VRage.Game.ModAPI;
|
||||||
using VRage.Network;
|
#if TORCH
|
||||||
using VRage.Utils;
|
using Torch.Utils;
|
||||||
using Task = ParallelTasks.Task;
|
using VRage.Library.Collections;
|
||||||
|
using System.Reflection;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Torch.Mod
|
namespace Torch.Mod
|
||||||
{
|
{
|
||||||
public static class ModCommunication
|
[MySessionComponentDescriptor(MyUpdateOrder.AfterSimulation)]
|
||||||
|
public class ModCommunication : MySessionComponentBase
|
||||||
{
|
{
|
||||||
public const ushort NET_ID = 4352;
|
public const ulong MOD_ID = 2915950488;
|
||||||
private static bool _closing = false;
|
private const ushort CHANNEL = 7654;
|
||||||
private static BlockingCollection<MessageBase> _processing;
|
|
||||||
private static MyConcurrentPool<IncomingMessage> _messagePool;
|
|
||||||
private static List<IMyPlayer> _playerCache;
|
|
||||||
|
|
||||||
public static void Register()
|
public override void BeforeStart()
|
||||||
{
|
{
|
||||||
MyLog.Default.WriteLineAndConsole("TORCH MOD: Registering mod communication.");
|
base.BeforeStart();
|
||||||
_processing = new BlockingCollection<MessageBase>(new ConcurrentQueue<MessageBase>());
|
MyAPIGateway.Multiplayer.RegisterSecureMessageHandler(CHANNEL, MessageHandler);
|
||||||
_playerCache = new List<IMyPlayer>();
|
|
||||||
_messagePool = new MyConcurrentPool<IncomingMessage>(8);
|
|
||||||
|
|
||||||
MyAPIGateway.Multiplayer.RegisterMessageHandler(NET_ID, MessageHandler);
|
|
||||||
//background thread to handle de/compression and processing
|
|
||||||
_closing = false;
|
|
||||||
MyAPIGateway.Parallel.StartBackground(DoProcessing);
|
|
||||||
MyLog.Default.WriteLineAndConsole("TORCH MOD: Mod communication registered successfully.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Unregister()
|
private void MessageHandler(ushort channel, byte[] data, ulong sender, bool fromServer)
|
||||||
{
|
{
|
||||||
MyLog.Default.WriteLineAndConsole("TORCH MOD: Unregistering mod communication.");
|
if (!fromServer)
|
||||||
MyAPIGateway.Multiplayer?.UnregisterMessageHandler(NET_ID, MessageHandler);
|
return;
|
||||||
_processing?.CompleteAdding();
|
|
||||||
_closing = true;
|
var message = MyAPIGateway.Utilities.SerializeFromBinary<MessageBase>(data);
|
||||||
//_task.Wait();
|
message.SenderId = sender;
|
||||||
|
|
||||||
|
if (MyAPIGateway.Multiplayer.IsServer) message.ProcessServer();
|
||||||
|
else message.ProcessClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void MessageHandler(byte[] bytes)
|
|
||||||
{
|
|
||||||
var m = _messagePool.Get();
|
|
||||||
m.CompressedData = bytes;
|
|
||||||
#if TORCH
|
#if TORCH
|
||||||
m.SenderId = MyEventContext.Current.Sender.Value;
|
[ReflectedMethodInfo(typeof(MyAPIUtilities), "VRage.Game.ModAPI.IMyUtilities.SerializeToBinary")]
|
||||||
#endif
|
private static MethodInfo _serializeMethod = null!;
|
||||||
|
|
||||||
_processing.Add(m);
|
private static readonly CacheList<IMyPlayer> Players = new();
|
||||||
}
|
|
||||||
|
|
||||||
public static void DoProcessing()
|
private static byte[] Serialize(MessageBase message)
|
||||||
{
|
{
|
||||||
while (!_closing)
|
return (byte[])_serializeMethod.MakeGenericMethod(message.GetType())
|
||||||
{
|
.Invoke(MyAPIGateway.Utilities, new object[] { message });
|
||||||
try
|
|
||||||
{
|
|
||||||
MessageBase m;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m = _processing.Take();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
MyLog.Default.WriteLineAndConsole($"Processing message: {m.GetType().Name}");
|
|
||||||
|
|
||||||
if (m is IncomingMessage) //process incoming messages
|
|
||||||
{
|
|
||||||
MessageBase i;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var o = MyCompression.Decompress(m.CompressedData);
|
|
||||||
m.CompressedData = null;
|
|
||||||
_messagePool.Return((IncomingMessage)m);
|
|
||||||
i = MyAPIGateway.Utilities.SerializeFromBinary<MessageBase>(o);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MyLog.Default.WriteLineAndConsole($"TORCH MOD: Failed to deserialize message! {ex}");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TorchModCore.Debug)
|
|
||||||
MyAPIGateway.Utilities.ShowMessage("Torch", $"Received message of type {i.GetType().Name}");
|
|
||||||
|
|
||||||
if (MyAPIGateway.Multiplayer.IsServer)
|
|
||||||
i.ProcessServer();
|
|
||||||
else
|
|
||||||
i.ProcessClient();
|
|
||||||
}
|
|
||||||
else //process outgoing messages
|
|
||||||
{
|
|
||||||
if (TorchModCore.Debug)
|
|
||||||
MyAPIGateway.Utilities.ShowMessage("Torch", $"Sending message of type {m.GetType().Name}");
|
|
||||||
|
|
||||||
var b = MyAPIGateway.Utilities.SerializeToBinary(m);
|
|
||||||
m.CompressedData = MyCompression.Compress(b);
|
|
||||||
|
|
||||||
switch (m.TargetType)
|
|
||||||
{
|
|
||||||
case MessageTarget.Single:
|
|
||||||
MyAPIGateway.Multiplayer.SendMessageTo(NET_ID, m.CompressedData, m.Target);
|
|
||||||
break;
|
|
||||||
case MessageTarget.Server:
|
|
||||||
MyAPIGateway.Multiplayer.SendMessageToServer(NET_ID, m.CompressedData);
|
|
||||||
break;
|
|
||||||
case MessageTarget.AllClients:
|
|
||||||
MyAPIGateway.Players.GetPlayers(_playerCache);
|
|
||||||
foreach (var p in _playerCache)
|
|
||||||
{
|
|
||||||
if (p.SteamUserId == MyAPIGateway.Multiplayer.MyId)
|
|
||||||
continue;
|
|
||||||
MyAPIGateway.Multiplayer.SendMessageTo(NET_ID, m.CompressedData, p.SteamUserId);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
case MessageTarget.AllExcept:
|
|
||||||
MyAPIGateway.Players.GetPlayers(_playerCache);
|
|
||||||
foreach (var p in _playerCache)
|
|
||||||
{
|
|
||||||
if (p.SteamUserId == MyAPIGateway.Multiplayer.MyId || m.Ignore.Contains(p.SteamUserId))
|
|
||||||
continue;
|
|
||||||
MyAPIGateway.Multiplayer.SendMessageTo(NET_ID, m.CompressedData, p.SteamUserId);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
_playerCache.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
MyLog.Default.WriteLineAndConsole($"TORCH MOD: Exception occurred in communication thread! {ex}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MyLog.Default.WriteLineAndConsole("TORCH MOD: INFO: Communication thread shut down successfully! THIS IS NOT AN ERROR");
|
|
||||||
//exit signal received. Clean everything and GTFO
|
|
||||||
_processing?.Dispose();
|
|
||||||
_processing = null;
|
|
||||||
_messagePool?.Clean();
|
|
||||||
_messagePool = null;
|
|
||||||
_playerCache = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SendMessageTo(MessageBase message, ulong target)
|
public static void SendMessageTo(MessageBase message, ulong target)
|
||||||
@@ -163,12 +52,7 @@ namespace Torch.Mod
|
|||||||
if (!MyAPIGateway.Multiplayer.IsServer)
|
if (!MyAPIGateway.Multiplayer.IsServer)
|
||||||
throw new Exception("Only server can send targeted messages");
|
throw new Exception("Only server can send targeted messages");
|
||||||
|
|
||||||
if (_closing)
|
MyAPIGateway.Multiplayer.SendMessageTo(CHANNEL, Serialize(message), target);
|
||||||
return;
|
|
||||||
|
|
||||||
message.Target = target;
|
|
||||||
message.TargetType = MessageTarget.Single;
|
|
||||||
_processing.Add(message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SendMessageToClients(MessageBase message)
|
public static void SendMessageToClients(MessageBase message)
|
||||||
@@ -176,11 +60,7 @@ namespace Torch.Mod
|
|||||||
if (!MyAPIGateway.Multiplayer.IsServer)
|
if (!MyAPIGateway.Multiplayer.IsServer)
|
||||||
throw new Exception("Only server can send targeted messages");
|
throw new Exception("Only server can send targeted messages");
|
||||||
|
|
||||||
if (_closing)
|
MyAPIGateway.Multiplayer.SendMessageToOthers(CHANNEL, Serialize(message));
|
||||||
return;
|
|
||||||
|
|
||||||
message.TargetType = MessageTarget.AllClients;
|
|
||||||
_processing.Add(message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SendMessageExcept(MessageBase message, params ulong[] ignoredUsers)
|
public static void SendMessageExcept(MessageBase message, params ulong[] ignoredUsers)
|
||||||
@@ -188,21 +68,20 @@ namespace Torch.Mod
|
|||||||
if (!MyAPIGateway.Multiplayer.IsServer)
|
if (!MyAPIGateway.Multiplayer.IsServer)
|
||||||
throw new Exception("Only server can send targeted messages");
|
throw new Exception("Only server can send targeted messages");
|
||||||
|
|
||||||
if (_closing)
|
using var players = Players;
|
||||||
return;
|
MyAPIGateway.Multiplayer.Players.GetPlayers(players, player => !ignoredUsers.Contains(player.SteamUserId));
|
||||||
|
|
||||||
message.TargetType = MessageTarget.AllExcept;
|
var data = Serialize(message);
|
||||||
message.Ignore = ignoredUsers;
|
foreach (var player in players)
|
||||||
_processing.Add(message);
|
{
|
||||||
|
MyAPIGateway.Multiplayer.SendMessageTo(CHANNEL, data, player.SteamUserId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SendMessageToServer(MessageBase message)
|
public static void SendMessageToServer(MessageBase message)
|
||||||
{
|
{
|
||||||
if (_closing)
|
throw new NotSupportedException();
|
||||||
return;
|
|
||||||
|
|
||||||
message.TargetType = MessageTarget.Server;
|
|
||||||
_processing.Add(message);
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,13 +9,11 @@
|
|||||||
<Import_RootNamespace>Torch.Mod</Import_RootNamespace>
|
<Import_RootNamespace>Torch.Mod</Import_RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\IncomingMessage.cs" />
|
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\JoinServerMessage.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Messages\JoinServerMessage.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\NotificationMessage.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Messages\NotificationMessage.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\DialogMessage.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Messages\DialogMessage.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\MessageBase.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Messages\MessageBase.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Messages\VoxelResetMessage.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Messages\VoxelResetMessage.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)ModCommunication.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)ModCommunication.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)TorchModCore.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@@ -1,51 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Sandbox.ModAPI;
|
|
||||||
using VRage.Game.Components;
|
|
||||||
|
|
||||||
namespace Torch.Mod
|
|
||||||
{
|
|
||||||
[MySessionComponentDescriptor(MyUpdateOrder.AfterSimulation)]
|
|
||||||
public class TorchModCore : MySessionComponentBase
|
|
||||||
{
|
|
||||||
public const ulong MOD_ID = 2722000298;
|
|
||||||
private static bool _init;
|
|
||||||
public static bool Debug;
|
|
||||||
|
|
||||||
public override void UpdateAfterSimulation()
|
|
||||||
{
|
|
||||||
if (_init)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_init = true;
|
|
||||||
ModCommunication.Register();
|
|
||||||
MyAPIGateway.Utilities.MessageEntered += Utilities_MessageEntered;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Utilities_MessageEntered(string messageText, ref bool sendToOthers)
|
|
||||||
{
|
|
||||||
if (messageText == "@!debug")
|
|
||||||
{
|
|
||||||
Debug = !Debug;
|
|
||||||
MyAPIGateway.Utilities.ShowMessage("Torch", $"Debug: {Debug}");
|
|
||||||
sendToOthers = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void UnloadData()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
MyAPIGateway.Utilities.MessageEntered -= Utilities_MessageEntered;
|
|
||||||
ModCommunication.Unregister();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
//session unloading, don't care
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,6 +1,5 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7-windows</TargetFramework>
|
|
||||||
<NoWarn>1591,0649</NoWarn>
|
<NoWarn>1591,0649</NoWarn>
|
||||||
<AssemblyTitle>Torch Server Tests</AssemblyTitle>
|
<AssemblyTitle>Torch Server Tests</AssemblyTitle>
|
||||||
<Product>Torch</Product>
|
<Product>Torch</Product>
|
||||||
@@ -8,24 +7,15 @@
|
|||||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<OutputPath>$(SolutionDir)\bin-test\$(Platform)\$(Configuration)\</OutputPath>
|
<OutputPath>$(SolutionDir)\bin-test\$(Platform)\$(Configuration)\</OutputPath>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<Configurations>Debug;Release</Configurations>
|
|
||||||
<Platforms>AnyCPU</Platforms>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="$(Configuration) == 'Release'">
|
<PropertyGroup Condition="$(Configuration) == 'Release'">
|
||||||
<DocumentationFile>$(SolutionDir)\bin-test\$(Platform)\$(Configuration)\Torch.Server.Tests.xml</DocumentationFile>
|
<DocumentationFile>$(SolutionDir)\bin-test\$(Platform)\$(Configuration)\Torch.Server.Tests.xml</DocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||||
<PackageReference Include="NLog" Version="5.1.0" />
|
<PackageReference Include="NLog" Version="5.3.2" />
|
||||||
<PackageReference Include="xunit" Version="2.4.2" />
|
<PackageReference Include="xunit" Version="2.8.0" />
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="VRage.Game, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\GameBinaries\VRage.Game.dll</HintPath>
|
|
||||||
<SpecificVersion>False</SpecificVersion>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Torch.API\Torch.API.csproj" />
|
<ProjectReference Include="..\Torch.API\Torch.API.csproj" />
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Torch.Server.ViewModels;
|
using Torch.Server.ViewModels;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
722
Torch.Server.Tests/packages.lock.json
Normal file
722
Torch.Server.Tests/packages.lock.json
Normal file
@@ -0,0 +1,722 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"dependencies": {
|
||||||
|
"net8.0-windows7.0": {
|
||||||
|
"Microsoft.NET.Test.Sdk": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[17.9.0, )",
|
||||||
|
"resolved": "17.9.0",
|
||||||
|
"contentHash": "7GUNAUbJYn644jzwLm5BD3a2p9C1dmP8Hr6fDPDxgItQk9hBs1Svdxzz07KQ/UphMSmgza9AbijBJGmw5D658A==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.CodeCoverage": "17.9.0",
|
||||||
|
"Microsoft.TestPlatform.TestHost": "17.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NLog": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[5.3.2, )",
|
||||||
|
"resolved": "5.3.2",
|
||||||
|
"contentHash": "cQRQZuDMjSyMe9EQBnI9v55YAMMz8GAfFd6fFJ6tc/kXnG7Hze8p1I8MgvWSBG6E36wA8vSxRrlm8uSIG+SENg=="
|
||||||
|
},
|
||||||
|
"xunit": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[2.8.0, )",
|
||||||
|
"resolved": "2.8.0",
|
||||||
|
"contentHash": "US3a3twJziAif1kFPGdk9fALwILHxV0n1roX5j67bN/d3o4DGNLHnV3tr5ZX+uinVrzfkf0avH3zGX8JPBC0qA==",
|
||||||
|
"dependencies": {
|
||||||
|
"xunit.analyzers": "1.13.0",
|
||||||
|
"xunit.assert": "2.8.0",
|
||||||
|
"xunit.core": "[2.8.0]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AutoCompleteTextBox": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.7.2",
|
||||||
|
"contentHash": "rslnIhQRK++Ty7epprYj861F8bo2N11TCUOgRs1r9mJ6w9HrhnQnE4zvUVm7xUsq8u5DCxR7cQtbAZ1txS2/Aw=="
|
||||||
|
},
|
||||||
|
"AvalonEdit": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.3.0.90",
|
||||||
|
"contentHash": "WVTb5MxwGqKdeasd3nG5udlV4t6OpvkFanziwI133K0/QJ5FvZmfzRQgpAjGTJhQfIA8GP7AzKQ3sTY9JOFk8Q=="
|
||||||
|
},
|
||||||
|
"Ben.Demystifier": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "0.4.1",
|
||||||
|
"contentHash": "axFeEMfmEORy3ipAzOXG/lE+KcNptRbei3F0C4kQCdeiQtW+qJW90K5iIovITGrdLt8AjhNCwk5qLSX9/rFpoA==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Reflection.Metadata": "5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ControlzEx": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "5.0.2",
|
||||||
|
"contentHash": "f724LoDJ36LxaLR62G4ek9ZAJI8BiiYRJJ04furC/qjXSeIwU0qmHFIe19xB1/FwxyZjevdFguEr9ZUjf3dZgw==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Xaml.Behaviors.Wpf": "1.1.31",
|
||||||
|
"System.Text.Json": "5.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"HarmonyX": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.10.2-prerelease.7",
|
||||||
|
"contentHash": "15kgPt5Cqeu7w1CHp4YqlVXuq6FKZj9iZwA/oNd7SaRVwvq2kZ9EODmJ2+U61ZLFasQY7nr2w/latSAv/Pjn/g==",
|
||||||
|
"dependencies": {
|
||||||
|
"MonoMod.RuntimeDetour": "25.1.0-prerelease.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"JetBrains.Annotations": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2023.3.0",
|
||||||
|
"contentHash": "PHfnvdBUdGaTVG9bR/GEfxgTwWM0Z97Y6X3710wiljELBISipSfF5okn/vz+C2gfO+ihoEyVPjaJwn8ZalVukA=="
|
||||||
|
},
|
||||||
|
"MahApps.Metro": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.4.10",
|
||||||
|
"contentHash": "45exHKJCVYaD1/rNr3ekZPECEBM4uHOt6aYp6yNaJbliFMUo+d3z8Gi1xG+qEkbiHKITX+dlz+BW1FOsjAbl/w==",
|
||||||
|
"dependencies": {
|
||||||
|
"ControlzEx": "[4.4.0, 6.0.0)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MdXaml": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.27.0",
|
||||||
|
"contentHash": "VWhqhCeKVkJe8vkPmXuGZlRX01WDrTugOLeUvJn18jH/8DrGGVBvtgIlJoELHD2f1DiEWqF3lxxjV55vnzE7Tg==",
|
||||||
|
"dependencies": {
|
||||||
|
"AvalonEdit": "6.3.0.90",
|
||||||
|
"MdXaml.Plugins": "1.27.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MdXaml.Plugins": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.27.0",
|
||||||
|
"contentHash": "We7LtBdoukRg9mqTfa1f5n8z/GQPMKBRj3URk9DiMuqzIHkW1lTgK5njVPSScxsRt4YzW22423tSnLWNm2MJKg=="
|
||||||
|
},
|
||||||
|
"Microsoft.Bcl.AsyncInterfaces": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw=="
|
||||||
|
},
|
||||||
|
"Microsoft.CodeAnalysis.Analyzers": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "3.3.4",
|
||||||
|
"contentHash": "AxkxcPR+rheX0SmvpLVIGLhOUXAKG56a64kV9VQZ4y9gR9ZmPXnqZvHJnmwLSwzrEP6junUF11vuc+aqo5r68g=="
|
||||||
|
},
|
||||||
|
"Microsoft.CodeAnalysis.Common": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "4.9.2",
|
||||||
|
"contentHash": "M5PThug7b2AdxL7xKmQs50KzAQTl9jENw5jMT3iUt16k+DAFlw1S87juU3UuPs3gvBm8trMBSOEvSFDr31c9Vw==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.CodeAnalysis.Analyzers": "3.3.4",
|
||||||
|
"System.Collections.Immutable": "8.0.0",
|
||||||
|
"System.Reflection.Metadata": "8.0.0",
|
||||||
|
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.CodeAnalysis.CSharp": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "4.9.2",
|
||||||
|
"contentHash": "HGIo7E9Mf3exAJbUdYpDFfLoYkSVaHDJXPyusWTYUTBaOPCowGw+Gap5McE1w+K+ryIXre72oiqL88sQHmHBmg==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.CodeAnalysis.Common": "[4.9.2]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.CodeCoverage": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "17.9.0",
|
||||||
|
"contentHash": "RGD37ZSrratfScYXm7M0HjvxMxZyWZL4jm+XgMZbkIY1UPgjUpbNA/t+WTGj/rC/0Hm9A3IrH3ywbKZkOCnoZA=="
|
||||||
|
},
|
||||||
|
"Microsoft.Diagnostics.NETCore.Client": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "0.2.410101",
|
||||||
|
"contentHash": "I4hMjlbPcM5R+M4ThD2Zt1z58M8uZnWkDbFLXHntOOAajajEucrw4XYNSaoi5rgoqksgxQ3g388Vof4QzUNwdQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Bcl.AsyncInterfaces": "1.1.0",
|
||||||
|
"Microsoft.Extensions.Logging": "2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Diagnostics.Runtime": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "3.1.512801",
|
||||||
|
"contentHash": "0lMUDr2oxNZa28D6NH5BuSQEe5T9tZziIkvkD44YkkCGQXPJqvFjLq5ZQq1hYLl3RjQJrY+hR0jFgap+EWPDTw==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Diagnostics.NETCore.Client": "0.2.410101"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration.Binder": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.1",
|
||||||
|
"contentHash": "2UKFJnLiBt7Od6nCnTqP9rTIUNhzmn9Hv1l2FchyKbz8xieB9ULwZTbQZMw+M24Qw3F5dzzH1U9PPleN0LNLOQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration.CommandLine": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "NZuZMz3Q8Z780nKX3ifV1fE7lS+6pynDHK71OfU4OZ1ItgvDOhyOC7E6z+JMZrAj63zRpwbdldYFk499t3+1dQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Configuration": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration.EnvironmentVariables": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "plvZ0ZIpq+97gdPNNvhwvrEZ92kNml9hd1pe3idMA7svR0PztdzVLkoWLcRFgySYXUJc3kSM3Xw3mNFMo/bxRA==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Configuration": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration.FileExtensions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "McP+Lz/EKwvtCv48z0YImw+L1gi1gy5rHhNaNIY2CrjloV+XY8gydT8DjMR6zWeL13AFK+DioVpppwAuO1Gi1w==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Configuration": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0",
|
||||||
|
"Microsoft.Extensions.FileProviders.Abstractions": "8.0.0",
|
||||||
|
"Microsoft.Extensions.FileProviders.Physical": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Configuration.Xml": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "0iRltfE/Xbh6gs9DHiBMShrxhcpJLtF/+2OqW1OpUh1QLQuAvMy4cGElSeJx1/hF6IbsxYhakVgfCNU0Hsmcwg==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Configuration": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Configuration.FileExtensions": "8.0.0",
|
||||||
|
"Microsoft.Extensions.FileProviders.Abstractions": "8.0.0",
|
||||||
|
"System.Security.Cryptography.Xml": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.DependencyInjection": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.DependencyInjection.Abstractions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg=="
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.FileProviders.Abstractions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "ZbaMlhJlpisjuWbvXr4LdAst/1XxH3vZ6A0BsgTphZ2L4PGuxRLz7Jr/S7mkAAnOn78Vu0fKhEgNF5JO3zfjqQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.FileProviders.Physical": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "UboiXxpPUpwulHvIAVE36Knq0VSHaAmfrFkegLyBZeaADuKezJ/AIXYAW8F5GBlGk/VaibN2k/Zn1ca8YAfVdA==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.FileProviders.Abstractions": "8.0.0",
|
||||||
|
"Microsoft.Extensions.FileSystemGlobbing": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.FileSystemGlobbing": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "OK+670i7esqlQrPjdIKRbsyMCe9g5kSLpRRQGSr4Q58AOYEe/hCnfLZprh7viNisSUUQZmMrbbuDaIrP+V1ebQ=="
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Logging": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "tvRkov9tAJ3xP51LCv3FJ2zINmv1P8Hi8lhhtcKGqM+ImiTCC84uOPEI4z8Cdq2C3o9e+Aa0Gw0rmrsJD77W+w==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.DependencyInjection": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Logging.Abstractions": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Options": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Logging.Abstractions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "arDBqTgFCyS0EvRV7O3MZturChstm50OJ0y9bDJvAcmEPJm0FFpFyjU/JLYyStNGGey081DvnQYlncNX5SJJGA==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Options": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "JOVOfqpnqlVLUzINQ2fox8evY2SKLYJ3BV8QDe/Jyp21u1T7r45x/R/5QdteURMR5r01GxeJSBBUOCOyaNXA3g==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
|
||||||
|
"Microsoft.Extensions.Primitives": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Extensions.Primitives": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g=="
|
||||||
|
},
|
||||||
|
"Microsoft.TestPlatform.ObjectModel": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "17.9.0",
|
||||||
|
"contentHash": "1ilw/8vgmjLyKU+2SKXKXaOqpYFJCQfGqGz+x0cosl981VzjrY74Sv6qAJv+neZMZ9ZMxF3ArN6kotaQ4uvEBw==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Reflection.Metadata": "1.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.TestPlatform.TestHost": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "17.9.0",
|
||||||
|
"contentHash": "Spmg7Wx49Ya3SxBjyeAR+nQpjMTKZwTwpZ7KyeOTIqI/WHNPnBU4HUvl5kuHPQAwGWqMy4FGZja1HvEwvoaDiA==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.TestPlatform.ObjectModel": "17.9.0",
|
||||||
|
"Newtonsoft.Json": "13.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Microsoft.Xaml.Behaviors.Wpf": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.1.31",
|
||||||
|
"contentHash": "LZpuf82ACZWldmfMuv3CTUMDh3o0xo0uHUaybR5HgqVLDBJJ9RZLykplQ/bTJd0/VDt3EhD4iDgUgbdIUAM+Kg=="
|
||||||
|
},
|
||||||
|
"Mono.Cecil": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "0.11.5",
|
||||||
|
"contentHash": "fxfX+0JGTZ8YQeu1MYjbBiK2CYTSzDyEeIixt+yqKKTn7FW8rv7JMY70qevup4ZJfD7Kk/VG/jDzQQTpfch87g=="
|
||||||
|
},
|
||||||
|
"MonoMod.Backports": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.1.1",
|
||||||
|
"contentHash": "lExtjdkld5iWrhYEspoT1bvy0pJ4oBOBkKu+tWKabK1rHvjuS+gjbAd2bG62UGKc0JRBG3myaWtvgIIwYDw1bQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"MonoMod.ILHelpers": "1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MonoMod.Core": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.1.1",
|
||||||
|
"contentHash": "7m7RqlxiWHilriKwzbK+F1FZiJG1vvVzfzRktVnoRb4OKYfdRalost/78LYTNOp9htwLgPKojZydRsNlI1/qHw==",
|
||||||
|
"dependencies": {
|
||||||
|
"Mono.Cecil": "0.11.5",
|
||||||
|
"MonoMod.Backports": "1.1.1",
|
||||||
|
"MonoMod.ILHelpers": "1.0.1",
|
||||||
|
"MonoMod.Utils": "25.0.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MonoMod.ILHelpers": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.0.1",
|
||||||
|
"contentHash": "6djj/Hz+/eTomo1H/sJEJNxBz2ZdhXjvH0MOmyU2xRtbjaIfBQuyVV0zNUbJhMY/8qoWrz7WXfskfFhdaY0afA=="
|
||||||
|
},
|
||||||
|
"MonoMod.RuntimeDetour": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "25.1.1",
|
||||||
|
"contentHash": "05oD6LyB3N4eqssBbDHfywNBalBRleX3/HHOQxLhjAyl59tWfZFah2WN0nZ/mrwQ5We3tFIUEHAfbyUxlAbeFw==",
|
||||||
|
"dependencies": {
|
||||||
|
"Mono.Cecil": "0.11.5",
|
||||||
|
"MonoMod.Backports": "1.1.1",
|
||||||
|
"MonoMod.Core": "1.1.1",
|
||||||
|
"MonoMod.ILHelpers": "1.0.1",
|
||||||
|
"MonoMod.Utils": "25.0.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"MonoMod.Utils": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "25.0.5",
|
||||||
|
"contentHash": "1lcpjEOiK1dfOxG9DsKkHNcP4G0DZSwtBEOhTGDfszjCvmLzCZqqFQvSzLRpzp3wfTKak+R0K2K5O5TbO0kwvg==",
|
||||||
|
"dependencies": {
|
||||||
|
"Mono.Cecil": "0.11.5",
|
||||||
|
"MonoMod.Backports": "1.1.1",
|
||||||
|
"MonoMod.ILHelpers": "1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Newtonsoft.Json": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "13.0.3",
|
||||||
|
"contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
|
||||||
|
},
|
||||||
|
"NuGet.Commands": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "pI2X+KRQYsVcmjJUIAXT+8fvUCZgNWBQiSizKCOltRqaMjtUHLetfADfz7jfreOBohsDxNzhBnNqPQ8MU/Gjxw==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.FileProviders.Abstractions": "6.0.0",
|
||||||
|
"Microsoft.Extensions.FileSystemGlobbing": "6.0.0",
|
||||||
|
"NuGet.Credentials": "6.9.1",
|
||||||
|
"NuGet.ProjectModel": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Common": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "FbuWZBjQ1NJXBDqCwSddN2yvw3Plq3sTCIh0nc66Hu8jrNr+BOaxlKZv78jvJ+pSy8BvurYOdF9sl9KoORjrtg==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Frameworks": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Configuration": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "GM06pcUzWdNsizeGciqCjAhryfI1F/rQPETLDF+8pDRgzVpA+wKAR01/4aFU+IXzugnQ9LqOb5YyCRuR1OVZiQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Common": "6.9.1",
|
||||||
|
"System.Security.Cryptography.ProtectedData": "4.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Credentials": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "elTErAznCWoqOLILVDN4FTa3+rpVVdUbHUaOUqJkk9+Z/ZSqyDPbCIhLaqTkPkWqoKa93gqzX9IFwURkMphPnw==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Protocol": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.DependencyResolver.Core": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "gVWIEScv1K40H2Fvs6HGaOzRMpG+r1RUqYpBdh7gqQ18kgsswWUSr90jCNtBb7PUYKkMU1oAhxTslj/gQjO+Vw==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Configuration": "6.9.1",
|
||||||
|
"NuGet.LibraryModel": "6.9.1",
|
||||||
|
"NuGet.Protocol": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Frameworks": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "DaKh3lenPUvzGccPkbI97BIvA27z+/UsL3ankfoZlX/4vBVDK5N1sheFTQ+GuJf+IgSzsJz/A21SPUpQLHwUtA=="
|
||||||
|
},
|
||||||
|
"NuGet.LibraryModel": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "xlOpbZTc4862vKHkZHLJ5VgDteo+78ftVkajB8rKgSpevnBqwPKv2Y5OfUxct9HCqWYw0ikVfNf/qfjqnQCV1Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Common": "6.9.1",
|
||||||
|
"NuGet.Versioning": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Packaging": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "6FyasOxKInCELJ+pGy8f17ub9st6ofFeNcBNTo7CRiPJlxyhJfKGKNpfe3HHYwvnZhc3Vdfr0kSR+f1BVGDuTA==",
|
||||||
|
"dependencies": {
|
||||||
|
"Newtonsoft.Json": "13.0.3",
|
||||||
|
"NuGet.Configuration": "6.9.1",
|
||||||
|
"NuGet.Versioning": "6.9.1",
|
||||||
|
"System.Security.Cryptography.Pkcs": "6.0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.ProjectModel": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "x98QkS3oloaJfdSsDFOGTH5oeoHHTDoyTO7oyg/7g60be14AQowLqgPQV52Kuscl4lknx/3259RTxyDcbkdifQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.DependencyResolver.Core": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Protocol": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "h3bdjqUY4jvwM02D/7QM4FR8x/bbf4Pyjrc1Etw7an2OrWKPUSx0vJPdapKzioxIw7GXl/aVUM/DCeIc3S9brA==",
|
||||||
|
"dependencies": {
|
||||||
|
"NuGet.Packaging": "6.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"NuGet.Versioning": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.9.1",
|
||||||
|
"contentHash": "ypnSvEtpNGo48bAWn95J1oHChycCXcevFSbn53fqzLxlXFSZP7dawu8p/7mHAfGufZQSV2sBpW80XQGIfXO8kQ=="
|
||||||
|
},
|
||||||
|
"nulastudio.NetBeauty": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.1.4.4",
|
||||||
|
"contentHash": "Q+4H1o9tNVVHEm4VHQq1kglc+eNAwVdEKKnNKez0kDZHBPRE+ufXIgN6ucdvi1A462nFDstChLafMt36L3kXAw=="
|
||||||
|
},
|
||||||
|
"protobuf-net": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "3.2.30",
|
||||||
|
"contentHash": "C/UTlmxEJHAHpqm8xQK1UyJKaIynVCSNG4mVrbLgnZ7ccH28nN49O8iMJvKEodTgVbnimvy+3mIiAdW6mATwnw==",
|
||||||
|
"dependencies": {
|
||||||
|
"protobuf-net.Core": "3.2.30"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"protobuf-net.Core": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "3.2.30",
|
||||||
|
"contentHash": "v2ZxxYrz+X212ukSx+uqkLuPu414bvmSAnTyf+PBUKR9ENJxO4P/csorA/27456MCp1JNoMssDj/f91RDiwBfQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Collections.Immutable": "7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"SemanticVersioning": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.0.2",
|
||||||
|
"contentHash": "4EQgYdNZ92SyaO7YFk6olVnebF5V+jrHyMUjvPq89tLeMo8NSfgDF+6Zwq/lgh9j/0yfQp9Lkm0ZA0rUATCZFA=="
|
||||||
|
},
|
||||||
|
"SharpDX": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "4.2.0-keen-cringe",
|
||||||
|
"contentHash": "LaJN3h1Gi1FWVdef2I5WtOH9gwzKCBniH0CragarbkN2QheYY6Lqm+91PcOfp1w/4wdVb+k8Kjv3sO393Tphtw=="
|
||||||
|
},
|
||||||
|
"SixLabors.Core": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.0.0-beta0007",
|
||||||
|
"contentHash": "s9aPl6yxwcvoKRD0u0zjkCISZCCifbUi9/XVFjdvlx5Pt7vRYmGV0anq1EEftUjIEHbEu5aNBipbUSBIV2CE7w==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Runtime.CompilerServices.Unsafe": "4.5.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"SpaceEngineersDedicated.ReferenceAssemblies": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.204.15",
|
||||||
|
"contentHash": "xq1quPCVGi1d4D/iH2iwd8B+1OH5Lqi9H/ld8kaZN8fZ9axz2wtqdq3jYbe9r/FKdSaMhqaERD5W62sHuI9tPA==",
|
||||||
|
"dependencies": {
|
||||||
|
"SharpDX": "4.2.0-keen-cringe",
|
||||||
|
"protobuf-net": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.CodeDom": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "WTlRjL6KWIMr/pAaq3rYqh0TJlzpouaQ/W1eelssHgtlwHAH25jXTkUphTYx9HaIIf7XA6qs/0+YhtLEQRkJ+Q=="
|
||||||
|
},
|
||||||
|
"System.Collections.Immutable": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg=="
|
||||||
|
},
|
||||||
|
"System.ComponentModel.Annotations": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "5.0.0",
|
||||||
|
"contentHash": "dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg=="
|
||||||
|
},
|
||||||
|
"System.Formats.Asn1": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "AJukBuLoe3QeAF+mfaRKQb2dgyrvt340iMBHYv+VdBzCUM06IxGlvl0o/uPOS7lHnXPN6u8fFRHSHudx5aTi8w=="
|
||||||
|
},
|
||||||
|
"System.Linq.Async": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.0.1",
|
||||||
|
"contentHash": "0YhHcaroWpQ9UCot3Pizah7ryAzQhNvobLMSxeDIGmnXfkQn8u5owvpOH0K6EVB+z9L7u6Cc4W17Br/+jyttEQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Bcl.AsyncInterfaces": "6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Management": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "jrK22i5LRzxZCfGb+tGmke2VH7oE0DvcDlJ1HAKYU8cPmD8XnpUT0bYn2Gy98GEhGjtfbR/sxKTVb+dE770pfA==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.CodeDom": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Reflection.Metadata": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "ptvgrFh7PvWI8bcVqG5rsA/weWM09EnthFHR5SCnS6IN+P4mj6rE1lBDC4U8HL9/57htKAqy4KQ3bBj84cfYyQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Collections.Immutable": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Runtime.CompilerServices.Unsafe": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "6.0.0",
|
||||||
|
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.Pkcs": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Formats.Asn1": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.ProtectedData": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "4.4.0",
|
||||||
|
"contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog=="
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.Xml": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "HQSFbakswZ1OXFz2Bt3AJlC6ENDqWeVpgqhf213xqQUMDifzydOHIKVb1RV4prayobvR3ETIScMaQdDF2hwGZA==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Security.Cryptography.Pkcs": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Text.Encodings.Web": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
||||||
|
},
|
||||||
|
"System.Text.Json": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.3",
|
||||||
|
"contentHash": "hpagS9joOwv6efWfrMmV9MjQXpiXZH72PgN067Ysfr6AWMSD1/1hEcvh/U5mUpPLezEWsOJSuVrmqDIVD958iA==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Text.Encodings.Web": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Torch.SixLabors.ImageSharp": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.0.0-beta6",
|
||||||
|
"contentHash": "WJ7ocT79HgmuKi0+ltpvXTiMI80UcI3DeS8XSfYwJtTB1tcQws6zLPGuUwra6qe6qRrFfpABeDP3xvHV1rJgfg==",
|
||||||
|
"dependencies": {
|
||||||
|
"SixLabors.Core": "1.0.0-beta0007",
|
||||||
|
"System.Runtime.CompilerServices.Unsafe": "4.5.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xunit.abstractions": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.0.3",
|
||||||
|
"contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg=="
|
||||||
|
},
|
||||||
|
"xunit.analyzers": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "1.13.0",
|
||||||
|
"contentHash": "Pai9YnDV71/Ox14nBHB6/f62iyPyLbmUG/YYMiA4dfdFZvr0gIYE9yGxSr0i5Tr3INK75wgL2MCUNEKpeiZ2Fw=="
|
||||||
|
},
|
||||||
|
"xunit.assert": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.8.0",
|
||||||
|
"contentHash": "lwf7Dy5/5HbDkaPx1YrGXCByytCEEcIn+KPI74jh2BD/RU/7RhO8c+S3k0Ph+Mr7+cLf338fl+o6UcgPCLa6PA=="
|
||||||
|
},
|
||||||
|
"xunit.core": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.8.0",
|
||||||
|
"contentHash": "McSTFGTETCxLpmJKE9TWi9FtFthrRbpRrjz2V2g8sK2wRt1+JHs15vwi+B+nfftFkV9aFWIXZfzZM95TIGZNIA==",
|
||||||
|
"dependencies": {
|
||||||
|
"xunit.extensibility.core": "[2.8.0]",
|
||||||
|
"xunit.extensibility.execution": "[2.8.0]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xunit.extensibility.core": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.8.0",
|
||||||
|
"contentHash": "eBJv9xQeY0p5z+C/L1tFjUFYqtl5pQqIEYCGTMl+MbRzA7sOlgYKwJE//vEePBp+mgBh7NjD0Qhz0liZBYM27w==",
|
||||||
|
"dependencies": {
|
||||||
|
"xunit.abstractions": "2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xunit.extensibility.execution": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "2.8.0",
|
||||||
|
"contentHash": "TyyrZesHB9ODZMS9c73OqiBz4x0vL944JCkSPBWW5w6PF2LlUfdfXRjjOhoIOuY6lTmEgl07rS4/Jot9mCYnpg==",
|
||||||
|
"dependencies": {
|
||||||
|
"xunit.extensibility.core": "[2.8.0]"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"torch": {
|
||||||
|
"type": "Project",
|
||||||
|
"dependencies": {
|
||||||
|
"ControlzEx": "[5.0.2, )",
|
||||||
|
"HarmonyX": "[2.10.2-prerelease.7, )",
|
||||||
|
"MahApps.Metro": "[2.4.10, )",
|
||||||
|
"Microsoft.CodeAnalysis.CSharp": "[4.9.2, )",
|
||||||
|
"Microsoft.CodeAnalysis.Common": "[4.9.2, )",
|
||||||
|
"MonoMod.RuntimeDetour": "[25.1.1, )",
|
||||||
|
"NLog": "[5.3.2, )",
|
||||||
|
"System.ComponentModel.Annotations": "[5.0.0, )",
|
||||||
|
"Torch.API": "[1.0.0, )",
|
||||||
|
"Torch.SixLabors.ImageSharp": "[1.0.0-beta6, )",
|
||||||
|
"protobuf-net": "[3.2.30, )"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"torch.api": {
|
||||||
|
"type": "Project",
|
||||||
|
"dependencies": {
|
||||||
|
"JetBrains.Annotations": "[2023.3.0, )",
|
||||||
|
"Microsoft.Extensions.Configuration.Binder": "[8.0.1, )",
|
||||||
|
"NLog": "[5.3.2, )",
|
||||||
|
"NuGet.Commands": "[6.9.1, )",
|
||||||
|
"NuGet.DependencyResolver.Core": "[6.9.1, )",
|
||||||
|
"SemanticVersioning": "[2.0.2, )",
|
||||||
|
"SpaceEngineersDedicated.ReferenceAssemblies": "[1.204.15, )",
|
||||||
|
"System.Linq.Async": "[6.0.1, )",
|
||||||
|
"System.Text.Json": "[8.0.3, )"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"torch.server": {
|
||||||
|
"type": "Project",
|
||||||
|
"dependencies": {
|
||||||
|
"AutoCompleteTextBox": "[1.7.2, )",
|
||||||
|
"Ben.Demystifier": "[0.4.1, )",
|
||||||
|
"ControlzEx": "[5.0.2, )",
|
||||||
|
"MahApps.Metro": "[2.4.10, )",
|
||||||
|
"MdXaml": "[1.27.0, )",
|
||||||
|
"Microsoft.Bcl.AsyncInterfaces": "[8.0.0, )",
|
||||||
|
"Microsoft.Diagnostics.Runtime": "[3.1.512801, )",
|
||||||
|
"Microsoft.Extensions.Configuration.CommandLine": "[8.0.0, )",
|
||||||
|
"Microsoft.Extensions.Configuration.EnvironmentVariables": "[8.0.0, )",
|
||||||
|
"Microsoft.Extensions.Configuration.Xml": "[8.0.0, )",
|
||||||
|
"Microsoft.Extensions.Logging": "[8.0.0, )",
|
||||||
|
"NLog": "[5.3.2, )",
|
||||||
|
"System.ComponentModel.Annotations": "[5.0.0, )",
|
||||||
|
"System.Management": "[8.0.0, )",
|
||||||
|
"Torch": "[1.0.0, )",
|
||||||
|
"Torch.API": "[1.0.0, )",
|
||||||
|
"nulastudio.NetBeauty": "[2.1.4.4, )"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"torch.tests": {
|
||||||
|
"type": "Project",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NET.Test.Sdk": "[17.9.0, )",
|
||||||
|
"NLog": "[5.3.2, )",
|
||||||
|
"Torch": "[1.0.0, )",
|
||||||
|
"Torch.API": "[1.0.0, )",
|
||||||
|
"xunit": "[2.8.0, )"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"net8.0-windows7.0/win-x64": {
|
||||||
|
"System.Management": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "jrK22i5LRzxZCfGb+tGmke2VH7oE0DvcDlJ1HAKYU8cPmD8XnpUT0bYn2Gy98GEhGjtfbR/sxKTVb+dE770pfA==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.CodeDom": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.Pkcs": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "ULmp3xoOwNYjOYp4JZ2NK/6NdTgiN1GQXzVVN1njQ7LOZ0d0B9vyMnhyqbIi9Qw4JXj1JgCsitkTShboHRx7Eg==",
|
||||||
|
"dependencies": {
|
||||||
|
"System.Formats.Asn1": "8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Security.Cryptography.ProtectedData": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "4.4.0",
|
||||||
|
"contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog=="
|
||||||
|
},
|
||||||
|
"System.Text.Encodings.Web": {
|
||||||
|
"type": "Transitive",
|
||||||
|
"resolved": "8.0.0",
|
||||||
|
"contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using Torch.Commands;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Torch.Commands;
|
|
||||||
|
|
||||||
namespace Torch.Server.Commands
|
namespace Torch.Server.Commands
|
||||||
{
|
{
|
||||||
|
@@ -1,23 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Targets;
|
|
||||||
using Sandbox.Engine.Utils;
|
|
||||||
using Torch.Utils;
|
|
||||||
using VRage.FileSystem;
|
|
||||||
|
|
||||||
namespace Torch.Server
|
namespace Torch.Server
|
||||||
{
|
{
|
||||||
@@ -27,10 +17,10 @@ namespace Torch.Server
|
|||||||
|
|
||||||
private static readonly Logger Log = LogManager.GetLogger(nameof(Initializer));
|
private static readonly Logger Log = LogManager.GetLogger(nameof(Initializer));
|
||||||
private bool _init;
|
private bool _init;
|
||||||
private const string STEAMCMD_DIR = "steamcmd";
|
private const string TOOL_DIR = "tool";
|
||||||
private const string STEAMCMD_ZIP = "temp.zip";
|
private const string TOOL_ZIP = "temp.zip";
|
||||||
private static readonly string STEAMCMD_EXE = "steamcmd.exe";
|
private static readonly string TOOL_EXE = "steamcmd.exe";
|
||||||
private const string STEAMCMD_ARGS = "+force_install_dir \"{0}\" +login anonymous +app_update 298740 +quit";
|
private const string TOOL_ARGS = "+force_install_dir \"{0}\" +login anonymous +app_update 298740 +quit";
|
||||||
private TorchServer _server;
|
private TorchServer _server;
|
||||||
|
|
||||||
internal Persistent<TorchConfig> ConfigPersistent { get; }
|
internal Persistent<TorchConfig> ConfigPersistent { get; }
|
||||||
@@ -56,8 +46,8 @@ namespace Torch.Server
|
|||||||
Log.Debug("Debug logging enabled.");
|
Log.Debug("Debug logging enabled.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!configuration.GetValue("noupdate", false))
|
if (configuration.GetValue("getGameUpdates", true) && !configuration.GetValue("noupdate", false))
|
||||||
RunSteamCmd(configuration);
|
RunSteamCmdAsync(configuration).Wait();
|
||||||
|
|
||||||
var processPid = configuration.GetValue<int>("waitForPid");
|
var processPid = configuration.GetValue<int>("waitForPid");
|
||||||
if (processPid != 0)
|
if (processPid != 0)
|
||||||
@@ -83,9 +73,9 @@ namespace Torch.Server
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public void Run(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
_server = new TorchServer(Config, ApplicationContext.Current.InstanceDirectory.FullName, ApplicationContext.Current.InstanceName);
|
_server = new TorchServer(Config, ApplicationContext.Current.InstanceDirectory.FullName, ApplicationContext.Current.InstanceName, configuration);
|
||||||
|
|
||||||
if (ApplicationContext.Current.IsService || Config.NoGui)
|
if (ApplicationContext.Current.IsService || Config.NoGui)
|
||||||
{
|
{
|
||||||
@@ -102,53 +92,56 @@ namespace Torch.Server
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
var gameThread = new Thread(() =>
|
_server.Init();
|
||||||
|
|
||||||
|
var uiThread = new Thread(() =>
|
||||||
{
|
{
|
||||||
_server.Init();
|
var ui = new TorchUI(_server);
|
||||||
|
|
||||||
if (Config.Autostart || Config.TempAutostart)
|
SynchronizationContext.SetSynchronizationContext(
|
||||||
{
|
new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
|
||||||
Config.TempAutostart = false;
|
|
||||||
_server.Start();
|
ui.ShowDialog();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gameThread.Start();
|
uiThread.SetApartmentState(ApartmentState.STA);
|
||||||
|
uiThread.Start();
|
||||||
|
|
||||||
var ui = new TorchUI(_server);
|
if (Config.Autostart || Config.TempAutostart)
|
||||||
|
{
|
||||||
SynchronizationContext.SetSynchronizationContext(
|
Config.TempAutostart = false;
|
||||||
new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
|
_server.Start();
|
||||||
|
}
|
||||||
ui.ShowDialog();
|
|
||||||
|
uiThread.Join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RunSteamCmd(IConfiguration configuration)
|
public static async Task RunSteamCmdAsync(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
var log = LogManager.GetLogger("SteamCMD");
|
var log = LogManager.GetLogger("SteamCMD");
|
||||||
|
|
||||||
var path = configuration.GetValue<string>("steamCmdPath") ?? ApplicationContext.Current.TorchDirectory
|
|
||||||
.CreateSubdirectory(STEAMCMD_DIR).FullName;
|
|
||||||
|
|
||||||
|
var path = configuration.GetValue<string>("steamToolPath") ?? ApplicationContext.Current.TorchDirectory
|
||||||
|
.CreateSubdirectory(TOOL_DIR).FullName;
|
||||||
|
|
||||||
if (!Directory.Exists(path))
|
if (!Directory.Exists(path))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(path);
|
Directory.CreateDirectory(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
var steamCmdExePath = Path.Combine(path, STEAMCMD_EXE);
|
var toolExe = Path.Combine(path, TOOL_EXE);
|
||||||
if (!File.Exists(steamCmdExePath))
|
if (!File.Exists(toolExe))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
log.Info("Downloading SteamCMD.");
|
log.Info("Downloading SteamCMD.");
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
using (var file = File.Create(STEAMCMD_ZIP))
|
await using (var file = File.Create(TOOL_ZIP))
|
||||||
using (var stream = client.GetStreamAsync("https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip").Result)
|
await using (var stream = await client.GetStreamAsync("https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip"))
|
||||||
stream.CopyTo(file);
|
await stream.CopyToAsync(file);
|
||||||
|
|
||||||
ZipFile.ExtractToDirectory(STEAMCMD_ZIP, path);
|
ZipFile.ExtractToDirectory(TOOL_ZIP, path);
|
||||||
File.Delete(STEAMCMD_ZIP);
|
File.Delete(TOOL_ZIP);
|
||||||
log.Info("SteamCMD downloaded successfully!");
|
log.Info("SteamCMD downloaded successfully!");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -159,21 +152,18 @@ namespace Torch.Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Checking for DS updates.");
|
log.Info("Checking for DS updates.");
|
||||||
var steamCmdProc = new ProcessStartInfo(steamCmdExePath)
|
var steamCmdProc = new ProcessStartInfo(toolExe)
|
||||||
{
|
{
|
||||||
Arguments = string.Format(STEAMCMD_ARGS, configuration.GetValue("gamePath", "../")),
|
Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../")),
|
||||||
WorkingDirectory = path,
|
WorkingDirectory = path,
|
||||||
UseShellExecute = false,
|
RedirectStandardOutput = true
|
||||||
RedirectStandardOutput = true,
|
|
||||||
StandardOutputEncoding = Encoding.ASCII
|
|
||||||
};
|
};
|
||||||
var cmd = Process.Start(steamCmdProc);
|
var cmd = Process.Start(steamCmdProc)!;
|
||||||
|
|
||||||
// ReSharper disable once PossibleNullReferenceException
|
|
||||||
while (!cmd.HasExited)
|
while (!cmd.HasExited)
|
||||||
{
|
{
|
||||||
log.Info(cmd.StandardOutput.ReadLine());
|
if (await cmd.StandardOutput.ReadLineAsync() is { } line)
|
||||||
Thread.Sleep(100);
|
log.Info(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Threading;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Targets;
|
using NLog.Targets;
|
||||||
using Torch.Server.ViewModels;
|
using Torch.Server.ViewModels;
|
||||||
|
54
Torch.Server/Managers/ConsoleCommandManager.cs
Normal file
54
Torch.Server/Managers/ConsoleCommandManager.cs
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
using NLog;
|
||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using Torch.API;
|
||||||
|
using Torch.API.Managers;
|
||||||
|
using Torch.Commands;
|
||||||
|
using Torch.Managers;
|
||||||
|
|
||||||
|
namespace Torch.Server.Managers
|
||||||
|
{
|
||||||
|
internal class ConsoleCommandManager(ITorchBase torchInstance) : Manager(torchInstance)
|
||||||
|
{
|
||||||
|
private static readonly Logger Log = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
[Dependency]
|
||||||
|
private CommandManager _commandManager;
|
||||||
|
|
||||||
|
public override void Attach()
|
||||||
|
{
|
||||||
|
if (!Torch.Config.NoGui)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Log.Info("Starting console command listener");
|
||||||
|
|
||||||
|
new Thread(CommandListener)
|
||||||
|
{
|
||||||
|
Name = "Console Command Listener",
|
||||||
|
IsBackground = true,
|
||||||
|
}.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CommandListener()
|
||||||
|
{
|
||||||
|
while (Torch.GameState < TorchGameState.Unloading)
|
||||||
|
{
|
||||||
|
var line = Console.ReadLine();
|
||||||
|
|
||||||
|
if (line == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
Torch.Invoke(() =>
|
||||||
|
{
|
||||||
|
if (!_commandManager.HandleCommandFromServer(line, LogResponse))
|
||||||
|
Log.Error("Invalid input '{0}'", line);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LogResponse(TorchChatMessage message)
|
||||||
|
{
|
||||||
|
Log.Info(message.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -1,19 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Fluent;
|
|
||||||
using Torch.API;
|
using Torch.API;
|
||||||
using Torch.Collections;
|
using Torch.Collections;
|
||||||
using Torch.Managers;
|
using Torch.Managers;
|
||||||
using Torch.Server.ViewModels.Entities;
|
using Torch.Server.ViewModels.Entities;
|
||||||
using Torch.Utils;
|
|
||||||
|
|
||||||
namespace Torch.Server.Managers
|
namespace Torch.Server.Managers
|
||||||
{
|
{
|
||||||
|
@@ -1,20 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Text;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Havok;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using Sandbox;
|
using Sandbox;
|
||||||
using Sandbox.Engine.Networking;
|
|
||||||
using Sandbox.Engine.Utils;
|
using Sandbox.Engine.Utils;
|
||||||
using Sandbox.Game;
|
|
||||||
using Sandbox.Game.Gui;
|
|
||||||
using Torch.API;
|
using Torch.API;
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
using Torch.Collections;
|
using Torch.Collections;
|
||||||
@@ -22,20 +14,56 @@ using Torch.Managers;
|
|||||||
using Torch.Mod;
|
using Torch.Mod;
|
||||||
using Torch.Server.ViewModels;
|
using Torch.Server.ViewModels;
|
||||||
using Torch.Utils;
|
using Torch.Utils;
|
||||||
using VRage;
|
|
||||||
using VRage.FileSystem;
|
using VRage.FileSystem;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using VRage.Game.ObjectBuilder;
|
|
||||||
using VRage.ObjectBuilders;
|
using VRage.ObjectBuilders;
|
||||||
using VRage.Plugins;
|
using VRage.ObjectBuilders.Private;
|
||||||
|
|
||||||
namespace Torch.Server.Managers
|
namespace Torch.Server.Managers
|
||||||
{
|
{
|
||||||
public class InstanceManager : Manager, IInstanceManager
|
public class InstanceManager : Manager, IInstanceManager
|
||||||
{
|
{
|
||||||
private const string CONFIG_NAME = "SpaceEngineers-Dedicated.cfg";
|
private const string CONFIG_NAME = "SpaceEngineers-Dedicated.cfg";
|
||||||
|
|
||||||
|
private Action<ConfigDedicatedViewModel> _instanceLoaded;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the instance loaded event.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Called when the instance is loaded and immediately if subscribed after the instance is loaded.
|
||||||
|
/// </remarks>
|
||||||
|
public event Action<ConfigDedicatedViewModel> InstanceLoaded
|
||||||
|
{
|
||||||
|
add
|
||||||
|
{
|
||||||
|
var action = _instanceLoaded;
|
||||||
|
Action<ConfigDedicatedViewModel> action2;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
action2 = action;
|
||||||
|
var action3 = (Action<ConfigDedicatedViewModel>)Delegate.Combine(action2, value);
|
||||||
|
action = Interlocked.CompareExchange(ref _instanceLoaded, action3, action2);
|
||||||
|
}
|
||||||
|
while (action != action2);
|
||||||
|
|
||||||
|
if (DedicatedConfig is not null)
|
||||||
|
value(DedicatedConfig);
|
||||||
|
}
|
||||||
|
remove
|
||||||
|
{
|
||||||
|
var action = _instanceLoaded;
|
||||||
|
Action<ConfigDedicatedViewModel> action2;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
action2 = action;
|
||||||
|
var action3 = (Action<ConfigDedicatedViewModel>)Delegate.Remove(action2, value);
|
||||||
|
action = Interlocked.CompareExchange(ref _instanceLoaded, action3, action2);
|
||||||
|
}
|
||||||
|
while (action != action2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public event Action<ConfigDedicatedViewModel> InstanceLoaded;
|
|
||||||
public ConfigDedicatedViewModel DedicatedConfig { get; set; }
|
public ConfigDedicatedViewModel DedicatedConfig { get; set; }
|
||||||
private static readonly Logger Log = LogManager.GetLogger(nameof(InstanceManager));
|
private static readonly Logger Log = LogManager.GetLogger(nameof(InstanceManager));
|
||||||
[Dependency]
|
[Dependency]
|
||||||
@@ -102,7 +130,7 @@ namespace Torch.Server.Managers
|
|||||||
|
|
||||||
SelectWorld(DedicatedConfig.LoadWorld ?? DedicatedConfig.Worlds.First().WorldPath, false);
|
SelectWorld(DedicatedConfig.LoadWorld ?? DedicatedConfig.Worlds.First().WorldPath, false);
|
||||||
|
|
||||||
InstanceLoaded?.Invoke(DedicatedConfig);
|
_instanceLoaded?.Invoke(DedicatedConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SelectCreatedWorld(string worldPath)
|
public void SelectCreatedWorld(string worldPath)
|
||||||
@@ -146,7 +174,7 @@ namespace Torch.Server.Managers
|
|||||||
{
|
{
|
||||||
DedicatedConfig.Mods.Clear();
|
DedicatedConfig.Mods.Clear();
|
||||||
//remove the Torch mod to avoid running multiple copies of it
|
//remove the Torch mod to avoid running multiple copies of it
|
||||||
DedicatedConfig.SelectedWorld.WorldConfiguration.Mods.RemoveAll(m => m.PublishedFileId == TorchModCore.MOD_ID);
|
DedicatedConfig.SelectedWorld.WorldConfiguration.Mods.RemoveAll(m => m.PublishedFileId == ModCommunication.MOD_ID);
|
||||||
foreach (var m in DedicatedConfig.SelectedWorld.WorldConfiguration.Mods)
|
foreach (var m in DedicatedConfig.SelectedWorld.WorldConfiguration.Mods)
|
||||||
DedicatedConfig.Mods.Add(new ModItemInfo(m));
|
DedicatedConfig.Mods.Add(new ModItemInfo(m));
|
||||||
Task.Run(() => DedicatedConfig.UpdateAllModInfosAsync());
|
Task.Run(() => DedicatedConfig.UpdateAllModInfosAsync());
|
||||||
@@ -161,7 +189,7 @@ namespace Torch.Server.Managers
|
|||||||
{
|
{
|
||||||
DedicatedConfig.Mods.Clear();
|
DedicatedConfig.Mods.Clear();
|
||||||
//remove the Torch mod to avoid running multiple copies of it
|
//remove the Torch mod to avoid running multiple copies of it
|
||||||
DedicatedConfig.SelectedWorld.WorldConfiguration.Mods.RemoveAll(m => m.PublishedFileId == TorchModCore.MOD_ID);
|
DedicatedConfig.SelectedWorld.WorldConfiguration.Mods.RemoveAll(m => m.PublishedFileId == ModCommunication.MOD_ID);
|
||||||
foreach (var m in DedicatedConfig.SelectedWorld.WorldConfiguration.Mods)
|
foreach (var m in DedicatedConfig.SelectedWorld.WorldConfiguration.Mods)
|
||||||
DedicatedConfig.Mods.Add(new ModItemInfo(m));
|
DedicatedConfig.Mods.Add(new ModItemInfo(m));
|
||||||
Task.Run(() => DedicatedConfig.UpdateAllModInfosAsync());
|
Task.Run(() => DedicatedConfig.UpdateAllModInfosAsync());
|
||||||
@@ -324,10 +352,10 @@ namespace Torch.Server.Managers
|
|||||||
public void SaveSandbox()
|
public void SaveSandbox()
|
||||||
{
|
{
|
||||||
using (var f = File.Open(_checkpointPath, FileMode.Create))
|
using (var f = File.Open(_checkpointPath, FileMode.Create))
|
||||||
MyObjectBuilderSerializer.SerializeXML(f, Checkpoint);
|
MyObjectBuilderSerializerKeen.SerializeXML(f, Checkpoint);
|
||||||
|
|
||||||
using (var f = File.Open(_worldConfigPath, FileMode.Create))
|
using (var f = File.Open(_worldConfigPath, FileMode.Create))
|
||||||
MyObjectBuilderSerializer.SerializeXML(f, WorldConfiguration);
|
MyObjectBuilderSerializerKeen.SerializeXML(f, WorldConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadSandbox()
|
public void LoadSandbox()
|
||||||
|
@@ -2,11 +2,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Fluent;
|
|
||||||
using Sandbox;
|
using Sandbox;
|
||||||
using Sandbox.Engine.Multiplayer;
|
using Sandbox.Engine.Multiplayer;
|
||||||
using Sandbox.Engine.Networking;
|
using Sandbox.Engine.Networking;
|
||||||
@@ -16,12 +13,10 @@ using Torch.API;
|
|||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
using Torch.Managers;
|
using Torch.Managers;
|
||||||
using Torch.Utils;
|
using Torch.Utils;
|
||||||
using Torch.ViewModels;
|
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using VRage.Game.ModAPI;
|
using VRage.Game.ModAPI;
|
||||||
using VRage.GameServices;
|
using VRage.GameServices;
|
||||||
using VRage.Network;
|
using VRage.Network;
|
||||||
using VRage.Steam;
|
|
||||||
|
|
||||||
namespace Torch.Server.Managers
|
namespace Torch.Server.Managers
|
||||||
{
|
{
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using NLog;
|
|
||||||
using Sandbox;
|
|
||||||
using Torch.API.Event;
|
using Torch.API.Event;
|
||||||
using Torch.Event;
|
using Torch.Event;
|
||||||
using VRage.Network;
|
using VRage.Network;
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
using Sandbox.Engine.Multiplayer;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using NLog;
|
|
||||||
using Sandbox.Engine.Multiplayer;
|
|
||||||
using Torch.Managers.PatchManager;
|
using Torch.Managers.PatchManager;
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@ namespace Torch.Server.Managers
|
|||||||
{
|
{
|
||||||
if (newstate == TorchGameState.Loading && MySandboxGame.ConfigDedicated.RemoteApiEnabled && !string.IsNullOrEmpty(MySandboxGame.ConfigDedicated.RemoteSecurityKey))
|
if (newstate == TorchGameState.Loading && MySandboxGame.ConfigDedicated.RemoteApiEnabled && !string.IsNullOrEmpty(MySandboxGame.ConfigDedicated.RemoteSecurityKey))
|
||||||
{
|
{
|
||||||
var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
|
var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiIP, MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
|
||||||
LogManager.GetCurrentClassLogger().Info($"Remote API started on port {myRemoteServer.Port}");
|
LogManager.GetCurrentClassLogger().Info($"Remote API started on port {myRemoteServer.Port}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.Runtime.InteropServices;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.Server
|
namespace Torch.Server
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using Sandbox.Game.World;
|
using Sandbox.Game.World;
|
||||||
using Torch.Managers.PatchManager;
|
using Torch.Managers.PatchManager;
|
||||||
|
@@ -1,15 +1,10 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Sandbox.Engine.Multiplayer;
|
using Sandbox.Engine.Multiplayer;
|
||||||
using Sandbox.Game.World;
|
|
||||||
using Torch.API.Managers;
|
|
||||||
using Torch.Managers.PatchManager;
|
using Torch.Managers.PatchManager;
|
||||||
using Torch.Managers.PatchManager.MSIL;
|
using Torch.Managers.PatchManager.MSIL;
|
||||||
using Torch.Server.Managers;
|
|
||||||
using VRage.Game.ModAPI;
|
|
||||||
|
|
||||||
namespace Torch.Patches
|
namespace Torch.Patches
|
||||||
{
|
{
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.Configuration.Xml;
|
|
||||||
using NLog;
|
|
||||||
using NLog.Config;
|
using NLog.Config;
|
||||||
using NLog.Targets;
|
using NLog.Targets;
|
||||||
using Torch.API;
|
using Torch.API;
|
||||||
@@ -12,7 +10,7 @@ namespace Torch.Server
|
|||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
[STAThread]
|
[MTAThread]
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var configurationBuilder = new ConfigurationBuilder()
|
var configurationBuilder = new ConfigurationBuilder()
|
||||||
@@ -39,7 +37,7 @@ namespace Torch.Server
|
|||||||
context.GameBinariesDirectory.FullName);
|
context.GameBinariesDirectory.FullName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
initializer.Run();
|
initializer.Run(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetupLogging(IApplicationContext context, IConfiguration configuration)
|
private static void SetupLogging(IApplicationContext context, IConfiguration configuration)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,26 +1,20 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net7-windows</TargetFramework>
|
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
|
||||||
<PublishUrl>publish\</PublishUrl>
|
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<AssemblyTitle>Torch Server</AssemblyTitle>
|
<AssemblyTitle>Torch Server</AssemblyTitle>
|
||||||
<Product>Torch</Product>
|
<Product>Torch</Product>
|
||||||
<Copyright>Copyright © Torch API 2017</Copyright>
|
<Copyright>Copyright © Torch API 2017</Copyright>
|
||||||
<OutputPath>..\bin\$(Platform)\$(Configuration)\</OutputPath>
|
<OutputPath>..\bin\$(Platform)\$(Configuration)\</OutputPath>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||||
<NeutralLanguage>en</NeutralLanguage>
|
<NeutralLanguage>en</NeutralLanguage>
|
||||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
|
||||||
<TieredPGO>true</TieredPGO>
|
<TieredPGO>true</TieredPGO>
|
||||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<BeautyLibsDir>torch64</BeautyLibsDir>
|
<BeautyLibsDir>torch64</BeautyLibsDir>
|
||||||
<NoBeautyFlag>True</NoBeautyFlag>
|
|
||||||
<ForceBeauty>True</ForceBeauty>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@@ -32,29 +26,26 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoCompleteTextBox" Version="1.6.0" />
|
<PackageReference Include="AutoCompleteTextBox" Version="1.7.2" />
|
||||||
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
|
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
|
||||||
<PackageReference Include="ControlzEx" Version="5.0.2" />
|
<PackageReference Include="ControlzEx" Version="5.0.2" />
|
||||||
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
|
<PackageReference Include="MahApps.Metro" Version="2.4.10" />
|
||||||
<PackageReference Include="MdXaml" Version="1.16.2" />
|
<PackageReference Include="MdXaml" Version="1.27.0" />
|
||||||
<PackageReference Include="Microsoft.Diagnostics.Runtime" Version="2.2.343001" />
|
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Diagnostics.Runtime" Version="3.1.512801" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="8.0.0" />
|
||||||
<PackageReference Include="NLog" Version="5.1.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
||||||
<PackageReference Include="PropertyChanged.Fody" Version="4.0.3" PrivateAssets="all" />
|
<PackageReference Include="NLog" Version="5.3.2" />
|
||||||
<PackageReference Include="Steamworks.NET" Version="20.1.0">
|
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="all" />
|
||||||
|
<PackageReference Include="Steamworks.NET" Version="20.2.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>compile</IncludeAssets>
|
<IncludeAssets>compile</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
<PackageReference Include="System.Management" Version="7.0.0" />
|
<PackageReference Include="System.Management" Version="8.0.0" />
|
||||||
<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.2.9.3" />
|
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.4" />
|
||||||
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.201.13">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
<IncludeAssets>compile</IncludeAssets>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -119,6 +119,9 @@ public class TorchConfig : ViewModel, ITorchConfig
|
|||||||
SourceType = UpdateSourceType.Github
|
SourceType = UpdateSourceType.Github
|
||||||
};
|
};
|
||||||
|
|
||||||
|
[Display(Name = "Packages", Description = "Packages to install and use.", GroupName = "Server")]
|
||||||
|
public List<string> Packages { get; set; } = new();
|
||||||
|
|
||||||
// for backward compatibility
|
// for backward compatibility
|
||||||
public void Save(string path = null) => Initializer.Instance?.ConfigPersistent?.Save(path);
|
public void Save(string path = null) => Initializer.Instance?.ConfigPersistent?.Save(path);
|
||||||
}
|
}
|
@@ -8,6 +8,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Microsoft.Diagnostics.Runtime;
|
using Microsoft.Diagnostics.Runtime;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
using NLog;
|
using NLog;
|
||||||
using PropertyChanged;
|
using PropertyChanged;
|
||||||
using Sandbox;
|
using Sandbox;
|
||||||
@@ -19,7 +20,6 @@ using Torch.API.Managers;
|
|||||||
using Torch.API.Session;
|
using Torch.API.Session;
|
||||||
using Torch.Commands;
|
using Torch.Commands;
|
||||||
using Torch.Managers.PatchManager;
|
using Torch.Managers.PatchManager;
|
||||||
using Torch.Mod;
|
|
||||||
using Torch.Server.Commands;
|
using Torch.Server.Commands;
|
||||||
using Torch.Server.Managers;
|
using Torch.Server.Managers;
|
||||||
using Torch.Utils;
|
using Torch.Utils;
|
||||||
@@ -46,8 +46,9 @@ namespace Torch.Server
|
|||||||
|
|
||||||
//Here to trigger rebuild
|
//Here to trigger rebuild
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public TorchServer(ITorchConfig config, string instancePath, string instanceName) : base(config)
|
public TorchServer(ITorchConfig config, string instancePath, string instanceName, IConfiguration configuration) : base(config)
|
||||||
{
|
{
|
||||||
|
Configuration = configuration;
|
||||||
InstancePath = instancePath;
|
InstancePath = instancePath;
|
||||||
InstanceName = instanceName;
|
InstanceName = instanceName;
|
||||||
DedicatedInstance = new InstanceManager(this);
|
DedicatedInstance = new InstanceManager(this);
|
||||||
@@ -57,7 +58,8 @@ namespace Torch.Server
|
|||||||
AddManager(new RemoteAPIManager(this));
|
AddManager(new RemoteAPIManager(this));
|
||||||
|
|
||||||
var sessionManager = Managers.GetManager<ITorchSessionManager>();
|
var sessionManager = Managers.GetManager<ITorchSessionManager>();
|
||||||
sessionManager.AddFactory(x => new MultiplayerManagerDedicated(this));
|
sessionManager.AddFactory(_ => new MultiplayerManagerDedicated(this));
|
||||||
|
sessionManager.AddFactory(_ => new ConsoleCommandManager(this));
|
||||||
sessionManager.SessionStateChanged += OnSessionStateChanged;
|
sessionManager.SessionStateChanged += OnSessionStateChanged;
|
||||||
|
|
||||||
// Needs to be done at some point after MyVRageWindows.Init
|
// Needs to be done at some point after MyVRageWindows.Init
|
||||||
@@ -67,6 +69,14 @@ namespace Torch.Server
|
|||||||
|
|
||||||
_simUpdateTimer.Elapsed += SimUpdateElapsed;
|
_simUpdateTimer.Elapsed += SimUpdateElapsed;
|
||||||
_simUpdateTimer.Start();
|
_simUpdateTimer.Start();
|
||||||
|
|
||||||
|
Console.CancelKeyPress += (_, _) =>
|
||||||
|
{
|
||||||
|
if (State == ServerState.Running)
|
||||||
|
Stop();
|
||||||
|
|
||||||
|
Destroy();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SimUpdateElapsed(object sender, System.Timers.ElapsedEventArgs e)
|
private void SimUpdateElapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||||
@@ -119,7 +129,38 @@ namespace Torch.Server
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ServerState State { get; private set; }
|
public ServerState State { get; private set; }
|
||||||
|
|
||||||
public event Action<ITorchServer> Initialized;
|
private Action<ITorchServer> _initializedEvent;
|
||||||
|
|
||||||
|
public event Action<ITorchServer> Initialized
|
||||||
|
{
|
||||||
|
add
|
||||||
|
{
|
||||||
|
var action = _initializedEvent;
|
||||||
|
Action<ITorchServer> action2;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
action2 = action;
|
||||||
|
var action3 = (Action<ITorchServer>)Delegate.Combine(action2, value);
|
||||||
|
action = Interlocked.CompareExchange(ref _initializedEvent, action3, action2);
|
||||||
|
}
|
||||||
|
while (action != action2);
|
||||||
|
|
||||||
|
if (GetManager<InstanceManager>().DedicatedConfig != null)
|
||||||
|
value(this); //if already initialized
|
||||||
|
}
|
||||||
|
remove
|
||||||
|
{
|
||||||
|
var action = _initializedEvent;
|
||||||
|
Action<ITorchServer> action2;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
action2 = action;
|
||||||
|
var action3 = (Action<ITorchServer>)Delegate.Remove(action2, value);
|
||||||
|
action = Interlocked.CompareExchange(ref _initializedEvent, action3, action2);
|
||||||
|
}
|
||||||
|
while (action != action2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int OnlinePlayers { get; private set; }
|
public int OnlinePlayers { get; private set; }
|
||||||
|
|
||||||
@@ -130,10 +171,12 @@ namespace Torch.Server
|
|||||||
base.Init();
|
base.Init();
|
||||||
GetManager<InstanceManager>().LoadInstance(InstancePath);
|
GetManager<InstanceManager>().LoadInstance(InstancePath);
|
||||||
CanRun = true;
|
CanRun = true;
|
||||||
Initialized?.Invoke(this);
|
_initializedEvent?.Invoke(this);
|
||||||
Log.Info($"Initialized server '{InstanceName}' at '{InstancePath}'");
|
Log.Info($"Initialized server '{InstanceName}' at '{InstancePath}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override IConfiguration Configuration { get; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Start()
|
public override void Start()
|
||||||
{
|
{
|
||||||
@@ -201,12 +244,28 @@ namespace Torch.Server
|
|||||||
|
|
||||||
new Thread(() =>
|
new Thread(() =>
|
||||||
{
|
{
|
||||||
|
if (save)
|
||||||
|
{
|
||||||
|
var saveResult = Save().Result;
|
||||||
|
if (saveResult is not (GameSaveResult.Success or GameSaveResult.TimedOut))
|
||||||
|
{
|
||||||
|
Log.Error("Save failed due to {Reason}. Restart aborted!", saveResult);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StopInternal();
|
StopInternal();
|
||||||
|
Destroy();
|
||||||
LogManager.Flush();
|
LogManager.Flush();
|
||||||
|
|
||||||
|
if (
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Environment.Exit(0);
|
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
|
||||||
|
true ||
|
||||||
#endif
|
#endif
|
||||||
|
ApplicationContext.Current.IsService
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
|
||||||
var exe = Path.Combine(AppContext.BaseDirectory, "Torch.Server.exe");
|
var exe = Path.Combine(AppContext.BaseDirectory, "Torch.Server.exe");
|
||||||
|
|
||||||
@@ -226,8 +285,6 @@ namespace Torch.Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
Process.Start(exe, $"--waitForPid {Environment.ProcessId} --tempAutostart true {string.Join(" ", args)}");
|
Process.Start(exe, $"--waitForPid {Environment.ProcessId} --tempAutostart true {string.Join(" ", args)}");
|
||||||
|
|
||||||
Environment.Exit(0);
|
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
Name = "Restart thread"
|
Name = "Restart thread"
|
||||||
@@ -242,14 +299,12 @@ namespace Torch.Server
|
|||||||
case TorchSessionState.Unloading:
|
case TorchSessionState.Unloading:
|
||||||
_watchdog?.Dispose();
|
_watchdog?.Dispose();
|
||||||
_watchdog = null;
|
_watchdog = null;
|
||||||
ModCommunication.Unregister();
|
|
||||||
break;
|
break;
|
||||||
case TorchSessionState.Loaded:
|
case TorchSessionState.Loaded:
|
||||||
_multiplayerManagerDedicated = CurrentSession.Managers.GetManager<MultiplayerManagerDedicated>();
|
_multiplayerManagerDedicated = CurrentSession.Managers.GetManager<MultiplayerManagerDedicated>();
|
||||||
_multiplayerManagerDedicated.PlayerJoined += MultiplayerManagerDedicatedOnPlayerJoined;
|
_multiplayerManagerDedicated.PlayerJoined += MultiplayerManagerDedicatedOnPlayerJoined;
|
||||||
_multiplayerManagerDedicated.PlayerLeft += MultiplayerManagerDedicatedOnPlayerLeft;
|
_multiplayerManagerDedicated.PlayerLeft += MultiplayerManagerDedicatedOnPlayerLeft;
|
||||||
CurrentSession.Managers.GetManager<CommandManager>().RegisterCommandModule(typeof(WhitelistCommands));
|
CurrentSession.Managers.GetManager<CommandManager>().RegisterCommandModule(typeof(WhitelistCommands));
|
||||||
ModCommunication.Register();
|
|
||||||
break;
|
break;
|
||||||
case TorchSessionState.Loading:
|
case TorchSessionState.Loading:
|
||||||
case TorchSessionState.Unloaded:
|
case TorchSessionState.Unloaded:
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using NLog;
|
using NLog;
|
||||||
using VRage;
|
using VRage;
|
||||||
@@ -31,9 +32,25 @@ internal class UnhandledExceptionHandler
|
|||||||
{
|
{
|
||||||
Console.WriteLine("Restarting in 5 seconds.");
|
Console.WriteLine("Restarting in 5 seconds.");
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000);
|
||||||
var exe = typeof(Program).Assembly.Location;
|
|
||||||
|
|
||||||
Process.Start(exe, $"-waitForPid {Environment.ProcessId} {_config}");
|
var exe = Path.Combine(AppContext.BaseDirectory, "Torch.Server.exe");
|
||||||
|
|
||||||
|
var args = Environment.GetCommandLineArgs();
|
||||||
|
|
||||||
|
for (var i = 0; i < args.Length; i++)
|
||||||
|
{
|
||||||
|
if (args[i].Contains(' '))
|
||||||
|
args[i] = $"\"{args[i]}\"";
|
||||||
|
|
||||||
|
if (!args[i].Contains("--tempAutostart", StringComparison.InvariantCultureIgnoreCase) &&
|
||||||
|
!args[i].Contains("--waitForPid", StringComparison.InvariantCultureIgnoreCase))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
args[i] = string.Empty;
|
||||||
|
args[++i] = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
Process.Start(exe, $"--waitForPid {Environment.ProcessId} --tempAutostart true {string.Join(" ", args)}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -1,12 +1,4 @@
|
|||||||
using System;
|
namespace Torch.Server.ViewModels
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using VRage.Game;
|
|
||||||
|
|
||||||
namespace Torch.Server.ViewModels
|
|
||||||
{
|
{
|
||||||
public class BlockLimitViewModel : ViewModel
|
public class BlockLimitViewModel : ViewModel
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Torch.Collections;
|
|
||||||
using VRage;
|
using VRage;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using VRage.Game.ModAPI;
|
using VRage.Game.ModAPI;
|
||||||
|
@@ -1,14 +1,10 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Sandbox.Engine.Utils;
|
using Sandbox.Engine.Utils;
|
||||||
using Torch.Collections;
|
using Torch.Collections;
|
||||||
using Torch.Server.Managers;
|
using Torch.Server.Managers;
|
||||||
using Torch.Utils;
|
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using VRage.GameServices;
|
|
||||||
|
|
||||||
namespace Torch.Server.ViewModels
|
namespace Torch.Server.ViewModels
|
||||||
{
|
{
|
||||||
|
@@ -1,10 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing.Text;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Sandbox.Game.Entities.Cube;
|
using Sandbox.Game.Entities.Cube;
|
||||||
using Sandbox.ModAPI;
|
using Sandbox.ModAPI;
|
||||||
using Sandbox.ModAPI.Interfaces;
|
using Sandbox.ModAPI.Interfaces;
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Sandbox.ModAPI;
|
|
||||||
using Sandbox.ModAPI.Interfaces;
|
using Sandbox.ModAPI.Interfaces;
|
||||||
|
|
||||||
namespace Torch.Server.ViewModels.Blocks
|
namespace Torch.Server.ViewModels.Blocks
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.Windows;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace Torch.Server.ViewModels.Entities
|
namespace Torch.Server.ViewModels.Entities
|
||||||
{
|
{
|
||||||
|
@@ -1,16 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Controls;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using Sandbox.Game.Entities;
|
using Sandbox.Game.Entities;
|
||||||
using Sandbox.Game.World;
|
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
using Torch.Collections;
|
using Torch.Collections;
|
||||||
using Torch.Server.Managers;
|
using Torch.Server.Managers;
|
||||||
using Torch.Utils;
|
using Torch.Utils;
|
||||||
using VRage.Game.Entity;
|
|
||||||
using VRage.Game.ModAPI;
|
|
||||||
using VRage.ModAPI;
|
using VRage.ModAPI;
|
||||||
using VRageMath;
|
using VRageMath;
|
||||||
|
|
||||||
|
@@ -1,12 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using Sandbox.Definitions;
|
using Sandbox.Definitions;
|
||||||
using Sandbox.Game.Entities;
|
using Sandbox.Game.Entities;
|
||||||
using Sandbox.Game.Entities.Cube;
|
using Sandbox.Game.Entities.Cube;
|
||||||
using Sandbox.ModAPI;
|
|
||||||
using Torch.API.Managers;
|
|
||||||
using Torch.Collections;
|
using Torch.Collections;
|
||||||
using Torch.Server.ViewModels.Blocks;
|
using Torch.Server.ViewModels.Blocks;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using Sandbox.Game.Entities;
|
||||||
using System.Linq;
|
|
||||||
using Sandbox.Game.Entities;
|
|
||||||
using VRage.Game.Entity;
|
|
||||||
using VRage.Game.ModAPI;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Torch.Collections;
|
using Torch.Collections;
|
||||||
|
|
||||||
|
@@ -1,18 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using Sandbox.Game.Entities;
|
using Sandbox.Game.Entities;
|
||||||
using Sandbox.Game.Entities.Character;
|
using Sandbox.Game.Entities.Character;
|
||||||
using Torch.Server.ViewModels.Entities;
|
using Torch.Server.ViewModels.Entities;
|
||||||
using VRage.Game.ModAPI;
|
|
||||||
using VRage.ModAPI;
|
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Torch.Collections;
|
using Torch.Collections;
|
||||||
using Torch.Server.Views.Entities;
|
|
||||||
|
|
||||||
namespace Torch.Server.ViewModels
|
namespace Torch.Server.ViewModels
|
||||||
{
|
{
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Torch.Server.ViewModels
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Torch.Server.ViewModels
|
|
||||||
{
|
{
|
||||||
public interface ILazyLoad
|
public interface ILazyLoad
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,6 @@
|
|||||||
using System;
|
using System.Threading.Tasks;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using Torch.Utils;
|
|
||||||
using VRage.GameServices;
|
|
||||||
|
|
||||||
namespace Torch.Server.ViewModels
|
namespace Torch.Server.ViewModels
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Torch.API;
|
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
using Torch.API.Plugins;
|
using Torch.API.Plugins;
|
||||||
using Torch.Collections;
|
using Torch.Collections;
|
||||||
|
@@ -1,13 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using NLog;
|
using NLog;
|
||||||
using Torch.API;
|
|
||||||
using Torch.API.Plugins;
|
using Torch.API.Plugins;
|
||||||
using Torch.Server.Views;
|
using Torch.Server.Views;
|
||||||
|
|
||||||
|
@@ -1,14 +1,7 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
using Torch;
|
|
||||||
using Torch.Collections;
|
|
||||||
using Torch.Views;
|
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
using VRage.Library.Utils;
|
using VRage.Library.Utils;
|
||||||
using VRage.Serialization;
|
|
||||||
|
|
||||||
namespace Torch.Server.ViewModels
|
namespace Torch.Server.ViewModels
|
||||||
{
|
{
|
||||||
|
@@ -1,17 +1,5 @@
|
|||||||
using System;
|
using System.Text.RegularExpressions;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace Torch.Server
|
namespace Torch.Server
|
||||||
{
|
{
|
||||||
|
@@ -1,35 +1,20 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using Torch;
|
|
||||||
using Sandbox;
|
|
||||||
using Sandbox.Engine.Multiplayer;
|
|
||||||
using Sandbox.Game.Gui;
|
using Sandbox.Game.Gui;
|
||||||
using Sandbox.Game.Multiplayer;
|
|
||||||
using Sandbox.Game.World;
|
using Sandbox.Game.World;
|
||||||
using Torch.API;
|
using Torch.API;
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
using Torch.API.Session;
|
using Torch.API.Session;
|
||||||
using Torch.Managers;
|
|
||||||
using Torch.Server.Managers;
|
|
||||||
using Torch.Server.Views;
|
using Torch.Server.Views;
|
||||||
using VRage.Game;
|
|
||||||
using Color = VRageMath.Color;
|
using Color = VRageMath.Color;
|
||||||
|
|
||||||
namespace Torch.Server
|
namespace Torch.Server
|
||||||
|
@@ -6,17 +6,14 @@ using System.Runtime.CompilerServices;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using Sandbox;
|
using Sandbox;
|
||||||
using Torch.API;
|
using Torch.API;
|
||||||
using Torch.API.Managers;
|
using Torch.API.Managers;
|
||||||
using Torch.Server.Annotations;
|
|
||||||
using Torch.Server.Managers;
|
using Torch.Server.Managers;
|
||||||
using Torch.Server.ViewModels;
|
using Torch.Server.ViewModels;
|
||||||
using Torch.Views;
|
|
||||||
using VRage.Game.ModAPI;
|
using VRage.Game.ModAPI;
|
||||||
using VRage.Serialization;
|
|
||||||
|
|
||||||
namespace Torch.Server.Views
|
namespace Torch.Server.Views
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
|
|
||||||
namespace Torch.Server.Views.Converters
|
namespace Torch.Server.Views.Converters
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sandbox.Definitions;
|
using Sandbox.Definitions;
|
||||||
using VRage.Game;
|
using VRage.Game;
|
||||||
|
@@ -3,11 +3,8 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Navigation;
|
|
||||||
|
|
||||||
namespace Torch.Server.Views.Converters
|
namespace Torch.Server.Views.Converters
|
||||||
{
|
{
|
||||||
|
@@ -1,16 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using Sandbox.Engine.Networking;
|
|
||||||
using Torch.Server.ViewModels;
|
using Torch.Server.ViewModels;
|
||||||
using Torch.Utils;
|
using Torch.Utils;
|
||||||
using VRage.Game;
|
|
||||||
|
|
||||||
namespace Torch.Server.Views.Converters
|
namespace Torch.Server.Views.Converters
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using VRageMath;
|
using VRageMath;
|
||||||
|
|
||||||
|
@@ -1,22 +1,5 @@
|
|||||||
using System;
|
using System.Windows;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using Sandbox.ModAPI;
|
|
||||||
using Sandbox.ModAPI.Interfaces;
|
|
||||||
using Torch.Server.ViewModels.Blocks;
|
|
||||||
using VRage.Game.ModAPI;
|
|
||||||
|
|
||||||
namespace Torch.Server.Views.Blocks
|
namespace Torch.Server.Views.Blocks
|
||||||
{
|
{
|
||||||
|
@@ -1,17 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Text;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Controls.Primitives;
|
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using Torch.Server.ViewModels.Blocks;
|
using Torch.Server.ViewModels.Blocks;
|
||||||
using Torch.Server.Views.Converters;
|
using Torch.Server.Views.Converters;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user