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

bz BaseURLHandler

From BZFlagWiki
Jump to: navigation, search
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.

Delcaration[edit]

class bz_BaseURLHandler
{
public:
 bz_BaseURLHandler();
 virtual ~bz_BaseURLHandler();
 virtual void done(const char* URL, void * data, unsigned int size, bool complete);
 virtual void timeout(const char* URL, int errorCode);
 virtual void error(const char* URL, int errorCode, const char *errorString);
}

Description[edit]

This is the base class for callbacks from bz_addURLJob. It is used to return info about a URL request back to the calling plug-in.

Plugins should derive there own callback class from this class and implement their own versions of the virtual methods that they require.

Methods[edit]

void done(const char* URL, void * data, unsigned int size, bool complete);
This is called as data is returned from the request. The complete paramater will be true on the last call for this job.
void timeout(const char* URL, int errorCode);
This is called when the URL job times out. This is usually because the server is offline
void error(const char* URL, int errorCode, const char *errorString);
This is called when the URL job errors out. This is usually because the URL is bad.