Update plugins/inc to use transitional syntax (#1)
* Update plugins/inc to use transitional syntax * Add CI job for validating plugins/inc * ci: work around broken entrypoint in sourcemod-spcomp image * ci: only compile Pawn plugins against master includes * ci: restore per-version compile-plugins matrix now that spcomp images are fixed * ci: reuse sm.branch as the image tag directly
This commit is contained in:
+21
-21
@@ -12,7 +12,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with SourcePawn SteamWorks. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
Author: Kyle Sanderson (KyleS).
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
@@ -40,73 +40,73 @@ public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
|
||||
CreateNative("Steam_SetRule", native_SetRule);
|
||||
CreateNative("Steam_ClearRules", native_ClearRules);
|
||||
CreateNative("Steam_ForceHeartbeat", native_ForceHeartbeat);
|
||||
|
||||
|
||||
g_hSteamServersConnected = CreateGlobalForward("Steam_SteamServersConnected", ET_Ignore);
|
||||
g_hSteamServersDisconnected = CreateGlobalForward("Steam_SteamServersDisconnected", ET_Ignore);
|
||||
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)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Call_StartForward(g_hSteamServersConnected);
|
||||
Call_Finish();
|
||||
}
|
||||
|
||||
public SteamWorks_SteamServersDisconnected()
|
||||
public void SteamWorks_SteamServersDisconnected()
|
||||
{
|
||||
if (GetForwardFunctionCount(g_hSteamServersDisconnected) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Call_StartForward(g_hSteamServersDisconnected);
|
||||
Call_Finish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user