コード例 #1
0
        // Token: 0x06000092 RID: 146 RVA: 0x000049A0 File Offset: 0x00002BA0
        public async Task <List <User> > DownloadSocialGraphAsync()
        {
            List <User> following = new List <User>();
            Response    response4 = await XBLCall.GetAsync(this.SocialGraphBaseURI + "/users/me/people", this.TokenManager.userHash, this.TokenManager.XToken, "2");

            Response response2 = response4;

            response4 = null;
            Response response3 = response2;

            response2 = null;
            Response resp = response3;

            response3 = null;
            SocialGraphResponseContract responseBody = JsonConvert.DeserializeObject <SocialGraphResponseContract>(resp.responseBody);

            foreach (SocialGraphPersonContract s in responseBody.SocialGraphPeople)
            {
                User user = new User();
                user.xuid            = s.Xuid;
                user.isFollowingBack = s.IsFollowingCaller;
                user.isFavorite      = s.IsFavorite;
                following.Add(user);
                user = null;
                user = null;
                user = null;
                s    = null;
            }
            SocialGraphPersonContract[] array = null;
            return(following);
        }
コード例 #2
0
        // Token: 0x06000093 RID: 147 RVA: 0x000049E8 File Offset: 0x00002BE8
        public async Task UpdateSocialGraphBatchAsync(List <User> users, SocialGraphOperation operation)
        {
            bool flag  = users.Count > 25;
            bool flag2 = flag;
            bool flag3 = flag2;

            if (flag3)
            {
                throw new ArgumentException("AddFollowers can only add " + 25 + " followers at a time");
            }
            this.logger.LogToOutputWindow("Calling social graph with " + users.Count + " xuids...");
            SocialGraphRequestContract requestBody = new SocialGraphRequestContract
            {
                xuids = users.ToXuidArray()
            };
            string body = JsonConvert.SerializeObject(requestBody);

            try
            {
                switch (operation)
                {
                case SocialGraphOperation.Favorite:
                {
                    Response response = await XBLCall.PostAsync(this.SocialGraphBaseURI + "/users/xuid(" + this.TokenManager.xuid + ")/people/favorites/xuids?method=add", body, this.TokenManager.userHash, this.TokenManager.XToken, "2");

                    break;
                }

                case SocialGraphOperation.Unfavorite:
                {
                    Response response2 = await XBLCall.PostAsync(this.SocialGraphBaseURI + "/users/xuid(" + this.TokenManager.xuid + ")/people/favorites/xuids?method=remove", body, this.TokenManager.userHash, this.TokenManager.XToken, "2");

                    break;
                }

                case SocialGraphOperation.Follow:
                {
                    Response response3 = await XBLCall.PostAsync(this.SocialGraphBaseURI + "/users/xuid(" + this.TokenManager.xuid + ")/people/xuids?method=add", body, this.TokenManager.userHash, this.TokenManager.XToken, "2");

                    break;
                }

                case SocialGraphOperation.Unfollow:
                {
                    Response response4 = await XBLCall.PostAsync(this.SocialGraphBaseURI + "/users/xuid(" + this.TokenManager.xuid + ")/people/xuids?method=remove", body, this.TokenManager.userHash, this.TokenManager.XToken, "2");

                    break;
                }
                }
            }
            catch (Exception ex)
            {
                this.logger.LogToOutputWindow("Failed to update social graph, error: " + ex.Message, Colors.Red);
            }
        }
コード例 #3
0
		// Token: 0x06000089 RID: 137 RVA: 0x00004768 File Offset: 0x00002968
		private async Task BatchPrivacyCallAsync(List<User> PrivacyXuidBatch, PrivacyOperation operation)
		{
			bool flag = PrivacyXuidBatch.Count > 10;
			bool flag2 = flag;
			bool flag3 = flag2;
			if (flag3)
			{
				throw new ArgumentException("PrivacyXuidBatch can only update " + 10.ToString() + " users at a time");
			}
			string operationStr = (operation == PrivacyOperation.Block) ? "Add" : "Remove";
			PrivacyRequestContract privacyRequestData = new PrivacyRequestContract
			{
				Operation = operationStr,
				Users = PrivacyXuidBatch.ToPrivacyUserArray()
			};
			string body = JsonConvert.SerializeObject(privacyRequestData);
			this.logger.LogToOutputWindow("Attempting to update block list status for " + PrivacyXuidBatch.Count + " xuids...");
			Response response = await XBLCall.PostAsync(this.PrivacyBaseURI + "/users/xuid(" + this.TokenManager.xuid + ")/people/never", body, this.TokenManager.userHash, this.TokenManager.XToken, "2");
		}
