/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>  
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            CreatePlayerSessionResponse response = new CreatePlayerSessionResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("PlayerSession", targetDepth))
                {
                    var unmarshaller = PlayerSessionUnmarshaller.Instance;
                    response.PlayerSession = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return response;
        }
Esempio n. 2
0
 public Amazon.GameLift.Model.PlayerSession CreatePlayerSession(Amazon.GameLift.Model.GameSession gsession)
 {
     try
     {
         var cpsreq = new Amazon.GameLift.Model.CreatePlayerSessionRequest();
         cpsreq.GameSessionId = gsession.GameSessionId;
         cpsreq.PlayerId      = playerId;
         Amazon.GameLift.Model.CreatePlayerSessionResponse cpsres = aglc.CreatePlayerSession(cpsreq);
         string psid = cpsres.PlayerSession != null ? cpsres.PlayerSession.PlayerSessionId : "N/A";
         Debug.Log((int)cpsres.HttpStatusCode + " PLAYER SESSION CREATED: " + psid);
         return(cpsres.PlayerSession);
     }
     catch (Amazon.GameLift.Model.InvalidGameSessionStatusException e)
     {
         Debug.Log(e.StatusCode.ToString() + " InvalidGameSessionStatusException: " + e.Message);
         return(null);
     }
 }