Merge upstream

This commit is contained in:
Cyberboss
2017-10-30 12:45:47 -04:00
8 changed files with 42 additions and 44 deletions
+3
View File
@@ -127,6 +127,9 @@ The service supports updates while running a DreamDaemon instance. Simply instal
* `Instance.cfg`
* The encrypted internal configuration settings for a server instance. Note that access to this file bypasses API user restrictions
### Codebase integration
To get the TGS3 API for your code base, import the 3 .dm files in the `DMAPI` folder into your include structure, then fill out the configuration as documented in the comments of server_tools.dm. Then, you may want to add a TGS3.json file to specify any static directories and .dlls your codebase uses, along with the optional changelog compile options.
### Starting the game server:
To run the game server, open the `Server` tab of the control panel and click either `Start`
+5 -3
View File
@@ -18,7 +18,7 @@ namespace TGInstallerWrapper
const string InterfaceDLL = "TGServiceInterface.dll";
const string InterfaceNamespace = "TGServiceInterface";
const string InterfaceComponentsNamespace = InterfaceNamespace + ".Components";
const string InterfaceClass = InterfaceNamespace + ".Server";
const string InterfaceClass = InterfaceNamespace + ".Interface";
const string InterfaceServiceInterface = InterfaceComponentsNamespace + ".ITGSService"; //fuck this typo
const string InterfaceClassVerifyConnection = "VerifyConnection";
const string InterfaceClassGetComponent = "GetComponent";
@@ -80,11 +80,11 @@ namespace TGInstallerWrapper
Version = ITGSService.GetMethod(InterfaceServiceInterfaceVersion);
PrepareForUpdate = ITGSService.GetMethod(InterfaceServiceInterfacePrepareForUpdate);
}
catch
catch (Exception e)
{
InterfaceAssembly = null;
VersionLabel.Text = "Error: (Could not load interface dll)";
return;
MessageBox.Show(String.Format("An error occurred while loading {0} (This is an easily preventable bug, please report it)! Error: {1}", InterfaceDLL, e.ToString()));
}
}
@@ -95,6 +95,8 @@ namespace TGInstallerWrapper
try
{
VersionLabel.Text = (string)Version.Invoke(GetComponentITGSService.Invoke(null, 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!");
}
catch
{
+2 -1
View File
@@ -283,8 +283,9 @@ namespace TGServerService
IRCLogModes = 6500,
/// <summary>
/// Warning: When the Repository submodule handler has to reclone a submodule entirely. This is a long operation and is due to an upstream bug
/// Error: When a submodule update operation fails completely
/// </summary>
SubmoduleReclone = 6600,
Submodule = 6600,
/// <summary>
/// This event is of type <see cref="System.Diagnostics.EventLogEntryType.SuccessAudit"/> or <see cref="System.Diagnostics.EventLogEntryType.FailureAudit"/>. It occurs when a user different from the previous one tries and either succeeds or fails to access a <see cref="ServerInstance"/>. DreamDaemon itself successfully accessing <see cref="TGServiceInterface.Components.ITGInterop"/> will not trigger this
/// </summary>
+11 -27
View File
@@ -482,38 +482,22 @@ namespace TGServerService
{
lock (watchdogLock)
{
//gotta go fast
var online = currentStatus == DreamDaemonStatus.Online;
if (online)
Proc.Suspend();
try
{
//gotta go fast
var online = currentStatus == DreamDaemonStatus.Online;
if (online)
Proc.Suspend();
try
{
var rgdl = RelativePath(GameDirLive);
if (Directory.Exists(rgdl))
//these next two lines should be atomic but this is the best we can do
Directory.Delete(rgdl);
CreateSymlink(rgdl, resurrectee);
}
finally
{
if (online && !Proc.HasExited)
Proc.Resume();
}
var rgdl = RelativePath(GameDirLive);
if (Directory.Exists(rgdl))
//these next two lines should be atomic but this is the best we can do
Directory.Delete(rgdl);
CreateSymlink(rgdl, resurrectee);
}
finally
{
if (currentStatus == DreamDaemonStatus.Online)
{
try
{
Proc.PriorityClass = ProcessPriorityClass.Normal;
}
catch { }
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.Normal;
Thread.CurrentThread.Priority = ThreadPriority.Normal;
}
if (online && !Proc.HasExited)
Proc.Resume();
}
}
var staged = DaemonStatus() != DreamDaemonStatus.Offline;
@@ -584,6 +584,7 @@ namespace TGServerService
GameAPIVersion = null; //needs updating
}
Proc.Start();
Proc.PriorityClass = ProcessPriorityClass.AboveNormal;
if (!Proc.WaitForInputIdle(DDHangStartTime * 1000))
{
+16 -9
View File
@@ -639,20 +639,27 @@ namespace TGServerService
}
catch (Exception e)
{
//workaround for https://github.com/libgit2/libgit2/issues/3820
//kill off the modules/ folder in .git and try again
try
{
Program.DeleteDirectory(String.Format("{0}/.git/modules/{1}", RelativePath(RepoPath), I.Path));
//workaround for https://github.com/libgit2/libgit2/issues/3820
//kill off the modules/ folder in .git and try again
try
{
Program.DeleteDirectory(String.Format("{0}/.git/modules/{1}", RepoPath, I.Path));
}
catch
{
throw e;
}
Repo.Submodules.Update(I.Name, suo);
var msg = String.Format("I had to reclone submodule {0}. If this is happening a lot find a better hack or fix https://github.com/libgit2/libgit2/issues/3820!", I.Name);
SendMessage(String.Format("REPO: {0}", msg), MessageType.DeveloperInfo);
WriteWarning(msg, EventID.Submodule);
}
catch
catch (Exception ex)
{
throw e;
WriteError(String.Format("Failed to update submodule {0}! Error: {1}", I.Name, ex.ToString()), EventID.Submodule);
}
Repo.Submodules.Update(I.Name, suo);
var msg = String.Format("I had to reclone submodule {0}. If this is happening a lot find a better hack or fix https://github.com/libgit2/libgit2/issues/3820!", I.Name);
SendMessage(String.Format("REPO: {0}", msg), MessageType.DeveloperInfo);
WriteWarning(msg, EventID.SubmoduleReclone);
}
}
+1 -1
View File
@@ -156,7 +156,7 @@ namespace TGServiceInterface
var splits = GetService().Version().Split(' ');
var theirs = new Version(splits[splits.Length - 1].Substring(1));
var ours = new Version(FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion);
if(theirs != ours)
if(theirs.Major != ours.Major || theirs.Minor != ours.Minor || theirs.Revision != ours.Revision) //don't care about the patch level
{
errorMessage = String.Format("Version mismatch between interface version ({0}) and service version ({1}). Some functionality may crash this program.", ours, theirs);
return true;
+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.5.2")]
[assembly: AssemblyFileVersion("3.1.5.2")]
[assembly: AssemblyInformationalVersion("3.1.5.2")]
[assembly: AssemblyVersion("3.1.6.1")]
[assembly: AssemblyFileVersion("3.1.6.1")]
[assembly: AssemblyInformationalVersion("3.1.6.1")]