How to configure Gamelift concurrent process for the server ?

0

Hi, I am trying to add concurrent server processes to my instance. I wonder how to make sure the activation succeeds for the instances with concurrent process. In my activation code for gamelfit in UE, IU hardcoded port 7777. How can I make this dynamic. I am not understanding the flow.

params->OnStartGameSession.BindLambda(onGameSession);

//OnProcessTerminate callback. GameLift invokes this before shutting down the instance 
//that is hosting this game server to give it time to gracefully shut down on its own. 
//In this example, we simply tell GameLift we are indeed going to shut down.
params->OnTerminate.BindLambda([=]() {gameLiftSdkModule->ProcessEnding(); });

//HealthCheck callback. GameLift invokes this callback about every 60 seconds. By default, 
//GameLift API automatically responds 'true'. A game can optionally perform checks on 
//dependencies and such and report status based on this info. If no response is received  
//within 60 seconds, health status is recorded as 'false'. 
//In this example, we're always healthy!
params->OnHealthCheck.BindLambda([]() {return true; });

//Here, the game server tells GameLift what port it is listening on for incoming player 
//connections. In this example, the port is hardcoded for simplicity. Since active game
//that are on the same instance must have unique ports, you may want to assign port values
//from a range, such as:
//int32 port = FURL::UrlConfig.DefaultPort;
//params->port;
params->port = 7777;

gameLiftSdkModule->ProcessReady(*params);

So how can I make sure the port I am selecting is the exact port at which matchmaking happened and the session is running?

1 Risposta
0

Hello,

Thank you for reaching out.

Please note that, the port would be defined before session placement, and not the other way around. Hence, you can pass the port on the command line arguments of the fleet configuration and then use that when you call ProcessReady (instead of the hardcoded one). Each instance will have the exact processes you configure always be running and waiting for sessions, for example on ports 7777, 8888, 9999 and the backend will get info when placement is ready on which port (and process) on which instance (and IP) was allocated.

AWS
con risposta 4 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande