sourcemod 1.13 upgrade. moved all plugins from steamworks to ripext. added smjanson and asyncsocket.inc an extra time so its easier to find. updated plugins that would not compile with 1.13

This commit is contained in:
jenz
2026-09-22 01:55:09 +02:00
parent 789b8ebef9
commit 2947bef434
17 changed files with 2131 additions and 462 deletions
+42 -51
View File
@@ -4,7 +4,7 @@
#include <basecomm>
#include <ccc>
#include <clientprefs>
#include <SteamWorks>
#include <ripext>
#tryinclude <zombiereloaded>
#include <selfmute>
#include <connect>
@@ -22,6 +22,8 @@ bool g_bSkipInfection = false;
char g_sLastWebclientIp[64];
int g_iHttpFileCounter;
public Plugin myinfo =
{
name = "NoSteam CELT Voice override",
@@ -73,7 +75,7 @@ public Action check_mutes(Handle timer, any data)
}
else
{
//maybe this is a fix? maybe not.
//maybe this is a fix? maybe not.
clear_steam_listen_override(i);
}
for (int j = 1; j <= MaxClients; j++)
@@ -145,28 +147,17 @@ public void SendWebclientNameToSignaling(const char[] webclientName)
// Adjust port/path to match your signaling servers actual endpoint
FormatEx(url, sizeof(url), "http://127.0.0.1:3000/webclient-name");
Handle hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodPOST, url);
if (hRequest == null)
{
return;
}
HTTPRequest hRequest = new HTTPRequest(url);
// Send the name as a POST body parameter
SteamWorks_SetHTTPRequestGetOrPostParameter(hRequest, "name", webclientName);
if (!SteamWorks_SetHTTPCallbacks(hRequest, OnWebclientNamePosted) ||
!SteamWorks_SendHTTPRequest(hRequest))
{
delete hRequest;
}
hRequest.AppendFormParam("name", "%s", webclientName);
hRequest.PostForm(OnWebclientNamePosted);
}
public int OnWebclientNamePosted(Handle hRequest, bool bFailure, bool bRequestSuccessful,
EHTTPStatusCode eStatusCode, any data)
public void OnWebclientNamePosted(HTTPResponse response, any value)
{
// Fire-and-forget: we dont care about the response, just clean up.
delete hRequest;
return 0;
// Fire-and-forget: we dont care about the response. ripext closes the
// request handle for us once this callback returns.
}
public void OnMapStart()
@@ -259,7 +250,7 @@ public Action ZR_OnClientMotherZombieEligible(int client)
public Action Timer_SendVoiceInit(Handle timer, int Serial)
{
int client;
int client;
if ((client = GetClientFromSerial(Serial)) == 0)
{
return Plugin_Handled;
@@ -276,53 +267,53 @@ public Action Timer_SendVoiceInit(Handle timer, int Serial)
* If the IP has changed since the last
* check and a webclient player is currently connected, forces them to
* reconnect with the new password via ClientCommand.
*
* ripext's HTTPResponse only exposes the body as decoded JSON, unlike
* SteamWorks' GetHTTPResponseBodyCallback which handed back a plain char[].
* Rather than change the signaling server's response format, we use
* HTTPRequest.DownloadFile() to write the raw body to a temp file and read
* it back as plain text, keeping the endpoint untouched.
**/
public void PollWebclientCurrentIp()
{
Handle hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET, "http://127.0.0.1:3000/webclient-current-ip");
if (hRequest == null)
{
return;
}
g_iHttpFileCounter++;
if (!SteamWorks_SetHTTPCallbacks(hRequest, OnWebclientCurrentIpReceived) ||
!SteamWorks_SendHTTPRequest(hRequest))
{
delete hRequest;
}
char sPath[PLATFORM_MAX_PATH];
BuildPath(Path_SM, sPath, sizeof(sPath), "data/nosteamcelt_ip_%d.tmp", g_iHttpFileCounter);
HTTPRequest hRequest = new HTTPRequest("http://127.0.0.1:3000/webclient-current-ip");
hRequest.DownloadFile(sPath, OnWebclientCurrentIpDownloaded, g_iHttpFileCounter);
}
public int OnWebclientCurrentIpReceived(Handle hRequest, bool bFailure, bool bRequestSuccessful,
EHTTPStatusCode eStatusCode, any data)
public void OnWebclientCurrentIpDownloaded(HTTPStatus status, any value)
{
if (bFailure || !bRequestSuccessful || eStatusCode != k_EHTTPStatusCode200OK)
{
delete hRequest;
return 0;
}
char sPath[PLATFORM_MAX_PATH];
BuildPath(Path_SM, sPath, sizeof(sPath), "data/nosteamcelt_ip_%d.tmp", value);
int bodySize;
bool gotSize = SteamWorks_GetHTTPResponseBodySize(hRequest, bodySize);
if (status != HTTPStatus_OK)
{
DeleteFile(sPath);
return;
}
char newIp[64];
newIp[0] = '\0';
if (gotSize && bodySize > 0 && bodySize < sizeof(newIp))
File hFile = OpenFile(sPath, "r");
if (hFile != null)
{
SteamWorks_GetHTTPResponseBodyData(hRequest, newIp, bodySize);
hFile.ReadLine(newIp, sizeof(newIp));
delete hFile;
}
DeleteFile(sPath);
delete hRequest;
TrimString(newIp);
if (newIp[0] == '\0')
{
return 0;
}
return;
if (StrEqual(newIp, g_sLastWebclientIp))
{
return 0;
}
return;
for (int i = 1; i <= MaxClients; i++)
{
@@ -334,7 +325,6 @@ public int OnWebclientCurrentIpReceived(Handle hRequest, bool bFailure, bool bRe
break;
}
}
return 0;
}
public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], const char[] sIP, const char[] sSteam32ID, char sRejectReason[255])
@@ -344,7 +334,7 @@ public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], co
if (sv_set_steam_id_ips != null)
{
sv_set_steam_id_ips.GetString(allowedIp, sizeof(allowedIp));
//this is to handle that the connect extension receives the password parameter for the webclient as its real connecting IP.
//this is to handle that the connect extension receives the password parameter for the webclient as its real connecting IP.
//works both for the client command retry and for the case that somebody presses the connect button in the clients Menu as the same password
//is applied again.
if (StrEqual(sIP, allowedIp) && strlen(g_sLastWebclientIp) > 0)
@@ -353,7 +343,7 @@ public EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], co
LogMessage("Backfilled empty password for webclient with cached IP: %s", g_sLastWebclientIp);
}
}
// ET_LowEvent takes the LOWEST value returned across all plugins hooking this forward.
// ET_LowEvent takes the LOWEST value returned across all plugins hooking this forward.
//this plugin returns 1 (Accept), meanwhile the reserved slot plugin still might return 0 (reject) or -1 (async) to overrule the decision from this return value.
return k_OnClientPreConnectEx_Accept;
}
@@ -364,3 +354,4 @@ stock bool IsValidClient(int client)
return true;
return false;
}