mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 23:17:20 +01:00
Clears BYOND cache on every reboot
This commit is contained in:
@@ -53,6 +53,11 @@ namespace TGS.Server
|
||||
/// </summary>
|
||||
const string ByondNoPromptTrustedMode = "trusted-check 0";
|
||||
|
||||
/// <summary>
|
||||
/// Contains cache shit that needs to be cleared out every startup
|
||||
/// </summary>
|
||||
static readonly string ByondCacheDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), ByondDirectory, "cache");
|
||||
|
||||
/// <summary>
|
||||
/// The status of the BYOND updater
|
||||
/// </summary>
|
||||
@@ -103,6 +108,18 @@ namespace TGS.Server
|
||||
CleanByondStaging();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to clear the <see cref="ByondCacheDirectory"/>
|
||||
/// </summary>
|
||||
void ClearCacheFolder()
|
||||
{
|
||||
try
|
||||
{
|
||||
Helpers.DeleteDirectory(ByondCacheDirectory, true, null);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the updater is considered busy
|
||||
|
||||
@@ -605,6 +605,7 @@ namespace TGS.Server
|
||||
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);
|
||||
UpdateBridgeDll(true);
|
||||
ClearCacheFolder();
|
||||
lock (topicLock)
|
||||
{
|
||||
GameAPIVersion = null; //needs updating
|
||||
|
||||
Reference in New Issue
Block a user