Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c82feb1a4a | ||
|
|
ceeaf66b95 | ||
|
|
8eaea7217c | ||
|
|
482491616f |
@@ -101,6 +101,41 @@ jobs:
|
||||
path: build/package/addons
|
||||
if-no-files-found: error
|
||||
|
||||
compile-plugins:
|
||||
name: compile-plugins-sm${{ matrix.sm.label }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sm:
|
||||
- label: "1.12"
|
||||
branch: "1.12-dev"
|
||||
- label: "1.13"
|
||||
branch: "master"
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Clone SourceMod includes
|
||||
run: |
|
||||
git clone --depth 1 -b ${{ matrix.sm.branch }} https://github.com/alliedmodders/sourcemod.git sourcemod
|
||||
|
||||
- name: Compile Pawn plugins
|
||||
run: |
|
||||
mkdir -p compiled
|
||||
status=0
|
||||
for f in Pawn/*.sp; do
|
||||
echo "::group::${f}"
|
||||
docker run --rm -v "${{ github.workspace }}:/work" -w /work \
|
||||
ghcr.io/alliedmodders/sourcemod-spcomp:${{ matrix.sm.branch }} \
|
||||
-i Pawn/includes -i sourcemod/plugins/include \
|
||||
"${f}" -o "compiled/$(basename "${f%.sp}.smx")" \
|
||||
|| status=1
|
||||
echo "::endgroup::"
|
||||
done
|
||||
exit "${status}"
|
||||
|
||||
release:
|
||||
name: Release
|
||||
needs: build
|
||||
|
||||
@@ -706,6 +706,35 @@ static sp_nativeinfo_t httpnatives[] = {
|
||||
{"SteamWorks_WriteHTTPResponseBodyToFile", sm_WriteHTTPResponseBodyToFile},
|
||||
{"SteamWorks_SendHTTPRequestAndStreamResponse", sm_SendHTTPRequestAndStreamResponse},
|
||||
{"SteamWorks_GetHTTPStreamingResponseBodyData", sm_GetHTTPStreamingResponseBodyData},
|
||||
|
||||
/* SteamWorksHTTPRequest methodmap. These reuse the functions above; the implicit
|
||||
`this` handle arrives as params[1], exactly like the hHandle/hRequest first
|
||||
parameter of the free-function natives (and the constructor maps to the create
|
||||
native, whose first argument is likewise params[1]). */
|
||||
{"SteamWorksHTTPRequest.SteamWorksHTTPRequest", sm_CreateHTTPRequest},
|
||||
{"SteamWorksHTTPRequest.SetContextValue", sm_SetHTTPRequestContextValue},
|
||||
{"SteamWorksHTTPRequest.SetNetworkActivityTimeout", sm_SetHTTPRequestNetworkActivityTimeout},
|
||||
{"SteamWorksHTTPRequest.SetHeaderValue", sm_SetHTTPRequestHeaderValue},
|
||||
{"SteamWorksHTTPRequest.SetGetOrPostParameter", sm_SetHTTPRequestGetOrPostParameter},
|
||||
{"SteamWorksHTTPRequest.SetUserAgentInfo", sm_SetHTTPRequestUserAgentInfo},
|
||||
{"SteamWorksHTTPRequest.SetRequiresVerifiedCertificate", sm_SetHTTPRequestRequiresVerifiedCertificate},
|
||||
{"SteamWorksHTTPRequest.SetAbsoluteTimeoutMS", sm_SetHTTPRequestAbsoluteTimeoutMS},
|
||||
{"SteamWorksHTTPRequest.SetCallbacks", sm_SetCallbacks},
|
||||
{"SteamWorksHTTPRequest.Send", sm_SendHTTPRequest},
|
||||
{"SteamWorksHTTPRequest.SendAndStreamResponse", sm_SendHTTPRequestAndStreamResponse},
|
||||
{"SteamWorksHTTPRequest.Defer", sm_DeferHTTPRequest},
|
||||
{"SteamWorksHTTPRequest.Prioritize", sm_PrioritizeHTTPRequest},
|
||||
{"SteamWorksHTTPRequest.GetResponseHeaderSize", sm_GetHTTPResponseHeaderSize},
|
||||
{"SteamWorksHTTPRequest.GetResponseHeaderValue", sm_GetHTTPResponseHeaderValue},
|
||||
{"SteamWorksHTTPRequest.GetResponseBodySize", sm_GetHTTPResponseBodySize},
|
||||
{"SteamWorksHTTPRequest.GetResponseBodyData", sm_GetHTTPResponseBodyData},
|
||||
{"SteamWorksHTTPRequest.GetStreamingResponseBodyData", sm_GetHTTPStreamingResponseBodyData},
|
||||
{"SteamWorksHTTPRequest.GetDownloadProgressPct", sm_GetHTTPDownloadProgressPct},
|
||||
{"SteamWorksHTTPRequest.GetWasTimedOut", sm_GetHTTPRequestWasTimedOut},
|
||||
{"SteamWorksHTTPRequest.SetRawPostBody", sm_SetHTTPRequestRawPostBody},
|
||||
{"SteamWorksHTTPRequest.SetRawPostBodyFromFile", sm_SetHTTPRequestRawPostBodyFromFile},
|
||||
{"SteamWorksHTTPRequest.GetResponseBodyCallback", sm_GetHTTPResponseBodyCallback},
|
||||
{"SteamWorksHTTPRequest.WriteResponseBodyToFile", sm_WriteHTTPResponseBodyToFile},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
+16
-16
@@ -2,12 +2,12 @@
|
||||
#include <sourcemod>
|
||||
#include <SteamWorks>
|
||||
|
||||
new g_iPatchVersion = 0;
|
||||
new g_iAppID = 0;
|
||||
int g_iPatchVersion = 0;
|
||||
int g_iAppID = 0;
|
||||
|
||||
new Handle:g_hForward = INVALID_HANDLE;
|
||||
Handle g_hForward = INVALID_HANDLE;
|
||||
|
||||
public Plugin:myinfo =
|
||||
public Plugin myinfo =
|
||||
{
|
||||
name = "SteamWorks Update Check", /* https://www.youtube.com/watch?v=Tq_0ht8HCcM */
|
||||
author = "Kyle Sanderson",
|
||||
@@ -16,15 +16,15 @@ public Plugin:myinfo =
|
||||
url = "https://AlliedMods.net"
|
||||
};
|
||||
|
||||
static stock bool:ReadSteamINF(const String:sPath[], &iAppID, &iPatchVersion)
|
||||
static stock bool ReadSteamINF(const char[] sPath, int &iAppID, int &iPatchVersion)
|
||||
{
|
||||
new Handle:hFile = OpenFile(sPath, "r");
|
||||
Handle hFile = OpenFile(sPath, "r");
|
||||
if (hFile == INVALID_HANDLE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
decl String:sBuffer[256];
|
||||
char sBuffer[256];
|
||||
|
||||
do
|
||||
{
|
||||
@@ -36,7 +36,7 @@ static stock bool:ReadSteamINF(const String:sPath[], &iAppID, &iPatchVersion)
|
||||
TrimString(sBuffer);
|
||||
ReplaceString(sBuffer, sizeof(sBuffer), ".", ""); /* CS:GO uses decimals in steam.inf, WebAPI is Steam| style. */
|
||||
|
||||
new iPos = FindCharInString(sBuffer, '=');
|
||||
int iPos = FindCharInString(sBuffer, '=');
|
||||
if (iPos == -1)
|
||||
{
|
||||
continue;
|
||||
@@ -71,7 +71,7 @@ static stock bool:ReadSteamINF(const String:sPath[], &iAppID, &iPatchVersion)
|
||||
return true;
|
||||
}
|
||||
|
||||
public OnPluginStart()
|
||||
public void OnPluginStart()
|
||||
{
|
||||
if (!ReadSteamINF("steam.inf", g_iAppID, g_iPatchVersion) && !ReadSteamINF("../steam.inf", g_iAppID, g_iPatchVersion))
|
||||
{
|
||||
@@ -81,20 +81,20 @@ public OnPluginStart()
|
||||
g_hForward = CreateGlobalForward("SteamWorks_RestartRequested", ET_Ignore);
|
||||
}
|
||||
|
||||
public OnMapStart()
|
||||
public void OnMapStart()
|
||||
{
|
||||
CreateTimer(120.0, OnCheckForUpdate, _, TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
|
||||
}
|
||||
|
||||
public Action:OnCheckForUpdate(Handle:hTimer)
|
||||
public Action OnCheckForUpdate(Handle hTimer)
|
||||
{
|
||||
static String:sRequest[256];
|
||||
static char sRequest[256];
|
||||
if (sRequest[0] == '\0')
|
||||
{
|
||||
FormatEx(sRequest, sizeof(sRequest), "http://api.steampowered.com/ISteamApps/UpToDateCheck/v0001/?appid=%u&version=%u&format=xml", g_iAppID, g_iPatchVersion);
|
||||
}
|
||||
|
||||
new Handle:hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET, sRequest);
|
||||
Handle hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET, sRequest);
|
||||
if (!hRequest || !SteamWorks_SetHTTPCallbacks(hRequest, OnTransferComplete) || !SteamWorks_SendHTTPRequest(hRequest))
|
||||
{
|
||||
CloseHandle(hRequest);
|
||||
@@ -103,7 +103,7 @@ public Action:OnCheckForUpdate(Handle:hTimer)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public OnTransferComplete(Handle:hRequest, bool:bFailure, bool:bRequestSuccessful, EHTTPStatusCode:eStatusCode)
|
||||
public void OnTransferComplete(Handle hRequest, bool bFailure, bool bRequestSuccessful, EHTTPStatusCode eStatusCode)
|
||||
{
|
||||
if (!bFailure && bRequestSuccessful && eStatusCode == k_EHTTPStatusCode200OK)
|
||||
{
|
||||
@@ -113,9 +113,9 @@ public OnTransferComplete(Handle:hRequest, bool:bFailure, bool:bRequestSuccessfu
|
||||
CloseHandle(hRequest);
|
||||
}
|
||||
|
||||
public APIWebResponse(const String:sData[])
|
||||
public void APIWebResponse(const char[] sData)
|
||||
{
|
||||
new iPos = StrContains(sData, "<required_version>");
|
||||
int iPos = StrContains(sData, "<required_version>");
|
||||
if (iPos == -1)
|
||||
{
|
||||
return;
|
||||
|
||||
+939
-86
File diff suppressed because it is too large
Load Diff
+17
-17
@@ -20,10 +20,10 @@
|
||||
#include <sourcemod>
|
||||
#include <SteamWorks>
|
||||
|
||||
new Handle:g_hSteamServersConnected = INVALID_HANDLE;
|
||||
new Handle:g_hSteamServersDisconnected = INVALID_HANDLE;
|
||||
Handle g_hSteamServersConnected = INVALID_HANDLE;
|
||||
Handle g_hSteamServersDisconnected = INVALID_HANDLE;
|
||||
|
||||
public Plugin:myinfo = {
|
||||
public Plugin myinfo = {
|
||||
name = "SteamWorks Additive Glider", /* SWAG */
|
||||
author = "Kyle Sanderson",
|
||||
description = "Translates SteamTools calls into SteamWorks calls.",
|
||||
@@ -31,7 +31,7 @@ public Plugin:myinfo = {
|
||||
url = "http://AlliedMods.net"
|
||||
};
|
||||
|
||||
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
|
||||
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
|
||||
{
|
||||
CreateNative("Steam_IsVACEnabled", native_IsVACEnabled);
|
||||
CreateNative("Steam_GetPublicIP", native_GetPublicIP);
|
||||
@@ -46,50 +46,50 @@ public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
|
||||
return APLRes_Success;
|
||||
}
|
||||
|
||||
public native_IsVACEnabled(Handle:plugin, numParams)
|
||||
public int native_IsVACEnabled(Handle plugin, int numParams)
|
||||
{
|
||||
return SteamWorks_IsVACEnabled();
|
||||
}
|
||||
|
||||
public native_GetPublicIP(Handle:plugin, numParams)
|
||||
public int native_GetPublicIP(Handle plugin, int numParams)
|
||||
{
|
||||
new addr[4];
|
||||
int addr[4];
|
||||
SteamWorks_GetPublicIP(addr);
|
||||
SetNativeArray(1, addr, sizeof(addr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
public native_SetGameDescription(Handle:plugin, numParams)
|
||||
public int native_SetGameDescription(Handle plugin, int numParams)
|
||||
{
|
||||
decl String:sDesc[PLATFORM_MAX_PATH];
|
||||
char sDesc[PLATFORM_MAX_PATH];
|
||||
GetNativeString(1, sDesc, sizeof(sDesc));
|
||||
return SteamWorks_SetGameDescription(sDesc);
|
||||
}
|
||||
|
||||
public native_IsConnected(Handle:plugin, numParams)
|
||||
public int native_IsConnected(Handle plugin, int numParams)
|
||||
{
|
||||
return SteamWorks_IsConnected();
|
||||
}
|
||||
|
||||
public native_SetRule(Handle:plugin, numParams)
|
||||
public int native_SetRule(Handle plugin, int numParams)
|
||||
{
|
||||
decl String:sKey[PLATFORM_MAX_PATH], String:sValue[PLATFORM_MAX_PATH];
|
||||
char sKey[PLATFORM_MAX_PATH], sValue[PLATFORM_MAX_PATH];
|
||||
GetNativeString(1, sKey, sizeof(sKey));
|
||||
GetNativeString(2, sValue, sizeof(sValue));
|
||||
return SteamWorks_SetRule(sKey, sValue);
|
||||
}
|
||||
|
||||
public native_ClearRules(Handle:plugin, numParams)
|
||||
public int native_ClearRules(Handle plugin, int numParams)
|
||||
{
|
||||
return SteamWorks_ClearRules();
|
||||
}
|
||||
|
||||
public native_ForceHeartbeat(Handle:plugin, numParams)
|
||||
public int native_ForceHeartbeat(Handle plugin, int numParams)
|
||||
{
|
||||
return SteamWorks_ForceHeartbeat();
|
||||
return 0;
|
||||
}
|
||||
|
||||
public SteamWorks_SteamServersConnected()
|
||||
public void SteamWorks_SteamServersConnected()
|
||||
{
|
||||
if (GetForwardFunctionCount(g_hSteamServersConnected) == 0)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ public SteamWorks_SteamServersConnected()
|
||||
Call_Finish();
|
||||
}
|
||||
|
||||
public SteamWorks_SteamServersDisconnected()
|
||||
public void SteamWorks_SteamServersDisconnected()
|
||||
{
|
||||
if (GetForwardFunctionCount(g_hSteamServersDisconnected) == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user