Fix BYOND updates not triggering recompile

This commit is contained in:
Cyberboss
2017-12-08 16:33:51 -05:00
parent d69a6cbe04
commit 43325055fe
2 changed files with 24 additions and 18 deletions
+9 -2
View File
@@ -306,8 +306,15 @@ namespace TGS.Server
RevisionStaging = null;
}
}
if(staged)
Compile();
if (staged)
lock (ByondLock)
{
//Some fuckery to trick the compiler into starting even though we're staged
//Won't fuck up the actual compiler thread though
updateStat = ByondStatus.Idle;
Compile();
updateStat = ByondStatus.Staged;
}
}
/// <inheritdoc />
public bool UpdateToVersion(int major, int minor)
+15 -16
View File
@@ -289,15 +289,6 @@ namespace TGS.Server
{
try
{
if (GetVersion(ByondVersion.Installed) == null)
{
lock (CompilerLock)
{
lastCompilerError = "BYOND not installed!";
compilerCurrentStatus = CompilerStatus.Initialized;
return;
}
}
if (!RepoConfigsMatch())
{
lock (CompilerLock)
@@ -419,15 +410,23 @@ namespace TGS.Server
return;
}
bool stagedBuild;
lock (ByondLock)
{
stagedBuild = updateStat == ByondStatus.Staged;
if (stagedBuild)
updateStat = ByondStatus.CompilingStaged;
else if (GetVersion(ByondVersion.Installed) == null)
lock (CompilerLock)
{
lastCompilerError = "BYOND not installed!";
compilerCurrentStatus = CompilerStatus.Initialized;
return;
}
}
using (var DM = new Process()) //will kill the process if the thread is terminated
{
bool stagedBuild;
lock (ByondLock)
{
stagedBuild = updateStat == ByondStatus.Staged;
if (stagedBuild)
updateStat = ByondStatus.CompilingStaged;
}
DM.StartInfo.FileName = RelativePath(Path.Combine(stagedBuild ? StagingDirectoryInner : ByondDirectory, "bin/dm.exe"));
DM.StartInfo.Arguments = String.Format("-clean {0}", dmePath);
DM.StartInfo.RedirectStandardOutput = true;