コード例 #4
0
        // Token: 0x06000085 RID: 133 RVA: 0x00004654 File Offset: 0x00002854
        public async Task UpdateGamertagAsync(string gamertag)
        {
            try
            {
                string requestBody = JsonConvert.SerializeObject(new AccountsGtChangeRequestContract
                {
                    Gamertag = gamertag
                });
                Response response = await XBLCall.PostAsync(this.AccountsBaseURI + "/gamertag", requestBody, this.TokenManager.userHash, this.TokenManager.XToken, "2");

                this.logger.LogToOutputWindow(Environment.NewLine + "Gamertag changed successfully.", Colors.Green);
                requestBody = null;
                requestBody = null;
                requestBody = null;
            }
            catch (Exception Exception)
            {
                this.logger.LogToOutputWindow(Exception.Message, Colors.Red);
            }
        }
コード例 #5
0
		// Token: 0x06000087 RID: 135 RVA: 0x000046C8 File Offset: 0x000028C8
		public async Task<List<User>> DownloadBlockListAsync()
		{
			List<User> blockList = new List<User>();
			Response response4 = await XBLCall.GetAsync(this.PrivacyBaseURI + "/users/xuid(" + this.TokenManager.xuid + ")/people/avoid", this.TokenManager.userHash, this.TokenManager.XToken, "2");
			Response response2 = response4;
			response4 = null;
			Response response3 = response2;
			response2 = null;
			Response resp = response3;
			response3 = null;
			PrivacyResponseContract privacyResponse = JsonConvert.DeserializeObject<PrivacyResponseContract>(resp.responseBody);
			foreach (PrivacyUserContract p in privacyResponse.Users)
			{
				blockList.Add(new User
				{
					xuid = p.Xuid
				});
				p = null;
			}
			PrivacyUserContract[] array = null;
			return blockList;
		}
コード例 #6
0
        // Token: 0x0600008F RID: 143 RVA: 0x000048C8 File Offset: 0x00002AC8
        public async Task ResetRepAsync(string fairplayRep, string commsRep, string UGCRep)
        {
            try
            {
                ReputationChangeRequestContract repRequestContract = new ReputationChangeRequestContract
                {
                    FairplayRepuation     = fairplayRep,
                    CommsReputation       = commsRep,
                    UserContentReputation = UGCRep
                };
                Response response = await XBLCall.PostAsync(this.ReputationBaseURI, JsonConvert.SerializeObject(repRequestContract), this.TokenManager.userHash, this.TokenManager.XToken, "101");

                this.logger.LogToOutputWindow("Reputation set successfully.");
                repRequestContract = null;
                repRequestContract = null;
                repRequestContract = null;
            }
            catch (Exception e)
            {
                this.logger.LogToOutputWindow("Error resetting reputation: " + e.Message);
            }
        }
コード例 #7
0
        // Token: 0x0600008B RID: 139 RVA: 0x000047DC File Offset: 0x000029DC
        public async Task <Dictionary <ProfileSettingName, string> > CallProfileService()
        {
            Response response4 = await XBLCall.PostAsync("https://profile.xboxlive.com/users/batch/profile/settings", this.SerializeRequestBody(), this.TokenManager.userHash, this.TokenManager.XToken, "2");

            Response response2 = response4;

            response4 = null;
            Response response3 = response2;

            response2 = null;
            Response resp = response3;

            response3 = null;
            ProfileResponseContract profileResponse = JsonConvert.DeserializeObject <ProfileResponseContract>(resp.responseBody);

            foreach (ProfileSettingContract setting in profileResponse.profileUsers[0].settings)
            {
                this.ProfileSettingById[ProfileDataAccess.StringToProfileSettingName(setting.id)] = setting.value;
                setting = null;
            }
            ProfileSettingContract[] array = null;
            return(this.ProfileSettingById);
        }
コード例 #8
0
        // Token: 0x0600009D RID: 157 RVA: 0x00004B38 File Offset: 0x00002D38
        public async Task <Dictionary <StatName, string> > DownloadAllStatsAsync()
        {
            Dictionary <StatName, string> repStats = new Dictionary <StatName, string>();
            Response response4 = await XBLCall.GetAsync(this.GetStatsURI(), this.tokenManager.userHash, this.tokenManager.XToken, "1");

            Response response2 = response4;

            response4 = null;
            Response response3 = response2;

            response2 = null;
            Response resp = response3;

            response3 = null;
            StatsResponseContract statsResponse = JsonConvert.DeserializeObject <StatsResponseContract>(resp.responseBody);

            foreach (StatContract stat in statsResponse.stats)
            {
                repStats[StatsDataAccess.ToStatName(stat.statname)] = stat.value;
                stat = null;
            }
            StatContract[] array = null;
            return(repStats);
        }