This wiki was in read-only mode for many years, but can now be edited again. A lot of information will need to be updated.

Functions (API): Difference between revisions

From BZFlagWiki
Jump to navigation Jump to search
Line 32: Line 32:
  BZF_API bool [[bz_getPlayerCurrentState]] ( int playerID, [[bz_PlayerUpdateState]] &state );
  BZF_API bool [[bz_getPlayerCurrentState]] ( int playerID, [[bz_PlayerUpdateState]] &state );
  BZF_API bool [[bz_isPlayerPaused]] ( int playerID );
  BZF_API bool [[bz_isPlayerPaused]] ( int playerID );
  BZF_API bool [[bz_setPlayerOperator]] ( int playerId );


=== Team Information===
=== Team Information===

Revision as of 02:18, 14 August 2007

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


Overview

The BZFS API provides a number of functions to plug-ins for use in querying the current game state. Functions are used both to get information about the game, and to trigger in game actions, such as activating a world weapon.

Function Groups

Functions are broken into a series of groups based on the type of action or information they deal with.

Event Registration

BZF_API bool bz_registerEvent ( bz_eEventType eventType, bz_EventHandler* eventHandler );
BZF_API bool bz_removeEvent ( bz_eEventType eventType, bz_EventHandler* eventHandler );

Non-Player Connections

BZF_API bool bz_registerNonPlayerConnectionHandler ( int connectionID, bz_NonPlayerConnectionHandler* handler );
BZF_API bool bz_removeNonPlayerConnectionHandler ( int connectionID, bz_NonPlayerConnectionHandler* handler );
BZF_API bool bz_sendNonPlayerData ( int connectionID, const void *data, unsigned int size );
BZF_API bool bz_disconectNonPlayerConnection ( int connectionID );

Player Information

BZF_API bool [[bz_getPlayerIndexList ( bz_APIIntList *playerList );
BZF_API [[bz_APIIntList *bz_getPlayerIndexList ( void );
BZF_API [[bz_BasePlayerRecord *bz_getPlayerByIndex ( int index );
BZF_API bool bz_updatePlayerData ( bz_BasePlayerRecord *playerRecord );
BZF_API bool bz_hasPerm ( int playerID, const char* perm );
BZF_API bool [[bz_grantPerm ( int playerID, const char* perm );
BZF_API bool bz_revokePerm ( int playerID, const char* perm );
BZF_API bool bz_freePlayerRecord ( bz_BasePlayerRecord *playerRecord );
BZF_API const char* bz_getPlayerFlag]] ( int playerID );
BZF_API bool bz_getPlayerCurrentState ( int playerID, bz_PlayerUpdateState &state );
BZF_API bool bz_isPlayerPaused ( int playerID );
 BZF_API bool bz_setPlayerOperator ( int playerId );

Team Information

BZF_API unsigned int bz_getTeamPlayerLimit ( bz_eTeamType team )

Server Management

BZF_API bool bz_restart ( void );

Map Management

BZF_API void bz_setClientWorldDowloadURL( const char* URL );
BZF_API const bzApiString bz_getClientWorldDowloadURL ( void );
BZF_API bool bz_saveWorldCacheFile( const char* file );

Flag Management

BZF_API bool bz_givePlayerFlag ( int playerID, const char* flagType, bool force );
BZF_API bool bz_removePlayerFlag ( int playerID );
BZF_API void bz_resetFlags ( bool onlyUnused );
BZF_API unsigned int bz_getNumFlags ( void );
BZF_API const bz_ApiString bz_getName( int flag );
BZF_API bool bz_resetFlag ( int flag );
BZF_API int bz_flagPlayer ( int flag );
BZF_API bool bz_getFlagPosition ( int flag, float* pos );
BZF_API bool bz_moveFlag ( int flag, float pos[3], bool reset = true );

Shot Type Control

BZF_API bool bz_setPlayerShotType( int playerId, bz_eShotType shotType );

Misc

See also

BZFS API

plug-ins