ModSecret.cs 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Diagnostics;
  6. using System.Globalization;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Net;
  10. using System.Security.Cryptography;
  11. using System.Text;
  12. using System.Threading;
  13. using System.Windows;
  14. using System.Windows.Media;
  15. using Microsoft.VisualBasic;
  16. using Microsoft.VisualBasic.CompilerServices;
  17. using Newtonsoft.Json.Linq;
  18. using PCL.My;
  19. namespace PCL
  20. {
  21. // Token: 0x020000C2 RID: 194
  22. [StandardModule]
  23. internal sealed class ModSecret
  24. {
  25. // Token: 0x060005B8 RID: 1464 RVA: 0x00030B30 File Offset: 0x0002ED30
  26. internal static void SecretOnApplicationStart()
  27. {
  28. Thread.CurrentThread.Priority = ThreadPriority.Highest;
  29. try
  30. {
  31. new FormattedText("", CultureInfo.CurrentCulture, FlowDirection.LeftToRight, Enumerable.First<Typeface>(Fonts.SystemTypefaces), 96.0, new ModBase.MyColor(), (double)ModBase._ConfigurationRepository);
  32. }
  33. catch (UriFormatException ex)
  34. {
  35. Environment.SetEnvironmentVariable("windir", Environment.GetEnvironmentVariable("SystemRoot"), EnvironmentVariableTarget.User);
  36. new FormattedText("", CultureInfo.CurrentCulture, FlowDirection.LeftToRight, Enumerable.First<Typeface>(Fonts.SystemTypefaces), 96.0, new ModBase.MyColor(), (double)ModBase._ConfigurationRepository);
  37. }
  38. try
  39. {
  40. Directory.CreateDirectory(ModBase.Path + "PCL");
  41. }
  42. catch (Exception ex2)
  43. {
  44. Interaction.MsgBox(string.Format("PCL 无法创建 PCL 文件夹({0}),请尝试:", ModBase.Path + "PCL") + "\r\n1. 将 PCL 移动到其他文件夹" + (ModBase.Path.StartsWithF("C:", true) ? ",例如 C 盘和桌面以外的其他位置。" : "。") + "\r\n2. 删除当前目录中的 PCL 文件夹,然后再试。\r\n3. 右键 PCL 选择属性,打开 兼容性 中的 以管理员身份运行此程序。", MsgBoxStyle.Critical, "运行环境错误");
  45. Environment.Exit(4);
  46. }
  47. if (!ModBase.CheckPermission(ModBase.Path + "PCL"))
  48. {
  49. Interaction.MsgBox("PCL 没有对当前文件夹的写入权限,请尝试:\r\n1. 将 PCL 移动到其他文件夹" + (ModBase.Path.StartsWithF("C:", true) ? ",例如 C 盘和桌面以外的其他位置。" : "。") + "\r\n2. 删除当前目录中的 PCL 文件夹,然后再试。\r\n3. 右键 PCL 选择属性,打开 兼容性 中的 以管理员身份运行此程序。", MsgBoxStyle.Critical, "运行环境错误");
  50. Environment.Exit(4);
  51. }
  52. ModSecret.indexerField = ModSecret.indexerField + "qgaq".ToUpper() + "1S";
  53. }
  54. // Token: 0x060005B9 RID: 1465 RVA: 0x00030CE4 File Offset: 0x0002EEE4
  55. internal static string SecretGetUniqueAddress()
  56. {
  57. string result;
  58. try
  59. {
  60. if (ModBase._SystemRepository < 1L)
  61. {
  62. result = "0000-0000-0000-0000";
  63. }
  64. else
  65. {
  66. string str;
  67. try
  68. {
  69. str = MyWpfExtension.ManageParser().Registry.GetValue(string.Format("HKEY_LOCAL_MACHINE\\SYSTEM\\Har{0}wareConfig", "D".ToLower()), "LastConfig", "Unknown").ToString().ToUpper().Trim(new char[]
  70. {
  71. '{',
  72. '}'
  73. });
  74. }
  75. catch (Exception ex)
  76. {
  77. ModBase.Log(ex, "获取主板标识码失败", ModBase.LogLevel.Debug, "出现错误");
  78. str = "Unknown";
  79. }
  80. string text;
  81. try
  82. {
  83. text = Conversions.ToString(ModBase.m_IdentifierRepository.Get("Identify", null));
  84. }
  85. catch (Exception ex2)
  86. {
  87. text = "";
  88. }
  89. if (text.Length < 3)
  90. {
  91. text = Conversions.ToString(ModBase.GetTimeTick()) + Conversions.ToString(MyWpfExtension.ManageParser().Info.AvailablePhysicalMemory);
  92. ModBase.m_IdentifierRepository.Set("Identify", text, false, null);
  93. }
  94. string str2 = ModBase.StrFill(ModBase.GetHash(str + text).ToString("X"), "7", 16);
  95. result = string.Format("{0}-{1}-{2}-{3}", new object[]
  96. {
  97. Strings.Mid(str2, 5, 4),
  98. Strings.Mid(str2, 13, 4),
  99. Strings.Mid(str2, 1, 4),
  100. Strings.Mid(str2, 9, 4)
  101. });
  102. }
  103. }
  104. catch (Exception ex3)
  105. {
  106. ModBase.Log(ex3, "PCL 无法获取设备标识码,这可能会导致部分设置无法正常存储。\r\n\r\n详细的错误信息", ModBase.LogLevel.Feedback, "获取标识码失败");
  107. result = "0000-0000-0000-0000";
  108. }
  109. return result;
  110. }
  111. // Token: 0x060005BA RID: 1466 RVA: 0x00030ECC File Offset: 0x0002F0CC
  112. internal static void SecretLaunchJvmArgs(ref List<string> DataList)
  113. {
  114. string text = Conversions.ToString(ModBase.m_IdentifierRepository.Get("VersionAdvanceJvm", ModMinecraft.AddClient()));
  115. DataList.Insert(0, Conversions.ToString((Operators.CompareString(text, "", false) == 0) ? ModBase.m_IdentifierRepository.Get("LaunchAdvanceJvm", null) : text));
  116. ModLaunch.McLaunchLog("当前剩余内存:" + Conversions.ToString(Math.Round(MyWpfExtension.ManageParser().Info.AvailablePhysicalMemory / 1024.0 / 1024.0 / 1024.0 * 10.0) / 10.0) + "G");
  117. DataList.Add("-Xmn" + Conversions.ToString(Math.Floor(PageVersionSetup.GetRam(ModMinecraft.AddClient(), null) * 1024.0 * 0.15)) + "m");
  118. DataList.Add("-Xmx" + Conversions.ToString(Math.Floor(PageVersionSetup.GetRam(ModMinecraft.AddClient(), null) * 1024.0)) + "m");
  119. if (!Enumerable.Any<string>(DataList, (ModSecret._Closure$__.$I6-0 == null) ? (ModSecret._Closure$__.$I6-0 = ((string d) => d.Contains("-Dlog4j2.formatMsgNoLookups=true"))) : ModSecret._Closure$__.$I6-0))
  120. {
  121. DataList.Add("-Dlog4j2.formatMsgNoLookups=true");
  122. }
  123. }
  124. // Token: 0x060005BB RID: 1467 RVA: 0x00031040 File Offset: 0x0002F240
  125. internal static string SecretFilter(string Raw, char FilterChar)
  126. {
  127. if (Raw.Contains("accessToken "))
  128. {
  129. try
  130. {
  131. foreach (string text in ModBase.RegexSearch(Raw, "(?<=accessToken ([^ ]{5}))[^ ]+(?=[^ ]{5})", 0))
  132. {
  133. Raw = Raw.Replace(text, new string(FilterChar, Enumerable.Count<char>(text)));
  134. }
  135. }
  136. finally
  137. {
  138. List<string>.Enumerator enumerator;
  139. ((IDisposable)enumerator).Dispose();
  140. }
  141. }
  142. string stateMap = ModLaunch.interceptorTests.Output._StateMap;
  143. string result;
  144. if (stateMap != null && stateMap.Length >= 10 && Raw.ContainsF(stateMap, true) && Operators.CompareString(ModLaunch.interceptorTests.Output.m_InstanceMap, ModLaunch.interceptorTests.Output._StateMap, false) != 0)
  145. {
  146. result = Raw.Replace(stateMap, Strings.Left(stateMap, 5) + new string(FilterChar, checked(stateMap.Length - 10)) + Strings.Right(stateMap, 5));
  147. }
  148. else
  149. {
  150. result = Raw;
  151. }
  152. return result;
  153. }
  154. // Token: 0x060005BC RID: 1468 RVA: 0x00031130 File Offset: 0x0002F330
  155. internal static object SecretCdnSign(string UrlWithMark)
  156. {
  157. object result;
  158. if (ModBase._SystemRepository < 1L)
  159. {
  160. result = UrlWithMark;
  161. }
  162. else if (!UrlWithMark.EndsWithF("{CDN}", false))
  163. {
  164. result = UrlWithMark;
  165. }
  166. else
  167. {
  168. string text = UrlWithMark.Replace("{CDN}", "").Replace(" ", "%20");
  169. string text2 = ModBase.StrFill(ModBase.RandomInteger(0, 2147483645).ToString("x"), "0", 8);
  170. string text3 = ModSecret.SecretDecrypt("VwHB1je1uabAr0gKijpFaQ==", "CDN");
  171. string text4 = Conversions.ToString(ModBase.GetUnixTimestamp());
  172. string text5 = text.Substring(checked(text.IndexOfF("://", false) + 3));
  173. text5 = text5.Substring(text5.IndexOfF("/", false));
  174. string stringMD = ModBase.GetStringMD5(new string[]
  175. {
  176. text5,
  177. text4,
  178. text2,
  179. "0",
  180. text3
  181. }.Join("-"));
  182. result = text + "?sign=" + new string[]
  183. {
  184. text4,
  185. text2,
  186. "0",
  187. stringMD
  188. }.Join("-");
  189. }
  190. return result;
  191. }
  192. // Token: 0x060005BD RID: 1469 RVA: 0x0003125C File Offset: 0x0002F45C
  193. internal static void SecretHeadersSign(string Url, ref WebClient Client, bool UseBrowserUserAgent = false)
  194. {
  195. if (ModBase._SystemRepository >= 1L)
  196. {
  197. if (!Url.Contains("baidupcs.com") && !Url.Contains("baidu.com"))
  198. {
  199. if (Url.Contains("modrinth.com"))
  200. {
  201. switch (ModBase.RandomInteger(1, 10))
  202. {
  203. case 1:
  204. Client.Headers["User-Agent"] = "Huawei/14.0.2.311";
  205. break;
  206. case 2:
  207. case 3:
  208. Client.Headers["User-Agent"] = "Edge/109.0.1474.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.160 Safari/537.36";
  209. break;
  210. case 4:
  211. Client.Headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130";
  212. break;
  213. case 5:
  214. case 6:
  215. Client.Headers["User-Agent"] = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Mobile Safari/537.3";
  216. break;
  217. default:
  218. Client.Headers["User-Agent"] = "PCL2/2.8.12.50 Mozilla/5.0 AppleWebKit/537.36 Chrome/63.0.3239.132 Safari/537.36";
  219. break;
  220. }
  221. }
  222. else if (UseBrowserUserAgent)
  223. {
  224. Client.Headers["User-Agent"] = "PCL2/2.8.12.50 Mozilla/5.0 AppleWebKit/537.36 Chrome/63.0.3239.132 Safari/537.36";
  225. }
  226. else
  227. {
  228. Client.Headers["User-Agent"] = "PCL2/2.8.12.50";
  229. }
  230. }
  231. else
  232. {
  233. Client.Headers["User-Agent"] = "LogStatistic";
  234. }
  235. Client.Headers["Referer"] = "http://" + Conversions.ToString(347) + ".pcl2.server/";
  236. if (Url.Contains(ModSecret.SecretDecrypt("kSHbgKrsiOuHY81i63QtJevaX2+IWvVT", "")))
  237. {
  238. Client.Headers.Add(ModSecret.SecretDecrypt("hlBzlKCNcyEYEaSOd0Vx0w==", ""), ModSecret.SecretDecrypt("SA+taZSvSkfRoq0fW5pnIpFzDGDck82KzMPbuglfAqrAbQAOwcZXBXVQVzenSNP14fnexB+G1bV/ufvjrtpiUA==", ""));
  239. }
  240. }
  241. }
  242. // Token: 0x060005BE RID: 1470 RVA: 0x00031408 File Offset: 0x0002F608
  243. internal static void SecretHeadersSign(string Url, ref HttpWebRequest Request, bool UseBrowserUserAgent = false)
  244. {
  245. if (ModBase._SystemRepository >= 1L)
  246. {
  247. if (!Url.Contains("baidupcs.com") && !Url.Contains("baidu.com"))
  248. {
  249. if (Url.Contains("modrinth.com"))
  250. {
  251. switch (ModBase.RandomInteger(1, 11))
  252. {
  253. case 1:
  254. Request.UserAgent = "Mozilla/5.0 AppleWebKit/537.36 Chrome/63.0.3239.132 Safari/537.36";
  255. break;
  256. case 2:
  257. case 11:
  258. Request.UserAgent = "Edge/109.0.1474.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.160 Safari/537.36";
  259. break;
  260. case 3:
  261. case 6:
  262. case 7:
  263. case 8:
  264. Request.UserAgent = "Huawei/14.0.2.311";
  265. break;
  266. case 4:
  267. case 9:
  268. case 10:
  269. Request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130";
  270. break;
  271. case 5:
  272. Request.UserAgent = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Mobile Safari/537.3";
  273. break;
  274. }
  275. }
  276. else if (UseBrowserUserAgent)
  277. {
  278. Request.UserAgent = "PCL2/2.8.12.50 Mozilla/5.0 AppleWebKit/537.36 Chrome/63.0.3239.132 Safari/537.36";
  279. }
  280. else
  281. {
  282. Request.UserAgent = "PCL2/2.8.12.50";
  283. }
  284. }
  285. else
  286. {
  287. Request.UserAgent = "LogStatistic";
  288. }
  289. Request.Referer = "http://" + Conversions.ToString(347) + ".pcl2.server/";
  290. if (Url.Contains(ModSecret.SecretDecrypt("kSHbgKrsiOuHY81i63QtJevaX2+IWvVT", "")))
  291. {
  292. Request.Headers.Add(ModSecret.SecretDecrypt("hlBzlKCNcyEYEaSOd0Vx0w==", ""), ModSecret.SecretDecrypt("SA+taZSvSkfRoq0fW5pnIpFzDGDck82KzMPbuglfAqrAbQAOwcZXBXVQVzenSNP14fnexB+G1bV/ufvjrtpiUA==", ""));
  293. }
  294. }
  295. }
  296. // Token: 0x060005BF RID: 1471 RVA: 0x0003156C File Offset: 0x0002F76C
  297. private static string SecretKeyGet(string Key)
  298. {
  299. string result;
  300. if (ModBase._SystemRepository < 1L)
  301. {
  302. result = "00000000";
  303. }
  304. else if (string.IsNullOrEmpty(Key))
  305. {
  306. result = "@;$ Abv2";
  307. }
  308. else
  309. {
  310. result = Strings.Mid(ModBase.StrFill(Conversions.ToString(ModBase.GetHash(Key)), "X", 8), 1, 8);
  311. }
  312. return result;
  313. }
  314. // Token: 0x060005C0 RID: 1472 RVA: 0x000315C0 File Offset: 0x0002F7C0
  315. internal static string SecretEncrypt(string SourceString, string Key = "")
  316. {
  317. Key = ModSecret.SecretKeyGet(Key);
  318. byte[] bytes = Encoding.UTF8.GetBytes(Key);
  319. byte[] bytes2 = Encoding.UTF8.GetBytes("95168702");
  320. DESCryptoServiceProvider descryptoServiceProvider = new DESCryptoServiceProvider();
  321. string result;
  322. using (MemoryStream memoryStream = new MemoryStream())
  323. {
  324. byte[] bytes3 = Encoding.UTF8.GetBytes(SourceString);
  325. using (CryptoStream cryptoStream = new CryptoStream(memoryStream, descryptoServiceProvider.CreateEncryptor(bytes, bytes2), CryptoStreamMode.Write))
  326. {
  327. cryptoStream.Write(bytes3, 0, bytes3.Length);
  328. cryptoStream.FlushFinalBlock();
  329. result = Convert.ToBase64String(memoryStream.ToArray());
  330. }
  331. }
  332. return result;
  333. }
  334. // Token: 0x060005C1 RID: 1473 RVA: 0x00031678 File Offset: 0x0002F878
  335. internal static string SecretDecrypt(string SourceString, string Key = "")
  336. {
  337. Key = ModSecret.SecretKeyGet(Key);
  338. byte[] bytes = Encoding.UTF8.GetBytes(Key);
  339. byte[] bytes2 = Encoding.UTF8.GetBytes("95168702");
  340. DESCryptoServiceProvider descryptoServiceProvider = new DESCryptoServiceProvider();
  341. string @string;
  342. using (MemoryStream memoryStream = new MemoryStream())
  343. {
  344. byte[] array = Convert.FromBase64String(SourceString);
  345. using (CryptoStream cryptoStream = new CryptoStream(memoryStream, descryptoServiceProvider.CreateDecryptor(bytes, bytes2), CryptoStreamMode.Write))
  346. {
  347. cryptoStream.Write(array, 0, array.Length);
  348. cryptoStream.FlushFinalBlock();
  349. @string = Encoding.UTF8.GetString(memoryStream.ToArray());
  350. }
  351. }
  352. return @string;
  353. }
  354. // Token: 0x060005C2 RID: 1474 RVA: 0x00031730 File Offset: 0x0002F930
  355. internal static bool SecretRsaVerify(string SourceString, string Sign)
  356. {
  357. bool result;
  358. try
  359. {
  360. if (ModBase._SystemRepository < 1L)
  361. {
  362. result = false;
  363. }
  364. else
  365. {
  366. RSACryptoServiceProvider rsacryptoServiceProvider = new RSACryptoServiceProvider(512);
  367. rsacryptoServiceProvider.FromXmlString(ModSecret.indexerField.Replace("!", "").Replace("$", "+") + "/R1Frckd3/Sn+Zsx9aD6U2f" + Conversions.ToString(Math.Round(84m)) + "SdWMDlrRY9DfhQ==</Modulus><Exponent>AQAB<\\Exponent><\\RSAKeyValue>".Replace("\\", "/"));
  368. result = rsacryptoServiceProvider.VerifyData(Encoding.Default.GetBytes(SourceString), typeof(SHA256), Convert.FromBase64String(Sign));
  369. }
  370. }
  371. catch (Exception ex)
  372. {
  373. result = false;
  374. }
  375. return result;
  376. }
  377. // Token: 0x060005C3 RID: 1475 RVA: 0x00031800 File Offset: 0x0002FA00
  378. public static void ViewReader(int config = -1)
  379. {
  380. try
  381. {
  382. if (ModSecret.configurationField != config || config < 0)
  383. {
  384. if (ModSecret.InsertReader((config >= 0) ? config : ModSecret.configurationField))
  385. {
  386. if (config >= 0)
  387. {
  388. ModSecret.configurationField = config;
  389. }
  390. switch (ModSecret.registryField)
  391. {
  392. case 1:
  393. ModSecret.m_ExpressionField = 999;
  394. break;
  395. case 2:
  396. ModSecret.m_GetterField = ModBase.RandomInteger(0, 359);
  397. ModSecret.m_TokenField = ModBase.RandomInteger(40, 70);
  398. ModSecret.m_ExpressionField = ModBase.RandomInteger(-20, 20);
  399. break;
  400. }
  401. ModSecret._InterpreterField = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField * 0.2, 25.0 + (double)ModSecret.m_ExpressionField * 0.3);
  402. checked
  403. {
  404. ModSecret.serializerField = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, (double)(45 + ModSecret.m_ExpressionField));
  405. ModSecret.watcherField = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, (double)(55 + ModSecret.m_ExpressionField));
  406. ModSecret.m_IdentifierField = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, (double)(65 + ModSecret.m_ExpressionField));
  407. }
  408. ModSecret._SystemField = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, 80.0 + (double)ModSecret.m_ExpressionField * 0.4);
  409. ModSecret.m_ParamField = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, 91.0 + (double)ModSecret.m_ExpressionField * 0.1);
  410. ModSecret.m_TagField = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, 94.0);
  411. ModSecret.m_ObserverField = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, 97.0);
  412. ModSecret._StubField = ModSecret.m_IdentifierField * 0.3 + ModSecret._SystemField * 0.3 + ModSecret.m_StateField * 0.4;
  413. ModSecret.m_RulesField = new ModBase.MyColor(190.0, ModSecret.m_TagField);
  414. ModSecret._ConsumerField = new ModBase.MyColor(1.0, ModSecret.m_ObserverField);
  415. Application.Current.Resources["ColorBrush1"] = new SolidColorBrush(ModSecret._InterpreterField);
  416. Application.Current.Resources["ColorBrush2"] = new SolidColorBrush(ModSecret.serializerField);
  417. Application.Current.Resources["ColorBrush3"] = new SolidColorBrush(ModSecret.watcherField);
  418. Application.Current.Resources["ColorBrush4"] = new SolidColorBrush(ModSecret.m_IdentifierField);
  419. Application.Current.Resources["ColorBrush5"] = new SolidColorBrush(ModSecret._SystemField);
  420. Application.Current.Resources["ColorBrush6"] = new SolidColorBrush(ModSecret.m_ParamField);
  421. Application.Current.Resources["ColorBrush7"] = new SolidColorBrush(ModSecret.m_TagField);
  422. Application.Current.Resources["ColorBrush8"] = new SolidColorBrush(ModSecret.m_ObserverField);
  423. Application.Current.Resources["ColorBrushBg0"] = new SolidColorBrush(ModSecret._StubField);
  424. Application.Current.Resources["ColorBrushBg1"] = new SolidColorBrush(ModSecret.m_RulesField);
  425. Application.Current.Resources["ColorObject1"] = ModSecret._InterpreterField;
  426. Application.Current.Resources["ColorObject2"] = ModSecret.serializerField;
  427. Application.Current.Resources["ColorObject3"] = ModSecret.watcherField;
  428. Application.Current.Resources["ColorObject4"] = ModSecret.m_IdentifierField;
  429. Application.Current.Resources["ColorObject5"] = ModSecret._SystemField;
  430. Application.Current.Resources["ColorObject6"] = ModSecret.m_ParamField;
  431. Application.Current.Resources["ColorObject7"] = ModSecret.m_TagField;
  432. Application.Current.Resources["ColorObject8"] = ModSecret.m_ObserverField;
  433. Application.Current.Resources["ColorObjectBg0"] = ModSecret._StubField;
  434. Application.Current.Resources["ColorObjectBg1"] = ModSecret.m_RulesField;
  435. ModSecret.PushReader();
  436. if (ModSecret.configurationField != 12 && ModSecret.configurationField != 14 && ModSecret.registryField != 2)
  437. {
  438. ModBase.Log("[UI] 刷新主题:" + Conversions.ToString(ModSecret.configurationField), ModBase.LogLevel.Normal, "出现错误");
  439. }
  440. }
  441. }
  442. }
  443. catch (Exception ex)
  444. {
  445. ModBase.Log(ex, "刷新主题颜色失败", ModBase.LogLevel.Hint, "出现错误");
  446. }
  447. }
  448. // Token: 0x060005C4 RID: 1476 RVA: 0x0000504E File Offset: 0x0000324E
  449. public static void PushReader()
  450. {
  451. ModBase.RunInUi((ModSecret._Closure$__.$I44-0 == null) ? (ModSecret._Closure$__.$I44-0 = delegate()
  452. {
  453. if (ModMain._ProcessIterator.IsLoaded)
  454. {
  455. LinearGradientBrush linearGradientBrush = new LinearGradientBrush
  456. {
  457. EndPoint = new Point(1.0, 0.0),
  458. StartPoint = new Point(0.0, 0.0)
  459. };
  460. checked
  461. {
  462. if (ModSecret.configurationField == 5)
  463. {
  464. linearGradientBrush.GradientStops.Add(new GradientStop
  465. {
  466. Offset = 0.0,
  467. Color = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, 25.0)
  468. });
  469. linearGradientBrush.GradientStops.Add(new GradientStop
  470. {
  471. Offset = 0.5,
  472. Color = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, 15.0)
  473. });
  474. linearGradientBrush.GradientStops.Add(new GradientStop
  475. {
  476. Offset = 1.0,
  477. Color = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, 25.0)
  478. });
  479. ModMain._ProcessIterator.PanTitle.Background = linearGradientBrush;
  480. ModMain._ProcessIterator.PanTitle.Background.Freeze();
  481. }
  482. else if (ModSecret.configurationField != 12 && ModSecret.registryField != 2)
  483. {
  484. if (ModSecret._WriterField is int)
  485. {
  486. linearGradientBrush.GradientStops.Add(new GradientStop
  487. {
  488. Offset = 0.0,
  489. Color = new ModBase.MyColor().FromHSL2(Conversions.ToDouble(Operators.SubtractObject(ModSecret.m_GetterField, ModSecret._WriterField)), (double)ModSecret.m_TokenField, (double)(48 + ModSecret.m_ExpressionField))
  490. });
  491. linearGradientBrush.GradientStops.Add(new GradientStop
  492. {
  493. Offset = 0.5,
  494. Color = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField, (double)(54 + ModSecret.m_ExpressionField))
  495. });
  496. linearGradientBrush.GradientStops.Add(new GradientStop
  497. {
  498. Offset = 1.0,
  499. Color = new ModBase.MyColor().FromHSL2(Conversions.ToDouble(Operators.AddObject(ModSecret.m_GetterField, ModSecret._WriterField)), (double)ModSecret.m_TokenField, (double)(48 + ModSecret.m_ExpressionField))
  500. });
  501. }
  502. else
  503. {
  504. linearGradientBrush.GradientStops.Add(new GradientStop
  505. {
  506. Offset = 0.0,
  507. Color = new ModBase.MyColor().FromHSL2(Conversions.ToDouble(Operators.AddObject(ModSecret.m_GetterField, NewLateBinding.LateIndexGet(ModSecret._WriterField, new object[]
  508. {
  509. 0
  510. }, null))), (double)ModSecret.m_TokenField, (double)(48 + ModSecret.m_ExpressionField))
  511. });
  512. linearGradientBrush.GradientStops.Add(new GradientStop
  513. {
  514. Offset = 0.5,
  515. Color = new ModBase.MyColor().FromHSL2(Conversions.ToDouble(Operators.AddObject(ModSecret.m_GetterField, NewLateBinding.LateIndexGet(ModSecret._WriterField, new object[]
  516. {
  517. 1
  518. }, null))), (double)ModSecret.m_TokenField, (double)(54 + ModSecret.m_ExpressionField))
  519. });
  520. linearGradientBrush.GradientStops.Add(new GradientStop
  521. {
  522. Offset = 1.0,
  523. Color = new ModBase.MyColor().FromHSL2(Conversions.ToDouble(Operators.AddObject(ModSecret.m_GetterField, NewLateBinding.LateIndexGet(ModSecret._WriterField, new object[]
  524. {
  525. 2
  526. }, null))), (double)ModSecret.m_TokenField, (double)(48 + ModSecret.m_ExpressionField))
  527. });
  528. }
  529. ModMain._ProcessIterator.PanTitle.Background = linearGradientBrush;
  530. ModMain._ProcessIterator.PanTitle.Background.Freeze();
  531. }
  532. else
  533. {
  534. linearGradientBrush.GradientStops.Add(new GradientStop
  535. {
  536. Offset = 0.0,
  537. Color = new ModBase.MyColor().FromHSL2((double)(ModSecret.m_GetterField - 21), (double)ModSecret.m_TokenField, (double)(53 + ModSecret.m_ExpressionField))
  538. });
  539. linearGradientBrush.GradientStops.Add(new GradientStop
  540. {
  541. Offset = 0.33,
  542. Color = new ModBase.MyColor().FromHSL2((double)(ModSecret.m_GetterField - 7), (double)ModSecret.m_TokenField, (double)(47 + ModSecret.m_ExpressionField))
  543. });
  544. linearGradientBrush.GradientStops.Add(new GradientStop
  545. {
  546. Offset = 0.67,
  547. Color = new ModBase.MyColor().FromHSL2((double)(ModSecret.m_GetterField + 7), (double)ModSecret.m_TokenField, (double)(47 + ModSecret.m_ExpressionField))
  548. });
  549. linearGradientBrush.GradientStops.Add(new GradientStop
  550. {
  551. Offset = 1.0,
  552. Color = new ModBase.MyColor().FromHSL2((double)(ModSecret.m_GetterField + 21), (double)ModSecret.m_TokenField, (double)(53 + ModSecret.m_ExpressionField))
  553. });
  554. ModMain._ProcessIterator.PanTitle.Background = linearGradientBrush;
  555. }
  556. if (ModSecret.configurationField >= 5 && ModSecret.configurationField != 14)
  557. {
  558. ModMain._ProcessIterator.ImgTitle.Source = string.Format("{0}Themes/{1}.png", ModBase.m_SerializerRepository, ModSecret.configurationField);
  559. }
  560. else
  561. {
  562. ModMain._ProcessIterator.ImgTitle.Source = null;
  563. }
  564. ModMain._ProcessIterator.ImgTitle.Opacity = ((ModSecret.configurationField == 13) ? 0.25 : 0.5);
  565. }
  566. if (Conversions.ToBoolean(ModBase.m_IdentifierRepository.Get("UiBackgroundColorful", null)))
  567. {
  568. linearGradientBrush = new LinearGradientBrush
  569. {
  570. EndPoint = new Point(0.1, 1.0),
  571. StartPoint = new Point(0.9, 0.0)
  572. };
  573. linearGradientBrush.GradientStops.Add(new GradientStop
  574. {
  575. Offset = -0.1,
  576. Color = new ModBase.MyColor().FromHSL2((double)(checked(ModSecret.m_GetterField - 20)), (double)Math.Min(60, ModSecret.m_TokenField) * 0.5, 80.0)
  577. });
  578. linearGradientBrush.GradientStops.Add(new GradientStop
  579. {
  580. Offset = 0.4,
  581. Color = new ModBase.MyColor().FromHSL2((double)ModSecret.m_GetterField, (double)ModSecret.m_TokenField * 0.9, 90.0)
  582. });
  583. linearGradientBrush.GradientStops.Add(new GradientStop
  584. {
  585. Offset = 1.1,
  586. Color = new ModBase.MyColor().FromHSL2((double)(checked(ModSecret.m_GetterField + 20)), (double)Math.Min(60, ModSecret.m_TokenField) * 0.5, 80.0)
  587. });
  588. ModMain._ProcessIterator.PanForm.Background = linearGradientBrush;
  589. }
  590. else
  591. {
  592. ModMain._ProcessIterator.PanForm.Background = new ModBase.MyColor(245.0, 245.0, 245.0);
  593. }
  594. ModMain._ProcessIterator.PanForm.Background.Freeze();
  595. }
  596. }) : ModSecret._Closure$__.$I44-0, false);
  597. }
  598. // Token: 0x060005C5 RID: 1477 RVA: 0x00031DA0 File Offset: 0x0002FFA0
  599. public static void ResetReader(bool isres)
  600. {
  601. ModSecret._Closure$__45-0 CS$<>8__locals1 = new ModSecret._Closure$__45-0(CS$<>8__locals1);
  602. CS$<>8__locals1.$VB$Local_EffectSetup = isres;
  603. ModBase.RunInUi(checked(delegate()
  604. {
  605. try
  606. {
  607. string text = Conversions.ToString(ModBase.m_IdentifierRepository.Get("UiLauncherThemeHide2", null));
  608. if (Operators.CompareString(text, "", false) == 0)
  609. {
  610. text = "3";
  611. }
  612. if (ModBase.m_IdentifierRepository.Get("UiLauncherThemeHide", null).ToString().Contains("7"))
  613. {
  614. text += "|7";
  615. }
  616. if (ModBase.m_IdentifierRepository.Get("UiLauncherThemeHide", null).ToString().Contains("6"))
  617. {
  618. text += "|6";
  619. }
  620. text = Enumerable.ToList<string>(Enumerable.SkipWhile<string>(Enumerable.Distinct<string>(text.Split("|")), (ModSecret._Closure$__.$I45-1 == null) ? (ModSecret._Closure$__.$I45-1 = ((string Data) => string.IsNullOrEmpty(Data))) : ModSecret._Closure$__.$I45-1)).Join("|");
  621. ModBase.m_IdentifierRepository.Set("UiLauncherThemeHide2", text, false, null);
  622. List<string> list = new List<string>(text.Split("|"));
  623. int num = 0;
  624. try
  625. {
  626. foreach (string value in list)
  627. {
  628. int num2 = Conversions.ToInteger(value);
  629. if (num2 >= 5 && num2 <= 14 && num2 != 8)
  630. {
  631. num++;
  632. }
  633. }
  634. }
  635. finally
  636. {
  637. List<string>.Enumerator enumerator;
  638. ((IDisposable)enumerator).Dispose();
  639. }
  640. if (ModSecret.DeleteReader(null))
  641. {
  642. num++;
  643. }
  644. string text2 = Conversions.ToString(ModBase.m_IdentifierRepository.Get("UiLauncherTheme", null));
  645. if (!ModSecret.InsertReader(Conversions.ToInteger(text2)))
  646. {
  647. ModBase.Log("[UI] 检测到尚未解锁的主题:" + text2 + ",已重置为默认主题", ModBase.LogLevel.Normal, "出现错误");
  648. ModBase.m_IdentifierRepository.Set("UiLauncherTheme", 0, false, null);
  649. }
  650. if (CS$<>8__locals1.$VB$Local_EffectSetup)
  651. {
  652. }
  653. }
  654. catch (Exception ex)
  655. {
  656. if ((ex.InnerException ?? ex) is FormatException)
  657. {
  658. ModBase.Log(ex, "解锁的主题列表存档已损坏,主题解锁已被重置", ModBase.LogLevel.Msgbox, "出现错误");
  659. ModBase.m_IdentifierRepository.Set("UiLauncherThemeHide2", "", false, null);
  660. }
  661. else
  662. {
  663. ModBase.Log(ex, "检查主题失败", ModBase.LogLevel.Feedback, "出现错误");
  664. }
  665. }
  666. }), false);
  667. }
  668. // Token: 0x060005C6 RID: 1478 RVA: 0x00031DD0 File Offset: 0x0002FFD0
  669. public static bool InsertReader(int reference_High)
  670. {
  671. checked
  672. {
  673. bool result;
  674. if (reference_High == 8)
  675. {
  676. result = ModSecret.DeleteReader(null);
  677. }
  678. else if (reference_High == 14)
  679. {
  680. int num = 0;
  681. string[] array = ModBase.m_IdentifierRepository.Get("UiLauncherThemeHide2", null).ToString().Split("|");
  682. for (int i = 0; i < array.Length; i++)
  683. {
  684. int num2 = Conversions.ToInteger(array[i]);
  685. if (num2 >= 5 && num2 <= 14 && num2 != 8)
  686. {
  687. num++;
  688. }
  689. }
  690. if (ModSecret.DeleteReader(null))
  691. {
  692. num++;
  693. }
  694. result = (num >= 5);
  695. }
  696. else
  697. {
  698. result = (Enumerable.Contains<int>(new int[]
  699. {
  700. 0,
  701. 1,
  702. 2,
  703. 3,
  704. 4,
  705. 42
  706. }, reference_High) || Enumerable.Contains<string>(ModBase.m_IdentifierRepository.Get("UiLauncherThemeHide2", null).ToString().Split("|"), reference_High.ToString()));
  707. }
  708. return result;
  709. }
  710. }
  711. // Token: 0x060005C7 RID: 1479 RVA: 0x0000507A File Offset: 0x0000327A
  712. internal static bool ThemeUnlock(int Id, bool ShowDoubleHint = true, string UnlockHint = null)
  713. {
  714. return false;
  715. }
  716. // Token: 0x060005C8 RID: 1480 RVA: 0x00031EA0 File Offset: 0x000300A0
  717. public static bool DeleteReader(string value = null)
  718. {
  719. bool result;
  720. try
  721. {
  722. string sign = (value ?? ModBase.m_IdentifierRepository.Get("UiLauncherThemeGold", null)).ToString().Replace("#", "");
  723. result = ModSecret.SecretRsaVerify("Gold|0|" + ModBase._TagRepository.Replace("-", ""), sign);
  724. }
  725. catch (Exception ex)
  726. {
  727. ModBase.Log(ex, "检查秋仪金失败", ModBase.LogLevel.Feedback, "出现错误");
  728. result = false;
  729. }
  730. return result;
  731. }
  732. // Token: 0x060005C9 RID: 1481 RVA: 0x00031F30 File Offset: 0x00030130
  733. public static bool? DonateCodeInput()
  734. {
  735. ModMain.Hint("正式版无法使用主题功能,若你获得了解锁码,请在快照版中使用!", ModMain.HintType.Info, true);
  736. return null;
  737. }
  738. // Token: 0x060005CA RID: 1482 RVA: 0x00031F54 File Offset: 0x00030154
  739. public static void UpdateCheckByButton()
  740. {
  741. if (ModSecret.m_SetterField)
  742. {
  743. ModMain.Hint("正在检查更新,请稍候!", ModMain.HintType.Info, true);
  744. return;
  745. }
  746. ModSecret.m_SetterField = true;
  747. ModBase.RunInThread((ModSecret._Closure$__.$I51-0 == null) ? (ModSecret._Closure$__.$I51-0 = delegate()
  748. {
  749. try
  750. {
  751. ModMain.Hint("正在检查更新,请稍候!", ModMain.HintType.Info, true);
  752. ModSecret._ConnectionField.WaitForExit(null, null, false);
  753. bool? flag = PageSetupSystem.IsLauncherNewest();
  754. if (flag == null)
  755. {
  756. ModMain.Hint("连接 PCL 服务器失败,请确认系统时间是否准确,尝试将 PCL 加入杀毒软件或防火墙白名单,然后重启 PCL!", ModMain.HintType.Critical, true);
  757. }
  758. else if (flag.GetValueOrDefault())
  759. {
  760. ModMain.Hint(string.Format("已经是最新{0} {1},不需要更新啦,可以直接使用!", "正式版", "2.8.12"), ModMain.HintType.Finish, true);
  761. }
  762. else if (ModMain.MyMsgBox("发现启动器更新,是否立即下载?", "发现更新!", "更新!冲!", "取消", "", false, true, false, null, null, null) != 2)
  763. {
  764. ModSecret.UpdateStart("https://pcl2-server-1253424809.file.myqcloud.com/update/{KEY}.zip{CDN}", false, null, false);
  765. }
  766. }
  767. catch (Exception ex)
  768. {
  769. ModBase.Log(ex, "尝试手动开始更新失败", ModBase.LogLevel.Feedback, "出现错误");
  770. }
  771. finally
  772. {
  773. ModSecret.m_SetterField = false;
  774. }
  775. }) : ModSecret._Closure$__.$I51-0);
  776. }
  777. // Token: 0x060005CB RID: 1483 RVA: 0x00031FA4 File Offset: 0x000301A4
  778. public static void UpdateStart(string BaseUrl, bool Slient, string ReceivedKey = null, bool ForceValidated = false)
  779. {
  780. ModSecret._Closure$__55-0 CS$<>8__locals1 = new ModSecret._Closure$__55-0(CS$<>8__locals1);
  781. CS$<>8__locals1.$VB$Local_BaseUrl = BaseUrl;
  782. if (ModSecret._FactoryField)
  783. {
  784. if (!Slient)
  785. {
  786. ModMain.Hint("PCL 正在下载更新,更新结束时将自动重启,请稍候!", ModMain.HintType.Info, true);
  787. ModSecret._ImporterField = false;
  788. }
  789. if (ModSecret.m_ExporterField)
  790. {
  791. ModSecret.UpdateRestart(true);
  792. return;
  793. }
  794. }
  795. else
  796. {
  797. ModSecret._FactoryField = true;
  798. ModSecret._ImporterField = Slient;
  799. ModBase.Log("[System] 更新已开始,静默:" + Conversions.ToString(ModSecret._ImporterField), ModBase.LogLevel.Normal, "出现错误");
  800. CS$<>8__locals1.$VB$Local_UpdateKey = "Publi3";
  801. if (!ModSecret._ImporterField)
  802. {
  803. ModMain.Hint("PCL 正在下载更新,更新结束时将自动重启,请稍候!", ModMain.HintType.Info, true);
  804. }
  805. ModBase.RunInUi(delegate()
  806. {
  807. try
  808. {
  809. ModSecret._Closure$__55-1 CS$<>8__locals2 = new ModSecret._Closure$__55-1(CS$<>8__locals2);
  810. CS$<>8__locals1.$VB$Local_BaseUrl = CS$<>8__locals1.$VB$Local_BaseUrl.Replace("{KEY}", CS$<>8__locals1.$VB$Local_UpdateKey);
  811. string[] urls;
  812. if (CS$<>8__locals1.$VB$Local_BaseUrl.EndsWithF(string.Format("pcl2-server-1253424809.file.myqcloud.com/update/{0}.zip{{CDN}}", "Publi3"), true))
  813. {
  814. urls = new string[]
  815. {
  816. "https://github.com/Hex-Dragon/PCL2/raw/main/%E6%9C%80%E6%96%B0%E6%AD%A3%E5%BC%8F%E7%89%88.zip",
  817. CS$<>8__locals1.$VB$Local_BaseUrl
  818. };
  819. }
  820. else
  821. {
  822. urls = new string[]
  823. {
  824. CS$<>8__locals1.$VB$Local_BaseUrl
  825. };
  826. }
  827. CS$<>8__locals2.$VB$Local_Loader = new ModLoader.LoaderCombo<string>("启动器更新", new ModLoader.LoaderBase[]
  828. {
  829. new ModNet.LoaderDownload("下载更新文件", new List<ModNet.NetFile>
  830. {
  831. new ModNet.NetFile(urls, ModBase.m_DecoratorRepository + "Update.zip", new ModBase.FileChecker(1048576L, -1L, null, false, false), false)
  832. })
  833. {
  834. ProgressWeight = 1.0
  835. },
  836. new ModLoader.LoaderTask<string, int>("安装更新", (ModSecret._Closure$__.$IR55-1 == null) ? (ModSecret._Closure$__.$IR55-1 = delegate(ModLoader.LoaderTask<string, int> a0)
  837. {
  838. ((ModSecret._Closure$__.$I55-1 == null) ? (ModSecret._Closure$__.$I55-1 = delegate()
  839. {
  840. string text = ModBase.Path + "PCL\\Plain Craft Launcher 2.exe";
  841. if (File.Exists(text))
  842. {
  843. File.Delete(text);
  844. ModBase.Log("[System] 已清理存在的更新文件:" + text, ModBase.LogLevel.Normal, "出现错误");
  845. }
  846. else
  847. {
  848. ModBase.Log("[System] 无需清理目标更新文件:" + text, ModBase.LogLevel.Normal, "出现错误");
  849. }
  850. ModBase.ExtractFile(ModBase.m_DecoratorRepository + "Update.zip", ModBase.Path + "PCL\\", null, null);
  851. File.Delete(ModBase.m_DecoratorRepository + "Update.zip");
  852. ModBase.Log("[System] 更新文件解压完成", ModBase.LogLevel.Normal, "出现错误");
  853. if (ModSecret._ImporterField)
  854. {
  855. ModSecret.m_ExporterField = true;
  856. return;
  857. }
  858. if (ModLaunch.databaseTests.State == ModBase.LoadState.Loading)
  859. {
  860. ModMain.Hint("更新已准备就绪,PCL 将在游戏启动完成后重启!", ModMain.HintType.Finish, true);
  861. while (ModLaunch.databaseTests.State == ModBase.LoadState.Loading)
  862. {
  863. Thread.Sleep(10);
  864. }
  865. }
  866. ModSecret.UpdateRestart(true);
  867. }) : ModSecret._Closure$__.$I55-1)();
  868. }) : ModSecret._Closure$__.$IR55-1, null, ThreadPriority.Normal)
  869. {
  870. ProgressWeight = 0.1
  871. }
  872. });
  873. CS$<>8__locals2.$VB$Local_Loader.OnStateChanged = delegate(ModLoader.LoaderBase a0)
  874. {
  875. base._Lambda$__2();
  876. };
  877. CS$<>8__locals2.$VB$Local_Loader.Start(null, false);
  878. if (!ModSecret._ImporterField)
  879. {
  880. ModLoader.LoaderTaskbarAdd<string>(CS$<>8__locals2.$VB$Local_Loader);
  881. ModMain._ProcessIterator.BtnExtraDownload.ShowRefresh();
  882. }
  883. }
  884. catch (Exception ex)
  885. {
  886. ModBase.Log(ex, "开始启动器更新失败", ModBase.LogLevel.Feedback, "出现错误");
  887. }
  888. }, false);
  889. }
  890. }
  891. // Token: 0x060005CC RID: 1484 RVA: 0x00032044 File Offset: 0x00030244
  892. public static void UpdateRestart(bool TriggerRestartAndByEnd)
  893. {
  894. try
  895. {
  896. ModSecret.m_ExporterField = false;
  897. string fileName = ModBase.Path + "PCL\\Plain Craft Launcher 2.exe";
  898. string text = string.Concat(new string[]
  899. {
  900. "--update ",
  901. Conversions.ToString(Process.GetCurrentProcess().Id),
  902. " \"",
  903. AppDomain.CurrentDomain.SetupInformation.ApplicationName,
  904. "\" \"",
  905. AppDomain.CurrentDomain.SetupInformation.ApplicationName,
  906. "\" ",
  907. Conversions.ToString(TriggerRestartAndByEnd)
  908. });
  909. ModBase.Log("[System] 更新程序启动,参数:" + text, ModBase.LogLevel.Normal, "出现错误");
  910. Process.Start(new ProcessStartInfo(fileName)
  911. {
  912. WindowStyle = ProcessWindowStyle.Hidden,
  913. CreateNoWindow = true,
  914. Arguments = text
  915. });
  916. if (TriggerRestartAndByEnd)
  917. {
  918. ModMain._ProcessIterator.EndProgram(false);
  919. ModBase.Log("[System] 已由于更新强制结束程序", ModBase.LogLevel.Normal, "出现错误");
  920. }
  921. }
  922. catch (Win32Exception ex)
  923. {
  924. ModBase.Log(ex, "自动更新时触发 Win32 错误,疑似被拦截", ModBase.LogLevel.Debug, "出现错误");
  925. if (ModMain.MyMsgBox(string.Format("由于被 Windows 安全中心拦截,或者存在权限问题,导致 PCL 无法更新。{0}请将 PCL 所在文件夹加入白名单,或者手动用 {1}PCL\\Plain Craft Launcher 2.exe 替换当前文件!", "\r\n", ModBase.Path), "更新失败", "查看帮助", "确定", "", true, true, false, null, null, null) == 1)
  926. {
  927. ModEvent.TryStartEvent("打开帮助", "启动器/Microsoft Defender 添加排除项.json");
  928. }
  929. }
  930. }
  931. // Token: 0x060005CD RID: 1485 RVA: 0x000321A0 File Offset: 0x000303A0
  932. public static void UpdateReplace(int ProcessId, string OldFileName, string NewFileName, bool TriggerRestart)
  933. {
  934. try
  935. {
  936. Process.GetProcessById(ProcessId).Kill();
  937. }
  938. catch (Exception ex)
  939. {
  940. }
  941. checked
  942. {
  943. string path = Strings.Mid(ModBase.Path, 1, ModBase.Path.Length - 4) + ModBase.GetFileNameFromPath(OldFileName);
  944. string text = Strings.Mid(ModBase.Path, 1, ModBase.Path.Length - 4) + ModBase.GetFileNameFromPath(NewFileName);
  945. Exception ex2 = null;
  946. int num = 0;
  947. do
  948. {
  949. try
  950. {
  951. if (File.Exists(path))
  952. {
  953. File.Delete(path);
  954. }
  955. if (File.Exists(text))
  956. {
  957. File.Delete(text);
  958. }
  959. if (!File.Exists(path) && !File.Exists(text))
  960. {
  961. break;
  962. }
  963. Thread.Sleep(2000);
  964. }
  965. catch (Exception ex3)
  966. {
  967. ex2 = ex3;
  968. }
  969. num++;
  970. }
  971. while (num <= 4);
  972. if (!File.Exists(path) && !File.Exists(text))
  973. {
  974. try
  975. {
  976. ModBase.CopyFile(ModBase.interpreterRepository, text);
  977. }
  978. catch (UnauthorizedAccessException ex4)
  979. {
  980. Interaction.MsgBox("PCL 更新失败:权限不足。请手动复制 PCL 文件夹下的新版本程序。\r\n若 PCL 位于桌面或 C 盘,你可以尝试将其挪到其他文件夹,这可能可以解决权限问题。\r\n" + ModBase.GetExceptionSummary(ex4), MsgBoxStyle.Critical, "更新失败");
  981. }
  982. catch (Exception ex5)
  983. {
  984. Interaction.MsgBox("PCL 更新失败:无法复制新文件。请手动复制 PCL 文件夹下的新版本程序。\r\n" + ModBase.GetExceptionSummary(ex5), MsgBoxStyle.Critical, "更新失败");
  985. return;
  986. }
  987. if (TriggerRestart)
  988. {
  989. try
  990. {
  991. Process.Start(text);
  992. }
  993. catch (Exception ex6)
  994. {
  995. Interaction.MsgBox("PCL 更新失败:无法重新启动。\r\n" + ModBase.GetExceptionSummary(ex6), MsgBoxStyle.Critical, "更新失败");
  996. }
  997. }
  998. return;
  999. }
  1000. if (ex2 is UnauthorizedAccessException)
  1001. {
  1002. Interaction.MsgBox(string.Concat(new string[]
  1003. {
  1004. "由于权限不足,PCL 无法完成更新。请尝试:\r\n",
  1005. (text.StartsWithF(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), false) || text.StartsWithF(Environment.GetFolderPath(Environment.SpecialFolder.Personal), false)) ? " - 将 PCL 文件移动到桌面、文档以外的文件夹(这或许可以一劳永逸地解决权限问题)\r\n" : "",
  1006. text.StartsWithF("C", true) ? " - 将 PCL 文件移动到 C 盘以外的文件夹(这或许可以一劳永逸地解决权限问题)\r\n" : "",
  1007. " - 右键以管理员身份运行 PCL\r\n - 手动复制已下载到 PCL 文件夹下的新版本程序,覆盖原程序\r\n\r\n",
  1008. ModBase.GetExceptionSummary(ex2)
  1009. }), MsgBoxStyle.Critical, "更新失败");
  1010. return;
  1011. }
  1012. Interaction.MsgBox("PCL 更新失败:无法删除原文件。请手动复制已下载到 PCL 文件夹下的新版本程序覆盖原程序。\r\n" + ModBase.GetExceptionSummary(ex2), MsgBoxStyle.Critical, "更新失败");
  1013. }
  1014. }
  1015. // Token: 0x060005CE RID: 1486 RVA: 0x00032400 File Offset: 0x00030600
  1016. private static void ServerSub(ModLoader.LoaderTask<int, int> Loader)
  1017. {
  1018. try
  1019. {
  1020. if (File.Exists(ModBase.Path + "PCL\\update.exe"))
  1021. {
  1022. File.Delete(ModBase.Path + "PCL\\update.exe");
  1023. ModBase.Log("[Server] 已清理更新缓存", ModBase.LogLevel.Normal, "出现错误");
  1024. }
  1025. }
  1026. catch (Exception ex)
  1027. {
  1028. ModBase.Log(ex, "清理更新缓存失败", ModBase.LogLevel.Debug, "出现错误");
  1029. }
  1030. ModBase.Log("[Server] 正在连接到 PCL 服务器", ModBase.LogLevel.Normal, "出现错误");
  1031. try
  1032. {
  1033. ModSecret.ServerSubReal();
  1034. }
  1035. catch (Exception ex2)
  1036. {
  1037. ModBase.Log(ex2, "连接到 PCL 服务器失败", ModBase.LogLevel.Debug, "出现错误");
  1038. }
  1039. }
  1040. // Token: 0x060005CF RID: 1487 RVA: 0x000324BC File Offset: 0x000306BC
  1041. private static void ServerSubReal()
  1042. {
  1043. int num = Conversions.ToInteger(ModBase.m_IdentifierRepository.Get("HintNotice", null));
  1044. int num2 = Conversions.ToInteger(ModBase.m_IdentifierRepository.Get("HintDownload", null));
  1045. checked
  1046. {
  1047. int num3;
  1048. int num4;
  1049. try
  1050. {
  1051. string text = Conversions.ToString(ModNet.NetGetCodeByRequestRetry("https://pcl2-server-1253424809.file.myqcloud.com/notice.cfg{CDN}", null, "", false, null, false));
  1052. num3 = (int)Math.Round(ModBase.Val(text.Split("|")[0]));
  1053. num4 = (int)Math.Round(ModBase.Val(text.Split("|")[3]));
  1054. if (num3 == 0)
  1055. {
  1056. throw new Exception("获取到的内容有误!(" + text + ")");
  1057. }
  1058. if (num3 > num)
  1059. {
  1060. ModBase.Log(string.Concat(new string[]
  1061. {
  1062. "[Server] 服务器公告:",
  1063. text,
  1064. ",本地公告编号:",
  1065. Conversions.ToString(num),
  1066. ",需更新"
  1067. }), ModBase.LogLevel.Normal, "出现错误");
  1068. }
  1069. else
  1070. {
  1071. ModBase.Log("[Server] 服务器公告:" + text + ",无需更新", ModBase.LogLevel.Normal, "出现错误");
  1072. }
  1073. ModBase.WriteFile(ModBase.m_DecoratorRepository + "Cache\\Notice.cfg", text, false, null);
  1074. }
  1075. catch (Exception ex)
  1076. {
  1077. if (!(ex is InvalidOperationException) || !ex.Message.Contains("FIPS"))
  1078. {
  1079. ModBase.Log(ex, "获取 PCL 服务器状态失败", ModBase.LogLevel.Debug, "出现错误");
  1080. return;
  1081. }
  1082. if (ModMain.MyMsgBox("由于系统未启用 FIPS 兼容算法,PCL 可能无法正常运行。\r\n请按照教程启用该功能,然后重启 PCL。", "兼容性警告", "打开教程", "取消", "", false, true, false, null, null, null) == 1)
  1083. {
  1084. ModBase.OpenWebsite("https://blog.csdn.net/qq_37608398/article/details/81209922");
  1085. }
  1086. }
  1087. try
  1088. {
  1089. if (num4 > num2 || !File.Exists(ModBase.m_DecoratorRepository + "Cache\\download.json"))
  1090. {
  1091. string text2 = ModNet.NetGetCodeByDownload("https://pcl2-server-1253424809.file.myqcloud.com/minecraft/download.json{CDN}", 45000, true, false);
  1092. Directory.CreateDirectory(ModBase.m_DecoratorRepository + "Cache\\");
  1093. ModBase.WriteFile(ModBase.m_DecoratorRepository + "Cache\\download.json", text2, false, null);
  1094. }
  1095. ModBase.m_IdentifierRepository.Set("HintDownload", num4, false, null);
  1096. }
  1097. catch (Exception ex2)
  1098. {
  1099. ModBase.Log(ex2, "下载 PCL 特供版信息失败", ModBase.LogLevel.Debug, "出现错误");
  1100. File.Delete(ModBase.m_DecoratorRepository + "Cache\\download.json");
  1101. }
  1102. string text3;
  1103. try
  1104. {
  1105. if (num3 <= num && File.Exists(ModBase.m_DecoratorRepository + "Cache\\Notice.json"))
  1106. {
  1107. text3 = ModBase.ReadFile(ModBase.m_DecoratorRepository + "Cache\\Notice.json", null);
  1108. }
  1109. else
  1110. {
  1111. text3 = Conversions.ToString(ModNet.NetGetCodeByRequestRetry("https://pcl2-server-1253424809.file.myqcloud.com/notice.json{CDN}", null, "", false, null, false));
  1112. ModBase.WriteFile(ModBase.m_DecoratorRepository + "Cache\\Notice.json", text3, false, null);
  1113. }
  1114. ModBase.m_IdentifierRepository.Set("HintNotice", num3, false, null);
  1115. }
  1116. catch (Exception ex3)
  1117. {
  1118. ModBase.Log(ex3, "下载 PCL 服务器公告失败", ModBase.LogLevel.Debug, "出现错误");
  1119. File.Delete(ModBase.m_DecoratorRepository + "Cache\\Notice.json");
  1120. return;
  1121. }
  1122. try
  1123. {
  1124. try
  1125. {
  1126. foreach (object obj in ((IEnumerable)ModBase.GetJson(text3.Replace("{UNIQUE}", ModBase._TagRepository))))
  1127. {
  1128. JObject jobject = (JObject)obj;
  1129. int num5 = (int)Math.Round(ModBase.Val(jobject["id"] ?? 0));
  1130. if (num5 > num)
  1131. {
  1132. bool flag = true;
  1133. try
  1134. {
  1135. foreach (JToken jtoken in (jobject["requirements"] ?? new byte[0]))
  1136. {
  1137. JProperty jproperty = (JProperty)jtoken;
  1138. if (!ModSecret.ServerRequirement(jproperty.Name, jproperty.Value))
  1139. {
  1140. flag = false;
  1141. }
  1142. }
  1143. }
  1144. finally
  1145. {
  1146. IEnumerator<JToken> enumerator2;
  1147. if (enumerator2 != null)
  1148. {
  1149. enumerator2.Dispose();
  1150. }
  1151. }
  1152. if (flag)
  1153. {
  1154. int num6 = (int)(jobject["importantLevel"] ?? 2);
  1155. bool flag2 = (bool)(jobject["isUpdate"] ?? false);
  1156. ModBase.Log("[Server] 重要等级 " + Conversions.ToString(num6) + ",更新公告 " + Conversions.ToString(flag2), ModBase.LogLevel.Normal, "出现错误");
  1157. if (!Operators.ConditionalCompareObjectGreater(ModBase.m_IdentifierRepository.Get(flag2 ? "SystemSystemUpdate" : "SystemSystemActivity", null), num6, false) && (!flag2 || !ModSecret._FactoryField))
  1158. {
  1159. string title = (jobject["title"] ?? "公告").ToString();
  1160. string text4 = (jobject["description"] ?? "").ToString().Replace("\\n", "\r\n");
  1161. JContainer jcontainer = (JContainer)(jobject["buttons"] ?? ModBase.GetJson("[]"));
  1162. int count = jcontainer.Count;
  1163. object obj2 = new object[0];
  1164. if (count > 0)
  1165. {
  1166. ModBase.Log("[Server] 显示公告 " + Conversions.ToString(num5) + ":" + text4, ModBase.LogLevel.Normal, "出现错误");
  1167. int num7;
  1168. switch (count)
  1169. {
  1170. case 1:
  1171. num7 = ModMain.MyMsgBox(text4, title, (jcontainer[0]["text"] ?? "确定").ToString(), "", "", false, true, true, null, null, null);
  1172. break;
  1173. case 2:
  1174. num7 = ModMain.MyMsgBox(text4, title, (jcontainer[0]["text"] ?? "确定").ToString(), (jcontainer[1]["text"] ?? "确定").ToString(), "", false, true, false, null, null, null);
  1175. break;
  1176. case 3:
  1177. num7 = ModMain.MyMsgBox(text4, title, (jcontainer[0]["text"] ?? "确定").ToString(), (jcontainer[1]["text"] ?? "确定").ToString(), (jcontainer[2]["text"] ?? "确定").ToString(), false, true, false, null, null, null);
  1178. break;
  1179. default:
  1180. ModBase.Log(string.Concat(new string[]
  1181. {
  1182. "[Server] 公告 ",
  1183. Conversions.ToString(num5),
  1184. " 的弹窗有 ",
  1185. Conversions.ToString(count),
  1186. " 个按钮,无法显示"
  1187. }), ModBase.LogLevel.Debug, "出现错误");
  1188. continue;
  1189. }
  1190. num7 = (int)Math.Round(ModBase.MathClamp((double)num7, 1.0, (double)count));
  1191. obj2 = (jcontainer[num7 - 1]["actions"] ?? new byte[0]);
  1192. }
  1193. else
  1194. {
  1195. obj2 = (jobject["actions"] ?? new byte[0]);
  1196. }
  1197. try
  1198. {
  1199. foreach (object obj3 in ((IEnumerable)obj2))
  1200. {
  1201. JProperty jproperty2 = (JProperty)obj3;
  1202. try
  1203. {
  1204. string name = jproperty2.Name;
  1205. if (Operators.CompareString(name, "copy", false) != 0)
  1206. {
  1207. if (Operators.CompareString(name, "website", false) != 0)
  1208. {
  1209. if (Operators.CompareString(name, "stop", false) != 0)
  1210. {
  1211. if (Operators.CompareString(name, "setup", false) != 0)
  1212. {
  1213. if (Operators.CompareString(name, "slientupdate", false) != 0)
  1214. {
  1215. if (Operators.CompareString(name, "update", false) != 0)
  1216. {
  1217. throw new Exception("未知的行动支:" + jproperty2.Name + ", " + jproperty2.Value.ToString());
  1218. }
  1219. ModSecret.UpdateStart((((JObject)jproperty2.Value)["url"] ?? "https://pcl2-server-1253424809.file.myqcloud.com/update/{KEY}.zip{CDN}").ToString(), false, null, true);
  1220. }
  1221. else
  1222. {
  1223. ModSecret.UpdateStart((((JObject)jproperty2.Value)["url"] ?? "https://pcl2-server-1253424809.file.myqcloud.com/update/{KEY}.zip{CDN}").ToString(), true, null, true);
  1224. }
  1225. }
  1226. else
  1227. {
  1228. ModBase.m_IdentifierRepository.Set(((JProperty)jproperty2.Value).Name, ((JProperty)jproperty2.Value).Value.ToString(), false, null);
  1229. }
  1230. }
  1231. else
  1232. {
  1233. ModMain._ProcessIterator.EndProgram(false);
  1234. }
  1235. }
  1236. else
  1237. {
  1238. ModBase.OpenWebsite(jproperty2.Value.ToString());
  1239. }
  1240. }
  1241. else
  1242. {
  1243. ModBase.ClipboardSet(jproperty2.Value.ToString(), true);
  1244. }
  1245. }
  1246. catch (Exception ex4)
  1247. {
  1248. ModBase.Log(ex4, string.Concat(new string[]
  1249. {
  1250. "执行 PCL 服务器公告动作失败(",
  1251. jproperty2.Name,
  1252. ", ",
  1253. jproperty2.Value.ToString(),
  1254. ")"
  1255. }), ModBase.LogLevel.Hint, "出现错误");
  1256. }
  1257. }
  1258. }
  1259. finally
  1260. {
  1261. IEnumerator enumerator3;
  1262. if (enumerator3 is IDisposable)
  1263. {
  1264. (enumerator3 as IDisposable).Dispose();
  1265. }
  1266. }
  1267. }
  1268. }
  1269. }
  1270. }
  1271. }
  1272. finally
  1273. {
  1274. IEnumerator enumerator;
  1275. if (enumerator is IDisposable)
  1276. {
  1277. (enumerator as IDisposable).Dispose();
  1278. }
  1279. }
  1280. }
  1281. catch (Exception ex5)
  1282. {
  1283. ModBase.Log(text3, ModBase.LogLevel.Normal, "出现错误");
  1284. ModBase.Log(ex5, "读取 PCL 服务器公告失败(" + Conversions.ToString(text3.Length) + ")", ModBase.LogLevel.Hint, "出现错误");
  1285. File.Delete(ModBase.m_DecoratorRepository + "Cache\\Notice.json");
  1286. }
  1287. }
  1288. }
  1289. // Token: 0x060005D0 RID: 1488 RVA: 0x00032F18 File Offset: 0x00031118
  1290. private static bool ServerRequirement(string Name, JToken Value)
  1291. {
  1292. checked
  1293. {
  1294. bool result;
  1295. try
  1296. {
  1297. uint num = <PrivateImplementationDetails>.ComputeStringHash(Name);
  1298. if (num <= 2200040294U)
  1299. {
  1300. if (num <= 1143669093U)
  1301. {
  1302. if (num != 127006290U)
  1303. {
  1304. if (num != 233440242U)
  1305. {
  1306. if (num == 1143669093U)
  1307. {
  1308. if (Operators.CompareString(Name, "setupboolean =", false) == 0)
  1309. {
  1310. return Operators.CompareString(ModBase.m_IdentifierRepository.Get(((JProperty)Value).Name, null).ToString().ToLower(), ((JProperty)Value).Value.ToString().ToLower(), false) == 0;
  1311. }
  1312. }
  1313. }
  1314. else if (Operators.CompareString(Name, "unlockedtheme =", false) == 0)
  1315. {
  1316. return ModSecret.InsertReader((int)Math.Round(ModBase.Val(Value)));
  1317. }
  1318. }
  1319. else if (Operators.CompareString(Name, "versionbranch <=", false) == 0)
  1320. {
  1321. return ModBase.Val("50") <= ModBase.Val(Value);
  1322. }
  1323. }
  1324. else if (num <= 1834020325U)
  1325. {
  1326. if (num != 1699755989U)
  1327. {
  1328. if (num == 1834020325U)
  1329. {
  1330. if (Operators.CompareString(Name, "setupinteger >=", false) == 0)
  1331. {
  1332. return Operators.ConditionalCompareObjectGreaterEqual(ModBase.m_IdentifierRepository.Get(((JProperty)Value).Name, null), ModBase.Val(((JProperty)Value).Value), false);
  1333. }
  1334. }
  1335. }
  1336. else if (Operators.CompareString(Name, "opencount >=", false) == 0)
  1337. {
  1338. return Operators.ConditionalCompareObjectGreaterEqual(ModBase.m_IdentifierRepository.Get("SystemCount", null), ModBase.Val(Value), false);
  1339. }
  1340. }
  1341. else if (num != 1931416207U)
  1342. {
  1343. if (num == 2200040294U)
  1344. {
  1345. if (Operators.CompareString(Name, "keyhash !=", false) == 0)
  1346. {
  1347. return ModBase.GetHash(ModSecret.indexerField.ToLower()) != ModBase.GetHash(Value.ToString().ToLower());
  1348. }
  1349. }
  1350. }
  1351. else if (Operators.CompareString(Name, "debug =", false) == 0)
  1352. {
  1353. return Operators.CompareString(ModBase._TokenRepository.ToString().ToLower(), Value.ToString().ToLower(), false) == 0;
  1354. }
  1355. }
  1356. else if (num <= 3063258025U)
  1357. {
  1358. if (num <= 2410018677U)
  1359. {
  1360. if (num != 2207725236U)
  1361. {
  1362. if (num == 2410018677U)
  1363. {
  1364. if (Operators.CompareString(Name, "d10000 <=", false) == 0)
  1365. {
  1366. return (double)ModBase.RandomInteger(1, 10000) <= ModBase.Val(Value);
  1367. }
  1368. }
  1369. }
  1370. else if (Operators.CompareString(Name, "versionbranch >=", false) == 0)
  1371. {
  1372. return ModBase.Val("50") >= ModBase.Val(Value);
  1373. }
  1374. }
  1375. else if (num != 2561636181U)
  1376. {
  1377. if (num == 3063258025U)
  1378. {
  1379. if (Operators.CompareString(Name, "unlockedtheme !=", false) == 0)
  1380. {
  1381. return !ModSecret.InsertReader((int)Math.Round(ModBase.Val(Value)));
  1382. }
  1383. }
  1384. }
  1385. else if (Operators.CompareString(Name, "uniqueaddress =", false) == 0)
  1386. {
  1387. return Operators.CompareString(ModBase._TagRepository, Value.ToString(), false) == 0;
  1388. }
  1389. }
  1390. else if (num <= 3317911237U)
  1391. {
  1392. if (num != 3250506571U)
  1393. {
  1394. if (num == 3317911237U)
  1395. {
  1396. if (Operators.CompareString(Name, "versioncode <=", false) == 0)
  1397. {
  1398. return 347.0 <= ModBase.Val(Value);
  1399. }
  1400. }
  1401. }
  1402. else if (Operators.CompareString(Name, "versioncode >=", false) == 0)
  1403. {
  1404. return 347.0 >= ModBase.Val(Value);
  1405. }
  1406. }
  1407. else if (num != 3779783387U)
  1408. {
  1409. if (num == 3914047723U)
  1410. {
  1411. if (Operators.CompareString(Name, "setupinteger <=", false) == 0)
  1412. {
  1413. return Operators.ConditionalCompareObjectLessEqual(ModBase.m_IdentifierRepository.Get(((JProperty)Value).Name, null), ModBase.Val(((JProperty)Value).Value), false);
  1414. }
  1415. }
  1416. }
  1417. else if (Operators.CompareString(Name, "opencount <=", false) == 0)
  1418. {
  1419. return Operators.ConditionalCompareObjectLessEqual(ModBase.m_IdentifierRepository.Get("SystemCount", null), ModBase.Val(Value), false);
  1420. }
  1421. ModBase.Log("[Server] 未知的条件支:" + Name + ", " + Value.ToString(), ModBase.LogLevel.Debug, "出现错误");
  1422. result = false;
  1423. }
  1424. catch (Exception ex)
  1425. {
  1426. ModBase.Log("[Server] 判断分支条件失败:" + Name + ", " + Value.ToString(), ModBase.LogLevel.Debug, "出现错误");
  1427. result = false;
  1428. }
  1429. return result;
  1430. }
  1431. }
  1432. // Token: 0x0400032D RID: 813
  1433. internal static string indexerField = "<RS!AKeyValu!e><Mo!dul!us>0L/cZoJUyBRAIE8OKiG8$qYOytXD$azFCBsmOuQra";
  1434. // Token: 0x0400032E RID: 814
  1435. public static ModBase.MyColor _InterpreterField = new ModBase.MyColor(52.0, 61.0, 74.0);
  1436. // Token: 0x0400032F RID: 815
  1437. public static ModBase.MyColor serializerField = new ModBase.MyColor(11.0, 91.0, 203.0);
  1438. // Token: 0x04000330 RID: 816
  1439. public static ModBase.MyColor watcherField = new ModBase.MyColor(19.0, 112.0, 243.0);
  1440. // Token: 0x04000331 RID: 817
  1441. public static ModBase.MyColor m_IdentifierField = new ModBase.MyColor(72.0, 144.0, 245.0);
  1442. // Token: 0x04000332 RID: 818
  1443. public static ModBase.MyColor _SystemField = new ModBase.MyColor(150.0, 192.0, 249.0);
  1444. // Token: 0x04000333 RID: 819
  1445. public static ModBase.MyColor m_ParamField = new ModBase.MyColor(213.0, 230.0, 253.0);
  1446. // Token: 0x04000334 RID: 820
  1447. public static ModBase.MyColor m_TagField = new ModBase.MyColor(222.0, 236.0, 253.0);
  1448. // Token: 0x04000335 RID: 821
  1449. public static ModBase.MyColor m_ObserverField = new ModBase.MyColor(234.0, 242.0, 254.0);
  1450. // Token: 0x04000336 RID: 822
  1451. public static ModBase.MyColor _StubField = new ModBase.MyColor(150.0, 192.0, 249.0);
  1452. // Token: 0x04000337 RID: 823
  1453. public static ModBase.MyColor m_RulesField = new ModBase.MyColor(190.0, ModSecret.m_TagField);
  1454. // Token: 0x04000338 RID: 824
  1455. public static ModBase.MyColor m_RefField = new ModBase.MyColor(64.0, 64.0, 64.0);
  1456. // Token: 0x04000339 RID: 825
  1457. public static ModBase.MyColor m_DecoratorField = new ModBase.MyColor(115.0, 115.0, 115.0);
  1458. // Token: 0x0400033A RID: 826
  1459. public static ModBase.MyColor instanceField = new ModBase.MyColor(140.0, 140.0, 140.0);
  1460. // Token: 0x0400033B RID: 827
  1461. public static ModBase.MyColor m_StateField = new ModBase.MyColor(166.0, 166.0, 166.0);
  1462. // Token: 0x0400033C RID: 828
  1463. public static ModBase.MyColor callbackField = new ModBase.MyColor(204.0, 204.0, 204.0);
  1464. // Token: 0x0400033D RID: 829
  1465. public static ModBase.MyColor m_TemplateField = new ModBase.MyColor(235.0, 235.0, 235.0);
  1466. // Token: 0x0400033E RID: 830
  1467. public static ModBase.MyColor _MethodField = new ModBase.MyColor(240.0, 240.0, 240.0);
  1468. // Token: 0x0400033F RID: 831
  1469. public static ModBase.MyColor taskField = new ModBase.MyColor(245.0, 245.0, 245.0);
  1470. // Token: 0x04000340 RID: 832
  1471. public static ModBase.MyColor _ConsumerField = new ModBase.MyColor(1.0, ModSecret.m_ObserverField);
  1472. // Token: 0x04000341 RID: 833
  1473. public static int configurationField = -1;
  1474. // Token: 0x04000342 RID: 834
  1475. public static int m_GetterField = 210;
  1476. // Token: 0x04000343 RID: 835
  1477. public static int m_TokenField = 85;
  1478. // Token: 0x04000344 RID: 836
  1479. public static int m_ExpressionField = 0;
  1480. // Token: 0x04000345 RID: 837
  1481. public static object _WriterField = 0;
  1482. // Token: 0x04000346 RID: 838
  1483. public static int registryField = 0;
  1484. // Token: 0x04000347 RID: 839
  1485. private static bool _RuleField = false;
  1486. // Token: 0x04000348 RID: 840
  1487. private static int m_ProccesorField = 1;
  1488. // Token: 0x04000349 RID: 841
  1489. private static bool m_SetterField = false;
  1490. // Token: 0x0400034A RID: 842
  1491. public static bool _FactoryField = false;
  1492. // Token: 0x0400034B RID: 843
  1493. public static bool m_ExporterField = false;
  1494. // Token: 0x0400034C RID: 844
  1495. private static bool _ImporterField;
  1496. // Token: 0x0400034D RID: 845
  1497. private static bool _WorkerField = false;
  1498. // Token: 0x0400034E RID: 846
  1499. public static ModLoader.LoaderTask<int, int> _ConnectionField = new ModLoader.LoaderTask<int, int>("PCL 服务", new Action<ModLoader.LoaderTask<int, int>>(ModSecret.ServerSub), null, ThreadPriority.BelowNormal)
  1500. {
  1501. ReloadTimeout = 60000
  1502. };
  1503. }
  1504. }