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.

Bz BaseURLHandler: Difference between revisions

From BZFlagWiki
Jump to navigation Jump to search
New page: {{BZFS_API_Doc}}{{BZFS_API_Class}} ==Delcaration== class bz_BaseURLHandler { public: bz_BaseURLHandler(); virtual ~bz_BaseURLHandler(); virtual void done(const char* URL, void * data...
 
spelling
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{BZFS_API_Doc}}{{BZFS_API_Class}}
{{BZFS_API_Doc}}{{BZFS_API_Class}}
==Delcaration==
==Delcaration==
class bz_BaseURLHandler
class bz_BaseURLHandler
{
{
public:
public:
   bz_BaseURLHandler();
   bz_BaseURLHandler();
   virtual ~bz_BaseURLHandler();
   virtual ~bz_BaseURLHandler();
Line 9: Line 9:
   virtual void timeout(const char* URL, int errorCode);
   virtual void timeout(const char* URL, int errorCode);
   virtual void error(const char* URL, int errorCode, const char *errorString);
   virtual void error(const char* URL, int errorCode, const char *errorString);
 
}
protected:
  int version;
};


==Description==
==Description==
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.
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 there own versions of the virtual methods that they require.
Plugins should derive there own callback class from this class and implement their own versions of the virtual methods that they require.


==Methods==
==Methods==

Latest revision as of 00:17, 2 June 2013

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

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

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

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.