From da5f76967f0afe9d9c64ded6666d7189e166b10b Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sun, 26 Jul 2020 04:59:51 +1000 Subject: [PATCH] Inline TestGet --- src/BizHawk.Client.Common/Api/HttpCommunication.cs | 2 -- src/BizHawk.Client.EmuHawk/Api/Libraries/CommApi.cs | 4 ++-- .../tools/Lua/Libraries/CommLuaLibrary.cs | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/BizHawk.Client.Common/Api/HttpCommunication.cs b/src/BizHawk.Client.Common/Api/HttpCommunication.cs index 8517344d66..7ea7541c2f 100644 --- a/src/BizHawk.Client.Common/Api/HttpCommunication.cs +++ b/src/BizHawk.Client.Common/Api/HttpCommunication.cs @@ -91,7 +91,5 @@ namespace BizHawk.Client.Common Timeout = timeout; } } - - public string TestGet() => Get(GetUrl).Result; } } diff --git a/src/BizHawk.Client.EmuHawk/Api/Libraries/CommApi.cs b/src/BizHawk.Client.EmuHawk/Api/Libraries/CommApi.cs index 773f398e29..4442933528 100644 --- a/src/BizHawk.Client.EmuHawk/Api/Libraries/CommApi.cs +++ b/src/BizHawk.Client.EmuHawk/Api/Libraries/CommApi.cs @@ -36,9 +36,9 @@ namespace BizHawk.Client.EmuHawk public string MmfRead(string mmf_filename, int expectedSize) => GlobalWin.memoryMappedFiles.ReadFromFile(mmf_filename, expectedSize); - public string HttpTest() => string.Join("\n", GlobalWin.httpCommunication.TestGet(), GlobalWin.httpCommunication.SendScreenshot(), "done testing"); + public string HttpTest() => string.Join("\n", HttpTestGet(), GlobalWin.httpCommunication.SendScreenshot(), "done testing"); - public string HttpTestGet() => GlobalWin.httpCommunication.TestGet(); + public string HttpTestGet() => GlobalWin.httpCommunication.Get(GlobalWin.httpCommunication.GetUrl).Result; public string HttpGet(string url) => GlobalWin.httpCommunication.ExecGet(url); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/CommLuaLibrary.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/CommLuaLibrary.cs index de71ccaea6..5b15cf59d7 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/CommLuaLibrary.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/CommLuaLibrary.cs @@ -171,7 +171,7 @@ namespace BizHawk.Client.EmuHawk public string HttpTest() { var list = new StringBuilder(); - list.AppendLine(GlobalWin.httpCommunication.TestGet()); + list.AppendLine(GlobalWin.httpCommunication.Get(GlobalWin.httpCommunication.GetUrl).Result); list.AppendLine(GlobalWin.httpCommunication.SendScreenshot()); list.AppendLine("done testing"); return list.ToString(); @@ -181,7 +181,7 @@ namespace BizHawk.Client.EmuHawk public string HttpTestGet() { CheckHttp(); - return GlobalWin.httpCommunication?.TestGet(); + return (GlobalWin.httpCommunication?.Get(GlobalWin.httpCommunication.GetUrl))?.Result; } [LuaMethod("httpGet", "makes a HTTP GET request")]