Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using ServerNite.API.Accounts;
- using Newtonsoft.Json;
- using Serilog;
- namespace ServerNite.API.Controllers
- {
- // Token: 0x0200004B RID: 75
- public sealed class ProfileController : Controller
- {
- // Token: 0x06000267 RID: 615 RVA: 0x0000E7BC File Offset: 0x0000C9BC
- [Route("POST", "/fortnite/api/game/v2/profile/*/client/QueryProfile")]
- public void QueryProfile()
- {
- this._accountId = base.Request.Url.Segments[base.Request.Url.Segments.Length - 3].Replace("/", "");
- if (!AccountManager.AccountExists(this._accountId))
- {
- base.Response.StatusCode = 404;
- return;
- }
- this._account = AccountManager.GetAccount(this._accountId);
- string a;
- base.Query.TryGetValue("profileId", out a);
- string text;
- base.Query.TryGetValue("rvn", out text);
- this._revision = Convert.ToInt32(text ?? "-2");
- if (a == "common_core")
- {
- this.QueryCommonCoreProfile();
- return;
- }
- if (a == "common_public")
- {
- this.QueryCommonPublicProfile();
- return;
- }
- if (!(a == "athena"))
- {
- base.Response.StatusCode = 500;
- return;
- }
- this.QueryAthenaProfile();
- }
- // Token: 0x06000268 RID: 616 RVA: 0x0000E8BC File Offset: 0x0000CABC
- private void QueryCommonCoreProfile()
- {
- HashSet<string> coreItems = this._account.CoreItems;
- Dictionary<string, object> dictionary = new Dictionary<string, object>();
- foreach (string templateId in coreItems)
- {
- dictionary.Add(Guid.NewGuid().ToString(), new
- {
- templateId = templateId,
- attributes = new
- {
- item_seen = 1
- },
- quantity = 1
- });
- }
- var <>f__AnonymousType = new
- {
- profileRevision = 8,
- profileId = "common_core",
- profileChangesBaseRevision = 8,
- profileChanges = new List<object>
- {
- new
- {
- changeType = "fullProfileUpdate",
- profile = new
- {
- _id = this._accountId,
- created = DateTime.Now.AddDays(-7.0).ToDateTimeString(),
- updated = DateTime.Now.AddDays(-1.0).ToDateTimeString(),
- rvn = 8,
- wipeNumber = 9,
- accountId = this._accountId,
- profileId = "common_core",
- version = "grant_skirmish_banners_october_2018",
- items = dictionary,
- stats = new
- {
- attributes = new
- {
- mtx_grace_balance = 0,
- import_friends_claimed = new List<object>(),
- mtx_purchase_history = new List<object>(),
- inventory_limit_bonus = 0,
- current_mtx_platform = "EpicPC",
- mtx_affiliate = "",
- weekly_purchases = new List<object>(),
- daily_purchases = new List<object>(),
- ban_history = new List<object>(),
- in_app_purchases = new List<object>(),
- monthly_purchases = new List<object>(),
- allowed_to_send_gifts = false,
- mfa_enabled = false,
- allowed_to_receive_gifts = false,
- gift_history = new List<object>()
- }
- },
- commandRevision = 4
- }
- }
- },
- profileCommandRevision = 4,
- serverTime = DateTime.Now.ToDateTimeString(),
- responseVersion = 1
- };
- Log.Information("Retrieved profile 'common_core' {AccountId}{Profile}{Revision}", this._accountId, f__AnonymousType, this._revision);
- base.Response.StatusCode = 200;
- base.Response.ContentType = "application/json";
- base.Response.Write(JsonConvert.SerializeObject(f__AnonymousType));
- }
- // Token: 0x06000269 RID: 617 RVA: 0x0000EA4C File Offset: 0x0000CC4C
- private void QueryCommonPublicProfile()
- {
- var <>f__AnonymousType = new
- {
- profileRevision = 1,
- profileId = "common_public",
- profileChangesBaseRevision = 1,
- profileChanges = new List<object>(),
- profileCommandRevision = 0,
- serverTime = DateTime.Now.ToDateTimeString(),
- responseVersion = 1
- };
- Log.Information("Retrieved profile 'common_public' {AccountId}{Profile}{Revision}", this._accountId, f__AnonymousType, this._revision);
- base.Response.StatusCode = 200;
- base.Response.ContentType = "application/json";
- base.Response.Write(JsonConvert.SerializeObject(f__AnonymousType));
- }
- // Token: 0x0600026A RID: 618 RVA: 0x0000EAC0 File Offset: 0x0000CCC0
- private void QueryAthenaProfile()
- {
- HashSet<string> athenaItems = this._account.AthenaItems;
- Dictionary<string, object> dictionary = new Dictionary<string, object>();
- foreach (string text in athenaItems)
- {
- string key = text;
- dictionary.Add(key, new
- {
- templateId = text,
- attributes = new
- {
- max_level_bonus = 0,
- level = 1,
- item_seen = 1,
- xp = 0,
- variants = new List<object>(),
- favorite = false
- },
- quantity = 1
- });
- }
- string[] array = new string[6];
- for (int i = 0; i < array.Length; i++)
- {
- array[i] = this._account.EquippedItems["favorite_dance" + i];
- }
- var <>f__AnonymousType = new
- {
- profileRevision = 10,
- profileId = "athena",
- profileChangesBaseRevision = 10,
- profileChanges = new List<object>
- {
- new
- {
- changeType = "fullProfileUpdate",
- profile = new
- {
- _id = this._accountId,
- created = DateTime.Now.AddDays(-7.0).ToDateTimeString(),
- updated = DateTime.Now.AddDays(-1.0).ToDateTimeString(),
- rvn = 10,
- wipeNumber = 5,
- accountId = this._accountId,
- profileId = "athena",
- version = "fortnitemares_part4_fixup_oct_18",
- items = dictionary,
- stats = new
- {
- attributes = new
- {
- past_seasons = new string[0],
- season_match_boost = 1000,
- favorite_victorypose = "",
- mfa_reward_claimed = false,
- quest_manager = new
- {
- dailyLoginInterval = DateTime.Now.AddDays(1.0).ToDateTimeString(),
- dailyQuestRerolls = 1
- },
- book_level = 0,
- season_num = 0,
- favorite_consumableemote = "",
- banner_color = "defaultcolor1",
- favorite_callingcard = "",
- favorite_character = this._account.EquippedItems["favorite_character"],
- favorite_spray = new string[0],
- book_xp = 0,
- favorite_loadingscreen = this._account.EquippedItems["favorite_loadingscreen"],
- book_purchased = false,
- lifetime_wins = 0,
- favorite_hat = "",
- level = 1000000,
- favorite_battlebus = "",
- favorite_mapmarker = "",
- favorite_vehicledeco = "",
- accountLevel = 1000000,
- favorite_backpack = this._account.EquippedItems["favorite_backpack"],
- favorite_dance = array,
- inventory_limit_bonus = 0,
- favorite_skydivecontrail = this._account.EquippedItems["favorite_skydivecontrail"],
- favorite_pickaxe = this._account.EquippedItems["favorite_pickaxe"],
- favorite_glider = this._account.EquippedItems["favorite_glider"],
- daily_rewards = new
- {
- },
- xp = 0,
- season_friend_match_boost = 0,
- favorite_musicpack = this._account.EquippedItems["favorite_musicpack"],
- banner_icon = "standardbanner1"
- }
- },
- commandRevision = 5
- }
- }
- },
- profileCommandRevision = 5,
- serverTime = DateTime.Now.ToDateTimeString(),
- responseVersion = 1
- };
- Log.Information("Retrieved profile 'athena' {AccountId}{Profile}{Revision}", this._accountId, f__AnonymousType, this._revision);
- base.Response.StatusCode = 200;
- base.Response.ContentType = "application/json";
- base.Response.Write(JsonConvert.SerializeObject(f__AnonymousType));
- }
- // Token: 0x04000145 RID: 325
- private string _accountId;
- // Token: 0x04000146 RID: 326
- private Account _account;
- // Token: 0x04000147 RID: 327
- private int _revision;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement