Exemplo n.º 1
0
        /// <summary>
        /// Retrieves a leaderboard with all the user's friends.
        /// </summary>
        /// <param name="index">The index of user</param>
        /// <param name="id">The ID of the leaderboard to retrieve.</param>
        /// <param name="replaceName">If true, the player's name is replaced by the string "You".</param>
        public async Task <RuyiNetSocialLeaderboardResponse> GetSocialLeaderboard(int index, string id, bool replaceName)
        {
            var data = new RuyiNetGetSocialLeaderboardRequest()
            {
                leaderboardId = mClient.AppId + "_" + id,
                replaceName   = replaceName
            };

            var resp = await mClient.BCService.Script_RunParentScriptAsync("GetSocialLeaderboard", JsonConvert.SerializeObject(data), "RUYI", index, token);

            return(mClient.Process <RuyiNetSocialLeaderboardResponse>(resp));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Retrieves a leaderboard with all the user's friends.
        /// </summary>
        /// <param name="index">The index of user</param>
        /// <param name="id">The ID of the leaderboard to retrieve.</param>
        /// <param name="replaceName">If true, the player's name is replaced by the string "You".</param>
        /// <param name="callback">The function to call when the data is retrieved.</param>
        public void GetSocialLeaderboard(int index, string id, bool replaceName,
                                         RuyiNetTask <RuyiNetSocialLeaderboardResponse> .CallbackType callback)
        {
            EnqueueTask(() =>
            {
                var data = new RuyiNetGetSocialLeaderboardRequest()
                {
                    leaderboardId = mClient.AppId + "_" + id,
                    replaceName   = replaceName
                };

                return(mClient.BCService.Script_RunParentScriptAsync("GetSocialLeaderboard", JsonConvert.SerializeObject(data), "RUYI", index, token).Result);
            }, callback);
        }