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.