Exemple #1
0
 public static IAsyncResult GetAll(string gameId, string privateKey, string username, string userToken, TrophyFilter filter, Action <Trophy[]> callback)
 {
     return(BeginGetAll(gameId, privateKey, username, userToken, filter, result => callback(EndGetAll(result))));
 }
Exemple #2
0
        public static IAsyncResult BeginGetAll(string gameId, string privateKey, string username, string userToken, TrophyFilter filter = TrophyFilter.All, AsyncCallback callback = null, object asyncState = null)
        {
            var request = TrophyRequestFactory.CreateGetRequest(gameId, privateKey, username, userToken, filter);

            return(request.Begin(callback, asyncState));
        }
Exemple #3
0
        public static Trophy[] GetAll(string gameId, string privateKey, string username, string userToken, TrophyFilter filter = TrophyFilter.All)
        {
            var request = TrophyRequestFactory.CreateGetRequest(gameId, privateKey, username, userToken, filter);

            return(request.Process(null));
        }
Exemple #4
0
        public static JsonRequest <Trophy[], TrophyResult> CreateGetRequest(string gameId, string publicKey, string username, string userToken, TrophyFilter filter)
        {
            var request = new JsonRequest <Trophy[], TrophyResult>(gameId, publicKey, Constants.TrophyUrls.GetUrl, RequestParameter.CreateUsername(username), RequestParameter.CreateUserToken(userToken));

            switch (filter)
            {
            case TrophyFilter.Achieved:
            {
                request.Parameters.Add("achieved", true);
                break;
            }

            case TrophyFilter.Unachieved:
            {
                request.Parameters.Add("unachieved", false);
                break;
            }
            }
            return(request);
        }