API_DOCS: Lag info functions

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

API_DOCS: Lag info functions

Post 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.
ImageJeffM
User avatar
ramires_pl
Private First Class
Private First Class
Posts: 46
Joined: Tue May 02, 2006 3:15 am
Location: Europe, Poland, Gliwice
Contact:

Post 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?
--
ramires
owner of bzflag.pl servers
@admin on some maps :)
Polish BZFlag forum, maps, tutorials and more
Polish MyApple e-store in devel version - Suggestions on pm
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post 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.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
ramires_pl
Private First Class
Private First Class
Posts: 46
Joined: Tue May 02, 2006 3:15 am
Location: Europe, Poland, Gliwice
Contact:

Post 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
--
ramires
owner of bzflag.pl servers
@admin on some maps :)
Polish BZFlag forum, maps, tutorials and more
Polish MyApple e-store in devel version - Suggestions on pm
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post 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.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
Post Reply