much secure, such wow
This commit is contained in:
parent
81ef2578b8
commit
73bc1ca057
82
NoSteamManager/scripting/NoSteamManagerFailSafe_RevEmu.sp
Normal file
82
NoSteamManager/scripting/NoSteamManagerFailSafe_RevEmu.sp
Normal file
@ -0,0 +1,82 @@
|
||||
#pragma semicolon 1
|
||||
|
||||
#include <sourcemod>
|
||||
#include <No_Steam_Info>
|
||||
|
||||
#pragma newdecls required
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public Plugin myinfo =
|
||||
{
|
||||
name = "NoSteamManagerFailSafe_RevEmu",
|
||||
author = "Neon",
|
||||
description = "FailSafe to prevent No-Steam clients from getting admin access.",
|
||||
version = "1.0.0"
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnClientPostAdminCheck(int client)
|
||||
{
|
||||
if(IsFakeClient(client) || IsClientSourceTV(client))
|
||||
return;
|
||||
|
||||
if(!CheckCommandAccess(client, "sm_admin", ADMFLAG_GENERIC, true))
|
||||
return;
|
||||
|
||||
if(!IsSteam(client))
|
||||
{
|
||||
char sConnectionType[32];
|
||||
GetConnectionType(client, sConnectionType, sizeof(sConnectionType));
|
||||
|
||||
LogMessage("%L got admin access while not being authentiated with steam (type: %s). Attempting to kick.", sConnectionType);
|
||||
LogAction(client, -1, "\"%L\"got admin access while not being authentiated with steam (type: %s). Attempting to kick.", sConnectionType);
|
||||
KickClient(client, "Security Validation failed. Please contact an Administrator.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void GetConnectionType(int client, char[] sConnectionType, int iMaxLength)
|
||||
{
|
||||
char sConnectionTypeInternal[32];
|
||||
|
||||
RevEmu_PlayerType PlayerType = RevEmu_GetPlayerType(client);
|
||||
if (PlayerType == ErrorGet)
|
||||
sConnectionTypeInternal = "Error";
|
||||
else if (PlayerType == SteamLegitUser)
|
||||
sConnectionTypeInternal = "SteamLegit";
|
||||
else if (PlayerType == SteamCrackedUser)
|
||||
sConnectionTypeInternal = "SteamCracked";
|
||||
else if (PlayerType == RevEmuUser)
|
||||
sConnectionTypeInternal = "RevEmu";
|
||||
else if (PlayerType == RevEmuUserOld)
|
||||
sConnectionTypeInternal = "RevEmuOld";
|
||||
else if (PlayerType == SettiSRCScanBot)
|
||||
sConnectionTypeInternal = "SettiSRCScanBot";
|
||||
else if (PlayerType == RevEmuUserV74)
|
||||
sConnectionTypeInternal = "RevEmuV74";
|
||||
else if (PlayerType == RevEmuUserVeryOld)
|
||||
sConnectionTypeInternal = "RevEmuVeryOld";
|
||||
else if (PlayerType == UnknownUser)
|
||||
sConnectionTypeInternal = "Unknown";
|
||||
else if (PlayerType == Steam2Legit)
|
||||
sConnectionTypeInternal = "Steam2Legit";
|
||||
else if (PlayerType == Steam2Cracked)
|
||||
sConnectionTypeInternal = "Steam2Cracked";
|
||||
|
||||
strcopy(sConnectionType, iMaxLength, sConnectionTypeInternal);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public bool IsSteam(int client)
|
||||
{
|
||||
return (RevEmu_GetPlayerType(client) == SteamLegitUser);
|
||||
}
|
Loading…
Reference in New Issue
Block a user