How to send custom Launch paramater for a game session when request to create game session?

0

Hi everyone, i'm new to gamelift, and i need your help: When client request to create new game session, can I send custom launch parameters to specific game session? Thank you very much! REMOVEDUPLOAD

질문됨 3년 전720회 조회
3개 답변
1
수락된 답변

I'm not sure about command line parameters but I know that when creating a game session, GameLift lets the client pass in data that can be retrieved by the server upon the start of the game session.

When you call createGameSession, you can pass optional parameters called GameSessionData and GameProperties that can both be retrieved by the game server hosting your game session, assuming it was created successfully. More about createGameSession can be found here, but keep in mind that other methods used to create a new game session also have these parameters or something similar, so you are not restricted to only using createGameSession. For example, startGameSessionPlacement takes in these two optional parameters as well.

The data would then be retrieved by your game server in the GameSession parameter passed to the onStartGameSession handler function that was defined by you in the ProcessParameters object passed to ProcessReady.

However, if you specifically need parameters to be passed at launch then I wouldn't suggest doing that through the client since the game sessions have to be hosted on server processes that are already running. You may be better off just creating separate fleets for specific server processes based on launch parameters and then have clients create a game session in the fleet that matches their request criterion.

답변함 3년 전
profile picture
전문가
검토됨 5달 전
profile picture
전문가
검토됨 6달 전
0

The launch parameter and game sessions are actually not directly related. Launch parameters are what launches the processes to wait for game session activation. So, when you create the game session, the processes should already be launched by your fleet's launch parameter, active, and ready to accept the game session.

Chris's suggestion in using the GameSessionData is correct; however, it does not work if you want to initialize the process with it, e.g. passing in the port to be used for calling "ProcessReady".

답변함 3년 전
0

I want to pass launch parameter to game server because my server use some parameter to decide which map should be played. But now I found another way to do that without passing launch parameter from client to server 😃 I'll check to use ProcessParameters and GameSessionData in game server as your suggession. Thank you very much!

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인