View Full Version : checkup for vac(valveanticheat) has loaded/is active
ghzero
10-12-2007, 03:34 AM
hello,
can anybody tell me an solve for check (safely) if VAC ist loaded(active) on the current server on that an plugin is runnin' ?!
FeuerSturm
10-12-2007, 01:09 PM
the server variable "secure" tell you if VAC is running or not
(1 = VAC ; 0 = not VAC secured)
i never tried to retrieve the value of that variable so i'm not sure
if it's possible at all.
if i get some time i'll try it, if not i'm curious if you tried and had success.
diamond-optic
10-12-2007, 08:10 PM
pretty sure 'secure' doesnt actually exist as a cvar.. try it in hlsw rcon.. it doesnt do anything
only place i can think of that shows if its secure or not in the console is the status command.. maybe get all that data (or just part of it) and check if it contains secure or insecure (or whatever status command shows for an insecure server)
*EDIT*
ok i just threw this together.. seems to work when i try it on a local server..
typing amx_checkvac should print in your chat if vac is enabled or disabled.. so this might actually be a method you could use to get its status
#include <amxmodx>
#define VERSION "1.0"
public plugin_init()
{
register_plugin("Check VAC",VERSION,"diamond-optic")
register_cvar("amx_checkvac_stats",VERSION,FCVAR_SERVER|FCVAR_SPONLY)
register_concmd("amx_checkvac","amx_checkvac",0,"- Check if VAC is enabled")
}
public amx_checkvac(id)
{
new data[512] //register the variable
get_cvar_string("status",data,511) //get what the status cmd says
if(containi(data,"insecure")) //check if its insecure first
client_print(id,print_chat,"VAC DISABLED!")
else if(containi(data,"secure")) //then check if its secure
client_print(id,print_chat,"VAC ENABLED!")
else //it didnt get either
client_print(id,print_chat,"VAC STATUS UNKNOWN")
return PLUGIN_HANDLED //end the command
}
*edit* ^ that code doesnt work :(
diamond-optic
10-12-2007, 09:29 PM
actually NEVERMIND!
lol that is saying VAC is disabled even when it is a secure server..
idk if its just me but i cant seem to get the contain (or containi) natives to work right..
i just tried using it in a different plugin to check a line in an ini file and whether it contains what im looking for or not it always returns that it did.. what gives here lol
*EDIT*
ok lol guess i was using contain wrong, as it returns -1 on failure and not 0.. but that still doesnt make it work, so im guessing that reading status as a cvar doesnt work lol, which i figured as much to begin with.. so ya nevermind again lol
ghzero
10-12-2007, 09:59 PM
actually NEVERMIND!
lol that is saying VAC is disabled even when it is a secure server..
idk if its just me but i cant seem to get the contain (or containi) natives to work right..
i just tried using it in a different plugin to check a line in an ini file and whether it contains what im looking for or not it always returns that it did.. what gives here lol
*EDIT*
ok lol guess i was using contain wrong, as it returns -1 on failure and not 0.. but that still doesnt make it work, so im guessing that reading status as a cvar doesnt work lol, which i figured as much to begin with.. so ya nevermind again lol
(first thank you all for helping!)
...reason for desfunction can be:
vac will be loaded after a break of seconds the mapchange/startup has done...not from plugin_init-time !! so it needs an set_task with maybe 5 seconds to check that. but the problem will be that you script can check that, but it is not safe enough ..this means...an player can name "SecuredKiller" an your script found the word secure... and an name of "InsecuredMonster" can kick that check to fail...
..maybe the result of "status" must be cutted from:
status
hostname: - DOD Server
version : 47/1.1.2.5/Stdio 3651 secure
tcp/ip : 84.16.2XX.1XX:28100
map : dod_flugplatz at: 0 x, 0 y, 0 z
players : 5 active (18 max)
# name userid uniqueid frag time ping loss adr
# 1 "Smok3" 1380 UNKNOWN 14 30:05:38 0 0
# 2 "phobos" 1381 UNKNOWN 15 30:05:38 0 0
# 3 "Ronin Marmot" 1382 UNKNOWN 16 30:05:38 0 0
# 4 "-CARDIAC-" 1383 UNKNOWN 12 30:05:38 0 0
# 5 "vittu" 1384 UNKNOWN 9 30:05:38 0 0
5 users
to a safe collection of it like:
version : 47/1.1.2.5/Stdio 3651 secure
only the version-line can help out to check this safely.. but I dont know how to cutting the string in sma-style in php4/5 we can search for the string between the X linefeed and the Y linefeed to cut the version line ...
diamond-optic
10-12-2007, 10:20 PM
ya i cant think of a way of using a plugin to get the data printed by the status command..
if theres a way to do it and get each individual like or check if the line starts with # then it would probably work.. but i did think bout the name thing.. but i figured it would see the real secure/insecure 1st and check that and once it does that once have it end..
*edit*
game-monitor.com is able to get if its secure or not when you look at a servers variable list
ghzero
10-12-2007, 11:56 PM
ya i cant think of a way of using a plugin to get the data printed by the status command..
if theres a way to do it and get each individual like or check if the line starts with # then it would probably work.. but i did think bout the name thing.. but i figured it would see the real secure/insecure 1st and check that and once it does that once have it end..
a question pls .. is it not possible to send serverconsole-command and get the result back ?! if not, the only way will be to query the own server from the server himself (lol) for the serverstatus what an fat workaround and large code will be to get that simple info. another nice solve for that problem can be an dynamic php -site created to query an serveraddress to give back the secure-status ..the plugin must only open that hhtp-link(incl.address:ip) to "read" his own secure-status.
ghzero
10-13-2007, 01:01 AM
game-monitor.com is able to get if its secure or not when you look at a servers variable list
game-monitor.com has a internal coded flodding/firewall for requests - so if an ip make many requests that website stops delivery. and game-monitor is sometimes very slow.. that slows down the pluginworking..
I'm goin to use that way now:
-coding phpsite(soap) for check the status of secure
-amxmodx: using sockets for call the phpsite
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.