Exemplo n.º 1
0
 public void SaveScore()
 {
     var userscore = new Score { Data = "1", Points = player.Score, UserName = username };
     Mogade.SaveScore(MogadeHelper.LeaderboardId(Leaderboards.Main), userscore, ScoreResponseHandler);
 }
Exemplo n.º 2
0
        private void GetText(IAsyncResult result)
        {
            string resultString = Guide.EndShowKeyboardInput(result);

            if (resultString.Length > 30)
            {
                resultString = resultString.Remove(30);
            }

            sblist.Clear();
            var userscore = new Score { Data = level.ToString(), Points = score, UserName = resultString };
            Mogade.SaveScore(MogadeHelper.LeaderboardId(Leaderboards.Main), userscore, ScoreResponseHandler);
            Mogade.GetRivals(MogadeHelper.LeaderboardId(Leaderboards.Main), LeaderboardScope.Overall, resultString, RivalResponseHandler);
            Mogade.GetLeaderboardCount(MogadeHelper.LeaderboardId(Leaderboards.Main), LeaderboardScope.Overall, TotalResponseHandler);
        }
Exemplo n.º 3
0
 public ScoreboardEntry(Score score)
 {
     username = score.UserName;
     level = score.Data;
     points = score.Points;
 }
Exemplo n.º 4
0
 public void SaveScore(string leaderboardId, Score score, string uniqueIdentifier, Action<Response<SavedScore>> callback)
 {
     var payload = new Dictionary<string, object> {{"lid", leaderboardId}, {"username", score.UserName}, {"userkey", uniqueIdentifier}, {"points", score.Points}, {"data", score.Data}};
      var communicator = new Communicator(this);
      communicator.SendPayload<SavedScore>(Communicator.Post, "scores", payload, r =>
      {
     if (r.Success) { r.Data = JsonConvert.DeserializeObject<SavedScore>(r.Raw); }
     if (callback != null) { callback(r); }
      });
 }