This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Bz BasePlayerRecord"

From BZFlagWiki
Jump to: navigation, search
(Methods)
(prettify, spelling)
Line 6: Line 6:
  
 
==Data==
 
==Data==
'''bz_BasePlayerRecord''' contains
+
Class bz_BasePlayerRecord has the following data members:
  
  {| border="1" cellpadding="20" cellspacing="0"
+
; int version : The version number of this API class ;
  !name
+
; int playerID : The player ID for the player.
  !type
+
; [[bz_ApiString]] callsign : The username/callsign for the player.
  !value desription
+
; [[bz_ApiString]] email : The e-mail string provided by the user
  |-
+
; [[bz_eTeamType]] team : The team the player is currently on.
  |version
+
; float lastUpdateTime : The server time of the last player update
  |int
+
; [[bz_PlayerUpdateState]] lastKnownState : The state record that was last sent
  |The version number of the record.
+
; [[bz_PlayerUpdateState]] currentState : The predicted state at the current time, representing where the server and all remote users show the player at.
  |-
+
; [[bz_ApiString]] ipAddress : The Internet Protocol v4 address of the connected client
  |playerID    
+
; [[bz_ApiString]] currentFlag : The one- or two-character name of the current flag the player is holding, or blank if no flag.
  |int
+
; [[bz_APIStringList]] flagHistory : A list of strings representing the names of all the flags the player has held, in order from newest to oldest.
  |The player ID for the player.
+
; bool spawned : True if the user has spawned and is playing.
  |-
+
; bool verified : True if the user has authenticated with the login system. Comparable to a user having a "+" in the scoreboard.
  |callsign
+
; bool globalUser : True if the user name was authenticated using the global login system as opposed to a local one.
  |[[bz_ApiString]]
+
; [[bz_ApiString]] bzID : The globally unique ID for authenticated users.
  |The username/callsign for the player.
+
; bool admin : Is true by default if user has the BAN permission. Sets the "@" sign.
  |-
+
; bool op : True if the user is identified as a server operator via /password
  |email
+
; bool canSpawn : True if the user has permissions to spawn (BZFlag 2.99).
  |[[bz_ApiString]]
+
; [[bz_APIStringList]] groups : The list of groups the user is a member of
  |The e-mail address provided by the user
+
; int lag : The user's current lag amount in milliseconds.
  |-
+
; int jitter : The user's current jitter amount in milliseconds.
  |team
+
; float packetloss : The user's current packet loss percentage.
  |[[bz_eTeamType]]
+
; int wins : The number of kills the user has had.
  |The team the player is currently on.
+
; int losses : The number of deaths the user has had
  |-
+
; int teamkills : The number of team mates the user has killed.
  |lastUpdateTime
+
  |float
+
  |The server time of the last player update
+
  |-
+
  |lastKnownState
+
  |[[bz_PlayerUpdateState]]
+
  |The state record that was last sent
+
  |-
+
  |currentState
+
  |[[bz_PlayerUpdateState]]
+
  |The predicted state at the current time, representing where the server and all remote users show the player at.
+
  |-
+
  |ipAddress
+
  |[[bz_ApiString]]
+
  |The internet protocols version 4 address of the user.
+
  |-
+
  |currentFlag
+
  |[[bz_ApiString]]
+
  |The name of the current flag the player is holding. This will be empty if the player has no flag.
+
  |-
+
  |flagHistory
+
  |[[bz_APIStringList]]
+
  |A list of strings representing the names of all the flags the player has held, in order from newest to oldest.
+
  |-
+
  |spawned
+
  |bool
+
  |True if the user has spawned and is playing.
+
  |-
+
  |verified
+
  |bool
+
  |True if the user has authenticated with the login system. Comparable to a user having a "+" in the scoreboard.
+
  |-
+
  |globalUser
+
  |bool
+
  |True if the user name was authenticated using the global login system as opposed to a local one.
+
  |-
+
  |bzID
+
  |[[bz_ApiString]]
+
  |The globally unique ID for authenticated users.
+
  |-
+
  |admin
+
  |bool
+
  |True if the user has kick and ban permissions.
+
  |-
+
  |op
+
  |bool
+
  |True if the user is identified as a server operator.
+
  |-
+
  |canSpawn
+
  |bool
+
  |True if the user has permisions to spawn.
+
  |-
+
  |groups
+
  |[[bz_APIStringList]]
+
  |The list of groups the user is a member of
+
  |-
+
  |lag
+
  |int
+
  |The user's current lag amount in milliseconds.
+
  |-
+
  |jitter
+
  |int
+
  |The user's current jitter amount in milliseconds.
+
  |-
+
  |packetloss
+
  |float
+
  |The user's current packet loss percentage.
+
  |-
+
  |wins
+
  |int
+
  |The number of kills the user has had.
+
  |-
+
  |losses
+
  |int
+
  |The number of deaths the user has had
+
  |-
+
  |teamkills
+
  |int
+
  |The number of team mates the user has killed.
+
|}
+
  
 
==Methods==
 
