diff --git a/_configuration_8cs_source.html b/_configuration_8cs_source.html
index 5098cd396c1..dc8bb9c3526 100644
--- a/_configuration_8cs_source.html
+++ b/_configuration_8cs_source.html
@@ -200,578 +200,580 @@
-
+
-
-
-
-
-
-
-
-
- 219 await Task.WhenAll(dmeExistsTask, headFileExistsTask, tailFileExistsTask, copyTask);
+
+ 212 await ensureDirectoriesTask;
+
+
+
+
+
+
+
- 221 if (!dmeExistsTask.Result && !headFileExistsTask.Result && !tailFileExistsTask.Result)
-
-
- 224 if (dmeExistsTask.Result)
-
-
- 227 if (!headFileExistsTask.Result && !tailFileExistsTask.Result)
-
-
- 230 static string IncludeLine(
string filePath) => String.Format(CultureInfo.InvariantCulture,
"#include \"{0}\"", filePath);
+ 221 await Task.WhenAll(dmeExistsTask, headFileExistsTask, tailFileExistsTask, copyTask);
+
+ 223 if (!dmeExistsTask.Result && !headFileExistsTask.Result && !tailFileExistsTask.Result)
+
+
+ 226 if (dmeExistsTask.Result)
+
+
+ 229 if (!headFileExistsTask.Result && !tailFileExistsTask.Result)
+
-
-
-
-
- 237 public async Task<IReadOnlyList<ConfigurationFileResponse>>
ListDirectory(
string configurationRelativePath,
ISystemIdentity systemIdentity, CancellationToken cancellationToken)
-
-
-
-
- 242 configurationRelativePath ??=
"/";
+ 232 static string IncludeLine(
string filePath) => String.Format(CultureInfo.InvariantCulture,
"#include \"{0}\"", filePath);
+
+
+
+
+
+ 239 public async Task<IReadOnlyList<ConfigurationFileResponse>>
ListDirectory(
string configurationRelativePath,
ISystemIdentity systemIdentity, CancellationToken cancellationToken)
+
+
+
- 244 var result =
new List<ConfigurationFileResponse>();
+ 244 configurationRelativePath ??=
"/";
-
-
-
-
-
-
- 252 Path = ioManager.ConcatPath(configurationRelativePath, x),
- 253 }).OrderBy(file => file.Path));
-
-
-
-
-
- 259 Path = ioManager.ConcatPath(configurationRelativePath, x),
- 260 }).OrderBy(file => file.Path));
-
-
-
-
-
-
- 267 logger.LogDebug(
"Contention when attempting to enumerate directory!");
-
-
-
- 271 if (systemIdentity ==
null)
-
-
-
-
-
-
-
-
- 281 public async Task<ConfigurationFileResponse>
Read(
string configurationRelativePath,
ISystemIdentity systemIdentity, CancellationToken cancellationToken)
-
-
-
-
-
+ 246 var result =
new List<ConfigurationFileResponse>();
+
+
+
+
+
+
+
+ 254 Path = ioManager.ConcatPath(configurationRelativePath, x),
+ 255 }).OrderBy(file => file.Path));
+
+
+
+
+
+ 261 Path = ioManager.ConcatPath(configurationRelativePath, x),
+ 262 }).OrderBy(file => file.Path));
+
+
+
+
+
+
+ 269 logger.LogDebug(
"Contention when attempting to enumerate directory!");
+
+
+
+ 273 if (systemIdentity ==
null)
+
+
+
+
+
+
+
+
+ 283 public async Task<ConfigurationFileResponse>
Read(
string configurationRelativePath,
ISystemIdentity systemIdentity, CancellationToken cancellationToken)
+
+
+
-
-
-
-
-
-
-
- 295 using var sha1 = SHA1.Create();
- 296 return String.Join(String.Empty, sha1.ComputeHash(content).Select(b => b.ToString(
"x2", CultureInfo.InvariantCulture)));
-
-
- 299 var originalSha = GetFileSha();
+
+
+
+
+
+
+
+
+
+ 297 using var sha1 = SHA1.Create();
+ 298 return String.Join(String.Empty, sha1.ComputeHash(content).Select(b => b.ToString(
"x2", CultureInfo.InvariantCulture)));
+
-
-
-
-
-
- 306 if (disposeToken.IsCancellationRequested)
-
-
- 309 var newSha = GetFileSha();
- 310 if (newSha != originalSha)
- 311 return ErrorCode.ConfigurationFileUpdated;
-
-
-
- 315 async cancellationToken =>
-
- 317 FileStream result =
null;
-
-
-
-
-
-
-
-
-
-
- 328 if (systemIdentity ==
null)
-
-
- 331 await systemIdentity.
RunImpersonated(GetFileStream, cancellationToken);
-
-
-
-
-
-
-
-
-
-
-
- 343 LastReadHash = originalSha,
- 344 AccessDenied =
false,
- 345 Path = configurationRelativePath,
-
-
- 348 catch (UnauthorizedAccessException)
-
-
-
-
-
-
-
-
-
- 358 logger.LogDebug(ex,
"IsDirectory exception!");
-
-
-
-
-
- 364 Path = configurationRelativePath,
-
-
- 367 result.AccessDenied =
true;
-
- 369 result.IsDirectory = isDirectory;
-
-
-
-
-
-
-
- 377 logger.LogDebug(
"Contention when attempting to read file!");
-
-
-
- 381 if (systemIdentity ==
null)
-
-
-
-
-
-
-
-
-
-
- 393 async Task<IReadOnlyList<string>> GetIgnoreFiles()
-
-
- 396 var ignoreFileText = Encoding.UTF8.GetString(ignoreFileBytes);
-
-
+ 301 var originalSha = GetFileSha();
+
+
+
+
+
+
+ 308 if (disposeToken.IsCancellationRequested)
+
+
+ 311 var newSha = GetFileSha();
+ 312 if (newSha != originalSha)
+ 313 return ErrorCode.ConfigurationFileUpdated;
+
+
+
+ 317 async cancellationToken =>
+
+ 319 FileStream result =
null;
+
+
+
+
+
+
+
+
+
+
+ 330 if (systemIdentity ==
null)
+
+
+ 333 await systemIdentity.
RunImpersonated(GetFileStream, cancellationToken);
+
+
+
+
+
+
+
+
+
+
+
+ 345 LastReadHash = originalSha,
+ 346 AccessDenied =
false,
+ 347 Path = configurationRelativePath,
+
+
+ 350 catch (UnauthorizedAccessException)
+
+
+
+
+
+
+
+
+
+ 360 logger.LogDebug(ex,
"IsDirectory exception!");
+
+
+
+
+
+ 366 Path = configurationRelativePath,
+
+
+ 369 result.AccessDenied =
true;
+
+ 371 result.IsDirectory = isDirectory;
+
+
+
+
+
+
+
+ 379 logger.LogDebug(
"Contention when attempting to read file!");
+
+
+
+ 383 if (systemIdentity ==
null)
+
+
+
+
+
+
+
+
+
+
+ 395 async Task<IReadOnlyList<string>> GetIgnoreFiles()
+
+
+ 398 var ignoreFileText = Encoding.UTF8.GetString(ignoreFileBytes);
-
- 401 using (var reader =
new StringReader(ignoreFileText))
-
- 403 cancellationToken.ThrowIfCancellationRequested();
- 404 var line = await reader.ReadLineAsync();
- 405 if (!String.IsNullOrEmpty(line))
-
-
-
-
-
-
- 412 IReadOnlyList<string> ignoreFiles;
+
+
+
+ 403 using (var reader =
new StringReader(ignoreFileText))
+
+ 405 cancellationToken.ThrowIfCancellationRequested();
+ 406 var line = await reader.ReadLineAsync();
+ 407 if (!String.IsNullOrEmpty(line))
+
+
+
+
+
- 414 async Task SymlinkBase(
bool files)
-
- 416 Task<IReadOnlyList<string>> task;
-
-
-
-
- 421 var entries = await task;
-
- 423 await Task.WhenAll(entries.Select(async file =>
-
- 425 var fileName = ioManager.GetFileName(file);
-
-
-
- 429 if (platformIdentifier.IsWindows)
- 430 ignored = ignoreFiles.Any(y => fileName.ToUpperInvariant() == y.ToUpperInvariant());
-
- 432 ignored = ignoreFiles.Any(y => fileName == y);
-
-
-
- 436 logger.LogTrace(
"Ignoring static file {fileName}...", fileName);
-
-
-
-
- 441 logger.LogTrace(
"Symlinking {filePath} to {destPath}...", file, destPath);
-
-
-
- 445 var fileExists = await fileExistsTask;
-
-
-
-
-
-
-
-
-
- 455 ignoreFiles = await GetIgnoreFiles();
- 456 await Task.WhenAll(SymlinkBase(
true), SymlinkBase(
false));
-
-
-
- 461 public async Task<ConfigurationFileResponse>
Write(
string configurationRelativePath,
ISystemIdentity systemIdentity,
string previousHash, CancellationToken cancellationToken)
-
- 463 await EnsureDirectories(cancellationToken);
- 464 var path = ValidateConfigRelativePath(configurationRelativePath);
-
-
+ 414 IReadOnlyList<string> ignoreFiles;
+
+ 416 async Task SymlinkBase(
bool files)
+
+ 418 Task<IReadOnlyList<string>> task;
+
+
+
+
+ 423 var entries = await task;
+
+ 425 await Task.WhenAll(entries.Select(async file =>
+
+ 427 var fileName = ioManager.GetFileName(file);
+
+
+
+ 431 if (platformIdentifier.IsWindows)
+ 432 ignored = ignoreFiles.Any(y => fileName.ToUpperInvariant() == y.ToUpperInvariant());
+
+ 434 ignored = ignoreFiles.Any(y => fileName == y);
+
+
+
+ 438 logger.LogTrace(
"Ignoring static file {fileName}...", fileName);
+
+
+
+
+ 443 logger.LogTrace(
"Symlinking {filePath} to {destPath}...", file, destPath);
+
+
+
+ 447 var fileExists = await fileExistsTask;
+
+
+
+
+
+
+
+
+
+ 457 ignoreFiles = await GetIgnoreFiles();
+ 458 await Task.WhenAll(SymlinkBase(
true), SymlinkBase(
false));
+
+
+
+ 463 public async Task<ConfigurationFileResponse>
Write(
string configurationRelativePath,
ISystemIdentity systemIdentity,
string previousHash, CancellationToken cancellationToken)
+
+ 465 await EnsureDirectories(cancellationToken);
+ 466 var path = ValidateConfigRelativePath(configurationRelativePath);
-
-
-
-
-
- 473 var uploadCancellationToken = disposeCts.Token;
- 474 async Task UploadHandler()
-
- 476 await
using (fileTicket)
-
- 478 var fileHash = previousHash;
- 479 var uploadStream = await fileTicket.GetResult(uploadCancellationToken);
- 480 if (uploadStream ==
null)
-
-
- 483 bool success =
false;
-
-
- 486 success = synchronousIOManager.WriteFileChecked(path, uploadStream, ref fileHash, cancellationToken);
-
-
- 489 if (fileTicket ==
null)
-
- 491 logger.LogDebug(
"File upload ticket for {path} expired!", path);
-
-
-
-
-
-
-
- 499 fileTicket.SetError(
ErrorCode.ConfigurationContendedAccess,
null);
-
-
-
- 503 if (systemIdentity ==
null)
-
-
- 506 await systemIdentity.
RunImpersonated(WriteCallback, cancellationToken);
-
-
-
- 510 fileTicket.SetError(
ErrorCode.ConfigurationFileUpdated, fileHash);
- 511 else if (uploadStream.Length > 0)
- 512 postWriteHandler.HandleWrite(path);
-
-
-
-
-
-
- 519 LastReadHash = previousHash,
-
- 521 AccessDenied =
false,
- 522 Path = configurationRelativePath,
-
-
-
- 526 uploadTasks = Task.WhenAll(uploadTasks, UploadHandler());
-
- 528 catch (UnauthorizedAccessException)
-
-
-
-
-
- 534 isDirectory = synchronousIOManager.IsDirectory(path);
-
-
-
- 538 logger.LogDebug(ex,
"IsDirectory exception!");
-
-
-
-
-
- 544 Path = configurationRelativePath,
-
-
- 547 result.AccessDenied =
true;
-
- 549 result.IsDirectory = isDirectory;
-
-
-
-
-
-
-
- 557 logger.LogDebug(
"Contention when attempting to write file!");
-
-
-
- 561 if (systemIdentity ==
null)
-
-
-
-
-
-
-
-
-
-
- 573 await EnsureDirectories(cancellationToken);
- 574 var path = ValidateConfigRelativePath(configurationRelativePath);
-
-
- 577 void DoCreate() => result = synchronousIOManager.CreateDirectory(path, cancellationToken);
-
-
-
-
-
- 583 logger.LogDebug(
"Contention when attempting to create directory!");
-
-
-
- 587 if (systemIdentity ==
null)
-
-
-
-
-
-
-
-
- 597 public Task
StartAsync(CancellationToken cancellationToken) => EnsureDirectories(cancellationToken);
-
- 600 public Task
StopAsync(CancellationToken cancellationToken) => EnsureDirectories(cancellationToken);
-
- 603 public async Task
HandleEvent(
EventType eventType, IEnumerable<string> parameters,
bool deploymentPipeline, CancellationToken cancellationToken)
-
- 605 ArgumentNullException.ThrowIfNull(parameters);
-
- 607 await EnsureDirectories(cancellationToken);
+
+
+
+
+
+
+
+ 475 var uploadCancellationToken = disposeCts.Token;
+ 476 async Task UploadHandler()
+
+ 478 await
using (fileTicket)
+
+ 480 var fileHash = previousHash;
+ 481 var uploadStream = await fileTicket.GetResult(uploadCancellationToken);
+ 482 if (uploadStream ==
null)
+
+
+ 485 bool success =
false;
+
+
+ 488 success = synchronousIOManager.WriteFileChecked(path, uploadStream, ref fileHash, cancellationToken);
+
+
+ 491 if (fileTicket ==
null)
+
+ 493 logger.LogDebug(
"File upload ticket for {path} expired!", path);
+
+
+
+
+
+
+
+ 501 fileTicket.SetError(
ErrorCode.ConfigurationContendedAccess,
null);
+
+
+
+ 505 if (systemIdentity ==
null)
+
+
+ 508 await systemIdentity.
RunImpersonated(WriteCallback, cancellationToken);
+
+
+
+ 512 fileTicket.SetError(
ErrorCode.ConfigurationFileUpdated, fileHash);
+ 513 else if (uploadStream.Length > 0)
+ 514 postWriteHandler.HandleWrite(path);
+
+
+
+
+
+
+ 521 LastReadHash = previousHash,
+
+ 523 AccessDenied =
false,
+ 524 Path = configurationRelativePath,
+
+
+
+ 528 uploadTasks = Task.WhenAll(uploadTasks, UploadHandler());
+
+ 530 catch (UnauthorizedAccessException)
+
+
+
+
+
+ 536 isDirectory = synchronousIOManager.IsDirectory(path);
+
+
+
+ 540 logger.LogDebug(ex,
"IsDirectory exception!");
+
+
+
+
+
+ 546 Path = configurationRelativePath,
+
+
+ 549 result.AccessDenied =
true;
+
+ 551 result.IsDirectory = isDirectory;
+
+
+
+
+
+
+
+ 559 logger.LogDebug(
"Contention when attempting to write file!");
+
+
+
+ 563 if (systemIdentity ==
null)
+
+
+
+
+
+
+
+
+
+
+ 575 await EnsureDirectories(cancellationToken);
+ 576 var path = ValidateConfigRelativePath(configurationRelativePath);
+
+
+ 579 void DoCreate() => result = synchronousIOManager.CreateDirectory(path, cancellationToken);
+
+
+
+
+
+ 585 logger.LogDebug(
"Contention when attempting to create directory!");
+
+
+
+ 589 if (systemIdentity ==
null)
+
+
+
+
+
+
+
+
+ 599 public Task
StartAsync(CancellationToken cancellationToken) => EnsureDirectories(cancellationToken);
+
+ 602 public Task
StopAsync(CancellationToken cancellationToken) => EnsureDirectories(cancellationToken);
+
+ 605 public async Task
HandleEvent(
EventType eventType, IEnumerable<string> parameters,
bool deploymentPipeline, CancellationToken cancellationToken)
+
+ 607 ArgumentNullException.ThrowIfNull(parameters);
- 609 if (!EventTypeScriptFileNameMap.TryGetValue(eventType, out var scriptName))
-
-
-
-
-
- 615 var files = await ioManager.GetFilesWithExtension(EventScriptsSubdirectory, platformIdentifier.ScriptFileExtension,
false, cancellationToken);
- 616 var resolvedScriptsDir = ioManager.ResolvePath(EventScriptsSubdirectory);
-
- 618 var scriptFiles = files
- 619 .Select(x => ioManager.GetFileName(x))
- 620 .Where(x => x.StartsWith(scriptName, StringComparison.Ordinal))
-
-
- 623 if (!scriptFiles.Any())
-
- 625 logger.LogTrace(
"No event scripts starting with \"{scriptName}\" detected", scriptName);
-
-
-
- 629 foreach (var scriptFile
in scriptFiles)
-
- 631 logger.LogTrace(
"Running event script {scriptFile}...", scriptFile);
- 632 await
using (var script = processExecutor.LaunchProcess(
- 633 ioManager.ConcatPath(resolvedScriptsDir, scriptFile),
-
-
-
- 637 parameters.Select(arg =>
-
- 639 if (!arg.Contains(
' ', StringComparison.Ordinal))
-
-
- 642 arg = arg.Replace(
"\"",
"\\\"", StringComparison.Ordinal);
+ 609 await EnsureDirectories(cancellationToken);
+
+ 611 if (!EventTypeScriptFileNameMap.TryGetValue(eventType, out var scriptName))
+
+
+
+
+
+ 617 var files = await ioManager.GetFilesWithExtension(EventScriptsSubdirectory, platformIdentifier.ScriptFileExtension,
false, cancellationToken);
+ 618 var resolvedScriptsDir = ioManager.ResolvePath(EventScriptsSubdirectory);
+
+ 620 var scriptFiles = files
+ 621 .Select(x => ioManager.GetFileName(x))
+ 622 .Where(x => x.StartsWith(scriptName, StringComparison.Ordinal))
+
+
+ 625 if (!scriptFiles.Any())
+
+ 627 logger.LogTrace(
"No event scripts starting with \"{scriptName}\" detected", scriptName);
+
+
+
+ 631 foreach (var scriptFile
in scriptFiles)
+
+ 633 logger.LogTrace(
"Running event script {scriptFile}...", scriptFile);
+ 634 await
using (var script = processExecutor.LaunchProcess(
+ 635 ioManager.ConcatPath(resolvedScriptsDir, scriptFile),
+
+
+
+ 639 parameters.Select(arg =>
+
+ 641 if (!arg.Contains(
' ', StringComparison.Ordinal))
+
-
-
- 646 readStandardHandles:
true,
- 647 noShellExecute:
true))
- 648 using (cancellationToken.Register(() => script.Terminate()))
-
- 650 if (sessionConfiguration.LowPriorityDeploymentProcesses)
- 651 script.AdjustPriority(
false);
-
- 653 var exitCode = await script.Lifetime;
- 654 cancellationToken.ThrowIfCancellationRequested();
- 655 var scriptOutput = await script.GetCombinedOutput(cancellationToken);
-
- 657 throw new JobException($
"Script {scriptFile} exited with code {exitCode}:{Environment.NewLine}{scriptOutput}");
-
- 659 logger.LogDebug(
"Script output:{newLine}{scriptOutput}", Environment.NewLine, scriptOutput);
-
-
-
-
-
-
-
- 668 await EnsureDirectories(cancellationToken);
- 669 var path = ValidateConfigRelativePath(configurationRelativePath);
-
-
-
-
-
-
- 676 logger.LogDebug(
"Contention when attempting to enumerate directory!");
-
-
-
- 680 void CheckDeleteImpl() => result = synchronousIOManager.DeleteDirectory(path);
+ 644 arg = arg.Replace(
"\"",
"\\\"", StringComparison.Ordinal);
+
+
+
+ 648 readStandardHandles:
true,
+ 649 noShellExecute:
true))
+ 650 using (cancellationToken.Register(() => script.Terminate()))
+
+ 652 if (sessionConfiguration.LowPriorityDeploymentProcesses)
+ 653 script.AdjustPriority(
false);
+
+ 655 var exitCode = await script.Lifetime;
+ 656 cancellationToken.ThrowIfCancellationRequested();
+ 657 var scriptOutput = await script.GetCombinedOutput(cancellationToken);
+
+ 659 throw new JobException($
"Script {scriptFile} exited with code {exitCode}:{Environment.NewLine}{scriptOutput}");
+
+ 661 logger.LogDebug(
"Script output:{newLine}{scriptOutput}", Environment.NewLine, scriptOutput);
+
+
+
+
+
+
+
+ 670 await EnsureDirectories(cancellationToken);
+ 671 var path = ValidateConfigRelativePath(configurationRelativePath);
+
+
+
+
+
+
+ 678 logger.LogDebug(
"Contention when attempting to enumerate directory!");
+
+
- 682 if (systemIdentity !=
null)
- 683 await systemIdentity.
RunImpersonated(CheckDeleteImpl, cancellationToken);
-
-
-
-
-
-
-
- 695 string StaticIgnorePath() => ioManager.ConcatPath(GameStaticFilesSubdirectory, StaticIgnoreFile);
-
-
-
- 704 async Task ValidateStaticFolder()
-
- 706 await ioManager.CreateDirectory(GameStaticFilesSubdirectory, cancellationToken);
- 707 var staticIgnorePath = StaticIgnorePath();
- 708 if (!await ioManager.FileExists(staticIgnorePath, cancellationToken))
- 709 await ioManager.WriteAllBytes(staticIgnorePath, Array.Empty<
byte>(), cancellationToken);
-
-
- 712 async Task ValidateCodeModsFolder()
-
- 714 if (await ioManager.DirectoryExists(CodeModificationsSubdirectory, cancellationToken))
-
-
- 717 await ioManager.CreateDirectory(CodeModificationsSubdirectory, cancellationToken);
-
- 719 ioManager.WriteAllBytes(
- 720 ioManager.ConcatPath(
- 721 CodeModificationsSubdirectory,
- 722 CodeModificationsHeadFile),
- 723 Encoding.UTF8.GetBytes(DefaultHeadInclude),
-
- 725 ioManager.WriteAllBytes(
- 726 ioManager.ConcatPath(
- 727 CodeModificationsSubdirectory,
- 728 CodeModificationsTailFile),
- 729 Encoding.UTF8.GetBytes(DefaultTailInclude),
-
-
-
-
- 734 ValidateCodeModsFolder(),
- 735 ioManager.CreateDirectory(EventScriptsSubdirectory, cancellationToken),
- 736 ValidateStaticFolder());
-
-
-
-
- 746 var nullOrEmptyCheck = String.IsNullOrEmpty(configurationRelativePath);
- 747 if (nullOrEmptyCheck)
-
- 749 if (configurationRelativePath[0] == Path.DirectorySeparatorChar || configurationRelativePath[0] == Path.AltDirectorySeparatorChar)
- 750 configurationRelativePath = DefaultIOManager.CurrentDirectory + configurationRelativePath;
- 751 var resolved = ioManager.ResolvePath(configurationRelativePath);
- 752 var local = !nullOrEmptyCheck ? ioManager.ResolvePath() :
null;
- 753 if (!nullOrEmptyCheck && resolved.Length < local.Length)
- 754 throw new InvalidOperationException(
"Attempted to access file outside of configuration manager!");
-
-
-
-
+ 682 void CheckDeleteImpl() => result = synchronousIOManager.DeleteDirectory(path);
+
+ 684 if (systemIdentity !=
null)
+ 685 await systemIdentity.
RunImpersonated(CheckDeleteImpl, cancellationToken);
+
+
+
+
+
+
+
+ 697 string StaticIgnorePath() => ioManager.ConcatPath(GameStaticFilesSubdirectory, StaticIgnoreFile);
+
+
+
+ 706 async Task ValidateStaticFolder()
+
+ 708 await ioManager.CreateDirectory(GameStaticFilesSubdirectory, cancellationToken);
+ 709 var staticIgnorePath = StaticIgnorePath();
+ 710 if (!await ioManager.FileExists(staticIgnorePath, cancellationToken))
+ 711 await ioManager.WriteAllBytes(staticIgnorePath, Array.Empty<
byte>(), cancellationToken);
+
+
+ 714 async Task ValidateCodeModsFolder()
+
+ 716 if (await ioManager.DirectoryExists(CodeModificationsSubdirectory, cancellationToken))
+
+
+ 719 await ioManager.CreateDirectory(CodeModificationsSubdirectory, cancellationToken);
+
+ 721 ioManager.WriteAllBytes(
+ 722 ioManager.ConcatPath(
+ 723 CodeModificationsSubdirectory,
+ 724 CodeModificationsHeadFile),
+ 725 Encoding.UTF8.GetBytes(DefaultHeadInclude),
+
+ 727 ioManager.WriteAllBytes(
+ 728 ioManager.ConcatPath(
+ 729 CodeModificationsSubdirectory,
+ 730 CodeModificationsTailFile),
+ 731 Encoding.UTF8.GetBytes(DefaultTailInclude),
+
+
+
+
+ 736 ValidateCodeModsFolder(),
+ 737 ioManager.CreateDirectory(EventScriptsSubdirectory, cancellationToken),
+ 738 ValidateStaticFolder());
+
+
+
+
+ 748 var nullOrEmptyCheck = String.IsNullOrEmpty(configurationRelativePath);
+ 749 if (nullOrEmptyCheck)
+
+ 751 if (configurationRelativePath[0] == Path.DirectorySeparatorChar || configurationRelativePath[0] == Path.AltDirectorySeparatorChar)
+ 752 configurationRelativePath = DefaultIOManager.CurrentDirectory + configurationRelativePath;
+ 753 var resolved = ioManager.ResolvePath(configurationRelativePath);
+ 754 var local = !nullOrEmptyCheck ? ioManager.ResolvePath() :
null;
+ 755 if (!nullOrEmptyCheck && resolved.Length < local.Length)
+ 756 throw new InvalidOperationException(
"Attempted to access file outside of configuration manager!");
+
+
+
+
Response when reading configuration files.
virtual ? string FileTicket
The ticket to use to access the Routes.Transfer controller.
Attribute for indicating the script that a given EventType runs.
string ScriptName
The name of the script the event script the EventType runs.
readonly IProcessExecutor processExecutor
The IProcessExecutor for Configuration.
-async Task< bool?> DeleteDirectory(string configurationRelativePath, ISystemIdentity systemIdentity, CancellationToken cancellationToken)
Attempt to delete an empty directory at configurationRelativePath . true if the directory was empty a...
+async Task< bool?> DeleteDirectory(string configurationRelativePath, ISystemIdentity systemIdentity, CancellationToken cancellationToken)
Attempt to delete an empty directory at configurationRelativePath . true if the directory was empty a...
readonly IFileTransferTicketProvider fileTransferService
The IFileTransferTicketProvider for Configuration.
static readonly string DefaultTailInclude
Default contents of CodeModificationsHeadFile.
readonly ISynchronousIOManager synchronousIOManager
The ISynchronousIOManager for Configuration.
-async Task< IReadOnlyList< ConfigurationFileResponse > > ListDirectory(string configurationRelativePath, ISystemIdentity systemIdentity, CancellationToken cancellationToken)
Get ConfigurationFileResponses for all items in a given configurationRelativePath ....
+async Task< IReadOnlyList< ConfigurationFileResponse > > ListDirectory(string configurationRelativePath, ISystemIdentity systemIdentity, CancellationToken cancellationToken)
Get ConfigurationFileResponses for all items in a given configurationRelativePath ....
Task StopAsync(CancellationToken cancellationToken)
-string ValidateConfigRelativePath(string configurationRelativePath)
Resolve a given configurationRelativePath to it's full path or throw an InvalidOperationException if...
+string ValidateConfigRelativePath(string configurationRelativePath)
Resolve a given configurationRelativePath to it's full path or throw an InvalidOperationException if...
async Task< ServerSideModifications > CopyDMFilesTo(string dmeFile, string destination, CancellationToken cancellationToken)
Copies all files in the CodeModifications directory to destination . A Task<TResult> resulting in the...
const string StaticIgnoreFile
Name of the ignore file in GameStaticFilesSubdirectory.
readonly SessionConfiguration sessionConfiguration
The SessionConfiguration for Configuration.
string StaticIgnorePath()
Get the proper path to StaticIgnoreFile.
Configuration(IIOManager ioManager, ISynchronousIOManager synchronousIOManager, ISymlinkFactory symlinkFactory, IProcessExecutor processExecutor, IPostWriteHandler postWriteHandler, IPlatformIdentifier platformIdentifier, IFileTransferTicketProvider fileTransferService, ILogger< Configuration > logger, GeneralConfiguration generalConfiguration, SessionConfiguration sessionConfiguration)
Initializes a new instance of the Configuration class.
-async Task< ConfigurationFileResponse > Write(string configurationRelativePath, ISystemIdentity systemIdentity, string previousHash, CancellationToken cancellationToken)
Writes to a given configurationRelativePath . A Task<TResult> resulting in the updated ConfigurationF...
+async Task< ConfigurationFileResponse > Write(string configurationRelativePath, ISystemIdentity systemIdentity, string previousHash, CancellationToken cancellationToken)
Writes to a given configurationRelativePath . A Task<TResult> resulting in the updated ConfigurationF...
static readonly IReadOnlyDictionary< EventType, string > EventTypeScriptFileNameMap
Map of EventTypes to the filename of the event scripts they trigger.
-async Task EnsureDirectories(CancellationToken cancellationToken)
Ensures standard configuration directories exist.
+async Task EnsureDirectories(CancellationToken cancellationToken)
Ensures standard configuration directories exist.
readonly ISymlinkFactory symlinkFactory
The ISymlinkFactory for Configuration.
readonly CancellationTokenSource disposeCts
The CancellationTokenSource that is triggered when IDisposable.Dispose is called.
Task uploadTasks
The culmination of all upload file transfer callbacks.
const string CodeModificationsSubdirectory
The CodeModifications directory name.
readonly IPostWriteHandler postWriteHandler
The IPostWriteHandler for Configuration.
readonly IPlatformIdentifier platformIdentifier
The IPlatformIdentifier for Configuration.
-async Task< ConfigurationFileResponse > Read(string configurationRelativePath, ISystemIdentity systemIdentity, CancellationToken cancellationToken)
Reads a given configurationRelativePath . A Task<TResult> resulting in the ConfigurationFileResponse ...
+async Task< ConfigurationFileResponse > Read(string configurationRelativePath, ISystemIdentity systemIdentity, CancellationToken cancellationToken)
Reads a given configurationRelativePath . A Task<TResult> resulting in the ConfigurationFileResponse ...
const string CodeModificationsHeadFile
The HeadInclude.dm filename.
-async Task HandleEvent(EventType eventType, IEnumerable< string > parameters, bool deploymentPipeline, CancellationToken cancellationToken)
Handle a given eventType . A Task representing the running operation.
+async Task HandleEvent(EventType eventType, IEnumerable< string > parameters, bool deploymentPipeline, CancellationToken cancellationToken)
Handle a given eventType . A Task representing the running operation.
readonly ILogger< Configuration > logger
The ILogger for Configuration.
readonly GeneralConfiguration generalConfiguration
The GeneralConfiguration for Configuration.
const string CodeModificationsTailFile
The TailInclude.dm filename.
-async Task< bool?> CreateDirectory(string configurationRelativePath, ISystemIdentity systemIdentity, CancellationToken cancellationToken)
Create an empty directory at configurationRelativePath . A Task<TResult> resulting in true if the dir...
+async Task< bool?> CreateDirectory(string configurationRelativePath, ISystemIdentity systemIdentity, CancellationToken cancellationToken)
Create an empty directory at configurationRelativePath . A Task<TResult> resulting in true if the dir...
static readonly string DefaultHeadInclude
Default contents of CodeModificationsHeadFile.
const string GameStaticFilesSubdirectory
The GameStaticFiles directory name.
Task StartAsync(CancellationToken cancellationToken)
const string EventScriptsSubdirectory
The EventScripts directory name.
readonly SemaphoreSlim semaphore
The SemaphoreSlim for Configuration. Also used as a lock object.
-async Task SymlinkStaticFilesTo(string destination, CancellationToken cancellationToken)
Symlinks all directories in the GameData directory to destination . A Task representing the running o...
+async Task SymlinkStaticFilesTo(string destination, CancellationToken cancellationToken)
Symlinks all directories in the GameData directory to destination . A Task representing the running o...
readonly IIOManager ioManager
The IIOManager for Configuration.
Represents code modifications via configuration.
General configuration options.
diff --git a/_tgstation_8_server_8_host_8_service_2_program_8cs.html b/_tgstation_8_server_8_host_8_service_2_program_8cs.html
index f031a571041..2ba4d5baa08 100644
--- a/_tgstation_8_server_8_host_8_service_2_program_8cs.html
+++ b/_tgstation_8_server_8_host_8_service_2_program_8cs.html
@@ -77,7 +77,9 @@
@@ -100,7 +102,202 @@
|
namespace | Tgstation.Server.Host.Service |
|
+
+
+
+
◆ GetPassthroughArgs()
+
+
+
+
+
+ string[] GetPassthroughArgs |
+ ( |
+ | ) |
+ |
+
+
+
+
+
+
◆ RestartService()
+
+
+
+
+
+ void RestartService |
+ ( |
+ ServiceController |
+ serviceController | ) |
+ |
+
+
+
+
+
Restarts a service using a given serviceController .
+
- Parameters
-
+
+ serviceController | The ServiceController for the service to restart. |
+
+
+
+
+
Definition at line 255 of file Program.cs.
+
256 {
+
257 if (serviceController.Status != ServiceControllerStatus.Running)
+
258 return;
+
259
+
260 var stop = !Detach;
+
261 if (!stop)
+
262 {
+
263 serviceController.ExecuteCommand(
+
+
+
266 .Value);
+
267 serviceController.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(30));
+
268 if (serviceController.Status != ServiceControllerStatus.Stopped)
+
269 stop = true;
+
270 }
+
271
+
272 if (stop)
+
273 {
+
274 serviceController.Stop();
+
275 serviceController.WaitForStatus(ServiceControllerStatus.Stopped);
+
276 }
+
277 }
+
Values able to be passed via the update file path.
+
static ? int GetCommandId(string command)
Gets the int value of a given command .
+
const string CommandDetachingShutdown
Stops the server ASAP, detaching the watchdog for any running instances.
+
+
References Tgstation.Server.Host.Common.PipeCommands.CommandDetachingShutdown, and Tgstation.Server.Host.Common.PipeCommands.GetCommandId().
+
+
Referenced by Tgstation.Server.Host.Service.Program.InvokeSC(), and Tgstation.Server.Host.Service.Program.OnExecuteAsync().
+
+
+
+
+
+
+
+
+
◆ RunConfigure()
+
+
+
+
+
+ async Task RunConfigure |
+ ( |
+ CancellationToken |
+ cancellationToken | ) |
+ |
+
+
+
+