From 6afd336bbfc11721b9899e9cdbfb0dcd00c369eb Mon Sep 17 00:00:00 2001 From: Norman Lansing Date: Fri, 13 Mar 2026 07:25:35 -0400 Subject: [PATCH] Minor spelling changes and switching GameSessionId to const in the OnStartGameSession Lambda --- Source/FPSTemplate/Private/Game/ShooterGameMode.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/FPSTemplate/Private/Game/ShooterGameMode.cpp b/Source/FPSTemplate/Private/Game/ShooterGameMode.cpp index 8ab32994..828f56fa 100644 --- a/Source/FPSTemplate/Private/Game/ShooterGameMode.cpp +++ b/Source/FPSTemplate/Private/Game/ShooterGameMode.cpp @@ -97,7 +97,7 @@ void AShooterGameMode::InitGameLift() ServerParametersForAnywhere.m_authToken = TCHAR_TO_UTF8(*GameLiftConfig.AuthTokenResult.Value); LogServerParameters(ServerParametersForAnywhere); - // InitSDK will establish a local connection with GameLfit's agent to enable further communication. + // InitSDK will establish a local connection with GameLift's agent to enable further communication. InitSdkOutcome = GameLiftSdkModule->InitSDK(ServerParametersForAnywhere); } else @@ -125,16 +125,17 @@ void AShooterGameMode::InitGameLift() //When a game session is created, Amazon GameLift Servers sends an activation request to the game server and passes along the game session object containing game properties and other settings. //Here is where a game server should take action based on the game session object. //Once the game server is ready to receive incoming player connections, it should invoke GameLiftServerAPI.ActivateGameSession() + // ReSharper disable once CppPassValueParameterByConstReference - not safe to do with async lambdas ProcessParameters->OnStartGameSession.BindLambda([=](Aws::GameLift::Server::Model::GameSession InGameSession) { - FString GameSessionId = FString(InGameSession.GetGameSessionId()); + const FString GameSessionId = FString(InGameSession.GetGameSessionId()); UE_LOG(LogShooterGameMode, Log, TEXT("GameSession Initializing: %s"), *GameSessionId); GameLiftSdkModule->ActivateGameSession(); }); //OnProcessTerminate callback. Amazon GameLift Servers will invoke this callback before shutting down an instance hosting this game server. //It gives this game server a chance to save its state, communicate with services, etc., before being shut down. - //In this case, we simply tell Amazon GameLift Servers we are indeed going to shutdown. + //In this case, we simply tell Amazon GameLift Servers we are indeed going to shut down. ProcessParameters->OnTerminate.BindLambda([=]() { UE_LOG(LogShooterGameMode, Log, TEXT("Game Server Process is terminating")); @@ -162,7 +163,7 @@ void AShooterGameMode::InitGameLift() FGenericPlatformMisc::RequestExit(false); }); - //This is the HealthCheck callback. + //This is the Health Check callback. //Amazon GameLift Servers will invoke this callback every 60 seconds or so. //Here, a game server might want to check the health of dependencies and such. //Simply return true if healthy, false otherwise.