Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
1,490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.83 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using ServerNite.API.Accounts;
  4. using Newtonsoft.Json;
  5. using Serilog;
  6.  
  7. namespace ServerNite.API.Controllers
  8. {
  9. // Token: 0x0200004B RID: 75
  10. public sealed class ProfileController : Controller
  11. {
  12. // Token: 0x06000267 RID: 615 RVA: 0x0000E7BC File Offset: 0x0000C9BC
  13. [Route("POST", "/fortnite/api/game/v2/profile/*/client/QueryProfile")]
  14. public void QueryProfile()
  15. {
  16. this._accountId = base.Request.Url.Segments[base.Request.Url.Segments.Length - 3].Replace("/", "");
  17. if (!AccountManager.AccountExists(this._accountId))
  18. {
  19. base.Response.StatusCode = 404;
  20. return;
  21. }
  22. this._account = AccountManager.GetAccount(this._accountId);
  23. string a;
  24. base.Query.TryGetValue("profileId", out a);
  25. string text;
  26. base.Query.TryGetValue("rvn", out text);
  27. this._revision = Convert.ToInt32(text ?? "-2");
  28. if (a == "common_core")
  29. {
  30. this.QueryCommonCoreProfile();
  31. return;
  32. }
  33. if (a == "common_public")
  34. {
  35. this.QueryCommonPublicProfile();
  36. return;
  37. }
  38. if (!(a == "athena"))
  39. {
  40. base.Response.StatusCode = 500;
  41. return;
  42. }
  43. this.QueryAthenaProfile();
  44. }
  45.  
  46. // Token: 0x06000268 RID: 616 RVA: 0x0000E8BC File Offset: 0x0000CABC
  47. private void QueryCommonCoreProfile()
  48. {
  49. HashSet<string> coreItems = this._account.CoreItems;
  50. Dictionary<string, object> dictionary = new Dictionary<string, object>();
  51. foreach (string templateId in coreItems)
  52. {
  53. dictionary.Add(Guid.NewGuid().ToString(), new
  54. {
  55. templateId = templateId,
  56. attributes = new
  57. {
  58. item_seen = 1
  59. },
  60. quantity = 1
  61. });
  62. }
  63. var <>f__AnonymousType = new
  64. {
  65. profileRevision = 8,
  66. profileId = "common_core",
  67. profileChangesBaseRevision = 8,
  68. profileChanges = new List<object>
  69. {
  70. new
  71. {
  72. changeType = "fullProfileUpdate",
  73. profile = new
  74. {
  75. _id = this._accountId,
  76. created = DateTime.Now.AddDays(-7.0).ToDateTimeString(),
  77. updated = DateTime.Now.AddDays(-1.0).ToDateTimeString(),
  78. rvn = 8,
  79. wipeNumber = 9,
  80. accountId = this._accountId,
  81. profileId = "common_core",
  82. version = "grant_skirmish_banners_october_2018",
  83. items = dictionary,
  84. stats = new
  85. {
  86. attributes = new
  87. {
  88. mtx_grace_balance = 0,
  89. import_friends_claimed = new List<object>(),
  90. mtx_purchase_history = new List<object>(),
  91. inventory_limit_bonus = 0,
  92. current_mtx_platform = "EpicPC",
  93. mtx_affiliate = "",
  94. weekly_purchases = new List<object>(),
  95. daily_purchases = new List<object>(),
  96. ban_history = new List<object>(),
  97. in_app_purchases = new List<object>(),
  98. monthly_purchases = new List<object>(),
  99. allowed_to_send_gifts = false,
  100. mfa_enabled = false,
  101. allowed_to_receive_gifts = false,
  102. gift_history = new List<object>()
  103. }
  104. },
  105. commandRevision = 4
  106. }
  107. }
  108. },
  109. profileCommandRevision = 4,
  110. serverTime = DateTime.Now.ToDateTimeString(),
  111. responseVersion = 1
  112. };
  113. Log.Information("Retrieved profile 'common_core' {AccountId}{Profile}{Revision}", this._accountId, f__AnonymousType, this._revision);
  114. base.Response.StatusCode = 200;
  115. base.Response.ContentType = "application/json";
  116. base.Response.Write(JsonConvert.SerializeObject(f__AnonymousType));
  117. }
  118.  
  119. // Token: 0x06000269 RID: 617 RVA: 0x0000EA4C File Offset: 0x0000CC4C
  120. private void QueryCommonPublicProfile()
  121. {
  122. var <>f__AnonymousType = new
  123. {
  124. profileRevision = 1,
  125. profileId = "common_public",
  126. profileChangesBaseRevision = 1,
  127. profileChanges = new List<object>(),
  128. profileCommandRevision = 0,
  129. serverTime = DateTime.Now.ToDateTimeString(),
  130. responseVersion = 1
  131. };
  132. Log.Information("Retrieved profile 'common_public' {AccountId}{Profile}{Revision}", this._accountId, f__AnonymousType, this._revision);
  133. base.Response.StatusCode = 200;
  134. base.Response.ContentType = "application/json";
  135. base.Response.Write(JsonConvert.SerializeObject(f__AnonymousType));
  136. }
  137.  
  138. // Token: 0x0600026A RID: 618 RVA: 0x0000EAC0 File Offset: 0x0000CCC0
  139. private void QueryAthenaProfile()
  140. {
  141. HashSet<string> athenaItems = this._account.AthenaItems;
  142. Dictionary<string, object> dictionary = new Dictionary<string, object>();
  143. foreach (string text in athenaItems)
  144. {
  145. string key = text;
  146. dictionary.Add(key, new
  147. {
  148. templateId = text,
  149. attributes = new
  150. {
  151. max_level_bonus = 0,
  152. level = 1,
  153. item_seen = 1,
  154. xp = 0,
  155. variants = new List<object>(),
  156. favorite = false
  157. },
  158. quantity = 1
  159. });
  160. }
  161. string[] array = new string[6];
  162. for (int i = 0; i < array.Length; i++)
  163. {
  164. array[i] = this._account.EquippedItems["favorite_dance" + i];
  165. }
  166. var <>f__AnonymousType = new
  167. {
  168. profileRevision = 10,
  169. profileId = "athena",
  170. profileChangesBaseRevision = 10,
  171. profileChanges = new List<object>
  172. {
  173. new
  174. {
  175. changeType = "fullProfileUpdate",
  176. profile = new
  177. {
  178. _id = this._accountId,
  179. created = DateTime.Now.AddDays(-7.0).ToDateTimeString(),
  180. updated = DateTime.Now.AddDays(-1.0).ToDateTimeString(),
  181. rvn = 10,
  182. wipeNumber = 5,
  183. accountId = this._accountId,
  184. profileId = "athena",
  185. version = "fortnitemares_part4_fixup_oct_18",
  186. items = dictionary,
  187. stats = new
  188. {
  189. attributes = new
  190. {
  191. past_seasons = new string[0],
  192. season_match_boost = 1000,
  193. favorite_victorypose = "",
  194. mfa_reward_claimed = false,
  195. quest_manager = new
  196. {
  197. dailyLoginInterval = DateTime.Now.AddDays(1.0).ToDateTimeString(),
  198. dailyQuestRerolls = 1
  199. },
  200. book_level = 0,
  201. season_num = 0,
  202. favorite_consumableemote = "",
  203. banner_color = "defaultcolor1",
  204. favorite_callingcard = "",
  205. favorite_character = this._account.EquippedItems["favorite_character"],
  206. favorite_spray = new string[0],
  207. book_xp = 0,
  208. favorite_loadingscreen = this._account.EquippedItems["favorite_loadingscreen"],
  209. book_purchased = false,
  210. lifetime_wins = 0,
  211. favorite_hat = "",
  212. level = 1000000,
  213. favorite_battlebus = "",
  214. favorite_mapmarker = "",
  215. favorite_vehicledeco = "",
  216. accountLevel = 1000000,
  217. favorite_backpack = this._account.EquippedItems["favorite_backpack"],
  218. favorite_dance = array,
  219. inventory_limit_bonus = 0,
  220. favorite_skydivecontrail = this._account.EquippedItems["favorite_skydivecontrail"],
  221. favorite_pickaxe = this._account.EquippedItems["favorite_pickaxe"],
  222. favorite_glider = this._account.EquippedItems["favorite_glider"],
  223. daily_rewards = new
  224. {
  225.  
  226. },
  227. xp = 0,
  228. season_friend_match_boost = 0,
  229. favorite_musicpack = this._account.EquippedItems["favorite_musicpack"],
  230. banner_icon = "standardbanner1"
  231. }
  232. },
  233. commandRevision = 5
  234. }
  235. }
  236. },
  237. profileCommandRevision = 5,
  238. serverTime = DateTime.Now.ToDateTimeString(),
  239. responseVersion = 1
  240. };
  241. Log.Information("Retrieved profile 'athena' {AccountId}{Profile}{Revision}", this._accountId, f__AnonymousType, this._revision);
  242. base.Response.StatusCode = 200;
  243. base.Response.ContentType = "application/json";
  244. base.Response.Write(JsonConvert.SerializeObject(f__AnonymousType));
  245. }
  246.  
  247. // Token: 0x04000145 RID: 325
  248. private string _accountId;
  249.  
  250. // Token: 0x04000146 RID: 326
  251. private Account _account;
  252.  
  253. // Token: 0x04000147 RID: 327
  254. private int _revision;
  255. }
  256. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement