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

Access to QueryClientCvarValue() or an analogous function


Post New Thread Reply   
 
Thread Tools Display Modes
BAILOPAN
Join Date: Jan 2004
Old 08-28-2005 , 06:00  
Reply With Quote #21

Hrm... I just don't like the idea of registering a new callback for each function. IIRC, registerForward will just alloc new memory for each function, even if it has the same name.

how about something like... register_cvarhandler() ?
__________________
egg
BAILOPAN is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 08-30-2005 , 10:45  
Reply With Quote #22

http://www.tcwonline.org/cgi-bin/vie...viewcvs-markup

Check out registerSPForward:
Code:
	int retVal = -1;
	CSPForward *pForward;
	if (!m_FreeSPForwards.empty())
	{
		retVal = m_FreeSPForwards.front();
		pForward = m_SPForwards[retVal >> 1];
		pForward->Set(func, amx, numParams, paramTypes);
		if (pForward->getFuncsNum() == 0)
			return -1;
		m_FreeSPForwards.pop();
	}
Creating and deleting many sp forwards should not be a performance problem, I have written them with that use in mind.

Anyway... I have written a client cvar query stress test metamod plugin.

The attached .zip file contains the source file and the VC++ 7.1 project file.

This metamod plugin sends a lot of queries for each player and checks the responses. The used cvars are aliased to minimise the chances that one of them changes while testing, so I have picked cvars I have never really used.

bgmbuffer
cl_burnrate
cl_burntime
cl_reloadefx
cl_slist
cl_vsmoothing
gl_zmax
gl_alphamin
joyadvaxisrcl_clockreset
r_mirroralpha
voice_overdrivefadetime

After aliasing, the plugin checks them one at a time, and stores the values. Then it goes to stress testing, which means sending a lot of queries and comparing the responses to the stored values.

Some logging is done in moddir/clcvqry (one logfile per day). The plugin creates the directory if it doesn't exist. All important entries are marked with !!!!, if there is no !!!! in the logfiles it means that everything went ok.

The cvar ccqst_qrate specifies how many queries per second should be sent for each player.

Netgraph traffic on my listenserver:
Code:
ccqst_qrate | traffic in k/s
          0 |  2.19
          5 |  2.22
         10 |  2.27
         20 |  2.36
         30 |  2.45
        100 |  3.10
        200 |  3.9
        400 |  4.8
        800 |  9.4
       1600 | 16.7
       3200 | 31.9
       4500 | 42.8
       6400 | 50+ -> reliable channel overflow
I haven't tried to compile this on linux because for some reason my suse install doesn't boot (kernel panic, can't mount root filesystem), I'll fix it when I get home.

As you can see, running this test on my listen server won't give usable results, so I'd be really happy if someone could run it on a busier server and set ccqst_qrate to a pretty high rate and then post the logfiles (zipped, also post the ccqst_qrate you have used).

Well, I've said enough, a huge amount of rodents helped me with this, goodnight.

EDIT: Attached the .cpp file in case you only want to read it without using WinZip or whatever

EDIT2: Please don't run this with any other plugins using cvar querying at a time.
Attached Files
File Type: zip clcvqry_stresstest.zip (6.8 KB, 78 views)
File Type: cpp clcvqry_stresstest.cpp (17.1 KB, 146 views)
__________________
hello, i am pm
PM is offline
BAILOPAN
Join Date: Jan 2004
Old 08-30-2005 , 11:48  
Reply With Quote #23

Ahh, sorry, I didn't see that you unregistered the forward after ;] (in fact it was stupid of me to assume you didn't). It'll go into 1.56 then.

Just a question: can this stress test a constant stream of queries over time? For example, obviously 6,400 cvars per second is terrible, but I wonder what sort of traffic would be generated, with say, 35 queries per client every 5 seconds...
__________________
egg
BAILOPAN is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 08-30-2005 , 11:57  
Reply With Quote #24

Quote:
Originally Posted by BAILOPAN
Ahh, sorry, I didn't see that you unregistered the forward after ;] (in fact it was stupid of me to assume you didn't). It'll go into 1.56 then.

Just a question: can this stress test a constant stream of queries over time? For example, obviously 6,400 cvars per second is terrible, but I wonder what sort of traffic would be generated, with say, 35 queries per client every 5 seconds...
The plugin can't do that at the moment...

Anyway, in my tests, no queries resulted in 2.19 k/s input traffic on the client; and 30 queries per second were at 2.45 k/s.

So sending 30 queries to one client at a time will be something like a one-time 0.26 k(bits? or is it bytes?) upload.

You should probably send random queries in random intervals in real-life applications.
__________________
hello, i am pm
PM is offline
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-06-2005 , 06:56  
Reply With Quote #25

Here we go:
http://amxmodx.org/funcwiki.php?go=func&id=854

This function will be available in the next AMX Mod X release.

zomg my newest codeses use this.
http://www.tcwonline.org/cgi-bin/vie...viewcvs-markup
__________________
hello, i am pm
PM 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 07:04.


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