Remove CSGO and Cleanup required folders.
This commit is contained in:
		
							parent
							
								
									a86d71c70b
								
							
						
					
					
						commit
						d7eb10d8f4
					
				| @ -48,7 +48,7 @@ int g_iLastReportID; | ||||
| 
 | ||||
| public Plugin myinfo = | ||||
| { | ||||
| 	name        = "Discord core", | ||||
| 	name        = "Discord Core", | ||||
| 	author      = "Obus and Neon", | ||||
| 	description = "Chat- & Rcon-Support", | ||||
| 	version     = "1.2.0", | ||||
| @ -1,192 +0,0 @@ | ||||
| #include <sourcemod> | ||||
| #include <SteamWorks> | ||||
| 
 | ||||
| #pragma semicolon 1 | ||||
| #pragma newdecls required | ||||
| 
 | ||||
| #include "SteamAPI.secret" | ||||
| 
 | ||||
| /* BOOLEANS */ | ||||
| bool g_bValid[MAXPLAYERS+1]     = {false, ...}; | ||||
| bool g_bValidated[MAXPLAYERS+1] = {false, ...}; | ||||
| 
 | ||||
| /* FORWARDS */ | ||||
| Handle g_hFwd_OnClientProfileValidated; | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Plugin myinfo = | ||||
| { | ||||
| 	name        = "NoSteamDetection", | ||||
| 	author      = "zaCade", | ||||
| 	description = "Mark people as 'NoSteam' if their steam profiles are incorrect", | ||||
| 	version     = "1.0" | ||||
| }; | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public APLRes AskPluginLoad2(Handle myself, bool late, char [] error, int err_max) | ||||
| { | ||||
| 	CreateNative("IsClientProfileValid",     Native_IsClientProfileValid); | ||||
| 	CreateNative("IsClientProfileValidated", Native_IsClientProfileValidated); | ||||
| 
 | ||||
| 	RegPluginLibrary("NoSteamDetection"); | ||||
| 	return APLRes_Success; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnPluginStart() | ||||
| { | ||||
| 	g_hFwd_OnClientProfileValidated = CreateGlobalForward("OnClientProfileValidated", ET_Ignore, Param_Cell, Param_Cell); | ||||
| 
 | ||||
| 	for(int client = 1; client <= MaxClients; client++) | ||||
| 	{ | ||||
| 		if(IsValidClient(client) && IsClientAuthorized(client)) | ||||
| 			OnClientAuthorized(client, ""); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientAuthorized(int client, const char[] auth) | ||||
| { | ||||
| 	char sSteam64ID[32]; | ||||
| 	GetClientAuthId(client, AuthId_SteamID64, sSteam64ID, sizeof(sSteam64ID)); | ||||
| 
 | ||||
| 	char sRequest[256]; | ||||
| 	Format(sRequest, sizeof(sRequest), "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=%s&steamids=%s&format=vdf", STEAM_API_KEY, sSteam64ID); | ||||
| 
 | ||||
| 	Handle hRequest = SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET, sRequest); | ||||
| 	if (!hRequest || | ||||
| 		!SteamWorks_SetHTTPCallbacks(hRequest, OnClientAuthorized_OnTransferComplete) || | ||||
| 		!SteamWorks_SetHTTPRequestContextValue(hRequest, GetClientSerial(client)) || | ||||
| 		!SteamWorks_SendHTTPRequest(hRequest)) | ||||
| 	{ | ||||
| 		delete hRequest; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public int OnClientAuthorized_OnTransferComplete(Handle hRequest, bool bFailure, bool bSuccessful, EHTTPStatusCode eStatusCode, int serial) | ||||
| { | ||||
| 	if (bFailure || !bSuccessful || eStatusCode != k_EHTTPStatusCode200OK) | ||||
| 	{ | ||||
| 		delete hRequest; | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	SteamWorks_GetHTTPResponseBodyCallback(hRequest, OnClientAuthorized_OnTransferResponse, serial); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public int OnClientAuthorized_OnTransferResponse(char[] sData, int serial) | ||||
| { | ||||
| 	int client; | ||||
| 	if ((client = GetClientFromSerial(serial)) == 0) | ||||
| 		return; | ||||
| 
 | ||||
| 	KeyValues Response = new KeyValues("SteamAPIResponse"); | ||||
| 
 | ||||
| 	if(!Response.ImportFromString(sData, "SteamAPIResponse")) | ||||
| 	{ | ||||
| 		OnClientAuthorized_FinishCall(client, false); | ||||
| 		delete Response; | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	if(!Response.JumpToKey("players")) | ||||
| 	{ | ||||
| 		OnClientAuthorized_FinishCall(client, false); | ||||
| 		delete Response; | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	if(!Response.GotoFirstSubKey()) | ||||
| 	{ | ||||
| 		OnClientAuthorized_FinishCall(client, false); | ||||
| 		delete Response; | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	if ((Response.GetNum("profilestate")) == 0) | ||||
| 	{ | ||||
| 		OnClientAuthorized_FinishCall(client, false); | ||||
| 		delete Response; | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	OnClientAuthorized_FinishCall(client, true); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientAuthorized_FinishCall(int client, bool valid) | ||||
| { | ||||
| 	g_bValid[client]     = valid; | ||||
| 	g_bValidated[client] = true; | ||||
| 
 | ||||
| 	Call_StartForward(g_hFwd_OnClientProfileValidated); | ||||
| 	Call_PushCell(client); | ||||
| 	Call_PushCell(valid); | ||||
| 	Call_Finish(); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientDisconnect(int client) | ||||
| { | ||||
| 	g_bValid[client]     = false; | ||||
| 	g_bValidated[client] = false; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public int Native_IsClientProfileValid(Handle hPlugin, int numParams) | ||||
| { | ||||
| 	int client = GetNativeCell(1); | ||||
| 
 | ||||
| 	if (!IsValidClient(client)) | ||||
| 		return false; | ||||
| 
 | ||||
| 	return g_bValid[client]; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public int Native_IsClientProfileValidated(Handle hPlugin, int numParams) | ||||
| { | ||||
| 	int client = GetNativeCell(1); | ||||
| 
 | ||||
| 	if (!IsValidClient(client)) | ||||
| 		return false; | ||||
| 
 | ||||
| 	return g_bValidated[client]; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public bool IsValidClient(int client) | ||||
| { | ||||
| 	if (client < 0) | ||||
| 		return false; | ||||
| 
 | ||||
| 	if (client > GetMaxClients()) | ||||
| 		return false; | ||||
| 
 | ||||
| 	return true; | ||||
| } | ||||
| @ -1,11 +0,0 @@ | ||||
| #if defined NoSteamDetection_included
 | ||||
| 	#endinput
 | ||||
| #endif
 | ||||
| 
 | ||||
| #define NoSteamDetection_included
 | ||||
| 
 | ||||
| native bool IsClientProfileValid(int client); | ||||
| 
 | ||||
| native bool IsClientProfileValidated(int client); | ||||
| 
 | ||||
| forward void OnClientProfileValidated(int client, bool valid); | ||||
| @ -1,154 +0,0 @@ | ||||
| #pragma semicolon 1 | ||||
| 
 | ||||
| #include <sourcemod> | ||||
| #include <basecomm> | ||||
| #include <NoSteamDetection> | ||||
| 
 | ||||
| #pragma newdecls required | ||||
| 
 | ||||
| /* CONVARS */ | ||||
| ConVar g_hCvar_BlockAdmin; | ||||
| ConVar g_hCvar_BlockVoice; | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Plugin myinfo = | ||||
| { | ||||
| 	name         = "NoSteamManager", | ||||
| 	author       = "zaCade", | ||||
| 	description  = "Manage No-Steam clients, denying admin access, ect.", | ||||
| 	version      = "1.0.0" | ||||
| }; | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnPluginStart() | ||||
| { | ||||
| 	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); | ||||
| 
 | ||||
| 	AddMultiTargetFilter("@steam", Filter_Steam, "Steam Players", false); | ||||
| 	AddMultiTargetFilter("@nosteam", Filter_NoSteam, "No-Steam Players", false); | ||||
| 
 | ||||
| 	RegConsoleCmd("sm_nosteam", Command_DisplaySteamStats, "Shows the number of Steam and No-Steam players"); | ||||
| 	RegConsoleCmd("sm_steam", Command_DisplaySteamStats, "Shows the number of Steam and No-Steam players"); | ||||
| 
 | ||||
| 	AutoExecConfig(); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnPluginEnd() | ||||
| { | ||||
| 	RemoveMultiTargetFilter("@steam", Filter_Steam); | ||||
| 	RemoveMultiTargetFilter("@nosteam", Filter_NoSteam); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Action Command_DisplaySteamStats(int client, int args) | ||||
| { | ||||
| 	char aBuf[1024]; | ||||
| 	char aBuf2[MAX_NAME_LENGTH]; | ||||
| 
 | ||||
| 	for(int i = 1; i <= MaxClients; i++) | ||||
| 	{ | ||||
| 		if(IsClientInGame(i) && !IsFakeClient(i)) | ||||
| 		{ | ||||
| 			if(IsClientProfileValidated(i) && !IsClientProfileValid(i)) | ||||
| 			{ | ||||
| 				GetClientName(i, aBuf2, sizeof(aBuf2)); | ||||
| 				StrCat(aBuf, sizeof(aBuf), aBuf2); | ||||
| 				StrCat(aBuf, sizeof(aBuf), ", "); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	if(strlen(aBuf)) | ||||
| 	{ | ||||
| 		aBuf[strlen(aBuf) - 2] = 0; | ||||
| 		ReplyToCommand(client, "[SM] No-Steam clients online: %s", aBuf); | ||||
| 	} | ||||
| 	else | ||||
| 		ReplyToCommand(client, "[SM] No-Steam clients online: none"); | ||||
| 
 | ||||
| 	return Plugin_Handled; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public bool Filter_Steam(const char[] sPattern, Handle hClients) | ||||
| { | ||||
| 	for(int i = 1; i <= MaxClients; i++) | ||||
| 	{ | ||||
| 		if(IsClientInGame(i) && !IsFakeClient(i)) | ||||
| 		{ | ||||
| 			if(IsClientProfileValidated(i) && IsClientProfileValid(i)) | ||||
| 				PushArrayCell(hClients, i); | ||||
| 		} | ||||
| 	} | ||||
| 	return true; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public bool Filter_NoSteam(const char[] sPattern, Handle hClients) | ||||
| { | ||||
| 	for(int i = 1; i <= MaxClients; i++) | ||||
| 	{ | ||||
| 		if(IsClientInGame(i) && !IsFakeClient(i)) | ||||
| 		{ | ||||
| 			if(IsClientProfileValidated(i) && !IsClientProfileValid(i)) | ||||
| 				PushArrayCell(hClients, i); | ||||
| 		} | ||||
| 	} | ||||
| 	return true; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Action OnClientPreAdminCheck(int client) | ||||
| { | ||||
| 	if(!g_hCvar_BlockAdmin.BoolValue) | ||||
| 		return Plugin_Continue; | ||||
| 
 | ||||
| 	if(IsFakeClient(client) || IsClientSourceTV(client)) | ||||
| 		return Plugin_Continue; | ||||
| 
 | ||||
| 	if(IsClientProfileValidated(client) && !IsClientProfileValid(client)) | ||||
| 	{ | ||||
| 		LogMessage("%L did not have a valid profile, denying admin.", client); | ||||
| 		NotifyPostAdminCheck(client); | ||||
| 
 | ||||
| 		return Plugin_Handled; | ||||
| 	} | ||||
| 
 | ||||
| 	return Plugin_Continue; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientPostAdminCheck(int client) | ||||
| { | ||||
| 	if(!g_hCvar_BlockVoice.BoolValue) | ||||
| 		return; | ||||
| 
 | ||||
| 	if(IsFakeClient(client) || IsClientSourceTV(client)) | ||||
| 		return; | ||||
| 
 | ||||
| 	if(IsClientProfileValidated(client) && !IsClientProfileValid(client)) | ||||
| 	{ | ||||
| 		LogMessage("%L did not have a valid profile, muting client.", client); | ||||
| 		BaseComm_SetClientMute(client, true); | ||||
| 
 | ||||
| 		return; | ||||
| 	} | ||||
| } | ||||
| @ -1,127 +0,0 @@ | ||||
| #include <sourcemod> | ||||
| #include <SteamWorks> | ||||
| #include <NoSteamDetection> | ||||
| 
 | ||||
| #pragma semicolon 1 | ||||
| #pragma newdecls required | ||||
| 
 | ||||
| bool g_bHasFakeClient[MAXPLAYERS + 1] = {false,...}; | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Plugin myinfo = | ||||
| { | ||||
| 	name        = "NoSteamPlayerCount", | ||||
| 	author      = "Neon", | ||||
| 	description = "", | ||||
| 	version     = "1.0", | ||||
| 	url         = "https://steamcommunity.com/id/n3ontm" | ||||
| }; | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnGameFrame() | ||||
| { | ||||
| 	SteamWorks_SetMaxPlayers(65); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnPluginStart() | ||||
| { | ||||
| 	RegAdminCmd("sm_addfake", Command_AddFake, ADMFLAG_ROOT, ""); | ||||
| 	RegAdminCmd("sm_removefake", Command_RemoveFake, ADMFLAG_ROOT, ""); | ||||
| 	RegAdminCmd("sm_countfakes", Command_CountFakes, ADMFLAG_BAN, ""); | ||||
| 
 | ||||
| 	for(int client = 1; client <= MaxClients; client++) | ||||
| 	{ | ||||
| 		if(IsValidClient(client) && IsClientProfileValidated(client)) | ||||
| 			OnClientProfileValidated(client, false); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnPluginEnd() | ||||
| { | ||||
| 	for(int client = 1; client <= MaxClients; client++) | ||||
| 	{ | ||||
| 		if(IsValidClient(client)) | ||||
| 			OnClientDisconnect(client); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Action Command_AddFake(int client, int argc) | ||||
| { | ||||
| 	SteamWorks_CreateFake("Kaitou Sinbad"); | ||||
| 	return Plugin_Handled; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Action Command_RemoveFake(int client, int argc) | ||||
| { | ||||
| 	SteamWorks_KickFake(); | ||||
| 	return Plugin_Handled; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Action Command_CountFakes(int client, int argc) | ||||
| { | ||||
| 	int iFakes = SteamWorks_CountFakes(); | ||||
| 	ReplyToCommand(client, "There are currently %d Fake Clients active.", iFakes); | ||||
| 	return Plugin_Handled; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientProfileValidated(int client, bool valid) | ||||
| { | ||||
| 	char sName[128]; | ||||
| 	GetClientName(client, sName, sizeof(sName)); | ||||
| 
 | ||||
| 	if(!IsClientProfileValid(client)) | ||||
| 	{ | ||||
| 		int iFakeID = SteamWorks_CreateFake(sName); | ||||
| 		g_bHasFakeClient[client] = true; | ||||
| 		LogMessage("\"%L\" connected as NoSteam. Fake Client with ID: \"%d\" got created.", client, iFakeID); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientDisconnect(int client) | ||||
| { | ||||
| 	if (!g_bHasFakeClient[client]) | ||||
| 		return; | ||||
| 
 | ||||
| 	SteamWorks_KickFake(); | ||||
| 	g_bHasFakeClient[client] = false; | ||||
| 	LogMessage("\"%L\" left as NoSteam. Fake Client got removed.", client); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public bool IsValidClient(int client) | ||||
| { | ||||
| 	if (client <= 0) | ||||
| 		return false; | ||||
| 
 | ||||
| 	if (client > GetMaxClients()) | ||||
| 		return false; | ||||
| 
 | ||||
| 	return true; | ||||
| } | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,158 +0,0 @@ | ||||
| #include <sourcemod> | ||||
| #include <SteamWorks> | ||||
| #include <connect> | ||||
| 
 | ||||
| #pragma semicolon 1 | ||||
| #pragma newdecls required | ||||
| 
 | ||||
| bool g_bHasFakeClient[MAXPLAYERS + 1] = {false,...}; | ||||
| int g_MaxPlayers = 64; | ||||
| 
 | ||||
| ConVar g_hCVar_FakeClients; | ||||
| ConVar g_hCVar_SourceTV; | ||||
| ConVar g_hCVar_MaxPlayers; | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Plugin myinfo = | ||||
| { | ||||
| 	name        = "NoSteamPlayerCount", | ||||
| 	author      = "Neon", | ||||
| 	description = "", | ||||
| 	version     = "1.0", | ||||
| 	url         = "https://steamcommunity.com/id/n3ontm" | ||||
| }; | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnGameFrame() | ||||
| { | ||||
| 	SteamWorks_SetMaxPlayers(g_MaxPlayers); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnPluginStart() | ||||
| { | ||||
| 	g_hCVar_FakeClients = CreateConVar("sm_nosteamplayercount_fakeclients", "1", "Increse PlayerCount for Fake Clients", 0, true, 0.0, true, 1.0); | ||||
| 	g_hCVar_SourceTV = CreateConVar("sm_nosteamplayercount_sourcetv", "1", "Increse PlayerCount for SourceTV", 0, true, 0.0, true, 1.0); | ||||
| 	g_hCVar_MaxPlayers = CreateConVar("sm_nosteamplayercount_maxplayers", "64", "Max Players to display in the sv browser", 0, true, 1.0, true, 128.0); | ||||
| 
 | ||||
| 	g_hCVar_MaxPlayers.AddChangeHook(OnConVarChanged); | ||||
| 
 | ||||
| 	AutoExecConfig(true, "plugin.NoSteamPlayerCount"); | ||||
| 
 | ||||
| 	RegAdminCmd("sm_addfake", Command_AddFake, ADMFLAG_ROOT, ""); | ||||
| 	RegAdminCmd("sm_removefake", Command_RemoveFake, ADMFLAG_ROOT, ""); | ||||
| 	RegAdminCmd("sm_countfakes", Command_CountFakes, ADMFLAG_BAN, ""); | ||||
| 
 | ||||
| 	for(int client = 1; client <= MaxClients; client++) | ||||
| 	{ | ||||
| 		if(IsValidClient(client) && IsClientAuthorized(client)) | ||||
| 			OnClientAuthorized(client, ""); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnPluginEnd() | ||||
| { | ||||
| 	for(int client = 1; client <= MaxClients; client++) | ||||
| 	{ | ||||
| 		if(IsValidClient(client)) | ||||
| 			OnClientDisconnect(client); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue) | ||||
| { | ||||
| 	if(convar == g_hCVar_MaxPlayers) | ||||
| 		g_MaxPlayers = g_hCVar_MaxPlayers.IntValue; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Action Command_AddFake(int client, int argc) | ||||
| { | ||||
| 	SteamWorks_CreateFake("Kaitou Sinbad"); | ||||
| 	return Plugin_Handled; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Action Command_RemoveFake(int client, int argc) | ||||
| { | ||||
| 	SteamWorks_KickFake(); | ||||
| 	return Plugin_Handled; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public Action Command_CountFakes(int client, int argc) | ||||
| { | ||||
| 	int iFakes = SteamWorks_CountFakes(); | ||||
| 	ReplyToCommand(client, "There are currently %d Fake Clients active.", iFakes); | ||||
| 	return Plugin_Handled; | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientAuthorized(int client, const char[] auth) | ||||
| { | ||||
| 	if (IsClientSourceTV(client) && (!GetConVarBool(g_hCVar_SourceTV))) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (IsFakeClient(client) && (!GetConVarBool(g_hCVar_FakeClients))) | ||||
| 		return; | ||||
| 
 | ||||
| 	char sSteamID[32]; | ||||
| 	GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID)); | ||||
| 
 | ||||
| 	char sName[128]; | ||||
| 	GetClientName(client, sName, sizeof(sName)); | ||||
| 
 | ||||
| 	if(!SteamClientAuthenticated(sSteamID)) | ||||
| 	{ | ||||
| 		int iFakeID = SteamWorks_CreateFake(sName); | ||||
| 		g_bHasFakeClient[client] = true; | ||||
| 		LogMessage("\"%L\" connected as NoSteam. Fake Client with ID: \"%d\" got created.", client, iFakeID); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientDisconnect(int client) | ||||
| { | ||||
| 	if (!g_bHasFakeClient[client]) | ||||
| 		return; | ||||
| 
 | ||||
| 	SteamWorks_KickFake(); | ||||
| 	g_bHasFakeClient[client] = false; | ||||
| 	LogMessage("\"%L\" left as NoSteam. Fake Client got removed.", client); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public bool IsValidClient(int client) | ||||
| { | ||||
| 	if (client <= 0) | ||||
| 		return false; | ||||
| 
 | ||||
| 	if (client > GetMaxClients()) | ||||
| 		return false; | ||||
| 
 | ||||
| 	return true; | ||||
| } | ||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue
	
	Block a user