private void Update() { // Create TCP server if we received port already if (Server.port > 0 && this.server == null) { Console.WriteLine("Port received, create network server"); this.server = new NetworkServer(this); } // Register to FleetIQ if we have all the needed info and not registered yet if (!registeredToFleetIQ) { if (this.taskDataArnWithContainer != null && this.publicIP != null && this.instanceId != null) { Console.WriteLine("Registering to FleetIQ"); var gameLiftConfig = new AmazonGameLiftConfig { RegionEndpoint = this.regionEndpoint }; var gameLiftClient = new AmazonGameLiftClient(gameLiftConfig); var registerGameServerRequest = new RegisterGameServerRequest(); registerGameServerRequest.GameServerGroupName = Server.fleetIqGameServerGroup; registerGameServerRequest.InstanceId = this.instanceId; registerGameServerRequest.ConnectionInfo = this.publicIP + ":" + Server.port; registerGameServerRequest.GameServerId = this.gameServerId; registerGameServerRequest.GameServerData = "{\"gametype\": \"normal\"}"; var response = gameLiftClient.RegisterGameServerAsync(registerGameServerRequest); response.Wait(); Console.WriteLine("Response HTTP code: " + response.Result.HttpStatusCode.ToString()); Console.WriteLine("Response game server: " + response.Result.GameServer.GameServerData.ToString()); Console.WriteLine("RegistrationRequest Sent!"); this.registeredToFleetIQ = true; } } }