I'm on AWS Gamelift SDK version 5.1 and I'm getting this error when trying to deploy a fleet:
Server process started correctly but did not call InitSDK() or ProcessReady() within 5 minutes.
This is how I'm calling InitSDK() in the code:
//InitSDK will establish a local connection with Amazon GameLift's agent to enable further communication.
var initSDKOutcome = GameLiftServerAPI.InitSDK();
Before, I tested this using AWS Anywhere code and this was working properly:
//WebSocketUrl from RegisterHost call
var webSocketUrl = CreateURI(listeningPort);
//Unique identifier for this process
var processId = Environment.ProcessId.ToString();
//Get this from calling AWS register-compute API. needs to be refreshed every few hours.
var authToken = "c689b530-c84c-4d5b-a668-fd62afdd7238";
//Unique identifier for your host that this process belongs to
var hostId = HOSTNAME;
Debug.Log("initiating AWS server");
ServerParameters serverParameters = new ServerParameters(
"wss://ap-southeast-1.api.amazongamelift.com",
processId,
"MyLaptop2",
"arn:aws:gamelift:ap-southeast-1:468989632272:fleet/fleet-7af060ab-8b7d-4829-94a7-8a42a69ee425",
authToken
);
//InitSDK will establish a local connection with Amazon GameLift's agent to enable further communication.
var initSDKOutcome = GameLiftServerAPI.InitSDK(serverParameters);
But when I switch over to InitSdk() without parameters, the deployment doesn't work. Also, I have a version of the code successfully deploying with AWS Sdk version 4.2, but I'd like to upgrade to 5.1 if possible. The 4.2 version is working, calling InitSdk() like this:
//InitSDK will establish a local connection with Amazon GameLift's agent to enable further communication.
var initSDKOutcome = GameLiftServerAPI.InitSDK();
Why is this code working in v4.2 but not in v5.1? Is there something I'm doing incorrectly?