Page 1 of 1

API_DOCS: Lag info functions

Posted: Wed Jan 31, 2007 11:11 pm
by JeffM
I have added 3 new functions to the API to let a plugin get the lag info about a player. These functions are in 2.0.x and 2.1

Code: Select all

BZF_API int bz_getPlayerLag( int playerId );
returns the average lag value for a player. this is the same value as the on inside the playerRecord, just easier to get.

Code: Select all

BZF_API int bz_getPlayerJitter( int playerId );
returns the jitter value for a player.

Code: Select all

BZF_API floatbz_getPlayerPacketloss( int playerId );
returns the packetloss for a player as a percentage.

Version 2.1 also has the jitter and packetloss values added to the bz_BasePlayerRecord class as these members.

Code: Select all

	int jitter;
	float packetloss;
the changes are in CVS as of right now.

Posted: Sun Feb 11, 2007 2:44 pm
by ramires_pl
is possible to write the plugin which can kick jittered player for earlier version like 2.0.8 where there is no jitter warn?

Posted: Sun Feb 11, 2007 5:13 pm
by blast
ramires_pl wrote:is possible to write the plugin which can kick jittered player for earlier version like 2.0.8 where there is no jitter warn?
You would need a recent 2.0.9 version to use jitter stuff in the API anyway.

Posted: Sun Feb 11, 2007 5:24 pm
by ramires_pl
that exactly how i think :/

but if i have dump of jitter too it must be possible to kick them for jitter from plugin level.

Maybe i thinking wrong but for me its just action, example:
get lagstat / jitter shows too

calculate jitter
if($plugin_jitter_kick_max < $jitter) { kick callsign } else { do nothing }

i must to read careful API DOC for this

Posted: Sun Feb 11, 2007 7:00 pm
by blast
You can't do a jitter check using a plugin with 2.0.8 at all. The API doesn't know about jitter in that version. You would need to compile the latest v2_0branch from CVS.