From b7574af8123156e1d5eb696fcbb228a1c2411b4f Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Tue, 10 Jan 2023 23:38:39 +0100 Subject: [PATCH] http response event table go brrr --- Capy64/LuaRuntime/Libraries/HTTP.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Capy64/LuaRuntime/Libraries/HTTP.cs b/Capy64/LuaRuntime/Libraries/HTTP.cs index 59946b2..d282752 100644 --- a/Capy64/LuaRuntime/Libraries/HTTP.cs +++ b/Capy64/LuaRuntime/Libraries/HTTP.cs @@ -155,6 +155,21 @@ public class HTTP : IPlugin else content = await response.Content.ReadAsStringAsync(); + // wip + /* + _game.LuaRuntime.PushEvent("http_response", L => + { + L.PushInteger(requestId); + + L.NewTable(); + + L.PushString("success"); + L.PushBoolean(response.IsSuccessStatusCode); + L.SetTable(-3); + + return 2; + });*/ + _game.LuaRuntime.PushEvent("http_response", requestId, response.IsSuccessStatusCode, content, (int)response.StatusCode, response.ReasonPhrase); });