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

Difference between revisions of "Bz eAllowPlayer"

From BZFlagWiki
Jump to: navigation, search
(New page: {{BZFS_API_Doc}} {{BZFS_API_Events}} {{API_Docs_that_need_work}} ==Overview== The '''bz_eAllowPlayer''' is an API event that is called each time a player joins to allow a plug-in to overr...)
 
m (typo fix)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{BZFS_API_Doc}}
 
{{BZFS_API_Doc}}
 
{{BZFS_API_Events}}
 
{{BZFS_API_Events}}
{{API_Docs_that_need_work}}
 
  
 
==Overview==
 
==Overview==
The '''bz_eAllowPlayer''' is an API event that is called each time a player joins to allow a plug-in to override the servers allow or deny choice.
+
The '''bz_eAllowPlayer''' is an API event that is called each time a player connects to the server. This event is called after all internal allow/deny logic.  
 +
 
 
==Data==
 
==Data==
 
'''bz_eAllowPlayer''' returns the '''bz_AllowPlayerEventData_V1''' data class.
 
'''bz_eAllowPlayer''' returns the '''bz_AllowPlayerEventData_V1''' data class.
Line 19: Line 19:
 
   |playerID
 
   |playerID
 
   |int
 
   |int
   |Each client has a player ID, even if that client is not yet in the game yet. This way, every client can be identified using an integer value.
+
   |This value is the player ID for the joining player.
 
   |-
 
   |-
 
   |callsign
 
   |callsign
 
   |[[bz_ApiString]]
 
   |[[bz_ApiString]]
   |The player's callsign
+
   |This value is the callsign for the player.
 
   |-
 
   |-
 
   |ipAddress
 
   |ipAddress
 
   |[[bz_ApiString]]
 
   |[[bz_ApiString]]
   |The IP address of the client which is trying to get into the game
+
   |This value is the IPv4 address of the player.
 
   |-
 
   |-
 
   |reason
 
   |reason
 
   |[[bz_ApiString]]
 
   |[[bz_ApiString]]
   |If a plugin denies the entrance of a player, then that plugin can explain why in this field.
+
   |This value is the reason for any denials of admittance, it will be reported back to the player.
 
   |-
 
   |-
 
   |allow
 
   |allow
 
   |bool
 
   |bool
   |This value should be set to true by the plugin if that plugin decided to allow the player to enter the game, and false otherwise.
+
   |This value is the current allow/deny state for the join. Plug-ins wishing to overide the server allow/deny logic can change this value.
 
   |-
 
   |-
 
   |eventTime
 
   |eventTime
 
   |double
 
   |double
   |This value is the time at which the client requested to enter the game (and thus the event was created).
+
   |This value is the local server time of the event.
 
   |}
 
   |}
 
==Uses==
 
==Uses==
A plugin can use this event to use an alternative to a ban list to decide whether a user should be allowed to play on the server. For example, if the server load is temporarily high, then a plugin could deny the entrance of even more users temporarily.
+
This is a modification event, plug-ins may override the allow/deny logic choice themselves. This is the primary hook for plug-ins that wish to implement custom ban list systems.
 
+
[[Category:BZFS_API_Docs]]
+
[[Category:BZFS_API_Events]]
+

Latest revision as of 01:27, 25 November 2016

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

BZFS Event. This page documents a BZFS event that is called by the game server to notify plug-ins of various actions and state changes in the game world.


Overview[edit]

The bz_eAllowPlayer is an API event that is called each time a player connects to the server. This event is called after all internal allow/deny logic.

Data[edit]

bz_eAllowPlayer returns the bz_AllowPlayerEventData_V1 data class.

name type value description
eventType bz_eEventType bz_eAllowPlayer
playerID int This value is the player ID for the joining player.
callsign bz_ApiString This value is the callsign for the player.
ipAddress bz_ApiString This value is the IPv4 address of the player.
reason bz_ApiString This value is the reason for any denials of admittance, it will be reported back to the player.
allow bool This value is the current allow/deny state for the join. Plug-ins wishing to overide the server allow/deny logic can change this value.
eventTime double This value is the local server time of the event.

Uses[edit]

This is a modification event, plug-ins may override the allow/deny logic choice themselves. This is the primary hook for plug-ins that wish to implement custom ban list systems.