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

Editing Bz BasePlayerRecord

Jump to: navigation, search

Warning: The database has been locked for maintenance, so you will not be able to save your edits right now. You may wish to copy and paste your text into a text file and save it for later.

The administrator who locked it offered this explanation: Archived wiki

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 3: Line 3:
  
 
==Overview==
 
==Overview==
The '''bz_BasePlayerRecord''' is an API class that is provided to expose information about a connected player to the plug-in.
+
The '''bz_bz_BasePlayerRecord''' is an API class that is provided to expose information about a connected player to the plug-in.
  
 
==Data==
 
==Data==
Class bz_BasePlayerRecord has the following data members:
+
'''bz_BasePlayerRecord''' contains
  
; int version : The version number of this API class ;
+
  {| border="1" cellpadding="20" cellspacing="0"
; int playerID : The player ID for the player.
+
  !name
; [[bz_ApiString]] callsign : The username/callsign for the player.
+
  !type
; [[bz_eTeamType]] team : The team the player is currently on.
+
  !value desription
; float lastUpdateTime : The server time of the last player update
+
  |-
; [[bz_PlayerUpdateState]] lastKnownState : The state record that was last sent
+
  |version
; [[bz_PlayerUpdateState]] currentState (not in 2.4) : The predicted state at the current time, representing where the server and all remote users show the player at.
+
  |int
; [[bz_ApiString]] ipAddress : The Internet Protocol v4 address of the connected client
+
  |The version number of the record.
; [[bz_ApiString]] currentFlag : The flag code of the flag to give to the player. The [[Flag_Reference_in_Plugins|flag code format]] is a string that looks like "FLag (+FL)" Where letters that make up the flag abbreviation is capitalized. So for example, Narrow is Narrow and Wings is WinGs. The content in parenthesis include a + sign if the flag is a good flag or a - sign if the flag is a bad flag followed by the symbol of the flag. If no flag is being held, this parameter is simply an empty string. The actual values outputted by this member can also be clarified on the 5th & 6th pages of the "Help" section in-game.
+
  |-
; [[bz_APIStringList]] flagHistory : A list of strings representing the names of all the flags the player has held, in order from newest to oldest.
+
  |playerID    
; bool spawned : True if the user has spawned and is playing.
+
  |int
; bool verified : True if the user has authenticated with the login system. Comparable to a user having a "+" in the scoreboard.
+
  |The player ID for the player.
; 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.
+
  |callsign
; bool admin : Is true by default if user has the BAN permission. Sets the "@" sign.
+
  |[[bz_ApiString]]
; bool op : True if the user is identified as a server operator via /password
+
  |The username/callsign for the player.
; 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
+
  |email
; int lag : The user's current lag amount in milliseconds.
+
  |[[bz_ApiString]]
; int jitter : The user's current jitter amount in milliseconds.
+
  |The e-mail address provided by the user
; float packetloss : The user's current packet loss percentage.
+
  |-
; int wins : The number of kills the user has had.
+
  |team
; int losses : The number of deaths the user has had
+
  |[[bz_eTeamType]]
; int teamKills : The number of team mates the user has killed.
+
  |The team the player is currently on.
 +
  |-
 +
  |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.
 +
  |-
 +
  |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.
 +
  |-
 +
  |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;
  
===update===
+
void '''update''' ( void );
void update ( void );
+
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.
  
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.
  
==Removed Fields==
+
[[Category:BZFS_API_Docs]]
The email field was removed with version 2.4 since it was removed from the game and changed to "motto"
+
[[Category:BZFS_API_Class]]

Please note that all contributions to BZFlagWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BZFlagWiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Templates used on this page: