PageLoginAuthSkin.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. using System;
  2. using System.CodeDom.Compiler;
  3. using System.ComponentModel;
  4. using System.Runtime.CompilerServices;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Input;
  8. using System.Windows.Markup;
  9. using Microsoft.VisualBasic;
  10. using Microsoft.VisualBasic.CompilerServices;
  11. namespace PCL
  12. {
  13. // Token: 0x020000F2 RID: 242
  14. [DesignerGenerated]
  15. public class PageLoginAuthSkin : Grid, IComponentConnector
  16. {
  17. // Token: 0x06000937 RID: 2359 RVA: 0x00006B29 File Offset: 0x00004D29
  18. public PageLoginAuthSkin()
  19. {
  20. base.Loaded += delegate(object sender, RoutedEventArgs e)
  21. {
  22. this.PageLoginLegacy_Loaded();
  23. };
  24. this.InitializeComponent();
  25. this.Skin.callbackMapper = PageLaunchLeft.m_FacadeMapper;
  26. }
  27. // Token: 0x06000938 RID: 2360 RVA: 0x00006B5A File Offset: 0x00004D5A
  28. private void PageLoginLegacy_Loaded()
  29. {
  30. this.Skin.callbackMapper.Start(null, false);
  31. }
  32. // Token: 0x06000939 RID: 2361 RVA: 0x00047E08 File Offset: 0x00046008
  33. public void Reload(bool KeepInput)
  34. {
  35. this.TextName.Text = Conversions.ToString(ModBase.m_IdentifierRepository.Get("CacheAuthName", null));
  36. this.TextEmail.Text = Conversions.ToString(ModBase.m_IdentifierRepository.Get("CacheAuthUsername", null));
  37. this.TextEmail.Visibility = (Conversions.ToBoolean(ModBase.m_IdentifierRepository.Get("UiLauncherEmail", null)) ? Visibility.Collapsed : Visibility.Visible);
  38. this.PageLoginLegacy_Loaded();
  39. }
  40. // Token: 0x0600093A RID: 2362 RVA: 0x00047E84 File Offset: 0x00046084
  41. public static ModLaunch.McLoginServer GetLoginData()
  42. {
  43. string interpreterMap = Conversions.ToString(Operators.ConcatenateObject(Information.IsNothing(ModMinecraft.AddClient()) ? ModBase.m_IdentifierRepository.Get("CacheAuthServerServer", null) : ModBase.m_IdentifierRepository.Get("VersionServerAuthServer", ModMinecraft.AddClient()), "/authserver"));
  44. return new ModLaunch.McLoginServer(ModLaunch.McLoginType.Auth)
  45. {
  46. m_SerializerMap = "Auth",
  47. interpreterMap = interpreterMap,
  48. m_IssuerMap = Conversions.ToString(ModBase.m_IdentifierRepository.Get("CacheAuthUsername", null)),
  49. _IndexerMap = Conversions.ToString(ModBase.m_IdentifierRepository.Get("CacheAuthPass", null)),
  50. m_WatcherMap = "Authlib-Injector",
  51. Type = ModLaunch.McLoginType.Auth
  52. };
  53. }
  54. // Token: 0x0600093B RID: 2363 RVA: 0x00047F34 File Offset: 0x00046134
  55. private void PageLoginAuthSkin_MouseEnter(object sender, MouseEventArgs e)
  56. {
  57. ModAnimation.AniStart(new ModAnimation.AniData[]
  58. {
  59. ModAnimation.AaOpacity(this.BtnEdit, 1.0 - this.BtnEdit.Opacity, 80, 0, null, false),
  60. ModAnimation.AaHeight(this.BtnEdit, 25.5 - this.BtnEdit.Height, 140, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false),
  61. ModAnimation.AaHeight(this.BtnEdit, -1.5, 50, 140, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false),
  62. ModAnimation.AaOpacity(this.BtnExit, 1.0 - this.BtnExit.Opacity, 80, 0, null, false),
  63. ModAnimation.AaHeight(this.BtnExit, 25.5 - this.BtnExit.Height, 140, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false),
  64. ModAnimation.AaHeight(this.BtnExit, -1.5, 50, 140, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false)
  65. }, "PageLoginAuthSkin Button", false);
  66. }
  67. // Token: 0x0600093C RID: 2364 RVA: 0x00048064 File Offset: 0x00046264
  68. private void PageLoginAuthSkin_MouseLeave(object sender, MouseEventArgs e)
  69. {
  70. ModAnimation.AniStart(new ModAnimation.AniData[]
  71. {
  72. ModAnimation.AaOpacity(this.BtnEdit, -this.BtnEdit.Opacity, 120, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false),
  73. ModAnimation.AaHeight(this.BtnEdit, 14.0 - this.BtnEdit.Height, 120, 0, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false),
  74. ModAnimation.AaOpacity(this.BtnExit, -this.BtnExit.Opacity, 120, 0, new ModAnimation.AniEaseOutFluent(ModAnimation.AniEasePower.Middle), false),
  75. ModAnimation.AaHeight(this.BtnExit, 14.0 - this.BtnExit.Height, 120, 0, new ModAnimation.AniEaseInFluent(ModAnimation.AniEasePower.Middle), false)
  76. }, "PageLoginAuthSkin Button", false);
  77. }
  78. // Token: 0x0600093D RID: 2365 RVA: 0x00048134 File Offset: 0x00046334
  79. private void BtnEdit_Click(object sender, EventArgs e)
  80. {
  81. if (ModLaunch.interceptorTests.State != ModBase.LoadState.Loading)
  82. {
  83. ModMain.Hint("正在尝试更换,请稍候!", ModMain.HintType.Info, true);
  84. ModBase.m_IdentifierRepository.Set("CacheAuthUuid", "", false, null);
  85. ModBase.m_IdentifierRepository.Set("CacheAuthName", "", false, null);
  86. ModBase.RunInThread(delegate
  87. {
  88. try
  89. {
  90. ModLaunch.McLoginServer loginData = PageLoginAuthSkin.GetLoginData();
  91. loginData._IdentifierMap = true;
  92. ModLaunch.interceptorTests.WaitForExit(loginData, null, true);
  93. ModBase.RunInUi(delegate()
  94. {
  95. this.Reload(true);
  96. }, false);
  97. }
  98. catch (Exception ex)
  99. {
  100. ModBase.Log(ex, "更换角色失败", ModBase.LogLevel.Hint, "出现错误");
  101. }
  102. });
  103. return;
  104. }
  105. ModBase.Log("[Launch] 要求更换角色,但登录加载器繁忙", ModBase.LogLevel.Debug, "出现错误");
  106. if (((ModLaunch.McLoginServer)ModLaunch.interceptorTests.Input)._IdentifierMap)
  107. {
  108. ModMain.Hint("正在尝试更换,请稍候!", ModMain.HintType.Info, true);
  109. return;
  110. }
  111. ModMain.Hint("正在登录中,请稍后再更换角色!", ModMain.HintType.Critical, true);
  112. }
  113. // Token: 0x0600093E RID: 2366 RVA: 0x000481D8 File Offset: 0x000463D8
  114. public static void ExitLogin()
  115. {
  116. ModBase.m_IdentifierRepository.Set("CacheAuthAccess", "", false, null);
  117. ModBase.m_IdentifierRepository.Set("CacheAuthUuid", "", false, null);
  118. ModBase.m_IdentifierRepository.Set("CacheAuthName", "", false, null);
  119. ModLaunch._ProcessTests.Input = null;
  120. ModMain.recordIterator.RefreshPage(false, true);
  121. }
  122. // Token: 0x0600093F RID: 2367 RVA: 0x00048240 File Offset: 0x00046440
  123. private void Skin_Click(object sender, MouseButtonEventArgs e)
  124. {
  125. string text = Conversions.ToString((ModMinecraft.AddClient() != null) ? ModBase.m_IdentifierRepository.Get("VersionServerAuthRegister", ModMinecraft.AddClient()) : ModBase.m_IdentifierRepository.Get("CacheAuthServerRegister", null));
  126. if (string.IsNullOrEmpty(new ValidateHttp().Validate(text)))
  127. {
  128. ModBase.OpenWebsite(text.Replace("/auth/register", "/user/closet"));
  129. }
  130. }
  131. // Token: 0x17000145 RID: 325
  132. // (get) Token: 0x06000940 RID: 2368 RVA: 0x00006B6E File Offset: 0x00004D6E
  133. // (set) Token: 0x06000941 RID: 2369 RVA: 0x000482A8 File Offset: 0x000464A8
  134. internal virtual Grid PanData
  135. {
  136. [CompilerGenerated]
  137. get
  138. {
  139. return this.methodClient;
  140. }
  141. [CompilerGenerated]
  142. set
  143. {
  144. MouseEventHandler value2 = new MouseEventHandler(this.PageLoginAuthSkin_MouseEnter);
  145. MouseEventHandler value3 = new MouseEventHandler(this.PageLoginAuthSkin_MouseLeave);
  146. Grid grid = this.methodClient;
  147. if (grid != null)
  148. {
  149. grid.MouseEnter -= value2;
  150. grid.MouseLeave -= value3;
  151. }
  152. this.methodClient = value;
  153. grid = this.methodClient;
  154. if (grid != null)
  155. {
  156. grid.MouseEnter += value2;
  157. grid.MouseLeave += value3;
  158. }
  159. }
  160. }
  161. // Token: 0x17000146 RID: 326
  162. // (get) Token: 0x06000942 RID: 2370 RVA: 0x00006B76 File Offset: 0x00004D76
  163. // (set) Token: 0x06000943 RID: 2371 RVA: 0x00006B7E File Offset: 0x00004D7E
  164. internal virtual TextBlock TextName { get; set; }
  165. // Token: 0x17000147 RID: 327
  166. // (get) Token: 0x06000944 RID: 2372 RVA: 0x00006B87 File Offset: 0x00004D87
  167. // (set) Token: 0x06000945 RID: 2373 RVA: 0x00006B8F File Offset: 0x00004D8F
  168. internal virtual TextBlock TextEmail { get; set; }
  169. // Token: 0x17000148 RID: 328
  170. // (get) Token: 0x06000946 RID: 2374 RVA: 0x00006B98 File Offset: 0x00004D98
  171. // (set) Token: 0x06000947 RID: 2375 RVA: 0x00048308 File Offset: 0x00046508
  172. internal virtual MyIconButton BtnEdit
  173. {
  174. [CompilerGenerated]
  175. get
  176. {
  177. return this.configurationClient;
  178. }
  179. [CompilerGenerated]
  180. set
  181. {
  182. MyIconButton.ClickEventHandler value2 = new MyIconButton.ClickEventHandler(this.BtnEdit_Click);
  183. MyIconButton myIconButton = this.configurationClient;
  184. if (myIconButton != null)
  185. {
  186. myIconButton.Click -= value2;
  187. }
  188. this.configurationClient = value;
  189. myIconButton = this.configurationClient;
  190. if (myIconButton != null)
  191. {
  192. myIconButton.Click += value2;
  193. }
  194. }
  195. }
  196. // Token: 0x17000149 RID: 329
  197. // (get) Token: 0x06000948 RID: 2376 RVA: 0x00006BA0 File Offset: 0x00004DA0
  198. // (set) Token: 0x06000949 RID: 2377 RVA: 0x0004834C File Offset: 0x0004654C
  199. internal virtual MyIconButton BtnExit
  200. {
  201. [CompilerGenerated]
  202. get
  203. {
  204. return this.getterClient;
  205. }
  206. [CompilerGenerated]
  207. set
  208. {
  209. MyIconButton.ClickEventHandler value2 = (PageLoginAuthSkin._Closure$__.$IR27-2 == null) ? (PageLoginAuthSkin._Closure$__.$IR27-2 = delegate(object sender, EventArgs e)
  210. {
  211. PageLoginAuthSkin.ExitLogin();
  212. }) : PageLoginAuthSkin._Closure$__.$IR27-2;
  213. MyIconButton myIconButton = this.getterClient;
  214. if (myIconButton != null)
  215. {
  216. myIconButton.Click -= value2;
  217. }
  218. this.getterClient = value;
  219. myIconButton = this.getterClient;
  220. if (myIconButton != null)
  221. {
  222. myIconButton.Click += value2;
  223. }
  224. }
  225. }
  226. // Token: 0x1700014A RID: 330
  227. // (get) Token: 0x0600094A RID: 2378 RVA: 0x00006BA8 File Offset: 0x00004DA8
  228. // (set) Token: 0x0600094B RID: 2379 RVA: 0x000483A8 File Offset: 0x000465A8
  229. internal virtual MySkin Skin
  230. {
  231. [CompilerGenerated]
  232. get
  233. {
  234. return this.m_TokenClient;
  235. }
  236. [CompilerGenerated]
  237. set
  238. {
  239. MySkin.ClickEventHandler value2 = new MySkin.ClickEventHandler(this.Skin_Click);
  240. MySkin tokenClient = this.m_TokenClient;
  241. if (tokenClient != null)
  242. {
  243. tokenClient.Click -= value2;
  244. }
  245. this.m_TokenClient = value;
  246. tokenClient = this.m_TokenClient;
  247. if (tokenClient != null)
  248. {
  249. tokenClient.Click += value2;
  250. }
  251. }
  252. }
  253. // Token: 0x0600094C RID: 2380 RVA: 0x000483EC File Offset: 0x000465EC
  254. [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  255. public void InitializeComponent()
  256. {
  257. if (!this.expressionClient)
  258. {
  259. this.expressionClient = true;
  260. Uri resourceLocator = new Uri("/Plain Craft Launcher 2;component/pages/pagelaunch/pageloginauthskin.xaml", UriKind.Relative);
  261. Application.LoadComponent(this, resourceLocator);
  262. }
  263. }
  264. // Token: 0x0600094D RID: 2381 RVA: 0x0000414E File Offset: 0x0000234E
  265. [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  266. internal Delegate _CreateDelegate(Type delegateType, string handler)
  267. {
  268. return Delegate.CreateDelegate(delegateType, this, handler);
  269. }
  270. // Token: 0x0600094E RID: 2382 RVA: 0x0004841C File Offset: 0x0004661C
  271. [EditorBrowsable(EditorBrowsableState.Never)]
  272. [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  273. public void System_Windows_Markup_IComponentConnector_Connect(int connectionId, object target)
  274. {
  275. if (connectionId == 1)
  276. {
  277. this.PanData = (Grid)target;
  278. return;
  279. }
  280. if (connectionId == 2)
  281. {
  282. this.TextName = (TextBlock)target;
  283. return;
  284. }
  285. if (connectionId == 3)
  286. {
  287. this.TextEmail = (TextBlock)target;
  288. return;
  289. }
  290. if (connectionId == 4)
  291. {
  292. this.BtnEdit = (MyIconButton)target;
  293. return;
  294. }
  295. if (connectionId == 5)
  296. {
  297. this.BtnExit = (MyIconButton)target;
  298. return;
  299. }
  300. if (connectionId == 6)
  301. {
  302. this.Skin = (MySkin)target;
  303. return;
  304. }
  305. this.expressionClient = true;
  306. }
  307. // Token: 0x040004E2 RID: 1250
  308. [CompilerGenerated]
  309. [AccessedThroughProperty("PanData")]
  310. private Grid methodClient;
  311. // Token: 0x040004E3 RID: 1251
  312. [AccessedThroughProperty("TextName")]
  313. [CompilerGenerated]
  314. private TextBlock taskClient;
  315. // Token: 0x040004E4 RID: 1252
  316. [AccessedThroughProperty("TextEmail")]
  317. [CompilerGenerated]
  318. private TextBlock consumerClient;
  319. // Token: 0x040004E5 RID: 1253
  320. [AccessedThroughProperty("BtnEdit")]
  321. [CompilerGenerated]
  322. private MyIconButton configurationClient;
  323. // Token: 0x040004E6 RID: 1254
  324. [AccessedThroughProperty("BtnExit")]
  325. [CompilerGenerated]
  326. private MyIconButton getterClient;
  327. // Token: 0x040004E7 RID: 1255
  328. [AccessedThroughProperty("Skin")]
  329. [CompilerGenerated]
  330. private MySkin m_TokenClient;
  331. // Token: 0x040004E8 RID: 1256
  332. private bool expressionClient;
  333. }
  334. }