NoSteamManager: Remove spoofing? Doesnt work.
This commit is contained in:
parent
f6b8c2786b
commit
cdbc35b0ad
@ -3,17 +3,12 @@
|
|||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <basecomm>
|
#include <basecomm>
|
||||||
#include <connect>
|
#include <connect>
|
||||||
#include <regex>
|
|
||||||
|
|
||||||
#pragma newdecls required
|
#pragma newdecls required
|
||||||
|
|
||||||
/* CONVARS */
|
/* CONVARS */
|
||||||
ConVar g_hCvar_BlockAdmin;
|
ConVar g_hCvar_BlockAdmin;
|
||||||
ConVar g_hCvar_BlockVoice;
|
ConVar g_hCvar_BlockVoice;
|
||||||
ConVar g_hCvar_BlockSpoof;
|
|
||||||
|
|
||||||
/* REGEX */
|
|
||||||
Regex g_hReg_ValidateSteamID;
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
@ -31,11 +26,8 @@ public Plugin myinfo =
|
|||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void OnPluginStart()
|
public void OnPluginStart()
|
||||||
{
|
{
|
||||||
g_hReg_ValidateSteamID = CompileRegex("[^STEAM_[01]:[01]:\\d{1,10}]");
|
|
||||||
|
|
||||||
g_hCvar_BlockAdmin = CreateConVar("sm_nosteam_block_admin", "1", "Should people marked as nosteam be blocked from admin?", FCVAR_NONE, true, 0.0, true, 1.0);
|
g_hCvar_BlockAdmin = CreateConVar("sm_nosteam_block_admin", "1", "Should people marked as nosteam be blocked from admin?", FCVAR_NONE, true, 0.0, true, 1.0);
|
||||||
g_hCvar_BlockVoice = CreateConVar("sm_nosteam_block_voice", "1", "Should people marked as nosteam be blocked from voice?", FCVAR_NONE, true, 0.0, true, 1.0);
|
g_hCvar_BlockVoice = CreateConVar("sm_nosteam_block_voice", "1", "Should people marked as nosteam be blocked from voice?", FCVAR_NONE, true, 0.0, true, 1.0);
|
||||||
g_hCvar_BlockSpoof = CreateConVar("sm_nosteam_block_spoof", "1", "Block nosteam people being able to spoof steamids.", FCVAR_NONE, true, 0.0, true, 1.0);
|
|
||||||
|
|
||||||
AddMultiTargetFilter("@steam", Filter_Steam, "Steam Players", false);
|
AddMultiTargetFilter("@steam", Filter_Steam, "Steam Players", false);
|
||||||
AddMultiTargetFilter("@nosteam", Filter_NoSteam, "No-Steam Players", false);
|
AddMultiTargetFilter("@nosteam", Filter_NoSteam, "No-Steam Players", false);
|
||||||
@ -175,57 +167,3 @@ public void OnClientPostAdminCheck(int client)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
|
||||||
// Purpose:
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
|
||||||
public void OnClientPutInServer(int client)
|
|
||||||
{
|
|
||||||
if(!g_hCvar_BlockSpoof.BoolValue)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(IsFakeClient(client) || IsClientSourceTV(client))
|
|
||||||
return;
|
|
||||||
|
|
||||||
char sSteamID[32];
|
|
||||||
GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID));
|
|
||||||
|
|
||||||
if(MatchRegex(g_hReg_ValidateSteamID, sSteamID) <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for(int player = 1; player <= MaxClients; player++)
|
|
||||||
{
|
|
||||||
if(client == player || !IsClientConnected(player))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(IsFakeClient(player) || IsClientSourceTV(player))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
char sPlayerSteamID[32];
|
|
||||||
GetClientAuthId(player, AuthId_Steam2, sPlayerSteamID, sizeof(sPlayerSteamID));
|
|
||||||
|
|
||||||
if(MatchRegex(g_hReg_ValidateSteamID, sPlayerSteamID) <= 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(StrEqual(sSteamID, sPlayerSteamID, false))
|
|
||||||
{
|
|
||||||
if(!SteamClientAuthenticated(sSteamID))
|
|
||||||
{
|
|
||||||
LogMessage("%L was not authenticated with steam, steamid already connected. Kicking connector.", client);
|
|
||||||
KickClient(client, "Please come back later.");
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!SteamClientAuthenticated(sPlayerSteamID))
|
|
||||||
{
|
|
||||||
LogMessage("%L was not authenticated with steam, steamid already connected. Kicking connected.", player);
|
|
||||||
KickClient(player, "Please come back later.");
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user