Skip to content

Commit

Permalink
Rename byondLock variables to engineLock
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss committed Oct 21, 2023
1 parent cf91aa9 commit 66b9ae6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
16 changes: 8 additions & 8 deletions src/Tgstation.Server.Host/Components/Deployment/DreamMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ await databaseContextFactory.UseContext(
var progressTask = ProgressTask(progressReporter, estimatedDuration, progressCts.Token);
try
{
using var byondLock = await engineManager.UseExecutables(null, null, cancellationToken);
using var engineLock = await engineManager.UseExecutables(null, null, cancellationToken);
currentChatCallback = chatManager.QueueDeploymentMessage(
revisionInformation,
byondLock.Version,
engineLock.Version,
DateTimeOffset.UtcNow + estimatedDuration,
repository.RemoteRepositoryOwner,
repository.RemoteRepositoryName,
Expand All @@ -491,7 +491,7 @@ await databaseContextFactory.UseContext(
DirectoryName = Guid.NewGuid(),
DmeName = dreamMakerSettings.ProjectName,
RevisionInformation = revisionInformation,
ByondVersion = byondLock.Version.ToString(),
ByondVersion = engineLock.Version.ToString(),
RepositoryOrigin = repository.Origin.ToString(),
};

Expand All @@ -514,7 +514,7 @@ await RunCompileJob(
job,
dreamMakerSettings,
launchParameters,
byondLock,
engineLock,
repository,
remoteDeploymentManager,
combinedTokenSource.Token);
Expand Down Expand Up @@ -764,7 +764,7 @@ async ValueTask ProgressTask(JobProgressReporter progressReporter, TimeSpan? est
/// <param name="timeout">The timeout in seconds for validation.</param>
/// <param name="securityLevel">The <see cref="DreamDaemonSecurity"/> level to use to validate the API.</param>
/// <param name="job">The <see cref="CompileJob"/> for the operation.</param>
/// <param name="byondLock">The current <see cref="IEngineExecutableLock"/>.</param>
/// <param name="engineLock">The current <see cref="IEngineExecutableLock"/>.</param>
/// <param name="portToUse">The port to use for API validation.</param>
/// <param name="requireValidate">If the API validation is required to complete the deployment.</param>
/// <param name="logOutput">If output should be logged to the DreamDaemon Diagnostics folder.</param>
Expand All @@ -774,7 +774,7 @@ async ValueTask VerifyApi(
uint timeout,
DreamDaemonSecurity securityLevel,
Models.CompileJob job,
IEngineExecutableLock byondLock,
IEngineExecutableLock engineLock,
ushort portToUse,
bool requireValidate,
bool logOutput,
Expand All @@ -801,8 +801,8 @@ async ValueTask VerifyApi(
using (var provider = new TemporaryDmbProvider(
ioManager.ResolvePath(job.DirectoryName.ToString()),
job,
byondLock.Version))
await using (var controller = await sessionControllerFactory.LaunchNew(provider, byondLock, launchParameters, true, cancellationToken))
engineLock.Version))
await using (var controller = await sessionControllerFactory.LaunchNew(provider, engineLock, launchParameters, true, cancellationToken))
{
var launchResult = await controller.LaunchResult.WaitAsync(cancellationToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public async ValueTask<ISessionController> LaunchNew(
}

// get the byond lock
var byondLock = currentByondLock ?? await engineManager.UseExecutables(
var engineLock = currentByondLock ?? await engineManager.UseExecutables(
dmbProvider.EngineVersion,
gameIOManager.ConcatPath(dmbProvider.Directory, dmbProvider.DmbName),
cancellationToken);
Expand All @@ -260,7 +260,7 @@ public async ValueTask<ISessionController> LaunchNew(
string outputFilePath = null;
var preserveLogFile = true;

var hasStandardOutput = byondLock.HasStandardOutput;
var hasStandardOutput = engineLock.HasStandardOutput;
if (launchParameters.LogOutput.Value)
{
var now = DateTimeOffset.UtcNow;
Expand All @@ -287,7 +287,7 @@ public async ValueTask<ISessionController> LaunchNew(
// launch dd
var process = await CreateGameServerProcess(
dmbProvider,
byondLock,
engineLock,
launchParameters,
accessIdentifier,
outputFilePath,
Expand Down Expand Up @@ -321,7 +321,7 @@ public async ValueTask<ISessionController> LaunchNew(
reattachInformation,
instance,
process,
byondLock,
engineLock,
byondTopicSender,
chatTrackingContext,
bridgeRegistrar,
Expand Down Expand Up @@ -360,7 +360,7 @@ public async ValueTask<ISessionController> LaunchNew(
catch
{
if (currentByondLock == null)
byondLock.Dispose();
engineLock.Dispose();
throw;
}
}
Expand All @@ -375,7 +375,7 @@ public async ValueTask<ISessionController> Reattach(

logger.LogTrace("Begin session reattach...");
var byondTopicSender = topicClientFactory.CreateTopicClient(reattachInformation.TopicRequestTimeout);
var byondLock = await engineManager.UseExecutables(
var engineLock = await engineManager.UseExecutables(
reattachInformation.Dmb.EngineVersion,
null, // Doesn't matter if it's trusted or not on reattach
cancellationToken);
Expand All @@ -393,7 +393,7 @@ public async ValueTask<ISessionController> Reattach(

try
{
if (byondLock.PromptsForNetworkAccess)
if (engineLock.PromptsForNetworkAccess)
networkPromptReaper.RegisterProcess(process);

var chatTrackingContext = chat.CreateTrackingContext();
Expand All @@ -410,7 +410,7 @@ public async ValueTask<ISessionController> Reattach(
reattachInformation,
instance,
process,
byondLock,
engineLock,
byondTopicSender,
chatTrackingContext,
bridgeRegistrar,
Expand All @@ -424,7 +424,7 @@ public async ValueTask<ISessionController> Reattach(
false);

process = null;
byondLock = null;
engineLock = null;
chatTrackingContext = null;

return controller;
Expand All @@ -443,7 +443,7 @@ public async ValueTask<ISessionController> Reattach(
}
catch
{
byondLock.Dispose();
engineLock.Dispose();
throw;
}
}
Expand All @@ -452,7 +452,7 @@ public async ValueTask<ISessionController> Reattach(
/// Creates the game server <see cref="IProcess"/>.
/// </summary>
/// <param name="dmbProvider">The <see cref="IDmbProvider"/>.</param>
/// <param name="byondLock">The <see cref="IEngineExecutableLock"/>.</param>
/// <param name="engineLock">The <see cref="IEngineExecutableLock"/>.</param>
/// <param name="launchParameters">The <see cref="DreamDaemonLaunchParameters"/>.</param>
/// <param name="accessIdentifier">The secure string to use for the session.</param>
/// <param name="logFilePath">The path to log DreamDaemon output to.</param>
Expand All @@ -461,15 +461,15 @@ public async ValueTask<ISessionController> Reattach(
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in the DreamDaemon <see cref="IProcess"/>.</returns>
async ValueTask<IProcess> CreateGameServerProcess(
IDmbProvider dmbProvider,
IEngineExecutableLock byondLock,
IEngineExecutableLock engineLock,
DreamDaemonLaunchParameters launchParameters,
string accessIdentifier,
string logFilePath,
bool apiValidate,
CancellationToken cancellationToken)
{
// important to run on all ports to allow port changing
var arguments = byondLock.FormatServerArguments(
var arguments = engineLock.FormatServerArguments(
dmbProvider,
new Dictionary<string, string>
{
Expand All @@ -478,16 +478,16 @@ async ValueTask<IProcess> CreateGameServerProcess(
{ DMApiConstants.ParamAccessIdentifier, accessIdentifier },
},
launchParameters,
!byondLock.HasStandardOutput
!engineLock.HasStandardOutput
? logFilePath
: null);

var process = processExecutor.LaunchProcess(
byondLock.ServerExePath,
engineLock.ServerExePath,
dmbProvider.Directory,
arguments,
logFilePath,
byondLock.HasStandardOutput,
engineLock.HasStandardOutput,
true);

try
Expand All @@ -500,7 +500,7 @@ async ValueTask<IProcess> CreateGameServerProcess(
else if (sessionConfiguration.LowPriorityDeploymentProcesses)
process.AdjustPriority(false);

if (!byondLock.HasStandardOutput)
if (!engineLock.HasStandardOutput)
networkPromptReaper.RegisterProcess(process);

// If this isnt a staging DD (From a Deployment), fire off an event
Expand Down

0 comments on commit 66b9ae6

Please sign in to comment.