public void SaveScore() { var userscore = new Score { Data = "1", Points = player.Score, UserName = username }; Mogade.SaveScore(MogadeHelper.LeaderboardId(Leaderboards.Main), userscore, ScoreResponseHandler); }
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); }
public ScoreboardEntry(Score score) { username = score.UserName; level = score.Data; points = score.Points; }
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); } }); }