==Methods==
 
The class provides a number of methods for various utility functions;
 
The class provides a number of methods for various utility functions;
  
void '''update''' ( void );
+
===update===
This method will update the player record with the most current data. This is usefull if a plug-in stores the pointer to the class and wishes to use it with current data.
+
void update ( void );
  
 +
This method will update the player record with the most current data. This is usefully if a plug-in stores the pointer to the class and wishes to use it with current data.
 +
 +
===hasPerm===
 +
bool hasPerm ( const char* perm );
  
bool '''hasPerm''' ( const char* perm );
 
 
This method will return true if the user has the permission with the specified name.
 
This method will return true if the user has the permission with the specified name.
  
 +
===grantPerm===
 +
bool grantPerm ( const char* perm );
  
bool '''grantPerm''' ( const char* perm );
 
 
This method will give the user the permission with the specified name, and return true if the operation was successful.
 
This method will give the user the permission with the specified name, and return true if the operation was successful.
  
 +
===revokePerm===
 +
bool revokePerm ( const char* perm );
  
bool '''revokePerm''' ( const char* perm );
 
 
This method will remove the user the permission with the specified name, and return true if the operation was successful.
 
This method will remove the user the permission with the specified name, and return true if the operation was successful.
  
 
==Uses==
 
==Uses==
 
This class is returned by a number of API functions and events. This class is used any time player specific data is requested.
 
This class is returned by a number of API functions and events. This class is used any time player specific data is requested.
 
[[Category:BZFS_API_Docs]]
 
[[Category:BZFS_API_Class]]
 

Revision as of 04:05, 31 May 2008

BZFS API Documentation This page contains part of the BZFS API documentation for use by Plug-ins on the BZFS server.

BZFS Class. This page documents a BZFS API class that is defined by the game server API. Plug-ins receive various classes in able to retrieve information about players and the game state from the server.


Overview

The bz_bz_BasePlayerRecord is an API class that is provided to expose information about a connected player to the plug-in.

Data

Class bz_BasePlayerRecord has the following data members:

int version 
The version number of this API class ;
int playerID 
The player ID for the player.
bz_ApiString callsign 
The username/callsign for the player.
bz_ApiString email 
The e-mail string provided by the user
bz_eTeamType team 
The team the player is currently on.
float lastUpdateTime 
The server time of the last player update
bz_PlayerUpdateState lastKnownState 
The state record that was last sent
bz_PlayerUpdateState currentState 
The predicted state at the current time, representing where the server and all remote users show the player at.
bz_ApiString ipAddress 
The Internet Protocol v4 address of the connected client
bz_ApiString currentFlag 
The one- or two-character name of the current flag the player is holding, or blank if no flag.
bz_APIStringList flagHistory 
A list of strings representing the names of all the flags the player has held, in order from newest to oldest.
bool spawned 
True if the user has spawned and is playing.
bool verified 
True if the user has authenticated with the login system. Comparable to a user having a "+" in the scoreboard.
bool globalUser 
True if the user name was authenticated using the global login system as opposed to a local one.
bz_ApiString bzID 
The globally unique ID for authenticated users.
bool admin 
Is true by default if user has the BAN permission. Sets the "@" sign.
bool op 
True if the user is identified as a server operator via /password
bool canSpawn 
True if the user has permissions to spawn (BZFlag 2.99).
bz_APIStringList groups 
The list of groups the user is a member of
int lag 
The user's current lag amount in milliseconds.
int jitter 
The user's current jitter amount in milliseconds.
float packetloss 
The user's current packet loss percentage.
int wins 
The number of kills the user has had.
int losses 
The number of deaths the user has had
int teamkills 
The number of team mates the user has killed.

Methods

The class provides a number of methods for various utility functions;

update

void update ( void );

This method will update the player record with the most current data. This is usefully if a plug-in stores the pointer to the class and wishes to use it with current data.

hasPerm

bool hasPerm ( const char* perm );

This method will return true if the user has the permission with the specified name.

grantPerm

bool grantPerm ( const char* perm );

This method will give the user the permission with the specified name, and return true if the operation was successful.

revokePerm

bool revokePerm ( const char* perm );

This method will remove the user the permission with the specified name, and return true if the operation was successful.

Uses

This class is returned by a number of API functions and events. This class is used any time player specific data is requested.