Преглед на файлове

Adding code comments to MPSGameLiftServerSystemComponent around how player join events are triggered

Signed-off-by: AMZN-Gene <[email protected]>
AMZN-Gene преди 2 години
родител
ревизия
d018841dd7
променени са 2 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 2 0
      MPSGameLift/Code/Source/MPSGameLiftServerSystemComponent.cpp
  2. 1 0
      MPSGameLift/Code/Source/MPSGameLiftServerSystemComponent.h

+ 2 - 0
MPSGameLift/Code/Source/MPSGameLiftServerSystemComponent.cpp

@@ -96,6 +96,8 @@ namespace MPSGameLift
                 "Session requested by Amazon GameLift. Make sure to load into a multiplayer level before players join.");
         }
 
+        // Start a timer to shutdown this server if no players join.
+        // This scheduled event will be stopped if m_connectionAquiredEventHandler is triggered.
         m_gameSessionNoPlayerShutdown.Enqueue(AZ::SecondsToTimeMs(sv_gameSessionNoPlayerShutdownTimeoutSeconds));
     }
 

+ 1 - 0
MPSGameLift/Code/Source/MPSGameLiftServerSystemComponent.h

@@ -66,6 +66,7 @@ namespace MPSGameLift
             }, 
             AZ::Name("MPSGameLiftServerSystemComponent No Player Joined the Game Session so Shutdown the App"));
 
+        // This event handler will subscribe to IMultiplayer and be triggered in the event a new connection is aquired by this server (ie: a player joining).
         Multiplayer::ConnectionAcquiredEvent::Handler m_connectionAquiredEventHandler = Multiplayer::ConnectionAcquiredEvent::Handler([this]([[maybe_unused]] Multiplayer::MultiplayerAgentDatum agentDatum) -> void {
             this->m_gameSessionNoPlayerShutdown.RemoveFromQueue();
             });