void OnGetRankDetails(string errorString, RankDetail result, params object[] userParam)
    {
        if (string.IsNullOrEmpty(errorString))
        {
            BestScore = "0";

            if (result != null)
            {
                BestScore = result.Score.ToString();
            }
        }
        else
        {
            GetHighScoreOffline(UIStateManager.Manager.CurrentLeaderboardDetail);
        }
    }
Exemple #2
0
        private string GetRankForCallsign(string callsign)
        {
            string result = "0";

            using (CSSDataContext db = new CSSDataContext())
            {
                RankDetail rank = Alias.GetRankForCallsign(db, callsign);

                result = string.Format("0|{0}|{1}|{2}|{3}|{4}|{5}|{6}",
                                       (int)rank.Rank,
                                       GetRankNameFromRank((int)rank.Rank),
                                       rank.Sigma,
                                       rank.Mu,
                                       rank.CommandRank,
                                       rank.CommandSigma,
                                       rank.CommandMu);
            }

            return(result);
        }
Exemple #3
0
    RankDetail ToRankDetail(XmlNode node, ref string errorString)
    {
        try
        {
            RankDetail rank = null;
            if (node != null)
            {
                rank = new RankDetail();
                rank.PlayerUsername = node["PlayerUsername"].InnerText;
                rank.LeaderboardId = node["LeaderboardId"].InnerText;
                long longVal = -1;
                long.TryParse(node["Rank"].InnerText, out longVal);

                double scoreVal = -1;
                double.TryParse(node["Score"].InnerText, out scoreVal);
                rank.Score = scoreVal;
                rank.Rank = longVal;
                return rank;
            }
        }
        catch (Exception ex)
        {
            errorString = ex.Message;
        }
        return null;
    }
    void OnGetRankDetails(string errorString, RankDetail result, params object[] userParam)
    {
        RankText.text = "Not Available";
        if (string.IsNullOrEmpty(errorString))
        {
            BestScoreText.text = "0";
            RankText.text = "0";

            if (result != null)
            {
                ToggleConnectionMode.sprite = OnlineModeSprite;
                BestScoreText.text = result.Score.ToString();
                PlayerBestScore = result.Score.ToString();
                RankText.text = result.Rank.ToString();
            }
        }
        else
        {
            SetHighScoreOffline(LeaderboardDetail);
        }
    }