From 0d72025ff2ee42f32d7cfc0535a3d0d2030f6dc5 Mon Sep 17 00:00:00 2001 From: Altair Sossai Date: Tue, 29 Oct 2024 09:43:33 -0300 Subject: [PATCH] Update l4d2_localhost.sp and shared_cvars.cfg --- .../plugins/optional/l4d2_localhost.smx | Bin 3419 -> 4259 bytes addons/sourcemod/scripting/l4d2_localhost.sp | 38 +++++++++++++++++- cfg/cfgogl/zonemod/shared_cvars.cfg | 1 + 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/addons/sourcemod/plugins/optional/l4d2_localhost.smx b/addons/sourcemod/plugins/optional/l4d2_localhost.smx index ba341f66125dd8172d5df0c1ca27134593e623e6..fbd4a81251d954c0660fe5ed93bcbf6692566afe 100644 GIT binary patch delta 4089 zcmXYs2T&7h+lCi76wy!=j}V%OAV^aTgpLBC7Y$tzPJLJ>>L%0f0ENd zkmrMT+=48E*VoDN3*_1T-|`Ext9efhZP@p;N8j;+YW(3C!kZ4Z&(9(Q7&s#B7!vO~ z+@7U^`Dqg4U78)FW+Sokr6fVAS$X(QIkvFd)uIurF z&I!ydso8qCy9zOP6q5qq;f5iLNk0VMdQM=pV5X%cY3F8l7_x}Ob}|wW)(;J=Buq`^W|S%Qm(e@u#O zU_hPdn^Lx;$L0^a&`kS1(tYP0UblN`0;+C!2<5lrTuky3a?7U7a-kLqmL8QHtnQd^ z1?Fu3c?|-r2a%{Pxx&d`GKuj$XNzg()sw(7n6|GB?@^W}wh5b3l*^aEXX&TLoLBJp z;N$&1*$~BT@Pn;S&Dg(< zdUl?Voib@`NF}aDnJ)16dS6XCr)JFNq zrd93q4|JXc;H{>6GoQzf^%0xuJQdaqw8_7SnUd}ksiB#?Sr_jq1{DP#gO6Fcy~`c? z4i98~xds#3#b(U%%WDkAipMM6%-p_Dj7e8kxP5SORGaqQ+QAi9($~>LLgtR>kG46*}UU>ud(|nbF3qt8Ie8;t)%0Cvx2n<_qQd#)q?`@ zOuwJ?^7=@LZ%-!Hi=B9O=7r2vThF5LcZ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u$^-tb9 zR`S+wS0{U^l*{3dqqCE_GQ|NF#VhrU0Mmm=@3aV%W3yOG+|c6Pe96^1p%0zfC43LF z744QdZT>L4aJcHZe@@jry*M+&S@WRs^-E%~l8QlOld(k%@$y8<8!UEPBWT$zFC=Ez VeiMDKiwA3S`LWBM8!E^m_FrW|9$Wwb diff --git a/addons/sourcemod/scripting/l4d2_localhost.sp b/addons/sourcemod/scripting/l4d2_localhost.sp index 3ce520654..c81d9d79f 100644 --- a/addons/sourcemod/scripting/l4d2_localhost.sp +++ b/addons/sourcemod/scripting/l4d2_localhost.sp @@ -2,6 +2,7 @@ #pragma newdecls required #include +#include public Plugin myinfo = { @@ -12,11 +13,14 @@ public Plugin myinfo = url = "https://github.com/altair-sossai/l4d2-zone-server" }; -ConVar hLocalhostUrl; +ConVar + hLocalhostUrl, + hLocalhostType; public void OnPluginStart() { hLocalhostUrl = CreateConVar("localhost_url", "", "URL used to perform local tests", FCVAR_PROTECTED); + hLocalhostType = CreateConVar("localhost_type", "url", "Type of content to be displayed, url|text", FCVAR_PROTECTED); RegConsoleCmd("sm_localhost", LocalHostCmd); } @@ -26,6 +30,36 @@ Action LocalHostCmd(int client, int args) char localHostUrl[100]; GetConVarString(hLocalhostUrl, localHostUrl, sizeof(localHostUrl)); - ShowMOTDPanel(client, "localhost", localHostUrl, MOTDPANEL_TYPE_URL); + char localHostType[10]; + GetConVarString(hLocalhostType, localHostType, sizeof(localHostType)); + + if (StrEqual(localHostType, "url")) + { + ShowMOTDPanel(client, "localhost", localHostUrl, MOTDPANEL_TYPE_URL); + return Plugin_Handled; + } + + if (StrEqual(localHostType, "text")) + { + HTTPRequest request = new HTTPRequest(localHostUrl); + + request.Get(LocalHostResponse, client); + + return Plugin_Handled; + } + return Plugin_Handled; +} + +void LocalHostResponse(HTTPResponse httpResponse, any client) +{ + if (httpResponse.Status != HTTPStatus_OK) + return; + + JSONObject response = view_as(httpResponse.Data); + + char content[40000]; + response.GetString("content", content, sizeof(content)); + + ShowMOTDPanel(client, "localhost", content, MOTDPANEL_TYPE_TEXT); } \ No newline at end of file diff --git a/cfg/cfgogl/zonemod/shared_cvars.cfg b/cfg/cfgogl/zonemod/shared_cvars.cfg index 63ccdf396..ad77e1eb4 100644 --- a/cfg/cfgogl/zonemod/shared_cvars.cfg +++ b/cfg/cfgogl/zonemod/shared_cvars.cfg @@ -150,6 +150,7 @@ confogl_addcvar patent_icon_max_level 15 // [l4d2_localhost.smx] confogl_addcvar localhost_url "http://localhost:5000" +confogl_addcvar localhost_type "url" // Stripper Path confogl_addcvar stripper_cfg_path cfg/stripper/zonemod \ No newline at end of file