Raised This Month: $51 Target: $400
 12% 

Blocking QueryClientConVar function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arg!
Veteran Member
Join Date: Jul 2008
Location: Australia
Old 07-23-2008 , 22:32   Blocking QueryClientConVar function
Reply With Quote #1

Is there an overload of QueryClientConVar that blocks rather than using the callback? I want to check a client cvar in an Action callback, and return Plugin_Handled or Plugin_Continue based on the results of the clients cvar and im currently failing to see how i can implement this pattern with the current function.
__________________
Arg! is offline
BAILOPAN
Join Date: Jan 2004
Old 07-24-2008 , 00:43   Re: Blocking QueryClientConVar function
Reply With Quote #2

What exactly are you trying to do? This is called when querying a client so there's nothing to block but other plugins getting the data.
__________________
egg
BAILOPAN is offline
Arg!
Veteran Member
Join Date: Jul 2008
Location: Australia
Old 07-24-2008 , 00:50   Re: Blocking QueryClientConVar function
Reply With Quote #3

i was trying to hook +voicerecord, then get the clients voice_inputfromfile all in the Action callback of the voicerecord hook. Then based on some logic, return Plugin_Handled to deny the use of the +voicerecord command (in effect, blocking HLSS) or Plugin_Continue to allow it.
I know theres a HLSS blocker or two out there, but i wanted to see if it could be done without having to poll the clients cvars on a timer, potentially reducing overhead.
As it turns out i havent been able to hook +voicerecord anyway so this may be a moot point.
__________________
Arg! is offline
BAILOPAN
Join Date: Jan 2004
Old 07-24-2008 , 01:40   Re: Blocking QueryClientConVar function
Reply With Quote #4

Indeed, anything with + is usually purely client-side. You can effectively mute the player using sdktools though, check out sdktools_voice.inc.
__________________
egg
BAILOPAN is offline
Arg!
Veteran Member
Join Date: Jul 2008
Location: Australia
Old 07-24-2008 , 02:27   Re: Blocking QueryClientConVar function
Reply With Quote #5

Indeed, that is maybe what i'll do. But i would like to find a game event that i can hook which only gets fired when a client sends voice audio to the server or similar.
__________________
Arg! is offline
Kigen
BANNED
Join Date: Feb 2008
Old 07-24-2008 , 04:33   Re: Blocking QueryClientConVar function
Reply With Quote #6

Voice related hooks/commands are done client-side and are never passed to the server so your "Action" command never gets to the server to be processed and as such you can't do that. I would like to point out that QueryClientConVar has to send a packet to the client and then receive a packet back, this cannot be done all in the same tick.

As far as HLSS and HLDJ spamming you can check out the following plugin.
http://forums.alliedmods.net/showthread.php?p=633905
Kigen is offline
Arg!
Veteran Member
Join Date: Jul 2008
Location: Australia
Old 07-24-2008 , 05:50   Re: Blocking QueryClientConVar function
Reply With Quote #7

yes, ive seen that plugin, im trying to work out how to do it without polling the client for changes. At some point their client must inform the server it is sending audio data, im hoping theres a hookable event, etc that i can use to detect this. I assume (could be a huge leap to assume this, not sure) that it would be cheaper to hook an already existing event, than it would to constantly send packets back to the client to determine if they are using HLSS.
And i can see why not doing the query in a blocking method would be dangerous, especially since sourcemod is not thread safe. I will look at a different way of implementing that if i can every work out the first part.
__________________
Arg! is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 07-24-2008 , 10:38   Re: Blocking QueryClientConVar function
Reply With Quote #8

You can still hook it though, can't you? I've seen +/- commands been hooked before with RegConsoleCmd, and even though you can't block it, you can still check when they press it, and then check their cvar.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-24-2008 , 13:28   Re: Blocking QueryClientConVar function
Reply With Quote #9

Curious, what +/- commands have you hooked?
__________________
Greyscale is offline
BAILOPAN
Join Date: Jan 2004
Old 07-25-2008 , 23:15   Re: Blocking QueryClientConVar function
Reply With Quote #10

You can create your own +/- commands as long as the client doesn't use the same command.
__________________
egg
BAILOPAN is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:08.


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