AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CS:GO] Ban By VAC (https://forums.alliedmods.net/showthread.php?t=309029)

adska 07-11-2018 02:20

[CS:GO] Ban By VAC
 
Hello, is it possible to catch an event when player on server is being banned by VAC? :roll:

Facksy 07-11-2018 04:51

Re: [CS:GO] Ban By VAC
 
Lel, I dont think so, what do you want to do?

Neuro Toxin 07-11-2018 05:18

Re: [CS:GO] Ban By VAC
 
I use a cookie system to track computers. So when an account becomes VACd all the other accounts with the same tracking cookie are banned.

Ilusion9 07-11-2018 13:15

Re: [CS:GO] Ban By VAC
 
Hook player_disconnect event and check the reason

PHP Code:


event
.GetString("reason"reasonsizeof(reason); 


midnight9 07-11-2018 16:15

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by Neuro Toxin (Post 2602870)
I use a cookie system to track computers. So when an account becomes VACd all the other accounts with the same tracking cookie are banned.

How exactly does it work?

Neuro Toxin 07-11-2018 19:15

Re: [CS:GO] Ban By VAC
 
Using the HTML MOTD. Use PHP to insert a tracking cookie.

adska 07-12-2018 04:52

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by Facksy (Post 2602866)
Lel, I dont think so, what do you want to do?

I want to do if player is banned by VAC then his account on my web would be frozen and he would not be able to do several actions.

Quote:

Originally Posted by Ilusion9 (Post 2602985)
Hook player_disconnect event and check the reason

PHP Code:


event
.GetString("reason"reasonsizeof(reason); 


It is a good idea, but what exactly should I check in that string?

mug1wara 07-12-2018 08:13

Re: [CS:GO] Ban By VAC
 
I don't understand why, but here you go

PHP Code:

#include <sourcemod>

public void OnPluginStart()
{
    
HookEvent("player_disconnect"Event_Disconnect);
}

public 
Action Event_Disconnect(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
char sReason[256];
    
    
GetEventString(hEvent"reason"sReasonsizeof(sReason));
    
    if (
StrEqual(sReason"VAC")) /* "VAC" is just an example, I don't know how it looks like while getting vac banned */
    
{
        
/* Do something here */
    
}



shavit 07-12-2018 09:05

Re: [CS:GO] Ban By VAC
 
iirc the message is "VAC banned from secure server"

Drixevel 07-12-2018 10:05

Re: [CS:GO] Ban By VAC
 
PHP Code:

#include <sourcemod> 

public void OnPluginStart() 

    
HookEvent("player_disconnect"Event_Disconnect); 


public 
void Event_Disconnect(Event event, const char[] namebool dontBroadcast

    
char sReason[256]; 
    
event.GetString("reason"sReasonsizeof(sReason)); 
     
    if (
StrContains(sReason"VAC") != -1)
    { 
        
//action
    



This makes more sense.

mug1wara 07-12-2018 10:25

Re: [CS:GO] Ban By VAC
 
Should've used StrContains, also:

if (StrContains(sReason, "VAC", false) != -1)

Bacardi 07-12-2018 16:34

Re: [CS:GO] Ban By VAC
 
hmmm. It was long time I had this kind plugin.
And I remember something that there is tiny differences with VAC message between windows and linux server...
I'm not 100% sure.

But last time I used this
*edit
And this works only when event player_disconnect happen. (VAC banned player try join in server or have been kicked by server.)

PHP Code:

if(StrEqual(reason"VAC banned from secure server\n"true)) 


adska 07-13-2018 02:40

Re: [CS:GO] Ban By VAC
 
Thanks all for solution :)

TheWhitesmith 07-14-2018 16:19

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by Drixevel (Post 2603138)
PHP Code:

#include <sourcemod> 

public void OnPluginStart() 

    
HookEvent("player_disconnect"Event_Disconnect); 


public 
void Event_Disconnect(Event event, const char[] namebool dontBroadcast

    
char sReason[256]; 
    
event.GetString("reason"sReasonsizeof(sReason)); 
     
    if (
StrContains(sReason"VAC") != -1)
    { 
        
//action
    



This makes more sense.

This is very wrong, people may get kicked by VAC but they aren't really VAC Banned.
Example: "Disconnect: VAC authentication error" (when you open Cheat Engine or Process Hacker 2 while playing on VAC-Protected server)

Drixevel 07-14-2018 16:32

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by TheWhitesmith (Post 2603633)
This is very wrong, people may get kicked by VAC but they aren't really VAC Banned.
Example: "Disconnect: VAC authentication error" (when you open Cheat Engine or Process Hacker 2 while playing on VAC-Protected server)

"Very wrong" might be an overreach but I see your point.

Visual77 07-15-2018 02:04

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by Drixevel (Post 2603634)
"Very wrong" might be an overreach but I see your point.

he's right about it being "very wrong". strequal should be used when the same word re-appears in different kick messages.

backwards 07-15-2018 02:49

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by Visual77 (Post 2603728)
he's right about it being "very wrong". strequal should be used when the same word re-appears in different kick messages.

Not exactly, he's still technically correct. it just requires more checks to work as intended. Just combined it with "StrContains" check for not containing "authentication" and other phrases associated with false VAC related disconnection issues.

DarkDeviL 07-15-2018 07:08

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by 1337norway (Post 2603730)
Just combined it with "StrContains" check for not containing "authentication" and other phrases associated with false VAC related disconnection issues.

Sounds very lousy, when you have the option do it "properly" like shown in Bacardi's example in Post #12.

The least you can do when making plugins, is try to do them right.

backwards 07-15-2018 07:32

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by arne1288 (Post 2603774)
Sounds very lousy, when you have the option do it "properly" like shown in Bacardi's example in Post #12.

The least you can do when making plugins, is try to do them right.

I wouldn't say it's "lousy" as that method Bacardi posted would break easily if the message string was slightly changed in the future. The dynamic way (my suggestion) would be more appropriate for the long term. It's ignorant to believe there's a "proper" way when it comes to something as contrasted as programming.

DarkDeviL 07-15-2018 07:42

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by 1337norway (Post 2603777)
I wouldn't say it's "lousy" as that method Bacardi posted would break easily if the message string was slightly changed in the future. The dynamic way (my suggestion) would be more appropriate for the long term. It's ignorant to believe there's a "proper" way when it comes to something as contrasted as programming.

Cutting corners and claiming to be "future proof", especially when you never know what happens in the future, and when it will lead to false positives; that is clearly "lousy".

The ignorant way, to take your word, would be check multiple StrEqual/StrContains, when you have the option right now to do it right and use one single, that wouldn't cause a single false positive.

You have some options and things available right now, those are the only things you can depend on at the time being. If things change in the future, you should adjust things at that time in the future.

A "Ban By VAC", to quote the title, is related to when a user is VAC banned, and NOT when there are anything else related to the VAC system, that isn't the exact ban.

Visual77 07-15-2018 07:49

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by 1337norway (Post 2603777)
I wouldn't say it's "lousy" as that method Bacardi posted would break easily if the message string was slightly changed in the future. The dynamic way (my suggestion) would be more appropriate for the long term. It's ignorant to believe there's a "proper" way when it comes to something as contrasted as programming.

it is lousy. valve never changes those kick messages. prolly been the same since vac was introduced i guess

backwards 07-15-2018 07:57

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by arne1288 (Post 2603780)
Cutting corners and attempting to be "future proof", especially when you never know what happens in the future, and when it may lead to false positives; that is clearly "lousy".

The ignorant way, to take your word, would be check multiple StrEqual/StrContains, when you have the option right now to do it right and use one single, that wouldn't cause a single false positive.

You have some options and things available right now, those are the only things you can depend on at the time being. If things change in the future, you should adjust things at that time in the future.

A "Ban By VAC", to quote the title, is related to when a user is VAC banned, and NOT when there are anything else related to the VAC system, that isn't the exact ban.

"cutting corners" implies that short cuts are taken to reduce the complexity of code in this situation. Obviously adding more code for separate checks would be the adverse of this. You are right, you never know what will happen in the future with updates. You don't know if they will change the string or introduce new strings which would make both scenarios equal. You'd have to come back and manipulate the program to account for these changes regardless. Adding multiple string checks wouldn't correlate to increased performance overhead in this case as the single longer string check would be even worse. You've made no valid logical statements for why one would be preferred over the other. It's clear you are upset over something here but attacking users on a public forum as an active moderator over disagreeing about programming choices is a bit ridiculous

Pelipoika 07-15-2018 08:18

Re: [CS:GO] Ban By VAC
 
Cheaters can use any disconnect message they wish to

DarkDeviL 07-15-2018 08:22

Re: [CS:GO] Ban By VAC
 
Quote:

Originally Posted by 1337norway (Post 2603786)
"cutting corners" implies that short cuts are taken to reduce the complexity of code in this situation. Obviously adding more code for separate checks would be the adverse of this. You are right, you never know what will happen in the future with updates. You don't know if they will change the string or introduce new strings which would make both scenarios equal. You'd have to come back and manipulate the program to account for these changes regardless. Adding multiple string checks wouldn't correlate to increased performance overhead in this case as the single longer string check would be even worse. You've made no valid logical statements for why one would be preferred over the other. It's clear you are upset over something here but attacking users on a public forum as an active moderator over disagreeing about programming choices is a bit ridiculous

And how come that cutting most of the phase away, before the check, isn't a "short cut" to you?

Kigen's anti cheat were failing after some Valve update in the past, causing false positives and thereby false bans. The lousy administrator of one of the servers where a such thing was happening, and were every single client was being banned, was once unwilling to "delete" the bans completely and remove the "ban history" .

In short words, it would be a matter of minutes to a couple of hours usually, before Google would know about the bans and list your Steam ID as being a previous offender by an anti cheat.

If, as you say, you do it with checking if "VAC" is in the phrase, and they will change it in the future, you will get innocent people banned from your way of doing it.

Using the full phase allows obviously requires future maintenance if that day will ever come, but is a simple phrase change, that will not cause any false positives.

- How would you personally feel, if your Steam profile had incorrect histories (that be, at third party sites), regarding VAC bans that you have never ever had? People may actually act on this!

If there is a reason for the ban, sure, go ahead, ...

Hitting innocents is NOT something I would be proud of, and while I have seen at least 3-4 VAC-related phrases, with only one of them being related to the exact ban, you're definitely going to end up hitting innocent people with your way of doing it.


There is, unfortunately, no ways to distinguish between "personal opinions" and "moderator opinions" form a moderator on any forums out there:

You're clearly misunderstanding my intentions with these messages, as they have never (neither as personal, nor as a moderator) been meant to be "attacking" you (or anyone else), but simply to help any people to make the code right.

backwards 07-15-2018 08:57

Re: [CS:GO] Ban By VAC
 
I do agree with you now after reading your response. I was under the impression that this would just be used to display a neat colorized message in chat and maybe a sound to make the banned player event more boldly defined. This was a really naive assumption. The concern of someone else using this "VAC" substring code for events to add bans to public databases like source bans would be a really bad idea. Anyone stumbling upon this thread for code snippet references should use the approach to scan the whole string to validate it's the correct message. Degrading someones name on a public forum due to incompetence of proper programming would be pretty bad. If it weren't for this factor i'd still disagree. That being stated I wouldn't trust a disconnect message as they can be customized with reasons for disconnection from the server. For this particular case of using the information provided to prevent the player from then using commands on a webpage would be a bad idea. For instance what if the player times out right before the vac ban is issued? Then the server wouldn't be notified. You should be handling this security check for vac bans on the webpages side by querying the steamids steam community page info.

Drixevel 07-15-2018 14:01

Re: [CS:GO] Ban By VAC
 
In my mind, being very wrong is code that doesn't work in the first place while unoptimal code tends to work but it can be better. I would have stated the original code with StrEqual would be better if the authentication error didn't pop up.

This thread turned into an elitist bloodbath pretty quickly.

adska 07-16-2018 02:10

Re: [CS:GO] Ban By VAC
 
I think to check "vac" and "ban" words in the message would be enough. If message contains these two words, it means player was banned by VAC.

Silvers 07-16-2018 13:22

Re: [CS:GO] Ban By VAC
 
What about future "VAC Unbanned" message? Nah I'm just joking. Sheesh :roll:


All times are GMT -4. The time now is 03:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.