API_DOCS: Server Reset and Map management.

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

API_DOCS: Server Reset and Map management.

Post by JeffM »

I added some functions that should make map changing easier.

Code: Select all

BZF_API bool bz_restart ( void );
This function will do the following things.
1) kick all players
2) stop any countdowns
3) stop any recordings
4) unload the world
5) reload the world ( calling the bz_eGetWorldEvent that allows for a map file override )
6) resets all flags.
7) accept new connections.

This will basically let you do a map reload, with out a full shutdown of the server. none of the plug ins are unloaded, the server is not desisted, none of that ). There may be some additional things we need to reset, we will add them as we find them ( like reload the command line options, or let the plug-in set them ).

Code: Select all

BZF_API void bz_setClientWorldDowloadURL( const char* URL );
This function sets the current URL used to download a cached world file. It will be sent to clients that connect giving them the option of using that file. This is helpful if you have changed the map file during a reload.

Code: Select all

BZF_API const bzApiString bz_getClientWorldDowloadURL( void );
Returns the current world URL.

Code: Select all

BZF_API bool bz_saveWorldCacheFile( const char* file );
Forces the server to save out a world cache file into the specified file. Returns false on failure.

These commands are in CVS for both 2.0.x and 2.1 as of now.

I'm sure the Restart function will need some work but any help testing it will be greatly appreciated.
ImageJeffM
Post Reply