Example #1
0
    void UpdateGameSession()
    {
        if (myGameSession == null)
        {
            Debug.Log("1");
            return;
        }
        Debug.Log("2");

        UpdateGameSessionRequest updateGameSessionRequest = new UpdateGameSessionRequest()
        {
            GameSessionId             = myGameSession.GameSessionId,
            MaximumPlayerSessionCount = 12
                                        // GameSessionId = gameSession.GameSessionId,
        };

        try
        {
            Debug.Log("Updating game session");
            UGSR = m_Client.UpdateGameSession(updateGameSessionRequest);
            Debug.Log("Done Updating game session");
        }
        catch (Exception ex)
        {
            Handler(ex);
        }
        if (UGSR != null)
        {
            Debug.Log(UGSR.GameSession.MaximumPlayerSessionCount);
        }
        //return updateGameSessionResponse.GameSession;
    }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            UpdateGameSessionResponse response = new UpdateGameSessionResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("GameSession", targetDepth))
                {
                    var unmarshaller = GameSessionUnmarshaller.Instance;
                    response.GameSession = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }