NoSteam: Change extension functions.

This commit is contained in:
zaCade 2019-02-24 11:31:45 +01:00
parent b8b460b6a7
commit 63213ce57f
3 changed files with 70 additions and 6 deletions

View File

@ -1,7 +1,7 @@
#pragma semicolon 1
#include <sourcemod>
#include <No_Steam_Info>
#include <RevEmuAPI>
#pragma newdecls required
@ -46,8 +46,8 @@ public void GetConnectionType(int client, char[] sConnectionType, int iMaxLength
{
char sConnectionTypeInternal[32];
RevEmu_PlayerType PlayerType = RevEmu_GetPlayerType(client);
if (PlayerType == ErrorGet)
RevEmu_UserType PlayerType = RevEmu_GetPlayerType(client);
if (PlayerType == Unknown)
sConnectionTypeInternal = "Error";
else if (PlayerType == SteamLegitUser)
sConnectionTypeInternal = "SteamLegit";

View File

@ -2,7 +2,7 @@
#include <sourcemod>
#include <basecomm>
#include <No_Steam_Info>
#include <RevEmuAPI>
#pragma newdecls required
@ -275,8 +275,8 @@ public void GetConnectionType(int client, char[] sConnectionType, int iMaxLength
{
char sConnectionTypeInternal[32];
RevEmu_PlayerType PlayerType = RevEmu_GetPlayerType(client);
if (PlayerType == ErrorGet)
RevEmu_UserType PlayerType = RevEmu_GetPlayerType(client);
if (PlayerType == Unknown)
sConnectionTypeInternal = "Error";
else if (PlayerType == SteamLegitUser)
sConnectionTypeInternal = "SteamLegit";

64
includes/RevEmuAPI.inc Normal file
View File

@ -0,0 +1,64 @@
#ifndef _RevEmuAPI_included
#define _RevEmuAPI_included
enum RevEmu_UserType
{
Invalid = -1,
SteamLegitUser = 0,
SteamCrackedUser,
RevEmuUser,
RevEmuUserOld,
SettiSRCScanBot,
RevEmuUserV74,
RevEmuUserVeryOld,
UnknownUser,
Steam2Legit,
Steam2Cracked
};
/**
* Check if clients usertype is legit.
*
* @param clients The client index.
*
* @return True if valid, false otherwise.
* @error Invalid client index, not connected or fake client.
*/
native bool RevEmu_IsPlayerSteam(int client);
/**
* Retrieve clients usertype.
*
* @param clients The client index.
*
* @return The clients usertype.
* @error Invalid client index, not connected or fake client.
*/
native RevEmu_UserType RevEmu_GetPlayerType(int client);
public Extension __ext_RevEmuAPI =
{
name = "RevEmuAPI",
file = "RevEmuAPI.ext",
#if defined AUTOLOAD_EXTENSIONS
autoload = 1,
#else
autoload = 0,
#endif
#if defined REQUIRE_EXTENSIONS
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_EXTENSIONS
public __ext_RevEmuAPI_SetNTVOptional()
{
MarkNativeAsOptional("RevEmu_IsPlayerSteam");
MarkNativeAsOptional("RevEmu_GetPlayerType");
}
#endif
#endif //_RevEmuAPI_included