diff --git a/HsMod/Patches/PatchHearthstone.cs b/HsMod/Patches/PatchHearthstone.cs index 70b93d25..e854c645 100644 --- a/HsMod/Patches/PatchHearthstone.cs +++ b/HsMod/Patches/PatchHearthstone.cs @@ -106,11 +106,11 @@ private static void PatchActorNames(ref Dictionary ___m_signatureFr if (pair.Value == 1) { // 9 新版随从的异画样式 - result.TryAdd(pair.Key, 9); + result[pair.Key] = 9; } else { - result.TryAdd(pair.Key, pair.Value); + result[pair.Key] = pair.Value; } } } diff --git a/HsMod/WebPage.cs b/HsMod/WebPage.cs index 1cd83218..453e852a 100644 --- a/HsMod/WebPage.cs +++ b/HsMod/WebPage.cs @@ -27,21 +27,23 @@ private static string GenerateBtn() } private static string GenerateNav(string title) +{ + string nav = string.Empty; + if (title != "index") + { + nav = "

"; + } + + return nav; +} + public static StringBuilder Template(string title = "", string body = "", bool useViewport = true) { diff --git a/HsMod/WebServer.cs b/HsMod/WebServer.cs index e657b9ae..a94c6e9d 100644 --- a/HsMod/WebServer.cs +++ b/HsMod/WebServer.cs @@ -82,7 +82,7 @@ private static async Task ProcessRequestAsync(HttpListenerContext context) // Read the JSON from the request body using (var reader = new StreamReader(request.InputStream)) { - string requestBody = await reader.ReadToEndAsync(); + string requestBody = reader.ReadToEnd(); Utils.MyLogger(BepInEx.Logging.LogLevel.Debug, $"POST: {requestBody}"); // Parse JSON and get the "command" field var json = Newtonsoft.Json.JsonConvert.DeserializeObject>(requestBody); @@ -123,7 +123,7 @@ private static async Task ProcessRequestAsync(HttpListenerContext context) // Read the JSON from the request body using (var reader = new StreamReader(request.InputStream)) { - string requestBody = await reader.ReadToEndAsync(); + string requestBody = reader.ReadToEnd(); Utils.MyLogger(BepInEx.Logging.LogLevel.Debug, $"POST: {requestBody}"); // Parse JSON and get the "key" field var json = Newtonsoft.Json.JsonConvert.DeserializeObject>(requestBody); @@ -183,7 +183,7 @@ private static async Task ProcessRequestAsync(HttpListenerContext context) // Read the JSON from the request body using (var reader = new StreamReader(request.InputStream)) { - string requestBody = await reader.ReadToEndAsync(); + string requestBody = reader.ReadToEnd(); Utils.MyLogger(BepInEx.Logging.LogLevel.Debug, $"POST: {requestBody}"); // Parse JSON and get the "key" field var json = Newtonsoft.Json.JsonConvert.DeserializeObject>(requestBody); @@ -266,7 +266,7 @@ private static async Task ProcessRequestAsync(HttpListenerContext context) if (VaildFilePath(preUrl)) // 优先查找本地文件 { context.Response.ContentType = GetMimeType(Path.GetExtension(preUrl)); - var file = await File.ReadAllBytesAsync(preUrl); + var file = File.ReadAllBytes(preUrl); await context.Response.OutputStream.WriteAsync(file, 0, file.Length); } else if (rawUrLower == "/safeimg")