ModDownload.cs 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Runtime.CompilerServices;
  6. using System.Text;
  7. using System.Threading;
  8. using Microsoft.VisualBasic;
  9. using Microsoft.VisualBasic.CompilerServices;
  10. using Newtonsoft.Json.Linq;
  11. namespace PCL
  12. {
  13. // Token: 0x0200014E RID: 334
  14. [StandardModule]
  15. public sealed class ModDownload
  16. {
  17. // Token: 0x06000DB5 RID: 3509 RVA: 0x0005C8AC File Offset: 0x0005AAAC
  18. public static ModNet.NetFile DlClientJarGet(ModMinecraft.McVersion Version, bool ReturnNothingOnFileUseable)
  19. {
  20. try
  21. {
  22. while (!string.IsNullOrEmpty(Version.CallThread()))
  23. {
  24. Version = new ModMinecraft.McVersion(Version.CallThread());
  25. }
  26. }
  27. catch (Exception ex)
  28. {
  29. ModBase.Log(ex, "获取底层继承版本失败", ModBase.LogLevel.Debug, "出现错误");
  30. }
  31. if (Version.NewThread()["downloads"] != null && Version.NewThread()["downloads"]["client"] != null && Version.NewThread()["downloads"]["client"]["url"] != null)
  32. {
  33. ModBase.FileChecker fileChecker = new ModBase.FileChecker(1024L, (long)(Version.NewThread()["downloads"]["client"]["size"] ?? -1), (string)Version.NewThread()["downloads"]["client"]["sha1"], true, false);
  34. ModNet.NetFile result;
  35. if (ReturnNothingOnFileUseable && fileChecker.Check(Version.Path + Version.Name + ".jar") == null)
  36. {
  37. result = null;
  38. }
  39. else
  40. {
  41. string original = (string)Version.NewThread()["downloads"]["client"]["url"];
  42. result = new ModNet.NetFile(ModDownload.DlSourceLauncherOrMetaGet(original), Version.Path + Version.Name + ".jar", fileChecker, false);
  43. }
  44. return result;
  45. }
  46. throw new Exception("底层版本 " + Version.Name + " 中无 jar 文件下载信息");
  47. }
  48. // Token: 0x06000DB6 RID: 3510 RVA: 0x0005CA64 File Offset: 0x0005AC64
  49. public static ModNet.NetFile DlClientAssetIndexGet(ModMinecraft.McVersion Version)
  50. {
  51. while (!string.IsNullOrEmpty(Version.CallThread()))
  52. {
  53. Version = new ModMinecraft.McVersion(Version.CallThread());
  54. }
  55. JToken jtoken = ModMinecraft.McAssetsGetIndex(Version, true, true);
  56. string localPath = ModMinecraft.m_ProxyTests + "assets\\indexes\\" + jtoken["id"].ToString() + ".json";
  57. ModBase.Log("[Download] 版本 " + Version.Name + " 对应的资源文件索引为 " + jtoken["id"].ToString(), ModBase.LogLevel.Normal, "出现错误");
  58. string text = (string)(jtoken["url"] ?? "");
  59. ModNet.NetFile result;
  60. if (Operators.CompareString(text, "", false) == 0)
  61. {
  62. result = null;
  63. }
  64. else
  65. {
  66. result = new ModNet.NetFile(ModDownload.DlSourceLauncherOrMetaGet(text), localPath, new ModBase.FileChecker(-1L, -1L, null, false, true), false);
  67. }
  68. return result;
  69. }
  70. // Token: 0x06000DB7 RID: 3511 RVA: 0x0005CB48 File Offset: 0x0005AD48
  71. public static List<ModLoader.LoaderBase> DlClientFix(ModMinecraft.McVersion Version, bool CheckAssetsHash, ModDownload.AssetsIndexExistsBehaviour AssetsIndexBehaviour)
  72. {
  73. List<ModLoader.LoaderBase> list = new List<ModLoader.LoaderBase>();
  74. List<ModLoader.LoaderBase> loaders = new List<ModLoader.LoaderBase>
  75. {
  76. new ModLoader.LoaderTask<string, List<ModNet.NetFile>>("分析缺失支持库文件", delegate(ModLoader.LoaderTask<string, List<ModNet.NetFile>> Task)
  77. {
  78. Task.Output = ModMinecraft.McLibFix(Version);
  79. }, null, ThreadPriority.Normal)
  80. {
  81. ProgressWeight = 1.0
  82. },
  83. new ModNet.LoaderDownload("下载支持库文件", new List<ModNet.NetFile>())
  84. {
  85. ProgressWeight = 15.0
  86. }
  87. };
  88. list.Add(new ModLoader.LoaderCombo<string>("下载支持库文件(主加载器)", loaders)
  89. {
  90. Block = false,
  91. Show = false,
  92. ProgressWeight = 16.0
  93. });
  94. if (Conversions.ToBoolean(ModMinecraft.ShouldIgnoreFileCheck(Version)))
  95. {
  96. ModBase.Log("[Download] 已跳过所有 Assets 检查", ModBase.LogLevel.Normal, "出现错误");
  97. }
  98. else
  99. {
  100. List<ModLoader.LoaderBase> list2 = new List<ModLoader.LoaderBase>();
  101. list2.Add(new ModLoader.LoaderTask<string, List<ModNet.NetFile>>("分析资源文件索引地址", delegate(ModLoader.LoaderTask<string, List<ModNet.NetFile>> Task)
  102. {
  103. try
  104. {
  105. ModNet.NetFile netFile = ModDownload.DlClientAssetIndexGet(Version);
  106. new FileInfo(netFile.m_AuthenticationTest);
  107. if (AssetsIndexBehaviour != ModDownload.AssetsIndexExistsBehaviour.AlwaysDownload && netFile.m_PageTest.Check(netFile.m_AuthenticationTest) == null)
  108. {
  109. Task.Output = new List<ModNet.NetFile>();
  110. }
  111. else
  112. {
  113. Task.Output = new List<ModNet.NetFile>
  114. {
  115. netFile
  116. };
  117. }
  118. }
  119. catch (Exception innerException)
  120. {
  121. throw new Exception("分析资源文件索引地址失败", innerException);
  122. }
  123. }, null, ThreadPriority.Normal)
  124. {
  125. ProgressWeight = 0.5,
  126. Show = false
  127. });
  128. list2.Add(new ModNet.LoaderDownload("下载资源文件索引", new List<ModNet.NetFile>())
  129. {
  130. ProgressWeight = 2.0
  131. });
  132. if (AssetsIndexBehaviour == ModDownload.AssetsIndexExistsBehaviour.DownloadInBackground)
  133. {
  134. List<ModLoader.LoaderBase> list3 = new List<ModLoader.LoaderBase>();
  135. string TempAddress = null;
  136. string RealAddress = null;
  137. list3.Add(new ModLoader.LoaderTask<string, List<ModNet.NetFile>>("后台分析资源文件索引地址", delegate(ModLoader.LoaderTask<string, List<ModNet.NetFile>> Task)
  138. {
  139. ModNet.NetFile netFile = ModDownload.DlClientAssetIndexGet(Version);
  140. RealAddress = netFile.m_AuthenticationTest;
  141. TempAddress = ModBase.m_DecoratorRepository + "Cache\\" + netFile._AlgoTest;
  142. netFile.m_AuthenticationTest = TempAddress;
  143. Task.Output = new List<ModNet.NetFile>
  144. {
  145. netFile
  146. };
  147. if (File.Exists(RealAddress) && Math.Abs((File.GetLastWriteTime(RealAddress).Date - DateAndTime.Now.Date).TotalDays) < 1.0)
  148. {
  149. ModBase.Log("[Download] 无需更新资源文件索引,取消", ModBase.LogLevel.Normal, "出现错误");
  150. Task.Abort();
  151. }
  152. }, null, ThreadPriority.Normal));
  153. list3.Add(new ModNet.LoaderDownload("后台下载资源文件索引", new List<ModNet.NetFile>()));
  154. list3.Add(new ModLoader.LoaderTask<List<ModNet.NetFile>, string>("后台复制资源文件索引", delegate(ModLoader.LoaderTask<List<ModNet.NetFile>, string> Task)
  155. {
  156. ModBase.CopyFile(TempAddress, RealAddress);
  157. ModLaunch.McLaunchLog("后台更新资源文件索引成功:" + TempAddress);
  158. }, null, ThreadPriority.Normal));
  159. ModLoader.LoaderCombo<string> loaderCombo = new ModLoader.LoaderCombo<string>("后台更新资源文件索引", list3);
  160. ModBase.Log("[Download] 开始后台检查资源文件索引", ModBase.LogLevel.Normal, "出现错误");
  161. loaderCombo.Start(null, false);
  162. }
  163. list2.Add(new ModLoader.LoaderTask<string, List<ModNet.NetFile>>("分析缺失资源文件", delegate(ModLoader.LoaderTask<string, List<ModNet.NetFile>> Task)
  164. {
  165. ModLoader.LoaderTask<string, List<ModNet.NetFile>> loaderTask = Task;
  166. ModMinecraft.McVersion $VB$Local_Version = Version;
  167. bool $VB$Local_CheckAssetsHash = CheckAssetsHash;
  168. ModLoader.LoaderBase loaderBase = Task;
  169. List<ModNet.NetFile> output = ModMinecraft.McAssetsFixList($VB$Local_Version, $VB$Local_CheckAssetsHash, ref loaderBase);
  170. Task = (ModLoader.LoaderTask<string, List<ModNet.NetFile>>)loaderBase;
  171. loaderTask.Output = output;
  172. }, null, ThreadPriority.Normal)
  173. {
  174. ProgressWeight = 3.0
  175. });
  176. list2.Add(new ModNet.LoaderDownload("下载资源文件", new List<ModNet.NetFile>())
  177. {
  178. ProgressWeight = 25.0
  179. });
  180. list.Add(new ModLoader.LoaderCombo<string>("下载资源文件(主加载器)", list2)
  181. {
  182. Block = false,
  183. Show = false,
  184. ProgressWeight = 30.5
  185. });
  186. }
  187. return list;
  188. }
  189. // Token: 0x06000DB8 RID: 3512 RVA: 0x0005CDAC File Offset: 0x0005AFAC
  190. private static void DlClientListMain(ModLoader.LoaderTask<string, ModDownload.DlClientListResult> Loader)
  191. {
  192. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadVersion", null);
  193. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  194. {
  195. ModDownload.DlSourceLoader<string, ModDownload.DlClientListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>>
  196. {
  197. new KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>(ModDownload._ManagerTests, 30),
  198. new KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>(ModDownload.queueTests, 90)
  199. }, Loader.IsForceRestarting);
  200. return;
  201. }
  202. if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  203. {
  204. ModDownload.DlSourceLoader<string, ModDownload.DlClientListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>>
  205. {
  206. new KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>(ModDownload.queueTests, 5),
  207. new KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>(ModDownload._ManagerTests, 35)
  208. }, Loader.IsForceRestarting);
  209. return;
  210. }
  211. ModDownload.DlSourceLoader<string, ModDownload.DlClientListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>>
  212. {
  213. new KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>(ModDownload.queueTests, 60),
  214. new KeyValuePair<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>, int>(ModDownload._ManagerTests, 120)
  215. }, Loader.IsForceRestarting);
  216. }
  217. // Token: 0x06000DB9 RID: 3513 RVA: 0x0005CE88 File Offset: 0x0005B088
  218. private static void DlClientListMojangMain(ModLoader.LoaderTask<string, ModDownload.DlClientListResult> Loader)
  219. {
  220. JObject jobject = (JObject)ModNet.NetGetCodeByRequestRetry("https://launchermeta.mojang.com/mc/game/version_manifest.json", null, "", true, null, false);
  221. try
  222. {
  223. JArray jarray = (JArray)jobject["versions"];
  224. if (jarray.Count < 200)
  225. {
  226. throw new Exception("获取到的版本列表长度不足(" + jobject.ToString() + ")");
  227. }
  228. if (File.Exists(ModBase.m_DecoratorRepository + "Cache\\download.json"))
  229. {
  230. jarray.Merge(RuntimeHelpers.GetObjectValue(ModBase.GetJson(ModBase.ReadFile(ModBase.m_DecoratorRepository + "Cache\\download.json", null))));
  231. }
  232. Loader.Output = new ModDownload.DlClientListResult
  233. {
  234. policyTest = true,
  235. classTest = "Mojang 官方源",
  236. Value = jobject
  237. };
  238. string text = (string)jobject["latest"]["release"];
  239. if (Conversions.ToBoolean(Conversions.ToBoolean(ModBase.m_IdentifierRepository.Get("ToolUpdateRelease", null)) && Conversions.ToBoolean(Operators.NotObject(Operators.CompareObjectEqual(ModBase.m_IdentifierRepository.Get("ToolUpdateReleaseLast", null), "", false))) && text != null && Conversions.ToBoolean(Operators.NotObject(Operators.CompareObjectEqual(ModBase.m_IdentifierRepository.Get("ToolUpdateReleaseLast", null), text, false)))))
  240. {
  241. ModMinecraft.McDownloadClientUpdateHint(text, jobject);
  242. ModDownload.m_EventTests = true;
  243. }
  244. ModDownloadLib.m_StructField = Conversions.ToInteger(text.Split(".")[1]);
  245. ModBase.m_IdentifierRepository.Set("ToolUpdateReleaseLast", text, false, null);
  246. text = (string)jobject["latest"]["snapshot"];
  247. if (Conversions.ToBoolean(Conversions.ToBoolean(ModBase.m_IdentifierRepository.Get("ToolUpdateSnapshot", null)) && Conversions.ToBoolean(Operators.NotObject(Operators.CompareObjectEqual(ModBase.m_IdentifierRepository.Get("ToolUpdateSnapshotLast", null), "", false))) && text != null && Conversions.ToBoolean(Operators.NotObject(Operators.CompareObjectEqual(ModBase.m_IdentifierRepository.Get("ToolUpdateSnapshotLast", null), text, false))) && !ModDownload.m_EventTests))
  248. {
  249. ModMinecraft.McDownloadClientUpdateHint(text, jobject);
  250. }
  251. ModBase.m_IdentifierRepository.Set("ToolUpdateSnapshotLast", text ?? "Nothing", false, null);
  252. }
  253. catch (Exception innerException)
  254. {
  255. throw new Exception("Minecraft 官方源版本列表解析失败", innerException);
  256. }
  257. }
  258. // Token: 0x06000DBA RID: 3514 RVA: 0x0005D0FC File Offset: 0x0005B2FC
  259. private static void DlClientListBmclapiMain(ModLoader.LoaderTask<string, ModDownload.DlClientListResult> Loader)
  260. {
  261. JObject jobject = (JObject)ModNet.NetGetCodeByRequestRetry("https://bmclapi2.bangbang93.com/mc/game/version_manifest.json", null, "", true, null, false);
  262. try
  263. {
  264. JArray jarray = (JArray)jobject["versions"];
  265. if (jarray.Count < 200)
  266. {
  267. throw new Exception("获取到的版本列表长度不足(" + jobject.ToString() + ")");
  268. }
  269. if (File.Exists(ModBase.m_DecoratorRepository + "Cache\\download.json"))
  270. {
  271. jarray.Merge(RuntimeHelpers.GetObjectValue(ModBase.GetJson(ModBase.ReadFile(ModBase.m_DecoratorRepository + "Cache\\download.json", null))));
  272. }
  273. if (!string.IsNullOrEmpty(Loader.Input))
  274. {
  275. string Id = Loader.Input;
  276. if (!Enumerable.Any<JToken>(ModDownload.accountTests.Output.Value["versions"], (JToken v) => (string)v["id"] == Id))
  277. {
  278. throw new Exception("BMCLAPI 源未包含目标版本 " + Id);
  279. }
  280. }
  281. Loader.Output = new ModDownload.DlClientListResult
  282. {
  283. policyTest = false,
  284. classTest = "BMCLAPI",
  285. Value = jobject
  286. };
  287. }
  288. catch (Exception innerException)
  289. {
  290. throw new Exception("Minecraft BMCLAPI 版本列表解析失败(" + jobject.ToString() + ")", innerException);
  291. }
  292. }
  293. // Token: 0x06000DBB RID: 3515 RVA: 0x0005D268 File Offset: 0x0005B468
  294. public static object DlClientListGet(string Id)
  295. {
  296. object result;
  297. try
  298. {
  299. Id = Id.Replace("_", "-");
  300. if (Operators.CompareString(Id, "1.0", false) != 0 && Id.EndsWithF(".0", false))
  301. {
  302. Id = Strings.Left(Id, checked(Id.Length - 2));
  303. }
  304. switch (ModDownload.accountTests.State)
  305. {
  306. case ModBase.LoadState.Waiting:
  307. case ModBase.LoadState.Failed:
  308. case ModBase.LoadState.Aborted:
  309. ModDownload.accountTests.WaitForExit(Id, null, true);
  310. break;
  311. case ModBase.LoadState.Loading:
  312. ModDownload.accountTests.WaitForExit(Id, null, false);
  313. break;
  314. case ModBase.LoadState.Finished:
  315. try
  316. {
  317. foreach (JToken jtoken in ModDownload.accountTests.Output.Value["versions"])
  318. {
  319. JObject jobject = (JObject)jtoken;
  320. if ((string)jobject["id"] == Id)
  321. {
  322. return jobject["url"].ToString();
  323. }
  324. }
  325. }
  326. finally
  327. {
  328. IEnumerator<JToken> enumerator;
  329. if (enumerator != null)
  330. {
  331. enumerator.Dispose();
  332. }
  333. }
  334. ModDownload.accountTests.WaitForExit(Id, null, true);
  335. break;
  336. }
  337. try
  338. {
  339. foreach (JToken jtoken2 in ModDownload.accountTests.Output.Value["versions"])
  340. {
  341. JObject jobject2 = (JObject)jtoken2;
  342. if ((string)jobject2["id"] == Id)
  343. {
  344. return jobject2["url"].ToString();
  345. }
  346. }
  347. }
  348. finally
  349. {
  350. IEnumerator<JToken> enumerator2;
  351. if (enumerator2 != null)
  352. {
  353. enumerator2.Dispose();
  354. }
  355. }
  356. ModBase.Log(string.Format("未发现版本 {0} 的 json 下载地址,版本列表返回为:{1}{2}", Id, "\r\n", ModDownload.accountTests.Output.Value.ToString()), ModBase.LogLevel.Debug, "出现错误");
  357. result = null;
  358. }
  359. catch (Exception ex)
  360. {
  361. ModBase.Log(ex, string.Format("获取版本 {0} 的 json 下载地址失败", Id), ModBase.LogLevel.Debug, "出现错误");
  362. result = null;
  363. }
  364. return result;
  365. }
  366. // Token: 0x06000DBC RID: 3516 RVA: 0x0005D49C File Offset: 0x0005B69C
  367. private static void DlOptiFineListMain(ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult> Loader)
  368. {
  369. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadVersion", null);
  370. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  371. {
  372. ModDownload.DlSourceLoader<int, ModDownload.DlOptiFineListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>>
  373. {
  374. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>(ModDownload._BaseTests, 30),
  375. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>(ModDownload._WrapperTests, 90)
  376. }, Loader.IsForceRestarting);
  377. return;
  378. }
  379. if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  380. {
  381. ModDownload.DlSourceLoader<int, ModDownload.DlOptiFineListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>>
  382. {
  383. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>(ModDownload._WrapperTests, 5),
  384. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>(ModDownload._BaseTests, 35)
  385. }, Loader.IsForceRestarting);
  386. return;
  387. }
  388. ModDownload.DlSourceLoader<int, ModDownload.DlOptiFineListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>>
  389. {
  390. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>(ModDownload._WrapperTests, 60),
  391. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>, int>(ModDownload._BaseTests, 120)
  392. }, Loader.IsForceRestarting);
  393. }
  394. // Token: 0x06000DBD RID: 3517 RVA: 0x0005D578 File Offset: 0x0005B778
  395. private static void DlOptiFineListOfficialMain(ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult> Loader)
  396. {
  397. string text = ModNet.NetGetCodeByClient("https://optifine.net/downloads", Encoding.Default, "application/json, text/javascript, */*; q=0.01", false);
  398. if (text.Length < 200)
  399. {
  400. throw new Exception("获取到的版本列表长度不足(" + text + ")");
  401. }
  402. checked
  403. {
  404. try
  405. {
  406. List<string> list = ModBase.RegexSearch(text, "(?<=colForge'>)[^<]*", 0);
  407. List<string> list2 = ModBase.RegexSearch(text, "(?<=colDate'>)[^<]+", 0);
  408. List<string> list3 = ModBase.RegexSearch(text, "(?<=OptiFine_)[0-9A-Za-z_.]+(?=.jar\")", 0);
  409. if (list2.Count != list3.Count)
  410. {
  411. throw new Exception("版本与发布时间数据无法对应");
  412. }
  413. if (list.Count != list3.Count)
  414. {
  415. throw new Exception("版本与 Forge 兼容数据无法对应");
  416. }
  417. if (list2.Count < 10)
  418. {
  419. throw new Exception("获取到的版本数量不足(" + text + ")");
  420. }
  421. List<ModDownload.DlOptiFineListEntry> list4 = new List<ModDownload.DlOptiFineListEntry>();
  422. int num = list2.Count - 1;
  423. for (int i = 0; i <= num; i++)
  424. {
  425. list3[i] = list3[i].Replace("_", " ");
  426. ModDownload.DlOptiFineListEntry dlOptiFineListEntry = new ModDownload.DlOptiFineListEntry();
  427. dlOptiFineListEntry.m_SchemaTest = list3[i].Replace("HD U ", "").Replace(".0 ", " ");
  428. dlOptiFineListEntry.m_ProcTest = new string[]
  429. {
  430. list2[i].Split(".")[2],
  431. list2[i].Split(".")[1],
  432. list2[i].Split(".")[0]
  433. }.Join("/");
  434. dlOptiFineListEntry._DefinitionTest = list3[i].ContainsF("pre", true);
  435. dlOptiFineListEntry.CompareMapper(list3[i].ToString().Split(" ")[0]);
  436. dlOptiFineListEntry._DescriptorTest = (list3[i].ContainsF("pre", true) ? "preview_" : "") + "OptiFine_" + list3[i].Replace(" ", "_") + ".jar";
  437. dlOptiFineListEntry.parserMap = list[i].Replace("Forge ", "").Replace("#", "");
  438. ModDownload.DlOptiFineListEntry dlOptiFineListEntry2 = dlOptiFineListEntry;
  439. if (dlOptiFineListEntry2.parserMap.Contains("N/A"))
  440. {
  441. dlOptiFineListEntry2.parserMap = null;
  442. }
  443. dlOptiFineListEntry2.m_PublisherTest = dlOptiFineListEntry2.CheckMapper() + "-OptiFine_" + list3[i].ToString().Replace(" ", "_").Replace(dlOptiFineListEntry2.CheckMapper() + "_", "");
  444. list4.Add(dlOptiFineListEntry2);
  445. }
  446. Loader.Output = new ModDownload.DlOptiFineListResult
  447. {
  448. producerTest = true,
  449. orderTest = "OptiFine 官方源",
  450. Value = list4
  451. };
  452. }
  453. catch (Exception innerException)
  454. {
  455. throw new Exception("OptiFine 官方源版本列表解析失败(" + text + ")", innerException);
  456. }
  457. }
  458. }
  459. // Token: 0x06000DBE RID: 3518 RVA: 0x0005D8A8 File Offset: 0x0005BAA8
  460. private static void DlOptiFineListBmclapiMain(ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult> Loader)
  461. {
  462. JArray jarray = (JArray)ModNet.NetGetCodeByRequestRetry("https://bmclapi2.bangbang93.com/optifine/versionList", null, "", true, null, false);
  463. try
  464. {
  465. List<ModDownload.DlOptiFineListEntry> list = new List<ModDownload.DlOptiFineListEntry>();
  466. try
  467. {
  468. foreach (JToken jtoken in jarray)
  469. {
  470. JObject jobject = (JObject)jtoken;
  471. ModDownload.DlOptiFineListEntry dlOptiFineListEntry = new ModDownload.DlOptiFineListEntry();
  472. dlOptiFineListEntry.m_SchemaTest = (jobject["mcversion"].ToString() + jobject["type"].ToString().Replace("HD_U", "").Replace("_", " ") + " " + jobject["patch"].ToString()).Replace(".0 ", " ");
  473. dlOptiFineListEntry.m_ProcTest = "";
  474. dlOptiFineListEntry._DefinitionTest = jobject["patch"].ToString().ContainsF("pre", true);
  475. dlOptiFineListEntry.CompareMapper(jobject["mcversion"].ToString());
  476. dlOptiFineListEntry._DescriptorTest = jobject["filename"].ToString();
  477. dlOptiFineListEntry.parserMap = (jobject["forge"] ?? "").ToString().Replace("Forge ", "").Replace("#", "");
  478. ModDownload.DlOptiFineListEntry dlOptiFineListEntry2 = dlOptiFineListEntry;
  479. if (dlOptiFineListEntry2.parserMap.Contains("N/A"))
  480. {
  481. dlOptiFineListEntry2.parserMap = null;
  482. }
  483. dlOptiFineListEntry2.m_PublisherTest = dlOptiFineListEntry2.CheckMapper() + "-OptiFine_" + (jobject["type"].ToString() + " " + jobject["patch"].ToString()).Replace(".0 ", " ").Replace(" ", "_").Replace(dlOptiFineListEntry2.CheckMapper() + "_", "");
  484. list.Add(dlOptiFineListEntry2);
  485. }
  486. }
  487. finally
  488. {
  489. IEnumerator<JToken> enumerator;
  490. if (enumerator != null)
  491. {
  492. enumerator.Dispose();
  493. }
  494. }
  495. Loader.Output = new ModDownload.DlOptiFineListResult
  496. {
  497. producerTest = false,
  498. orderTest = "BMCLAPI",
  499. Value = list
  500. };
  501. }
  502. catch (Exception innerException)
  503. {
  504. throw new Exception("OptiFine BMCLAPI 版本列表解析失败(" + jarray.ToString() + ")", innerException);
  505. }
  506. }
  507. // Token: 0x06000DBF RID: 3519 RVA: 0x0005DB38 File Offset: 0x0005BD38
  508. private static void DlForgeListMain(ModLoader.LoaderTask<int, ModDownload.DlForgeListResult> Loader)
  509. {
  510. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadVersion", null);
  511. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  512. {
  513. ModDownload.DlSourceLoader<int, ModDownload.DlForgeListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>>
  514. {
  515. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>(ModDownload.m_PrototypeTests, 30),
  516. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>(ModDownload.m_CodeTests, 90)
  517. }, Loader.IsForceRestarting);
  518. return;
  519. }
  520. if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  521. {
  522. ModDownload.DlSourceLoader<int, ModDownload.DlForgeListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>>
  523. {
  524. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>(ModDownload.m_CodeTests, 5),
  525. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>(ModDownload.m_PrototypeTests, 35)
  526. }, Loader.IsForceRestarting);
  527. return;
  528. }
  529. ModDownload.DlSourceLoader<int, ModDownload.DlForgeListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>>
  530. {
  531. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>(ModDownload.m_CodeTests, 60),
  532. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>, int>(ModDownload.m_PrototypeTests, 120)
  533. }, Loader.IsForceRestarting);
  534. }
  535. // Token: 0x06000DC0 RID: 3520 RVA: 0x0005DC14 File Offset: 0x0005BE14
  536. private static void DlForgeListOfficialMain(ModLoader.LoaderTask<int, ModDownload.DlForgeListResult> Loader)
  537. {
  538. string text = Conversions.ToString(ModNet.NetGetCodeByRequestRetry("https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.2.4.html", Encoding.Default, "text/html", false, null, true));
  539. if (text.Length < 200)
  540. {
  541. throw new Exception("获取到的版本列表长度不足(" + text + ")");
  542. }
  543. List<string> list = ModBase.RegexSearch(text, "(?<=a href=\"index_)[0-9.]+(_pre[0-9]?)?(?=.html)", 0);
  544. list.Add("1.2.4");
  545. if (list.Count < 10)
  546. {
  547. throw new Exception("获取到的版本数量不足(" + text + ")");
  548. }
  549. Loader.Output = new ModDownload.DlForgeListResult
  550. {
  551. m_FieldMap = true,
  552. m_BroadcasterMap = "Forge 官方源",
  553. Value = list
  554. };
  555. }
  556. // Token: 0x06000DC1 RID: 3521 RVA: 0x0005DCC4 File Offset: 0x0005BEC4
  557. private static void DlForgeListBmclapiMain(ModLoader.LoaderTask<int, ModDownload.DlForgeListResult> Loader)
  558. {
  559. string text = Conversions.ToString(ModNet.NetGetCodeByRequestRetry("https://bmclapi2.bangbang93.com/forge/minecraft", Encoding.Default, "", false, null, false));
  560. if (text.Length < 200)
  561. {
  562. throw new Exception("获取到的版本列表长度不足(" + text + ")");
  563. }
  564. List<string> list = ModBase.RegexSearch(text, "[0-9.]+(_pre[0-9]?)?", 0);
  565. if (list.Count < 10)
  566. {
  567. throw new Exception("获取到的版本数量不足(" + text + ")");
  568. }
  569. Loader.Output = new ModDownload.DlForgeListResult
  570. {
  571. m_FieldMap = false,
  572. m_BroadcasterMap = "BMCLAPI",
  573. Value = list
  574. };
  575. }
  576. // Token: 0x06000DC2 RID: 3522 RVA: 0x0005DD6C File Offset: 0x0005BF6C
  577. public static void DlForgeVersionMain(ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>> Loader)
  578. {
  579. ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>> key = new ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>("DlForgeVersion Official", new Action<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>>(ModDownload.DlForgeVersionOfficialMain), null, ThreadPriority.Normal);
  580. ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>> key2 = new ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>("DlForgeVersion Bmclapi", new Action<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>>(ModDownload.DlForgeVersionBmclapiMain), null, ThreadPriority.Normal);
  581. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadVersion", null);
  582. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  583. {
  584. ModDownload.DlSourceLoader<string, List<ModDownload.DlForgeVersionEntry>>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>>
  585. {
  586. new KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>(key2, 30),
  587. new KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>(key, 90)
  588. }, Loader.IsForceRestarting);
  589. return;
  590. }
  591. if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  592. {
  593. ModDownload.DlSourceLoader<string, List<ModDownload.DlForgeVersionEntry>>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>>
  594. {
  595. new KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>(key, 5),
  596. new KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>(key2, 35)
  597. }, Loader.IsForceRestarting);
  598. return;
  599. }
  600. ModDownload.DlSourceLoader<string, List<ModDownload.DlForgeVersionEntry>>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>>
  601. {
  602. new KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>(key, 60),
  603. new KeyValuePair<ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>>, int>(key2, 120)
  604. }, Loader.IsForceRestarting);
  605. }
  606. // Token: 0x06000DC3 RID: 3523 RVA: 0x0005DE64 File Offset: 0x0005C064
  607. public static void DlForgeVersionOfficialMain(ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>> Loader)
  608. {
  609. string text;
  610. try
  611. {
  612. text = ModNet.NetGetCodeByDownload("https://files.minecraftforge.net/maven/net/minecraftforge/forge/index_" + Loader.Input.Replace("-", "_") + ".html", 45000, false, true);
  613. }
  614. catch (Exception ex)
  615. {
  616. if (ModBase.GetExceptionSummary(ex).Contains("(404)"))
  617. {
  618. throw new Exception("没有可用版本");
  619. }
  620. throw;
  621. }
  622. if (text.Length < 1000)
  623. {
  624. throw new Exception("获取到的版本列表长度不足(" + text + ")");
  625. }
  626. List<ModDownload.DlForgeVersionEntry> list = new List<ModDownload.DlForgeVersionEntry>();
  627. checked
  628. {
  629. try
  630. {
  631. string[] array = Strings.Mid(text, 1, text.LastIndexOfF("</table>", false)).Split("<td class=\"download-version");
  632. int num = Enumerable.Count<string>(array) - 1;
  633. for (int i = 1; i <= num; i++)
  634. {
  635. string text2 = array[i];
  636. try
  637. {
  638. string text3 = ModBase.RegexSeek(text2, "(?<=[^(0-9)]+)[0-9\\.]+", 0);
  639. bool propertyMap = text2.Contains("fa promo-recommended");
  640. string input = Loader.Input;
  641. string text4 = ModBase.RegexSeek(text2, string.Format("(?<=-{0}-)[^-\"]+(?=-[a-z]+.[a-z]{{3}})", text3), 0);
  642. if (string.IsNullOrWhiteSpace(text4))
  643. {
  644. text4 = null;
  645. }
  646. string[] array2 = ModBase.RegexSeek(text2, "(?<=\"download-time\" title=\")[^\"]+", 0).Split(" -:".ToCharArray());
  647. string mapperMap = new DateTime(Conversions.ToInteger(array2[0]), Conversions.ToInteger(array2[1]), Conversions.ToInteger(array2[2]), Conversions.ToInteger(array2[3]), Conversions.ToInteger(array2[4]), Conversions.ToInteger(array2[5]), 0, DateTimeKind.Utc).ToLocalTime().ToString("yyyy'/'MM'/'dd HH':'mm");
  648. string text5;
  649. string composerMap;
  650. if (text2.Contains("classifier-installer\""))
  651. {
  652. text2 = text2.Substring(text2.IndexOfF("installer.jar", false));
  653. text5 = ModBase.RegexSeek(text2, "(?<=MD5:</strong> )[^<]+", 0);
  654. composerMap = "installer";
  655. }
  656. else if (text2.Contains("classifier-universal\""))
  657. {
  658. text2 = text2.Substring(text2.IndexOfF("universal.zip", false));
  659. text5 = ModBase.RegexSeek(text2, "(?<=MD5:</strong> )[^<]+", 0);
  660. composerMap = "universal";
  661. }
  662. else
  663. {
  664. if (!text2.Contains("client.zip"))
  665. {
  666. goto IL_29C;
  667. }
  668. text2 = text2.Substring(text2.IndexOfF("client.zip", false));
  669. text5 = ModBase.RegexSeek(text2, "(?<=MD5:</strong> )[^<]+", 0);
  670. composerMap = "client";
  671. }
  672. list.Add(new ModDownload.DlForgeVersionEntry(text3, text4, input)
  673. {
  674. _ComposerMap = composerMap,
  675. propertyMap = propertyMap,
  676. threadMap = text5.Trim(new char[]
  677. {
  678. '\r',
  679. '\n'
  680. }),
  681. mapperMap = mapperMap
  682. });
  683. }
  684. catch (Exception innerException)
  685. {
  686. throw new Exception("Forge 官方源版本信息提取失败(" + text2 + ")", innerException);
  687. }
  688. IL_29C:;
  689. }
  690. }
  691. catch (Exception innerException2)
  692. {
  693. throw new Exception("Forge 官方源版本列表解析失败(" + text + ")", innerException2);
  694. }
  695. if (!Enumerable.Any<ModDownload.DlForgeVersionEntry>(list))
  696. {
  697. throw new Exception("没有可用版本");
  698. }
  699. Loader.Output = list;
  700. }
  701. }
  702. // Token: 0x06000DC4 RID: 3524 RVA: 0x0005E1A0 File Offset: 0x0005C3A0
  703. public static void DlForgeVersionBmclapiMain(ModLoader.LoaderTask<string, List<ModDownload.DlForgeVersionEntry>> Loader)
  704. {
  705. JArray jarray = (JArray)ModNet.NetGetCodeByRequestRetry("https://bmclapi2.bangbang93.com/forge/minecraft/" + Loader.Input.Replace("-", "_"), null, "", true, null, false);
  706. List<ModDownload.DlForgeVersionEntry> list = new List<ModDownload.DlForgeVersionEntry>();
  707. try
  708. {
  709. string left = ModDownloadLib.McDownloadForgeRecommendedGet(Loader.Input);
  710. try
  711. {
  712. foreach (JToken jtoken in jarray)
  713. {
  714. JObject jobject = (JObject)jtoken;
  715. string threadMap = null;
  716. string composerMap = "unknown";
  717. int num = -1;
  718. try
  719. {
  720. foreach (JToken jtoken2 in jobject["files"])
  721. {
  722. JObject jobject2 = (JObject)jtoken2;
  723. string left2 = jobject2["category"].ToString();
  724. if (Operators.CompareString(left2, "installer", false) != 0)
  725. {
  726. if (Operators.CompareString(left2, "universal", false) != 0)
  727. {
  728. if (Operators.CompareString(left2, "client", false) == 0 && num <= 0 && Operators.CompareString(jobject2["format"].ToString(), "zip", false) == 0)
  729. {
  730. threadMap = (string)jobject2["hash"];
  731. composerMap = "client";
  732. num = 0;
  733. }
  734. }
  735. else if (num <= 1 && Operators.CompareString(jobject2["format"].ToString(), "zip", false) == 0)
  736. {
  737. threadMap = (string)jobject2["hash"];
  738. composerMap = "universal";
  739. num = 1;
  740. }
  741. }
  742. else if (Operators.CompareString(jobject2["format"].ToString(), "jar", false) == 0)
  743. {
  744. threadMap = (string)jobject2["hash"];
  745. composerMap = "installer";
  746. num = 2;
  747. }
  748. }
  749. }
  750. finally
  751. {
  752. IEnumerator<JToken> enumerator2;
  753. if (enumerator2 != null)
  754. {
  755. enumerator2.Dispose();
  756. }
  757. }
  758. string branch = (string)jobject["branch"];
  759. string text = (string)jobject["version"];
  760. ModDownload.DlForgeVersionEntry dlForgeVersionEntry = new ModDownload.DlForgeVersionEntry(text, branch, Loader.Input)
  761. {
  762. threadMap = threadMap,
  763. _ComposerMap = composerMap,
  764. propertyMap = (Operators.CompareString(left, text, false) == 0)
  765. };
  766. jobject["modified"].ToString().Split(new char[]
  767. {
  768. '-',
  769. 'T',
  770. ':',
  771. '.',
  772. ' ',
  773. '/'
  774. });
  775. dlForgeVersionEntry.mapperMap = jobject["modified"].ToObject<DateTime>().ToLocalTime().ToString("yyyy'/'MM'/'dd HH':'mm");
  776. list.Add(dlForgeVersionEntry);
  777. }
  778. }
  779. finally
  780. {
  781. IEnumerator<JToken> enumerator;
  782. if (enumerator != null)
  783. {
  784. enumerator.Dispose();
  785. }
  786. }
  787. }
  788. catch (Exception innerException)
  789. {
  790. throw new Exception("Forge BMCLAPI 版本列表解析失败(" + jarray.ToString() + ")", innerException);
  791. }
  792. if (!Enumerable.Any<ModDownload.DlForgeVersionEntry>(list))
  793. {
  794. throw new Exception("没有可用版本");
  795. }
  796. Loader.Output = list;
  797. }
  798. // Token: 0x06000DC5 RID: 3525 RVA: 0x0005E4C0 File Offset: 0x0005C6C0
  799. private static void DlNeoForgeListMain(ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult> Loader)
  800. {
  801. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadVersion", null);
  802. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  803. {
  804. ModDownload.DlSourceLoader<int, ModDownload.DlNeoForgeListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>>
  805. {
  806. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>(ModDownload.m_AdapterTests, 30),
  807. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>(ModDownload.infoTests, 90)
  808. }, Loader.IsForceRestarting);
  809. return;
  810. }
  811. if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  812. {
  813. ModDownload.DlSourceLoader<int, ModDownload.DlNeoForgeListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>>
  814. {
  815. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>(ModDownload.infoTests, 5),
  816. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>(ModDownload.m_AdapterTests, 35)
  817. }, Loader.IsForceRestarting);
  818. return;
  819. }
  820. ModDownload.DlSourceLoader<int, ModDownload.DlNeoForgeListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>>
  821. {
  822. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>(ModDownload.infoTests, 60),
  823. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>, int>(ModDownload.m_AdapterTests, 120)
  824. }, Loader.IsForceRestarting);
  825. }
  826. // Token: 0x06000DC6 RID: 3526 RVA: 0x0005E59C File Offset: 0x0005C79C
  827. private static void DlNeoForgeListOfficialMain(ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult> Loader)
  828. {
  829. string text = ModNet.NetGetCodeByDownload("https://maven.neoforged.net/api/maven/versions/releases/net/neoforged/neoforge", 45000, true, true);
  830. string text2 = ModNet.NetGetCodeByDownload("https://maven.neoforged.net/api/maven/versions/releases/net/neoforged/forge", 45000, true, true);
  831. if (text.Length >= 100 && text2.Length >= 100)
  832. {
  833. try
  834. {
  835. Loader.Output = new ModDownload.DlNeoForgeListResult
  836. {
  837. testMap = true,
  838. _RepositoryMap = "NeoForge 官方源",
  839. Value = ModDownload.GetNeoForgeEntries(text, text2)
  840. };
  841. return;
  842. }
  843. catch (Exception innerException)
  844. {
  845. throw new Exception(string.Concat(new string[]
  846. {
  847. "NeoForge 官方源版本列表解析失败(",
  848. text,
  849. "\r\n\r\n",
  850. text2,
  851. ")"
  852. }), innerException);
  853. }
  854. }
  855. throw new Exception("获取到的版本列表长度不足(" + text + ")");
  856. }
  857. // Token: 0x06000DC7 RID: 3527 RVA: 0x0005E674 File Offset: 0x0005C874
  858. public static void DlNeoForgeListBmclapiMain(ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult> Loader)
  859. {
  860. string text = ModNet.NetGetCodeByDownload("https://bmclapi2.bangbang93.com/neoforge/meta/api/maven/details/releases/net/neoforged/neoforge", 45000, true, true);
  861. string text2 = ModNet.NetGetCodeByDownload("https://bmclapi2.bangbang93.com/neoforge/meta/api/maven/details/releases/net/neoforged/forge", 45000, true, true);
  862. if (text.Length >= 100 && text2.Length >= 100)
  863. {
  864. try
  865. {
  866. Loader.Output = new ModDownload.DlNeoForgeListResult
  867. {
  868. testMap = true,
  869. _RepositoryMap = "BMCLAPI",
  870. Value = ModDownload.GetNeoForgeEntries(text, text2)
  871. };
  872. return;
  873. }
  874. catch (Exception innerException)
  875. {
  876. throw new Exception(string.Concat(new string[]
  877. {
  878. "NeoForge BMCLAPI 版本列表解析失败(",
  879. text,
  880. "\r\n\r\n",
  881. text2,
  882. ")"
  883. }), innerException);
  884. }
  885. }
  886. throw new Exception("获取到的版本列表长度不足(" + text + ")");
  887. }
  888. // Token: 0x06000DC8 RID: 3528 RVA: 0x0005E74C File Offset: 0x0005C94C
  889. private static List<ModDownload.DlNeoForgeListEntry> GetNeoForgeEntries(string LatestJson, string LatestLegacyJson)
  890. {
  891. List<ModDownload.DlNeoForgeListEntry> list = Enumerable.ToList<ModDownload.DlNeoForgeListEntry>(Enumerable.Select<string, ModDownload.DlNeoForgeListEntry>(Enumerable.Where<string>(ModBase.RegexSearch(LatestLegacyJson + LatestJson, "(?<=\")(1\\.20\\.1-)?\\d+\\.\\d+\\.\\d+(-beta)?(?=\")", 0), (ModDownload._Closure$__.$I42-0 == null) ? (ModDownload._Closure$__.$I42-0 = ((string name) => Operators.CompareString(name, "47.1.82", false) != 0)) : ModDownload._Closure$__.$I42-0), (ModDownload._Closure$__.$I42-1 == null) ? (ModDownload._Closure$__.$I42-1 = ((string name) => new ModDownload.DlNeoForgeListEntry(name))) : ModDownload._Closure$__.$I42-1));
  892. if (!Enumerable.Any<ModDownload.DlNeoForgeListEntry>(list))
  893. {
  894. throw new Exception("没有可用版本");
  895. }
  896. return Enumerable.ToList<ModDownload.DlNeoForgeListEntry>(Enumerable.OrderByDescending<ModDownload.DlNeoForgeListEntry, Version>(list, (ModDownload._Closure$__.$I42-2 == null) ? (ModDownload._Closure$__.$I42-2 = ((ModDownload.DlNeoForgeListEntry a) => a.clientMap)) : ModDownload._Closure$__.$I42-2));
  897. }
  898. // Token: 0x06000DC9 RID: 3529 RVA: 0x0005E804 File Offset: 0x0005CA04
  899. private static void DlLiteLoaderListMain(ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult> Loader)
  900. {
  901. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadVersion", null);
  902. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  903. {
  904. ModDownload.DlSourceLoader<int, ModDownload.DlLiteLoaderListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>>
  905. {
  906. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>(ModDownload.m_MerchantTests, 30),
  907. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>(ModDownload.listTests, 90)
  908. }, Loader.IsForceRestarting);
  909. return;
  910. }
  911. if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  912. {
  913. ModDownload.DlSourceLoader<int, ModDownload.DlLiteLoaderListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>>
  914. {
  915. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>(ModDownload.listTests, 5),
  916. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>(ModDownload.m_MerchantTests, 35)
  917. }, Loader.IsForceRestarting);
  918. return;
  919. }
  920. ModDownload.DlSourceLoader<int, ModDownload.DlLiteLoaderListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>>
  921. {
  922. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>(ModDownload.listTests, 60),
  923. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>, int>(ModDownload.m_MerchantTests, 120)
  924. }, Loader.IsForceRestarting);
  925. }
  926. // Token: 0x06000DCA RID: 3530 RVA: 0x0005E8E0 File Offset: 0x0005CAE0
  927. private static void DlLiteLoaderListOfficialMain(ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult> Loader)
  928. {
  929. JObject jobject = (JObject)ModNet.NetGetCodeByRequestRetry("https://dl.liteloader.com/versions/versions.json", null, "", true, null, false);
  930. try
  931. {
  932. JObject jobject2 = (JObject)jobject["versions"];
  933. List<ModDownload.DlLiteLoaderListEntry> list = new List<ModDownload.DlLiteLoaderListEntry>();
  934. try
  935. {
  936. foreach (KeyValuePair<string, JToken> keyValuePair in jobject2)
  937. {
  938. if (!keyValuePair.Key.StartsWithF("1.6", false) && !keyValuePair.Key.StartsWithF("1.5", false))
  939. {
  940. JToken jtoken = (keyValuePair.Value["artefacts"] ?? keyValuePair.Value["snapshots"])["com.mumfrey:liteloader"]["latest"];
  941. list.Add(new ModDownload.DlLiteLoaderListEntry
  942. {
  943. Inherit = keyValuePair.Key,
  944. IsLegacy = (Conversions.ToDouble(keyValuePair.Key.Split(".")[1]) < 8.0),
  945. IsPreview = (Operators.CompareString(jtoken["stream"].ToString().ToLower(), "snapshot", false) == 0),
  946. FileName = "liteloader-installer-" + keyValuePair.Key + ((Operators.CompareString(keyValuePair.Key, "1.8", false) == 0 || Operators.CompareString(keyValuePair.Key, "1.9", false) == 0) ? ".0" : "") + "-00-SNAPSHOT.jar",
  947. MD5 = (string)jtoken["md5"],
  948. ReleaseTime = ModBase.GetLocalTime(ModBase.GetDate((int)jtoken["timestamp"])).ToString("yyyy'/'MM'/'dd HH':'mm"),
  949. JsonToken = jtoken
  950. });
  951. }
  952. }
  953. }
  954. finally
  955. {
  956. IEnumerator<KeyValuePair<string, JToken>> enumerator;
  957. if (enumerator != null)
  958. {
  959. enumerator.Dispose();
  960. }
  961. }
  962. Loader.Output = new ModDownload.DlLiteLoaderListResult
  963. {
  964. IsOfficial = true,
  965. SourceName = "LiteLoader 官方源",
  966. Value = list
  967. };
  968. }
  969. catch (Exception innerException)
  970. {
  971. throw new Exception("LiteLoader 官方源版本列表解析失败(" + jobject.ToString() + ")", innerException);
  972. }
  973. }
  974. // Token: 0x06000DCB RID: 3531 RVA: 0x0005EB44 File Offset: 0x0005CD44
  975. private static void DlLiteLoaderListBmclapiMain(ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult> Loader)
  976. {
  977. JObject jobject = (JObject)ModNet.NetGetCodeByRequestRetry("https://bmclapi2.bangbang93.com/maven/com/mumfrey/liteloader/versions.json", null, "", true, null, false);
  978. try
  979. {
  980. JObject jobject2 = (JObject)jobject["versions"];
  981. List<ModDownload.DlLiteLoaderListEntry> list = new List<ModDownload.DlLiteLoaderListEntry>();
  982. try
  983. {
  984. foreach (KeyValuePair<string, JToken> keyValuePair in jobject2)
  985. {
  986. if (!keyValuePair.Key.StartsWithF("1.6", false) && !keyValuePair.Key.StartsWithF("1.5", false))
  987. {
  988. JToken jtoken = (keyValuePair.Value["artefacts"] ?? keyValuePair.Value["snapshots"])["com.mumfrey:liteloader"]["latest"];
  989. list.Add(new ModDownload.DlLiteLoaderListEntry
  990. {
  991. Inherit = keyValuePair.Key,
  992. IsLegacy = (Conversions.ToDouble(keyValuePair.Key.Split(".")[1]) < 8.0),
  993. IsPreview = (Operators.CompareString(jtoken["stream"].ToString().ToLower(), "snapshot", false) == 0),
  994. FileName = "liteloader-installer-" + keyValuePair.Key + ((Operators.CompareString(keyValuePair.Key, "1.8", false) == 0 || Operators.CompareString(keyValuePair.Key, "1.9", false) == 0) ? ".0" : "") + "-00-SNAPSHOT.jar",
  995. MD5 = (string)jtoken["md5"],
  996. ReleaseTime = ModBase.GetLocalTime(ModBase.GetDate((int)jtoken["timestamp"])).ToString("yyyy'/'MM'/'dd HH':'mm"),
  997. JsonToken = jtoken
  998. });
  999. }
  1000. }
  1001. }
  1002. finally
  1003. {
  1004. IEnumerator<KeyValuePair<string, JToken>> enumerator;
  1005. if (enumerator != null)
  1006. {
  1007. enumerator.Dispose();
  1008. }
  1009. }
  1010. Loader.Output = new ModDownload.DlLiteLoaderListResult
  1011. {
  1012. IsOfficial = false,
  1013. SourceName = "BMCLAPI",
  1014. Value = list
  1015. };
  1016. }
  1017. catch (Exception innerException)
  1018. {
  1019. throw new Exception("LiteLoader BMCLAPI 版本列表解析失败(" + jobject.ToString() + ")", innerException);
  1020. }
  1021. }
  1022. // Token: 0x06000DCC RID: 3532 RVA: 0x0005EDA8 File Offset: 0x0005CFA8
  1023. private static void DlFabricListMain(ModLoader.LoaderTask<int, ModDownload.DlFabricListResult> Loader)
  1024. {
  1025. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadVersion", null);
  1026. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  1027. {
  1028. ModDownload.DlSourceLoader<int, ModDownload.DlFabricListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>>
  1029. {
  1030. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>(ModDownload._ComparatorTests, 30),
  1031. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>(ModDownload.algoTests, 90)
  1032. }, Loader.IsForceRestarting);
  1033. return;
  1034. }
  1035. if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  1036. {
  1037. ModDownload.DlSourceLoader<int, ModDownload.DlFabricListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>>
  1038. {
  1039. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>(ModDownload.algoTests, 5),
  1040. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>(ModDownload._ComparatorTests, 35)
  1041. }, Loader.IsForceRestarting);
  1042. return;
  1043. }
  1044. ModDownload.DlSourceLoader<int, ModDownload.DlFabricListResult>(Loader, new List<KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>>
  1045. {
  1046. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>(ModDownload.algoTests, 60),
  1047. new KeyValuePair<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>, int>(ModDownload._ComparatorTests, 120)
  1048. }, Loader.IsForceRestarting);
  1049. }
  1050. // Token: 0x06000DCD RID: 3533 RVA: 0x0005EE84 File Offset: 0x0005D084
  1051. private static void DlFabricListOfficialMain(ModLoader.LoaderTask<int, ModDownload.DlFabricListResult> Loader)
  1052. {
  1053. JObject jobject = (JObject)ModNet.NetGetCodeByRequestRetry("https://meta.fabricmc.net/v2/versions", null, "", true, null, false);
  1054. try
  1055. {
  1056. ModDownload.DlFabricListResult dlFabricListResult = new ModDownload.DlFabricListResult
  1057. {
  1058. specificationMap = true,
  1059. m_ContextMap = "Fabric 官方源",
  1060. Value = jobject
  1061. };
  1062. if (dlFabricListResult.Value["game"] == null || dlFabricListResult.Value["loader"] == null || dlFabricListResult.Value["installer"] == null)
  1063. {
  1064. throw new Exception("获取到的列表缺乏必要项");
  1065. }
  1066. Loader.Output = dlFabricListResult;
  1067. }
  1068. catch (Exception innerException)
  1069. {
  1070. throw new Exception("Fabric 官方源版本列表解析失败(" + jobject.ToString() + ")", innerException);
  1071. }
  1072. }
  1073. // Token: 0x06000DCE RID: 3534 RVA: 0x0005EF50 File Offset: 0x0005D150
  1074. private static void DlFabricListBmclapiMain(ModLoader.LoaderTask<int, ModDownload.DlFabricListResult> Loader)
  1075. {
  1076. JObject jobject = (JObject)ModNet.NetGetCodeByRequestRetry("https://bmclapi2.bangbang93.com/fabric-meta/v2/versions", null, "", true, null, false);
  1077. try
  1078. {
  1079. ModDownload.DlFabricListResult dlFabricListResult = new ModDownload.DlFabricListResult
  1080. {
  1081. specificationMap = false,
  1082. m_ContextMap = "BMCLAPI",
  1083. Value = jobject
  1084. };
  1085. if (dlFabricListResult.Value["game"] == null || dlFabricListResult.Value["loader"] == null || dlFabricListResult.Value["installer"] == null)
  1086. {
  1087. throw new Exception("获取到的列表缺乏必要项");
  1088. }
  1089. Loader.Output = dlFabricListResult;
  1090. }
  1091. catch (Exception innerException)
  1092. {
  1093. throw new Exception("Fabric BMCLAPI 版本列表解析失败(" + jobject.ToString() + ")", innerException);
  1094. }
  1095. }
  1096. // Token: 0x06000DCF RID: 3535 RVA: 0x0005F01C File Offset: 0x0005D21C
  1097. public static object DlModRequest(string Url, bool IsJson = false)
  1098. {
  1099. string text = ModDownload.DlSourceModGet(Url);
  1100. List<KeyValuePair<string, int>> list = new List<KeyValuePair<string, int>>();
  1101. if (Operators.CompareString(text, Url, false) != 0)
  1102. {
  1103. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadMod", null);
  1104. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  1105. {
  1106. if (ModBase._TokenRepository)
  1107. {
  1108. list.Add(new KeyValuePair<string, int>(text, 10));
  1109. list.Add(new KeyValuePair<string, int>(text, 20));
  1110. list.Add(new KeyValuePair<string, int>(Url, 30));
  1111. list.Add(new KeyValuePair<string, int>(text, 60));
  1112. list.Add(new KeyValuePair<string, int>(Url, 60));
  1113. }
  1114. else
  1115. {
  1116. list.Add(new KeyValuePair<string, int>(Url, 5));
  1117. list.Add(new KeyValuePair<string, int>(Url, 20));
  1118. list.Add(new KeyValuePair<string, int>(text, 30));
  1119. list.Add(new KeyValuePair<string, int>(Url, 60));
  1120. list.Add(new KeyValuePair<string, int>(text, 60));
  1121. }
  1122. }
  1123. else if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  1124. {
  1125. list.Add(new KeyValuePair<string, int>(Url, 5));
  1126. list.Add(new KeyValuePair<string, int>(Url, 20));
  1127. list.Add(new KeyValuePair<string, int>(text, 30));
  1128. list.Add(new KeyValuePair<string, int>(Url, 60));
  1129. list.Add(new KeyValuePair<string, int>(text, 60));
  1130. }
  1131. else
  1132. {
  1133. list.Add(new KeyValuePair<string, int>(Url, 5));
  1134. list.Add(new KeyValuePair<string, int>(Url, 30));
  1135. list.Add(new KeyValuePair<string, int>(Url, 60));
  1136. list.Add(new KeyValuePair<string, int>(text, 60));
  1137. list.Add(new KeyValuePair<string, int>(text, 60));
  1138. }
  1139. }
  1140. string text2 = "";
  1141. try
  1142. {
  1143. foreach (KeyValuePair<string, int> keyValuePair in list)
  1144. {
  1145. try
  1146. {
  1147. return ModNet.NetGetCodeByRequestOnce(keyValuePair.Key, Encoding.UTF8, checked(keyValuePair.Value * 1000), IsJson, "", true);
  1148. }
  1149. catch (Exception ex)
  1150. {
  1151. text2 = text2 + ex.Message + "\r\n";
  1152. }
  1153. }
  1154. }
  1155. finally
  1156. {
  1157. List<KeyValuePair<string, int>>.Enumerator enumerator;
  1158. ((IDisposable)enumerator).Dispose();
  1159. }
  1160. throw new Exception(text2);
  1161. }
  1162. // Token: 0x06000DD0 RID: 3536 RVA: 0x0005F240 File Offset: 0x0005D440
  1163. public static string DlModRequest(string Url, string Method, string Data, string ContentType)
  1164. {
  1165. string text = ModDownload.DlSourceModGet(Url);
  1166. List<KeyValuePair<string, int>> list = new List<KeyValuePair<string, int>>();
  1167. if (Operators.CompareString(text, Url, false) != 0)
  1168. {
  1169. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadMod", null);
  1170. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  1171. {
  1172. if (ModBase._TokenRepository)
  1173. {
  1174. list.Add(new KeyValuePair<string, int>(text, 10));
  1175. list.Add(new KeyValuePair<string, int>(text, 20));
  1176. list.Add(new KeyValuePair<string, int>(Url, 30));
  1177. list.Add(new KeyValuePair<string, int>(text, 60));
  1178. list.Add(new KeyValuePair<string, int>(Url, 60));
  1179. }
  1180. else
  1181. {
  1182. list.Add(new KeyValuePair<string, int>(Url, 5));
  1183. list.Add(new KeyValuePair<string, int>(Url, 20));
  1184. list.Add(new KeyValuePair<string, int>(text, 30));
  1185. list.Add(new KeyValuePair<string, int>(Url, 60));
  1186. list.Add(new KeyValuePair<string, int>(text, 60));
  1187. }
  1188. }
  1189. else if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  1190. {
  1191. list.Add(new KeyValuePair<string, int>(Url, 5));
  1192. list.Add(new KeyValuePair<string, int>(Url, 20));
  1193. list.Add(new KeyValuePair<string, int>(text, 30));
  1194. list.Add(new KeyValuePair<string, int>(Url, 60));
  1195. list.Add(new KeyValuePair<string, int>(text, 60));
  1196. }
  1197. else
  1198. {
  1199. list.Add(new KeyValuePair<string, int>(Url, 5));
  1200. list.Add(new KeyValuePair<string, int>(Url, 30));
  1201. list.Add(new KeyValuePair<string, int>(Url, 60));
  1202. list.Add(new KeyValuePair<string, int>(text, 60));
  1203. list.Add(new KeyValuePair<string, int>(text, 60));
  1204. }
  1205. }
  1206. string text2 = "";
  1207. try
  1208. {
  1209. foreach (KeyValuePair<string, int> keyValuePair in list)
  1210. {
  1211. try
  1212. {
  1213. return ModNet.NetRequestOnce(keyValuePair.Key, Method, Data, ContentType, checked(keyValuePair.Value * 1000), null, true, false);
  1214. }
  1215. catch (Exception ex)
  1216. {
  1217. text2 = text2 + ex.Message + "\r\n";
  1218. }
  1219. }
  1220. }
  1221. finally
  1222. {
  1223. List<KeyValuePair<string, int>>.Enumerator enumerator;
  1224. ((IDisposable)enumerator).Dispose();
  1225. }
  1226. throw new Exception(text2);
  1227. }
  1228. // Token: 0x06000DD1 RID: 3537 RVA: 0x0005F460 File Offset: 0x0005D660
  1229. public static string[] DlSourceResourceGet(string Original)
  1230. {
  1231. Original = Original.Replace("http://resources.download.minecraft.net", "https://resources.download.minecraft.net");
  1232. return new string[]
  1233. {
  1234. Original.Replace("https://piston-data.mojang.com", "https://bmclapi2.bangbang93.com/assets").Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com/assets").Replace("https://resources.download.minecraft.net", "https://bmclapi2.bangbang93.com/assets"),
  1235. Original
  1236. };
  1237. }
  1238. // Token: 0x06000DD2 RID: 3538 RVA: 0x0005F4BC File Offset: 0x0005D6BC
  1239. public static string[] DlSourceLibraryGet(string Original)
  1240. {
  1241. return new string[]
  1242. {
  1243. Original.Replace("https://piston-data.mojang.com", "https://bmclapi2.bangbang93.com/maven").Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com/maven").Replace("https://libraries.minecraft.net", "https://bmclapi2.bangbang93.com/maven"),
  1244. Original.Replace("https://piston-data.mojang.com", "https://bmclapi2.bangbang93.com/libraries").Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com/libraries").Replace("https://libraries.minecraft.net", "https://bmclapi2.bangbang93.com/libraries"),
  1245. Original
  1246. };
  1247. }
  1248. // Token: 0x06000DD3 RID: 3539 RVA: 0x0005F538 File Offset: 0x0005D738
  1249. public static string DlSourceModGet(string Original)
  1250. {
  1251. return Original.Replace("api.modrinth.com", "mod.mcimirror.top/modrinth").Replace("staging-api.modrinth.com", "mod.mcimirror.top/modrinth").Replace("cdn.modrinth.com", "mod.mcimirror.top").Replace("api.curseforge.com", "mod.mcimirror.top/curseforge").Replace("edge.forgecdn.net", "mod.mcimirror.top").Replace("mediafilez.forgecdn.net", "mod.mcimirror.top").Replace("media.forgecdn.net", "mod.mcimirror.top");
  1252. }
  1253. // Token: 0x06000DD4 RID: 3540 RVA: 0x0005F5B0 File Offset: 0x0005D7B0
  1254. public static string[] DlSourceLauncherOrMetaGet(string Original)
  1255. {
  1256. if (Original == null)
  1257. {
  1258. throw new Exception("无对应的 json 下载地址");
  1259. }
  1260. return new string[]
  1261. {
  1262. Original.Replace("https://piston-data.mojang.com", "https://bmclapi2.bangbang93.com").Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com").Replace("https://launcher.mojang.com", "https://bmclapi2.bangbang93.com").Replace("https://launchermeta.mojang.com", "https://bmclapi2.bangbang93.com"),
  1263. Original
  1264. };
  1265. }
  1266. // Token: 0x06000DD5 RID: 3541 RVA: 0x0005F618 File Offset: 0x0005D818
  1267. private static void DlSourceLoader<InputType, OutputType>(ModLoader.LoaderTask<InputType, OutputType> MainLoader, List<KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int>> LoaderList, bool IsForceRestart = false)
  1268. {
  1269. int num = 0;
  1270. checked
  1271. {
  1272. for (;;)
  1273. {
  1274. IL_21B:
  1275. bool flag = true;
  1276. try
  1277. {
  1278. foreach (KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int> keyValuePair in LoaderList)
  1279. {
  1280. if (num == 0)
  1281. {
  1282. if (IsForceRestart || (keyValuePair.Key.Input == null ^ MainLoader.Input == null))
  1283. {
  1284. continue;
  1285. }
  1286. if (keyValuePair.Key.Input != null)
  1287. {
  1288. ModLoader.LoaderTask<!!0, !!1> key = keyValuePair.Key;
  1289. ref !!0 ptr = ref key.Input;
  1290. if (default(!!0) == null)
  1291. {
  1292. InputType input = key.Input;
  1293. ptr = ref input;
  1294. }
  1295. if (!ptr.Equals(MainLoader.Input))
  1296. {
  1297. continue;
  1298. }
  1299. }
  1300. }
  1301. if (keyValuePair.Key.State != ModBase.LoadState.Failed)
  1302. {
  1303. flag = false;
  1304. }
  1305. if (keyValuePair.Key.State == ModBase.LoadState.Finished)
  1306. {
  1307. MainLoader.Output = keyValuePair.Key.Output;
  1308. ModDownload.DlSourceLoaderAbort<InputType, OutputType>(LoaderList);
  1309. return;
  1310. }
  1311. if (flag && num < keyValuePair.Value * 100)
  1312. {
  1313. num = keyValuePair.Value * 100;
  1314. }
  1315. }
  1316. }
  1317. finally
  1318. {
  1319. List<KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int>>.Enumerator enumerator;
  1320. ((IDisposable)enumerator).Dispose();
  1321. }
  1322. if (num == 0)
  1323. {
  1324. Enumerable.First<KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int>>(LoaderList).Key.Start(MainLoader.Input, IsForceRestart);
  1325. try
  1326. {
  1327. foreach (KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int> keyValuePair2 in Enumerable.Skip<KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int>>(LoaderList, 1))
  1328. {
  1329. keyValuePair2.Key.State = ModBase.LoadState.Waiting;
  1330. }
  1331. }
  1332. finally
  1333. {
  1334. IEnumerator<KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int>> enumerator2;
  1335. if (enumerator2 != null)
  1336. {
  1337. enumerator2.Dispose();
  1338. }
  1339. }
  1340. }
  1341. int num2 = LoaderList.Count - 1;
  1342. int i = 0;
  1343. while (i <= num2)
  1344. {
  1345. if (num == LoaderList[i].Value * 100)
  1346. {
  1347. if (i >= LoaderList.Count - 1 || Enumerable.All<KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int>>(LoaderList, (ModDownload._Closure$__66<!!0, !!1>.$I66-0 == null) ? (ModDownload._Closure$__66<!!0, !!1>.$I66-0 = ((KeyValuePair<ModLoader.LoaderTask<$CLS0, $CLS1>, int> l) => l.Key.State == ModBase.LoadState.Failed)) : ModDownload._Closure$__66<!!0, !!1>.$I66-0))
  1348. {
  1349. goto IL_22D;
  1350. }
  1351. LoaderList[i + 1].Key.Start(MainLoader.Input, IsForceRestart);
  1352. IL_208:
  1353. Thread.Sleep(10);
  1354. num++;
  1355. if (!MainLoader.IsAborted)
  1356. {
  1357. goto IL_21B;
  1358. }
  1359. goto IL_222;
  1360. }
  1361. else
  1362. {
  1363. i++;
  1364. }
  1365. }
  1366. goto IL_208;
  1367. }
  1368. IL_222:
  1369. ModDownload.DlSourceLoaderAbort<InputType, OutputType>(LoaderList);
  1370. return;
  1371. IL_22D:
  1372. Exception ex = null;
  1373. int num3 = LoaderList.Count - 1;
  1374. for (int j = 0; j <= num3; j++)
  1375. {
  1376. LoaderList[j].Key.Input = default(!!0);
  1377. if (LoaderList[j].Key.Error != null && (ex == null || LoaderList[j].Key.Error.Message.Contains("没有可用版本")))
  1378. {
  1379. ex = LoaderList[j].Key.Error;
  1380. }
  1381. }
  1382. if (ex == null)
  1383. {
  1384. ex = new TimeoutException("下载源连接超时");
  1385. }
  1386. ModDownload.DlSourceLoaderAbort<InputType, OutputType>(LoaderList);
  1387. throw ex;
  1388. }
  1389. }
  1390. // Token: 0x06000DD6 RID: 3542 RVA: 0x0005F920 File Offset: 0x0005DB20
  1391. private static void DlSourceLoaderAbort<InputType, OutputType>(List<KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int>> LoaderList)
  1392. {
  1393. try
  1394. {
  1395. foreach (KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int> keyValuePair in LoaderList)
  1396. {
  1397. if (keyValuePair.Key.State == ModBase.LoadState.Loading)
  1398. {
  1399. keyValuePair.Key.Abort();
  1400. }
  1401. }
  1402. }
  1403. finally
  1404. {
  1405. List<KeyValuePair<ModLoader.LoaderTask<InputType, OutputType>, int>>.Enumerator enumerator;
  1406. ((IDisposable)enumerator).Dispose();
  1407. }
  1408. }
  1409. // Token: 0x0400071C RID: 1820
  1410. public static ModLoader.LoaderTask<string, ModDownload.DlClientListResult> accountTests = new ModLoader.LoaderTask<string, ModDownload.DlClientListResult>("DlClientList Main", new Action<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>>(ModDownload.DlClientListMain), null, ThreadPriority.Normal);
  1411. // Token: 0x0400071D RID: 1821
  1412. public static ModLoader.LoaderTask<string, ModDownload.DlClientListResult> queueTests = new ModLoader.LoaderTask<string, ModDownload.DlClientListResult>("DlClientList Mojang", new Action<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>>(ModDownload.DlClientListMojangMain), null, ThreadPriority.Normal);
  1413. // Token: 0x0400071E RID: 1822
  1414. private static bool m_EventTests = false;
  1415. // Token: 0x0400071F RID: 1823
  1416. public static ModLoader.LoaderTask<string, ModDownload.DlClientListResult> _ManagerTests = new ModLoader.LoaderTask<string, ModDownload.DlClientListResult>("DlClientList Bmclapi", new Action<ModLoader.LoaderTask<string, ModDownload.DlClientListResult>>(ModDownload.DlClientListBmclapiMain), null, ThreadPriority.Normal);
  1417. // Token: 0x04000720 RID: 1824
  1418. public static ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult> m_ModelTests = new ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>("DlOptiFineList Main", new Action<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>>(ModDownload.DlOptiFineListMain), null, ThreadPriority.Normal);
  1419. // Token: 0x04000721 RID: 1825
  1420. public static ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult> _WrapperTests = new ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>("DlOptiFineList Official", new Action<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>>(ModDownload.DlOptiFineListOfficialMain), null, ThreadPriority.Normal);
  1421. // Token: 0x04000722 RID: 1826
  1422. public static ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult> _BaseTests = new ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>("DlOptiFineList Bmclapi", new Action<ModLoader.LoaderTask<int, ModDownload.DlOptiFineListResult>>(ModDownload.DlOptiFineListBmclapiMain), null, ThreadPriority.Normal);
  1423. // Token: 0x04000723 RID: 1827
  1424. public static ModLoader.LoaderTask<int, ModDownload.DlForgeListResult> m_AttributeTests = new ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>("DlForgeList Main", new Action<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>>(ModDownload.DlForgeListMain), null, ThreadPriority.Normal);
  1425. // Token: 0x04000724 RID: 1828
  1426. public static ModLoader.LoaderTask<int, ModDownload.DlForgeListResult> m_CodeTests = new ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>("DlForgeList Official", new Action<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>>(ModDownload.DlForgeListOfficialMain), null, ThreadPriority.Normal);
  1427. // Token: 0x04000725 RID: 1829
  1428. public static ModLoader.LoaderTask<int, ModDownload.DlForgeListResult> m_PrototypeTests = new ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>("DlForgeList Bmclapi", new Action<ModLoader.LoaderTask<int, ModDownload.DlForgeListResult>>(ModDownload.DlForgeListBmclapiMain), null, ThreadPriority.Normal);
  1429. // Token: 0x04000726 RID: 1830
  1430. public static ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult> m_AnnotationTests = new ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>("DlNeoForgeList Main", new Action<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>>(ModDownload.DlNeoForgeListMain), null, ThreadPriority.Normal);
  1431. // Token: 0x04000727 RID: 1831
  1432. public static ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult> infoTests = new ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>("DlNeoForgeList Official", new Action<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>>(ModDownload.DlNeoForgeListOfficialMain), null, ThreadPriority.Normal);
  1433. // Token: 0x04000728 RID: 1832
  1434. public static ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult> m_AdapterTests = new ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>("DlNeoForgeList Bmclapi", new Action<ModLoader.LoaderTask<int, ModDownload.DlNeoForgeListResult>>(ModDownload.DlNeoForgeListBmclapiMain), null, ThreadPriority.Normal);
  1435. // Token: 0x04000729 RID: 1833
  1436. public static ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult> _FacadeTests = new ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>("DlLiteLoaderList Main", new Action<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>>(ModDownload.DlLiteLoaderListMain), null, ThreadPriority.Normal);
  1437. // Token: 0x0400072A RID: 1834
  1438. public static ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult> listTests = new ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>("DlLiteLoaderList Official", new Action<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>>(ModDownload.DlLiteLoaderListOfficialMain), null, ThreadPriority.Normal);
  1439. // Token: 0x0400072B RID: 1835
  1440. public static ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult> m_MerchantTests = new ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>("DlLiteLoaderList Bmclapi", new Action<ModLoader.LoaderTask<int, ModDownload.DlLiteLoaderListResult>>(ModDownload.DlLiteLoaderListBmclapiMain), null, ThreadPriority.Normal);
  1441. // Token: 0x0400072C RID: 1836
  1442. public static ModLoader.LoaderTask<int, ModDownload.DlFabricListResult> authenticationTests = new ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>("DlFabricList Main", new Action<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>>(ModDownload.DlFabricListMain), null, ThreadPriority.Normal);
  1443. // Token: 0x0400072D RID: 1837
  1444. public static ModLoader.LoaderTask<int, ModDownload.DlFabricListResult> algoTests = new ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>("DlFabricList Official", new Action<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>>(ModDownload.DlFabricListOfficialMain), null, ThreadPriority.Normal);
  1445. // Token: 0x0400072E RID: 1838
  1446. public static ModLoader.LoaderTask<int, ModDownload.DlFabricListResult> _ComparatorTests = new ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>("DlFabricList Bmclapi", new Action<ModLoader.LoaderTask<int, ModDownload.DlFabricListResult>>(ModDownload.DlFabricListBmclapiMain), null, ThreadPriority.Normal);
  1447. // Token: 0x0400072F RID: 1839
  1448. public static ModLoader.LoaderTask<int, List<ModComp.CompFile>> mappingTests = new ModLoader.LoaderTask<int, List<ModComp.CompFile>>("Fabric API List Loader", delegate(ModLoader.LoaderTask<int, List<ModComp.CompFile>> Task)
  1449. {
  1450. Task.Output = ModComp.CompFilesGet("fabric-api", false);
  1451. }, null, ThreadPriority.Normal);
  1452. // Token: 0x04000730 RID: 1840
  1453. public static ModLoader.LoaderTask<int, List<ModComp.CompFile>> tokenizerTests = new ModLoader.LoaderTask<int, List<ModComp.CompFile>>("OptiFabric List Loader", delegate(ModLoader.LoaderTask<int, List<ModComp.CompFile>> Task)
  1454. {
  1455. Task.Output = ModComp.CompFilesGet("322385", true);
  1456. }, null, ThreadPriority.Normal);
  1457. // Token: 0x0200014F RID: 335
  1458. public enum AssetsIndexExistsBehaviour
  1459. {
  1460. // Token: 0x04000732 RID: 1842
  1461. DontDownload,
  1462. // Token: 0x04000733 RID: 1843
  1463. DownloadInBackground,
  1464. // Token: 0x04000734 RID: 1844
  1465. AlwaysDownload
  1466. }
  1467. // Token: 0x02000150 RID: 336
  1468. public struct DlClientListResult
  1469. {
  1470. // Token: 0x04000735 RID: 1845
  1471. public string classTest;
  1472. // Token: 0x04000736 RID: 1846
  1473. public bool policyTest;
  1474. // Token: 0x04000737 RID: 1847
  1475. public JObject Value;
  1476. }
  1477. // Token: 0x02000151 RID: 337
  1478. public struct DlOptiFineListResult
  1479. {
  1480. // Token: 0x04000738 RID: 1848
  1481. public string orderTest;
  1482. // Token: 0x04000739 RID: 1849
  1483. public bool producerTest;
  1484. // Token: 0x0400073A RID: 1850
  1485. public List<ModDownload.DlOptiFineListEntry> Value;
  1486. }
  1487. // Token: 0x02000152 RID: 338
  1488. public class DlOptiFineListEntry
  1489. {
  1490. // Token: 0x06000DD8 RID: 3544 RVA: 0x00008C7C File Offset: 0x00006E7C
  1491. public string CheckMapper()
  1492. {
  1493. return this.strategyTest;
  1494. }
  1495. // Token: 0x06000DD9 RID: 3545 RVA: 0x00008C84 File Offset: 0x00006E84
  1496. public void CompareMapper(string value)
  1497. {
  1498. if (value.EndsWithF(".0", false))
  1499. {
  1500. value = Strings.Left(value, checked(value.Length - 2));
  1501. }
  1502. this.strategyTest = value;
  1503. }
  1504. // Token: 0x0400073B RID: 1851
  1505. public string m_SchemaTest;
  1506. // Token: 0x0400073C RID: 1852
  1507. public string _DescriptorTest;
  1508. // Token: 0x0400073D RID: 1853
  1509. public string m_PublisherTest;
  1510. // Token: 0x0400073E RID: 1854
  1511. public bool _DefinitionTest;
  1512. // Token: 0x0400073F RID: 1855
  1513. private string strategyTest;
  1514. // Token: 0x04000740 RID: 1856
  1515. public string m_ProcTest;
  1516. // Token: 0x04000741 RID: 1857
  1517. public string parserMap;
  1518. }
  1519. // Token: 0x02000153 RID: 339
  1520. public struct DlForgeListResult
  1521. {
  1522. // Token: 0x04000742 RID: 1858
  1523. public string m_BroadcasterMap;
  1524. // Token: 0x04000743 RID: 1859
  1525. public bool m_FieldMap;
  1526. // Token: 0x04000744 RID: 1860
  1527. public List<string> Value;
  1528. }
  1529. // Token: 0x02000154 RID: 340
  1530. public abstract class DlForgelikeEntry
  1531. {
  1532. // Token: 0x06000DDC RID: 3548 RVA: 0x00008CAB File Offset: 0x00006EAB
  1533. public string CustomizeMapper()
  1534. {
  1535. if (!this.m_ReaderMap)
  1536. {
  1537. return "Forge";
  1538. }
  1539. return "NeoForge";
  1540. }
  1541. // Token: 0x06000DDD RID: 3549 RVA: 0x0005F984 File Offset: 0x0005DB84
  1542. public string AssetMapper()
  1543. {
  1544. string result;
  1545. if (this.m_ReaderMap)
  1546. {
  1547. result = "jar";
  1548. }
  1549. else
  1550. {
  1551. result = ((Operators.CompareString(((ModDownload.DlForgeVersionEntry)this)._ComposerMap, "installer", false) == 0) ? "jar" : "zip");
  1552. }
  1553. return result;
  1554. }
  1555. // Token: 0x17000218 RID: 536
  1556. // (get) Token: 0x06000DDE RID: 3550 RVA: 0x00008CC0 File Offset: 0x00006EC0
  1557. public bool IsLegacy
  1558. {
  1559. get
  1560. {
  1561. return this.clientMap.Major < 20;
  1562. }
  1563. }
  1564. // Token: 0x04000745 RID: 1861
  1565. public bool m_ReaderMap;
  1566. // Token: 0x04000746 RID: 1862
  1567. public Version clientMap;
  1568. // Token: 0x04000747 RID: 1863
  1569. public string m_ConfigMap;
  1570. // Token: 0x04000748 RID: 1864
  1571. public string _TestsMap;
  1572. }
  1573. // Token: 0x02000155 RID: 341
  1574. public class DlForgeVersionEntry : ModDownload.DlForgelikeEntry
  1575. {
  1576. // Token: 0x06000DE0 RID: 3552 RVA: 0x0005F9C8 File Offset: 0x0005DBC8
  1577. public DlForgeVersionEntry(string Version, string Branch, string Inherit)
  1578. {
  1579. this.threadMap = null;
  1580. if (Operators.CompareString(Version, "11.15.1.2318", false) == 0 || Operators.CompareString(Version, "11.15.1.1902", false) == 0 || Operators.CompareString(Version, "11.15.1.1890", false) == 0)
  1581. {
  1582. Branch = "1.8.9";
  1583. }
  1584. if (Branch == null && Operators.CompareString(Inherit, "1.7.10", false) == 0 && Conversions.ToDouble(Version.Split(".")[3]) >= 1300.0)
  1585. {
  1586. Branch = "1.7.10";
  1587. }
  1588. this.m_ReaderMap = false;
  1589. this.m_ConfigMap = Version;
  1590. this.clientMap = new Version(Version);
  1591. this._TestsMap = Inherit;
  1592. this.iteratorMap = Version + ((Branch == null) ? "" : ("-" + Branch));
  1593. }
  1594. // Token: 0x04000749 RID: 1865
  1595. public string mapperMap;
  1596. // Token: 0x0400074A RID: 1866
  1597. public string threadMap;
  1598. // Token: 0x0400074B RID: 1867
  1599. public bool propertyMap;
  1600. // Token: 0x0400074C RID: 1868
  1601. public string _ComposerMap;
  1602. // Token: 0x0400074D RID: 1869
  1603. public string iteratorMap;
  1604. }
  1605. // Token: 0x02000156 RID: 342
  1606. public struct DlNeoForgeListResult
  1607. {
  1608. // Token: 0x0400074E RID: 1870
  1609. public string _RepositoryMap;
  1610. // Token: 0x0400074F RID: 1871
  1611. public bool testMap;
  1612. // Token: 0x04000750 RID: 1872
  1613. public List<ModDownload.DlNeoForgeListEntry> Value;
  1614. }
  1615. // Token: 0x02000157 RID: 343
  1616. public class DlNeoForgeListEntry : ModDownload.DlForgelikeEntry
  1617. {
  1618. // Token: 0x06000DE2 RID: 3554 RVA: 0x0005FA8C File Offset: 0x0005DC8C
  1619. public string RateMapper()
  1620. {
  1621. string text = base.IsLegacy ? "forge" : "neoforge";
  1622. return string.Format("https://maven.neoforged.net/releases/net/neoforged/{0}/{1}/{2}-{3}", new object[]
  1623. {
  1624. text,
  1625. this._ErrorMap,
  1626. text,
  1627. this._ErrorMap
  1628. });
  1629. }
  1630. // Token: 0x06000DE3 RID: 3555 RVA: 0x0005FAD8 File Offset: 0x0005DCD8
  1631. public DlNeoForgeListEntry(string ApiName)
  1632. {
  1633. this.m_ReaderMap = true;
  1634. this._ErrorMap = ApiName;
  1635. this._MapMap = ApiName.Contains("beta");
  1636. if (ApiName.Contains("1.20.1"))
  1637. {
  1638. this.m_ConfigMap = ApiName.Replace("1.20.1-", "");
  1639. this.clientMap = new Version("19." + this.m_ConfigMap);
  1640. this._TestsMap = "1.20.1";
  1641. return;
  1642. }
  1643. this.m_ConfigMap = ApiName;
  1644. this.clientMap = new Version(ApiName.BeforeFirst("-", false));
  1645. this._TestsMap = string.Format("1.{0}", this.clientMap.Major) + ((this.clientMap.Minor == 0) ? "" : ("." + Conversions.ToString(this.clientMap.Minor)));
  1646. }
  1647. // Token: 0x04000751 RID: 1873
  1648. public bool _MapMap;
  1649. // Token: 0x04000752 RID: 1874
  1650. public string _ErrorMap;
  1651. }
  1652. // Token: 0x02000158 RID: 344
  1653. public struct DlLiteLoaderListResult
  1654. {
  1655. // Token: 0x04000753 RID: 1875
  1656. public string SourceName;
  1657. // Token: 0x04000754 RID: 1876
  1658. public bool IsOfficial;
  1659. // Token: 0x04000755 RID: 1877
  1660. public List<ModDownload.DlLiteLoaderListEntry> Value;
  1661. // Token: 0x04000756 RID: 1878
  1662. public Exception OfficialError;
  1663. }
  1664. // Token: 0x02000159 RID: 345
  1665. public class DlLiteLoaderListEntry
  1666. {
  1667. // Token: 0x04000757 RID: 1879
  1668. public string FileName;
  1669. // Token: 0x04000758 RID: 1880
  1670. public bool IsPreview;
  1671. // Token: 0x04000759 RID: 1881
  1672. public string Inherit;
  1673. // Token: 0x0400075A RID: 1882
  1674. public bool IsLegacy;
  1675. // Token: 0x0400075B RID: 1883
  1676. public string ReleaseTime;
  1677. // Token: 0x0400075C RID: 1884
  1678. public string MD5;
  1679. // Token: 0x0400075D RID: 1885
  1680. public JToken JsonToken;
  1681. }
  1682. // Token: 0x0200015A RID: 346
  1683. public struct DlFabricListResult
  1684. {
  1685. // Token: 0x0400075E RID: 1886
  1686. public string m_ContextMap;
  1687. // Token: 0x0400075F RID: 1887
  1688. public bool specificationMap;
  1689. // Token: 0x04000760 RID: 1888
  1690. public JObject Value;
  1691. }
  1692. }
  1693. }