Exemplo n.º 1
0
    private void OnChallengeIssued(ChallengeIssuedMessage message)
    {
        Debug.Log("On Challenge Issued");
        var challengeInstaceId = message.Challenge.ChallengeId;

        Debug.Log("This challenge ID: " + challengeInstaceId);
        if (challengeInstaceId != null)
        {
            var acc = new AcceptChallengeRequest();
            acc.SetChallengeInstanceId(challengeInstaceId);
            acc.Send(OnChallengeIssuedSuccess);
        }
    }
 /// <summary>
 /// Begin a new AcceptChallengeRequest
 /// </summary>
 /// <param name="requestData"></param>
 /// <returns></returns>
 public AcceptChallengeResponse AcceptChallengeRequest(AcceptChallengeRequest requestData)
 {
     return(JsonConvert.DeserializeObject <AcceptChallengeResponse>(Requestor.PostString(Urls.AcceptChallengeRequest, JsonHelper.SerializeData(requestData)).ResponseJson));
 }
        /// <summary>
        /// Begin a new asynchronous AcceptChallengeRequest
        /// </summary>
        /// <param name="requestData"></param>
        /// <returns></returns>
        public async Task <AcceptChallengeResponse> AcceptChallengeRequestAsync(AcceptChallengeRequest requestData)
        {
            var res = await Requestor.PostStringAsync(Urls.AcceptChallengeRequest, JsonHelper.SerializeData(requestData));

            return(JsonConvert.DeserializeObject <AcceptChallengeResponse>(res.ResponseJson));
        }