Merge upstream

This commit is contained in:
Cyberboss
2017-11-05 21:22:04 -05:00
32 changed files with 352 additions and 236 deletions
+1 -1
View File
@@ -73,7 +73,7 @@
#define SERVICE_VERSION_PARAM "server_service_version"
#define SERVICE_INSTANCE_PARAM "server_instance"
#define SERVICE_PR_TEST_JSON "prtestjob.json"
#define SERVICE_INTERFACE_DLL "TGServiceInterface.dll"
#define SERVICE_INTERFACE_DLL "TGDreamDaemonBridge.dll"
#define SERVICE_INTERFACE_FUNCTION "DDEntryPoint"
#define SERVICE_CMD_HARD_REBOOT "hard_reboot"
+1 -1
View File
@@ -157,7 +157,7 @@ namespace TGCommandLine
/// </summary>
/// <param name="instanceName">The name of the <see cref="ITGInstance"/> to test</param>
/// <param name="silentSuccess">If <see langword="true"/>, does not output on success</param>
/// <returns><see langword="true"/> if a <see cref="ConnectivityLevel.Authenticated"/> was achieved with <see cref="Interface.ConnectToInstance(string)"/>, <see langword="false"/> otherwise</returns>
/// <returns><see langword="true"/> if a <see cref="ConnectivityLevel.Authenticated"/> was achieved with <see cref="Interface.ConnectToInstance(string, bool)"/>, <see langword="false"/> otherwise</returns>
static bool CheckInstanceConnectivity(string instanceName, bool silentSuccess)
{
var res = currentInterface.ConnectToInstance(instanceName);
+8 -8
View File
@@ -18,27 +18,27 @@
<PropertyGroup>
<ApplicationIcon>tgs.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>bin\x86\Release\TGCommandLine.xml</DocumentationFile>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\x86\Release\TGCommandLine.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="AdminCommands.cs" />
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using TGServiceInterface;
using TGServiceInterface.Components;
namespace TGControlPanel
{
@@ -29,6 +30,11 @@ namespace TGControlPanel
{
InitializeComponent();
Interface = I;
if (Interface.IsRemoteConnection)
{
var splits = Interface.GetComponent<ITGSService>().Version().Split(' ');
Text = String.Format("TGS {0}: {1}:{2}", splits[splits.Length - 1], Interface.HTTPSURL, Interface.HTTPSPort);
}
Text += " Instance: " + I.InstanceName;
if (Interface.VersionMismatch(out string error) && MessageBox.Show(error, "Warning", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
+8 -8
View File
@@ -17,27 +17,27 @@
<PropertyGroup>
<ApplicationIcon>tgs.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>bin\x86\Release\TGControlPanel.xml</DocumentationFile>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\x86\Release\TGControlPanel.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -2,14 +2,15 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using TGServiceInterface;
using TGServiceInterface.Components;
namespace TGServiceInterface
namespace TGDreamDaemonBridge
{
/// <summary>
/// Holds the proc that DD calls to access <see cref="ITGInterop"/>
/// </summary>
public sealed class DreamDaemonBridge
public static class DreamDaemonBridge
{
/// <summary>
/// The proc that DD calls to access <see cref="ITGInterop"/>
@@ -26,7 +27,7 @@ namespace TGServiceInterface
parsedArgs.AddRange(args);
parsedArgs.RemoveAt(0);
using (var I = new Interface())
if(I.ConnectToInstanceImpl(parsedArgs[0], true).HasFlag(ConnectivityLevel.Connected))
if(I.ConnectToInstance(parsedArgs[0], true).HasFlag(ConnectivityLevel.Connected))
I.GetComponent<ITGInterop>().InteropMessage(String.Join(" ", parsedArgs));
}
catch { }
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<Costura />
</Weavers>
@@ -0,0 +1,16 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TGStation Server Service DreamDaemon Bridge")]
[assembly: AssemblyDescription("Used by DreamDaemon to call into the TGStation Server Service")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9a01ef03-8eae-45cb-8b87-4a17bd904557")]
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9A01EF03-8EAE-45CB-8B87-4A17BD904557}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TGDreamDaemonBridge</RootNamespace>
<AssemblyName>TGDreamDaemonBridge</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PlatformTarget>x86</PlatformTarget>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Compile Include="DreamDaemonBridge.cs" />
<Compile Include="..\Version.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Costura, Version=1.6.2.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.1.6.2\lib\dotnet\Costura.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="RGiesecke.DllExport.Metadata, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8f52d83c1a22df51, processorArchitecture=MSIL">
<HintPath>..\packages\UnmanagedExports.1.2.7\lib\net\RGiesecke.DllExport.Metadata.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TGServiceInterface\TGServiceInterface.csproj">
<Project>{ac4e7e8b-f83a-481c-a8b0-8fa4e8ae59ab}</Project>
<Name>TGServiceInterface</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets" Condition="Exists('../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets')" />
<Import Project="..\packages\Fody.2.0.0\build\netstandard1.4\Fody.targets" Condition="Exists('..\packages\Fody.2.0.0\build\netstandard1.4\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.2.0.0\build\netstandard1.4\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.2.0.0\build\netstandard1.4\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" />
</Project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="1.6.2" targetFramework="net452" developmentDependency="true" />
<package id="Fody" version="2.0.0" targetFramework="net452" developmentDependency="true" requireReinstallation="true" />
<package id="UnmanagedExports" version="1.2.7" targetFramework="net452" developmentDependency="true" />
</packages>
+1
View File
@@ -20,6 +20,7 @@ namespace TGInstallerWrapper
if (disposing && (components != null))
{
components.Dispose();
CleanTempDir();
}
base.Dispose(disposing);
}
+28 -49
View File
@@ -3,10 +3,11 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TGServiceInterface;
using TGServiceInterface.Components;
namespace TGInstallerWrapper
{
@@ -14,27 +15,13 @@ namespace TGInstallerWrapper
{
const string DefaultInstallDir = "TG Station Server"; //keep this in sync with the msi installer
//reflection shit, make sure it matches
const string InterfaceDLL = "TGServiceInterface.dll";
const string InterfaceNamespace = "TGServiceInterface";
const string InterfaceComponentsNamespace = InterfaceNamespace + ".Components";
const string InterfaceClass = InterfaceNamespace + ".Interface";
const string InterfaceServiceInterface = InterfaceComponentsNamespace + ".ITGSService"; //fuck this typo
const string InterfaceClassVerifyConnection = "VerifyConnection";
const string InterfaceClassGetComponent = "GetComponent";
const string InterfaceServiceInterfaceVersion = "Version";
const string InterfaceServiceInterfacePrepareForUpdate = "PrepareForUpdate";
Assembly InterfaceAssembly;
object InterfaceObject;
Type Server, ITGSService;
MethodInfo VerifyConnection, GetComponentITGSService, Version, PrepareForUpdate;
string tempDir;
bool installing = false;
bool cancelled = false;
bool pathIsDefault = true;
Interface Interface;
/// <summary>
/// Construct an installer form
/// </summary>
@@ -42,7 +29,6 @@ namespace TGInstallerWrapper
{
InitializeComponent();
SetupTempDir();
LoadInterfaceFromReflection();
CheckForExistingVersion();
PathTextBox.Text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), DefaultInstallDir);
}
@@ -55,7 +41,7 @@ namespace TGInstallerWrapper
if (File.Exists(tempDir))
File.Delete(tempDir);
else if (Directory.Exists(tempDir))
Directory.Delete(tempDir);
Directory.Delete(tempDir, true);
}
catch { }
if (File.Exists(tempDir) || Directory.Exists(tempDir))
@@ -63,42 +49,37 @@ namespace TGInstallerWrapper
tempDir = Path.GetTempFileName();
File.Delete(tempDir); //we want a dir not a file
}
Directory.CreateDirectory(tempDir);
}
void LoadInterfaceFromReflection()
{
//so this is where we expect to find the interface dll
try
{
var tmppath = Path.Combine(tempDir, InterfaceDLL);
File.WriteAllBytes(tmppath, Properties.Resources.TGServiceInterface);
InterfaceAssembly = Assembly.LoadFrom(tmppath); //we can't link to it, or load the bytes directly because the thing will complain about mixing the DLLExport code and IL code
Server = InterfaceAssembly.GetType(InterfaceClass);
InterfaceObject = Activator.CreateInstance(Server);
ITGSService = InterfaceAssembly.GetType(InterfaceServiceInterface);
VerifyConnection = Server.GetMethod(InterfaceClassVerifyConnection);
GetComponentITGSService = Server.GetMethod(InterfaceClassGetComponent).MakeGenericMethod(ITGSService);
Version = ITGSService.GetMethod(InterfaceServiceInterfaceVersion);
PrepareForUpdate = ITGSService.GetMethod(InterfaceServiceInterfacePrepareForUpdate);
Directory.CreateDirectory(tempDir);
}
catch (Exception e)
catch
{
InterfaceAssembly = null;
VersionLabel.Text = "Error: (Could not load interface dll)";
MessageBox.Show(String.Format("An error occurred while loading {0} (This is an easily preventable bug, please report it)! Error: {1}", InterfaceDLL, e.ToString()));
tempDir = null;
}
}
void CleanTempDir() {
if(tempDir != null)
try
{
Directory.Delete(tempDir, true);
}
catch { }
}
void CheckForExistingVersion() {
if (InterfaceAssembly == null)
return;
var verifiedConnection = VerifyConnection.Invoke(InterfaceObject, null) == null;
Interface = new Interface();
var verifiedConnection = Interface.ConnectionStatus().HasFlag(ConnectivityLevel.Administrator);
try
{
VersionLabel.Text = (string)Version.Invoke(GetComponentITGSService.Invoke(InterfaceObject, null), null);
if (VersionLabel.Text.Contains("v3.0")) //OH GOD!!!!
MessageBox.Show("Warning! Upgrading from version 3.0 may trigger a bug that can delete /config and /data. IT IS STRONGLY RECCOMMENDED THAT YOU BACKUP THESE FOLDERS BEFORE UPDATING!");
VersionLabel.Text = Interface.GetComponent<ITGSService>().Version();
var isV0 = VersionLabel.Text.Contains("v3.0");
if (isV0) //OH GOD!!!!
MessageBox.Show("Upgrading from version 3.0 may trigger a bug that can delete /config and /data. IT IS STRONGLY RECCOMMENDED THAT YOU BACKUP THESE FOLDERS BEFORE UPDATING!", "Warning");
if (isV0 || VersionLabel.Text.Contains("v3.1"))
//Friendly reminger
MessageBox.Show("Upgrading to service version 3.2 will break the 3.1 DMAPI. It is recommended you update your game to the 3.2 API before updating the servive to avoid having to trigger hard restarts.", "Note");
}
catch
{
@@ -114,12 +95,10 @@ namespace TGInstallerWrapper
bool TellServiceWereComingForThem()
{
if (InterfaceAssembly == null)
return ConfirmDangerousUpgrade();
var connectionVerified = VerifyConnection.Invoke(InterfaceObject, null) == null;
var connectionVerified = Interface.ConnectionStatus().HasFlag(ConnectivityLevel.Administrator);
try
{
PrepareForUpdate.Invoke(GetComponentITGSService.Invoke(InterfaceObject, null), null);
Interface.GetComponent<ITGSService>().PrepareForUpdate();
Thread.Sleep(3000); //chat messages
return true;
}
-10
View File
@@ -79,15 +79,5 @@ namespace TGInstallerWrapper.Properties {
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] TGServiceInterface {
get {
object obj = ResourceManager.GetObject("TGServiceInterface", resourceCulture);
return ((byte[])(obj));
}
}
}
}
@@ -124,7 +124,4 @@
<data name="TGServiceInstaller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\TGServiceInstaller\bin\Release\TGServiceInstaller.msi;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="TGServiceInterface" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\..\TGServiceInterface\bin\x86\Release\TGServiceInterface.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
+14 -8
View File
@@ -20,27 +20,27 @@
<PropertyGroup>
<ApplicationIcon>tgs.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>bin\x86\Release\TG Station Server Installer.xml</DocumentationFile>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\x86\Release\TG Station Server Installer.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Costura, Version=1.6.2.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
@@ -85,6 +85,12 @@
<None Include="FodyWeavers.xml" />
<Content Include="tgs.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TGServiceInterface\TGServiceInterface.csproj">
<Project>{ac4e7e8b-f83a-481c-a8b0-8fa4e8ae59ab}</Project>
<Name>TGServiceInterface</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.2.0.0\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.2.0.0\build\dotnet\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+2 -2
View File
@@ -251,11 +251,11 @@ namespace TGServerService
/// <summary>
/// Info: When the <see cref="TGServiceInterface"/> dll is updated for the <see cref="ServerInstance"/>
/// </summary>
InterfaceDLLUpdated = 5800,
BridgeDLLUpdated = 5800,
/// <summary>
/// Error: An error occurred while updating the <see cref="TGServiceInterface"/> dll for the <see cref="ServerInstance"/>
/// </summary>
InterfaceDLLUpdateFail = 5900,
BridgeDLLUpdateFail = 5900,
/// <summary>
/// Error: An error occurred while starting the <see cref="ServerInstance"/>
/// </summary>
+1 -1
View File
@@ -7,7 +7,7 @@ namespace TGServerService
/// <summary>
/// Helpers to <see cref="Suspend(Process)"/>ing and <see cref="Resume(Process)"/> a <see cref="Process"/>. Lightly massaged code from https://stackoverflow.com/a/13109774. Documentation linked from MSDN on 20/10/2017
/// </summary>
public static class ProcessExtension
static class ProcessExtension
{
/// <summary>
/// https://msdn.microsoft.com/en-us/library/windows/desktop/ms686769(v=vs.85).aspx
+1 -1
View File
@@ -8,7 +8,7 @@ namespace TGServerService
/// This tells the .msi there is a Windows <see cref="ServiceBase"/> in this <see cref="System.Reflection.Assembly"/> that needs installation
/// </summary>
[RunInstaller(true)]
public partial class ProjectInstaller : Installer
public sealed class ProjectInstaller : Installer
{
/// <summary>
/// Construct a <see cref="ProjectInstaller"/>
+18 -20
View File
@@ -35,12 +35,10 @@ namespace TGServerService
const string BDirTest = GameDirB + LiveFile;
const string LiveDirTest = GameDirLive + LiveFile;
const string InterfaceDLLName = "TGServiceInterface.dll";
object CompilerLock = new object();
CompilerStatus compilerCurrentStatus;
string lastCompilerError;
Thread CompilerThread;
bool compilationCancellationRequestation = false;
bool canCancelCompilation = false;
@@ -85,7 +83,7 @@ namespace TGServerService
if (CompilerThread == null || !CompilerThread.IsAlive)
return;
CompilerThread.Abort(); //this will safely kill dm
InitCompiler(); //also cleanup
InitCompiler(); //also cleanup
}
}
@@ -101,7 +99,7 @@ namespace TGServerService
{
return compilerCurrentStatus == CompilerStatus.Uninitialized || compilerCurrentStatus == CompilerStatus.Initialized;
}
/// <inheritdoc />
public bool Initialize()
{
@@ -120,7 +118,7 @@ namespace TGServerService
//what is says on the tin
CompilerStatus IsInitialized()
{
if (File.Exists(RelativePath(Path.Combine(GameDirLive, InterfaceDLLName)))) //its a good tell, jim
if (File.Exists(RelativePath(Path.Combine(GameDirLive, BridgeDLLName)))) //its a good tell, jim
return CompilerStatus.Initialized;
return CompilerStatus.Uninitialized;
}
@@ -128,13 +126,13 @@ namespace TGServerService
//we need to remove symlinks before we can recursively delete
void CleanGameFolder()
{
var GameDirAInterface = RelativePath(Path.Combine(GameDirA, InterfaceDLLName));
if (Directory.Exists(GameDirAInterface))
Directory.Delete(GameDirAInterface);
var GameDirABridge = RelativePath(Path.Combine(GameDirA, BridgeDLLName));
if (Directory.Exists(GameDirABridge))
Directory.Delete(GameDirABridge);
var GameDirBInterface = RelativePath(Path.Combine(GameDirB, InterfaceDLLName));
if (Directory.Exists(GameDirBInterface))
Directory.Delete(GameDirBInterface);
var GameDirBBridge = RelativePath(Path.Combine(GameDirB, BridgeDLLName));
if (Directory.Exists(GameDirBBridge))
Directory.Delete(GameDirBBridge);
var rgdl = RelativePath(GameDirLive);
if (Directory.Exists(rgdl))
@@ -193,9 +191,9 @@ namespace TGServerService
CreateSymlink(RelativePath(Path.Combine(GameDirA, I)), RelativePath(Path.Combine(StaticDirs, I)));
}
var ridlln = RelativePath(InterfaceDLLName);
CreateSymlink(RelativePath(Path.Combine(GameDirA, InterfaceDLLName)), ridlln);
CreateSymlink(RelativePath(Path.Combine(GameDirB, InterfaceDLLName)), ridlln);
var rbdlln = RelativePath(BridgeDLLName);
CreateSymlink(RelativePath(Path.Combine(GameDirA, BridgeDLLName)), rbdlln);
CreateSymlink(RelativePath(Path.Combine(GameDirB, BridgeDLLName)), rbdlln);
CreateSymlink(RelativePath(GameDirLive), RelativePath(GameDirA));
@@ -226,7 +224,7 @@ namespace TGServerService
return;
}
CompileImpl();
}
}
//Returns the A or B dir in which the game is NOT running
string GetStagingDir()
@@ -265,7 +263,7 @@ namespace TGServerService
{
File.Delete(rsclock);
}
catch //held open by byond
catch //held open by byond
{
//This means there is a staged update waiting to be applied, we have to unstage it before we can work
Directory.Delete(RelativePath(GameDirLive));
@@ -348,7 +346,7 @@ namespace TGServerService
resurrectee = GetStagingDir(); //non-relative
var Config = GetCachedRepoConfig();
var deleteExcludeList = new List<string> { InterfaceDLLName };
var deleteExcludeList = new List<string> { BridgeDLLName };
deleteExcludeList.AddRange(Config.StaticDirectoryPaths);
deleteExcludeList.AddRange(Config.DLLPaths);
Program.DeleteDirectory(resurrectee, true, deleteExcludeList);
@@ -369,8 +367,8 @@ namespace TGServerService
CreateSymlink(the_path, RelativePath(Path.Combine(StaticDirs, I)));
}
if (!File.Exists(Path.Combine(resurrectee, InterfaceDLLName)))
CreateSymlink(Path.Combine(resurrectee, InterfaceDLLName), RelativePath(InterfaceDLLName));
if (!File.Exists(Path.Combine(resurrectee, BridgeDLLName)))
CreateSymlink(Path.Combine(resurrectee, BridgeDLLName), RelativePath(BridgeDLLName));
deleteExcludeList.Add(".git");
Program.CopyDirectory(RelativePath(RepoPath), resurrectee, deleteExcludeList);
+42 -20
View File
@@ -151,7 +151,7 @@ namespace TGServerService
//autostart the server
if (Config.Autostart)
//break this off so we don't hold up starting the service
ThreadPool.QueueUserWorkItem( _ => { Start(); });
ThreadPool.QueueUserWorkItem(_ => { Start(); });
}
/// <summary>
@@ -178,7 +178,7 @@ namespace TGServerService
else if (Detach)
Config.ReattachRequired = false;
Stop();
if(pcpu != null)
if (pcpu != null)
pcpu.Dispose();
if (RenameLog)
try
@@ -267,7 +267,7 @@ namespace TGServerService
{
if (DaemonStatus() == DreamDaemonStatus.Offline)
return Start();
lock(restartLock)
lock (restartLock)
{
if (RestartInProgress)
return "Restart already in progress";
@@ -276,8 +276,8 @@ namespace TGServerService
SendMessage("DD: Hard restart triggered", MessageType.WatchdogInfo);
Stop();
var res = Start();
if(res != null)
lock(restartLock)
if (res != null)
lock (restartLock)
{
RestartInProgress = false;
}
@@ -496,7 +496,7 @@ namespace TGServerService
}
return StartImpl(false);
}
/// <summary>
/// Translate the configured <see cref="DreamDaemonSecurity"/> level into a byond command line param
/// </summary>
@@ -519,28 +519,47 @@ namespace TGServerService
}
/// <summary>
/// Copies <see cref="InterfaceDLLName"/> from the program directory to the the <see cref="ServerInstance"/> directory
/// Copies <see cref="BridgeDLLName"/> from the program directory to the the <see cref="ServerInstance"/> directory
/// </summary>
/// <param name="overwrite">If <see langword="true"/>, overwrites the <see cref="ServerInstance"/>'s current interface .dll if it exists</param>
void UpdateInterfaceDll(bool overwrite)
void UpdateBridgeDll(bool overwrite)
{
var ridlln = RelativePath(InterfaceDLLName);
var FileExists = File.Exists(ridlln);
var rbdlln = RelativePath(BridgeDLLName);
var FileExists = File.Exists(rbdlln);
if (FileExists && !overwrite)
return;
//Copy the interface dll to the static dir
var InterfacePath = Assembly.GetAssembly(typeof(DreamDaemonBridge)).Location;
var InterfacePath = Assembly.GetAssembly(typeof(Interface)).Location;
//bridge is installed next to the interface
var BridgePath = Path.Combine(Path.GetDirectoryName(InterfacePath), BridgeDLLName);
#if DEBUG
//We could be debugging from the project directory
if (!File.Exists(BridgePath))
//A little hackish debug mode doctoring never hurt anyone
BridgePath = Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(InterfacePath)))), "TGDreamDaemonBridge/bin/x86/Debug", BridgeDLLName);
#endif
try
{
//Use reflection to ensure these are the droids we're looking for
Assembly.ReflectionOnlyLoadFrom(BridgePath).GetType(DreamDaemonBridgeType, true);
}
catch (Exception e)
{
WriteError(String.Format("Unable to locate {0}! Error: {1}", BridgeDLLName, e.ToString()), EventID.BridgeDLLUpdateFail);
return;
}
try
{
if (FileExists)
{
var Old = File.ReadAllBytes(ridlln);
var New = File.ReadAllBytes(InterfacePath);
var Old = File.ReadAllBytes(rbdlln);
var New = File.ReadAllBytes(BridgePath);
if (Old.SequenceEqual(New))
return; //no need
}
File.Copy(InterfacePath, ridlln, overwrite);
WriteInfo("Updated interface DLL", EventID.InterfaceDLLUpdated);
File.Copy(BridgePath, rbdlln, overwrite);
}
catch
{
@@ -548,18 +567,20 @@ namespace TGServerService
{
//ok the things being stupid and hasn't released the dll yet, try ONCE more
Thread.Sleep(1000);
File.Copy(InterfacePath, ridlln, overwrite);
File.Copy(InterfacePath, rbdlln, overwrite);
}
catch (Exception e)
{
//intentionally using the fi
WriteError("Failed to update interface DLL! Error: " + e.ToString(), EventID.InterfaceDLLUpdateFail);
WriteError("Failed to update bridge DLL! Error: " + e.ToString(), EventID.BridgeDLLUpdateFail);
return;
}
}
WriteInfo("Updated interface DLL", EventID.BridgeDLLUpdated);
}
/// <summary>
/// Clears the current <see cref="GameAPIVersion"/>, calls <see cref="UpdateInterfaceDll(bool)"/> with a <see langword="true"/> parameter, and attempts to start the DreamDaemon <see cref="Proc"/>
/// Clears the current <see cref="GameAPIVersion"/>, calls <see cref="UpdateBridgeDll(bool)"/> with a <see langword="true"/> parameter, and attempts to start the DreamDaemon <see cref="Proc"/>
/// </summary>
/// <param name="watchdog">If <see langword="false"/>, sets <see cref="DDWatchdog"/> to a new <see cref="Thread"/> pointing to <see cref="Watchdog"/> and starts it</param>
/// <returns><see langword="null"/> on success, error message on failure</returns>
@@ -578,7 +599,7 @@ namespace TGServerService
GenCommsKey();
StartingSecurity = Config.Security;
Proc.StartInfo.Arguments = String.Format("{0} -port {1} {5}-close -verbose -params \"server_service={3}&server_service_version={4}&{6}={7}\" -{2} -public", DMB, Config.Port, SecurityWord(), serviceCommsKey, Version(), Config.Webclient ? "-webclient " : "", SPInstanceName, Config.Name);
UpdateInterfaceDll(true);
UpdateBridgeDll(true);
lock (topicLock)
{
GameAPIVersion = null; //needs updating
@@ -715,7 +736,8 @@ namespace TGServerService
/// <inheritdoc />
public void SetWebclient(bool on)
{
lock (watchdogLock) {
lock (watchdogLock)
{
var diff = on != Config.Webclient;
if (diff)
{
+34 -23
View File
@@ -49,6 +49,19 @@ namespace TGServerService
const string CCPAdminOnly = "admin_only";
const string CCPRequiredParameters = "required_parameters";
/// <summary>
/// The file name of the .dll that contains the <see cref="ITGInterop"/> bridge class
/// </summary>
const string BridgeDLLName = "TGDreamDaemonBridge.dll";
/// <summary>
/// The namespace that contains the <see cref="ITGInterop"/> bridge class. Used for reflection
/// </summary>
const string DreamDaemonBridgeNamespace = "TGDreamDaemonBridge";
/// <summary>
/// The <see cref="ITGInterop"/> bridge class. Used for reflection
/// </summary>
const string DreamDaemonBridgeType = DreamDaemonBridgeNamespace + ".DreamDaemonBridge";
List<Command> ServerChatCommands;
void LoadServerChatCommands()
@@ -172,34 +185,33 @@ namespace TGServerService
lock (topicLock) {
if (!CheckAPIVersionConstraints())
return "Incompatible API!";
StringBuilder stringPacket = new StringBuilder();
stringPacket.Append((char)'\x00', 8);
stringPacket.Append('?' + topicdata);
stringPacket.Append((char)'\x00');
string fullString = stringPacket.ToString();
var packet = Encoding.ASCII.GetBytes(fullString);
packet[1] = 0x83;
var FinalLength = packet.Length - 4;
if (FinalLength > UInt16.MaxValue)
return "Error: Topic too long";
var lengthBytes = BitConverter.GetBytes((ushort)FinalLength);
packet[2] = lengthBytes[1]; //fucking endianess
packet[3] = lengthBytes[0];
var returnedString = "NULL";
var returnedData = new byte[UInt16.MaxValue];
using (var topicSender = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { SendTimeout = 5000, ReceiveTimeout = 5000 })
{
try
{
topicSender.Connect(IPAddress.Loopback, port);
StringBuilder stringPacket = new StringBuilder();
stringPacket.Append((char)'\x00', 8);
stringPacket.Append('?' + topicdata);
stringPacket.Append((char)'\x00');
string fullString = stringPacket.ToString();
var packet = Encoding.ASCII.GetBytes(fullString);
packet[1] = 0x83;
var FinalLength = packet.Length - 4;
if (FinalLength > UInt16.MaxValue)
return "Error: Topic too long";
var lengthBytes = BitConverter.GetBytes((ushort)FinalLength);
packet[2] = lengthBytes[1]; //fucking endianess
packet[3] = lengthBytes[0];
topicSender.Send(packet);
string returnedString = "NULL";
try
{
var returnedData = new byte[UInt16.MaxValue];
topicSender.Receive(returnedData);
var raw_string = Encoding.ASCII.GetString(returnedData).TrimEnd(new char[] { (char)0 }).Trim();
if (raw_string.Length > 6)
@@ -213,14 +225,13 @@ namespace TGServerService
{
topicSender.Shutdown(SocketShutdown.Both);
}
return returnedString;
}
catch
{
return "Topic delivery failed!";
}
}
return returnedString;
}
}
+2 -2
View File
@@ -96,7 +96,7 @@ namespace TGServerService
{
Directory.CreateDirectory(RelativePath(RepoKeyDir));
if(Exists())
UpdateInterfaceDll(false);
UpdateBridgeDll(false);
if(LoadRepo() == null)
DisableGarbageCollectionNoLock();
//start the autoupdate timer
@@ -338,7 +338,7 @@ namespace TGServerService
void InitialConfigureRepository()
{
Directory.CreateDirectory(RelativePath(StaticDirs));
UpdateInterfaceDll(false);
UpdateBridgeDll(false);
UpdateTGS3Json();
var Config = GetCachedRepoConfig(); //RepoBusy is set if we're here
foreach(var I in Config.StaticDirectoryPaths)
+8 -8
View File
@@ -19,27 +19,27 @@
<PropertyGroup>
<ApplicationIcon>tgs.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>bin\x86\Release\TGServerService.xml</DocumentationFile>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\x86\Release\TGServerService.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Discord.Net.Core, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
+3
View File
@@ -119,6 +119,9 @@
<Component Id="TGServiceInterface" Guid="*">
<File Source="$(var.TGServiceInterface.TargetPath)" />
</Component>
<Component Id="TGDreamDaemonBridge" Guid="*">
<File Source="$(var.TGDreamDaemonBridge.TargetPath)" />
</Component>
</ComponentGroup>
<ComponentGroup Id="Gitx86Components" Directory="x86Folder">
<Component Id="LibGit2Sharpx86" Guid="*">
@@ -40,6 +40,14 @@
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\TGDreamDaemonBridge\TGDreamDaemonBridge.csproj">
<Name>TGDreamDaemonBridge</Name>
<Project>{9a01ef03-8eae-45cb-8b87-4a17bd904557}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
<ProjectReference Include="..\TGServerService\TGServerService.csproj">
<Name>TGServerService</Name>
<Project>{f32eda25-0855-411c-af5e-f0d042917e2d}</Project>
+12 -17
View File
@@ -49,12 +49,12 @@ namespace TGServiceInterface
/// <summary>
/// If this is set, we will try and connect to an HTTPS server running at this address
/// </summary>
readonly string HTTPSURL;
public readonly string HTTPSURL;
/// <summary>
/// The port used by the service
/// </summary>
readonly ushort HTTPSPort;
public readonly ushort HTTPSPort;
/// <summary>
/// Username for remote operations
@@ -149,29 +149,19 @@ namespace TGServiceInterface
/// Targets <paramref name="instanceName"/> as the instance to use with <see cref="GetComponent{T}"/>. Closes all connections to any previous instance
/// </summary>
/// <param name="instanceName">The name of the instance to connect to</param>
/// <param name="skipChecks">If set to <see langword="true"/>, skips the connectivity and authentication checks, sets <see cref="InstanceName"/>, and returns <see cref="ConnectivityLevel.Connected"/></param>
/// <returns>The apporopriate <see cref="ConnectivityLevel"/></returns>
public ConnectivityLevel ConnectToInstance(string instanceName = null)
public ConnectivityLevel ConnectToInstance(string instanceName = null, bool skipChecks = false)
{
if (instanceName == null)
instanceName = InstanceName;
return ConnectToInstanceImpl(instanceName, false);
}
/// <summary>
/// Targets <paramref name="instanceName"/> as the instance to use with <see cref="GetComponent{T}"/>. Closes all connections to any previous instance. Sets <see cref="InstanceName"/>
/// </summary>
/// <param name="instanceName">The name of the instance to connect to</param>
/// <param name="skipAuthChecks">If set to <see langword="true"/>, skips the connectivity and authentication checks and returns <see cref="ConnectivityLevel.Connected"/></param>
/// <returns>The apporopriate <see cref="ConnectivityLevel"/></returns>
internal ConnectivityLevel ConnectToInstanceImpl(string instanceName, bool skipAuthChecks)
{
if (!ConnectionStatus().HasFlag(ConnectivityLevel.Connected))
if (!skipChecks && !ConnectionStatus().HasFlag(ConnectivityLevel.Connected))
return ConnectivityLevel.None;
var prevInstance = InstanceName;
if (prevInstance != instanceName)
CloseAllChannels(false);
InstanceName = instanceName;
if (skipAuthChecks)
if (skipChecks)
return ConnectivityLevel.Connected;
try
{
@@ -201,6 +191,11 @@ namespace TGServiceInterface
}
}
/// <summary>
/// Checks if the <see cref="Interface"/> is setup for a remote connection
/// </summary>
public bool IsRemoteConnection { get { return HTTPSURL != null; } }
/// <summary>
/// Closes all <see cref="ChannelFactory"/>s stored in <see cref="ChannelFactoryCache"/> and clears it
/// </summary>
@@ -322,7 +317,7 @@ namespace TGServiceInterface
var accessPath = instanceName == null ? MasterInterfaceName : String.Format("{0}/{1}", InstanceInterfaceName, instanceName);
var InterfaceName = typeof(T).Name;
if (HTTPSURL == null)
if (!IsRemoteConnection)
{
var res2 = new ChannelFactory<T>(
new NetNamedPipeBinding { SendTimeout = new TimeSpan(0, 0, 30), MaxReceivedMessageSize = TransferLimitLocal }, new EndpointAddress(String.Format("net.pipe://localhost/{0}/{1}", accessPath, InterfaceName))); //10 megs
+9 -15
View File
@@ -15,31 +15,28 @@
<PropertyGroup>
<ApplicationIcon>tgs.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>bin\x86\Release\TGServiceInterface.xml</DocumentationFile>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\x86\Release\TGServiceInterface.xml</DocumentationFile>
<RegisterForComInterop>false</RegisterForComInterop>
</PropertyGroup>
<ItemGroup>
<Reference Include="RGiesecke.DllExport.Metadata, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8f52d83c1a22df51, processorArchitecture=MSIL">
<HintPath>..\packages\UnmanagedExports.1.2.7\lib\net\RGiesecke.DllExport.Metadata.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
@@ -57,7 +54,6 @@
<Compile Include="Components\DreamDaemon.cs" />
<Compile Include="Components\Chat.cs" />
<Compile Include="Components\Instance.cs" />
<Compile Include="DreamDaemonBridge.cs" />
<Compile Include="Enumerations.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="InstanceMetadata.cs" />
@@ -75,8 +71,6 @@
</ItemGroup>
<ItemGroup>
<None Include="TGServiceInterface.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets" Condition="Exists('../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets')" />
</Project>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="UnmanagedExports" version="1.2.7" targetFramework="net452" developmentDependency="true" />
</packages>
+30 -24
View File
@@ -86,34 +86,40 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{287B
.github\CONTRIBUTING.md = .github\CONTRIBUTING.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TGDreamDaemonBridge", "TGDreamDaemonBridge\TGDreamDaemonBridge.csproj", "{9A01EF03-8EAE-45CB-8B87-4A17BD904557}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F32EDA25-0855-411C-AF5E-F0D042917E2D}.Debug|x86.ActiveCfg = Debug|x86
{F32EDA25-0855-411C-AF5E-F0D042917E2D}.Debug|x86.Build.0 = Debug|x86
{F32EDA25-0855-411C-AF5E-F0D042917E2D}.Release|x86.ActiveCfg = Release|x86
{F32EDA25-0855-411C-AF5E-F0D042917E2D}.Release|x86.Build.0 = Release|x86
{394E7643-6B8C-416F-AB18-95AC12648CDC}.Debug|x86.ActiveCfg = Debug|x86
{394E7643-6B8C-416F-AB18-95AC12648CDC}.Debug|x86.Build.0 = Debug|x86
{394E7643-6B8C-416F-AB18-95AC12648CDC}.Release|x86.ActiveCfg = Release|x86
{394E7643-6B8C-416F-AB18-95AC12648CDC}.Release|x86.Build.0 = Release|x86
{89191F69-B18E-4B59-B72E-E12F9B6811A0}.Debug|x86.ActiveCfg = Debug|x86
{89191F69-B18E-4B59-B72E-E12F9B6811A0}.Debug|x86.Build.0 = Debug|x86
{89191F69-B18E-4B59-B72E-E12F9B6811A0}.Release|x86.ActiveCfg = Release|x86
{89191F69-B18E-4B59-B72E-E12F9B6811A0}.Release|x86.Build.0 = Release|x86
{AC4E7E8B-F83A-481C-A8B0-8FA4E8AE59AB}.Debug|x86.ActiveCfg = Debug|x86
{AC4E7E8B-F83A-481C-A8B0-8FA4E8AE59AB}.Debug|x86.Build.0 = Debug|x86
{AC4E7E8B-F83A-481C-A8B0-8FA4E8AE59AB}.Release|x86.ActiveCfg = Release|x86
{AC4E7E8B-F83A-481C-A8B0-8FA4E8AE59AB}.Release|x86.Build.0 = Release|x86
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Debug|x86.ActiveCfg = Debug|x86
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Release|x86.ActiveCfg = Release|x86
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Release|x86.Build.0 = Release|x86
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Debug|x86.ActiveCfg = Debug|x86
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Release|x86.ActiveCfg = Release|x86
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Release|x86.Build.0 = Release|x86
{F32EDA25-0855-411C-AF5E-F0D042917E2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F32EDA25-0855-411C-AF5E-F0D042917E2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F32EDA25-0855-411C-AF5E-F0D042917E2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F32EDA25-0855-411C-AF5E-F0D042917E2D}.Release|Any CPU.Build.0 = Release|Any CPU
{394E7643-6B8C-416F-AB18-95AC12648CDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{394E7643-6B8C-416F-AB18-95AC12648CDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{394E7643-6B8C-416F-AB18-95AC12648CDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{394E7643-6B8C-416F-AB18-95AC12648CDC}.Release|Any CPU.Build.0 = Release|Any CPU
{89191F69-B18E-4B59-B72E-E12F9B6811A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89191F69-B18E-4B59-B72E-E12F9B6811A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89191F69-B18E-4B59-B72E-E12F9B6811A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89191F69-B18E-4B59-B72E-E12F9B6811A0}.Release|Any CPU.Build.0 = Release|Any CPU
{AC4E7E8B-F83A-481C-A8B0-8FA4E8AE59AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC4E7E8B-F83A-481C-A8B0-8FA4E8AE59AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC4E7E8B-F83A-481C-A8B0-8FA4E8AE59AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC4E7E8B-F83A-481C-A8B0-8FA4E8AE59AB}.Release|Any CPU.Build.0 = Release|Any CPU
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Debug|Any CPU.ActiveCfg = Debug|x86
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Release|Any CPU.ActiveCfg = Release|x86
{154435F6-0890-42D4-9AEC-B743D4FBC1CB}.Release|Any CPU.Build.0 = Release|x86
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8956D4C3-BFB9-448E-BF5F-EE7E6F9996F9}.Release|Any CPU.Build.0 = Release|Any CPU
{9A01EF03-8EAE-45CB-8B87-4A17BD904557}.Debug|Any CPU.ActiveCfg = Debug|x86
{9A01EF03-8EAE-45CB-8B87-4A17BD904557}.Debug|Any CPU.Build.0 = Debug|x86
{9A01EF03-8EAE-45CB-8B87-4A17BD904557}.Release|Any CPU.ActiveCfg = Release|x86
{9A01EF03-8EAE-45CB-8B87-4A17BD904557}.Release|Any CPU.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+4 -4
View File
@@ -1,5 +1,5 @@
$bf = $Env:APPVEYOR_BUILD_FOLDER
$src = "$bf\TGInstallerWrapper\bin\x86\Release"
$src = "$bf\TGInstallerWrapper\bin\Release"
$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$src\TG Station Server Installer.exe").FileVersion
$doxdir = "C:\tgsdox"
@@ -43,9 +43,9 @@ $destination_md5sha = "$bf\MD5-SHA1-Server-v$version.txt"
$src2 = "$bf\ClientApps"
[system.io.directory]::CreateDirectory($src2)
Copy-Item "$bf\TGCommandLine\bin\x86\Release\TGCommandLine.exe" "$src2\TGCommandLine.exe"
Copy-Item "$bf\TGControlPanel\bin\x86\Release\TGControlPanel.exe" "$src2\TGControlPanel.exe"
Copy-Item "$bf\TGServiceInterface\bin\x86\Release\TGServiceInterface.dll" "$src2\TGServiceInterface.dll"
Copy-Item "$bf\TGCommandLine\bin\Release\TGCommandLine.exe" "$src2\TGCommandLine.exe"
Copy-Item "$bf\TGControlPanel\bin\Release\TGControlPanel.exe" "$src2\TGControlPanel.exe"
Copy-Item "$bf\TGServiceInterface\bin\Release\TGServiceInterface.dll" "$src2\TGServiceInterface.dll"
$dest2 = "$bf\TGS3-Client-v$version.zip"
+3 -3
View File
@@ -12,6 +12,6 @@ using System.Reflection;
// [assembly: AssemblyVersion("1.0.*")]
//It's impossible to make these a define, don't say I didn't warn you
[assembly: AssemblyVersion("3.1.6.5")]
[assembly: AssemblyFileVersion("3.1.6.5")]
[assembly: AssemblyInformationalVersion("3.1.6.5")]
[assembly: AssemblyVersion("3.1.6.6")]
[assembly: AssemblyFileVersion("3.1.6.6")]
[assembly: AssemblyInformationalVersion("3.1.6.6")]
+3 -1
View File
@@ -18,6 +18,8 @@ artifacts:
name: MD5SHA1Client
cache:
- packages -> **\packages.config
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
install:
- choco install fciv doxygen.portable graphviz.portable
before_build:
@@ -30,7 +32,7 @@ build:
after_build:
- ps: .\Tools\TGS3Build.ps1
- ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE -match "\[TGSDeploy\]"){$env:TGSDeploy = "Do it."}
- ps: $env:TGSVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$env:APPVEYOR_BUILD_FOLDER/TGServerService/bin/x86/Release/TGServerService.exe").FileVersion
- ps: $env:TGSVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$env:APPVEYOR_BUILD_FOLDER/TGServerService/bin/Release/TGServerService.exe").FileVersion
deploy:
- provider: GitHub
release: "tgstation-server-v$(TGSVersion)"