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年前519ビュー
3回答
0
承認された回答

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
エキスパート
レビュー済み 25日前
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