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

Difference between revisions of "Bz BaseURLHandler"

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

Revision as of 21:03, 26 September 2008

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 there 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.