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

Editing Bz eGetWorldEvent

Jump to: navigation, search

Warning: The database has been locked for maintenance, so you will not be able to save your edits right now. You may wish to copy and paste your text into a text file and save it for later.

The administrator who locked it offered this explanation: Archived wiki

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 3: Line 3:
  
 
==Overview==
 
==Overview==
The '''bz_eGetWorldEvent''' is an API event that is called before the [[BZFS]] server defines the world.
+
The '''bz_eGetWorldEvent''' is an API event that is called when the world is defined.
  
 
==Data==
 
==Data==
Line 19: Line 19:
 
   |generated
 
   |generated
 
   |bool
 
   |bool
   |The value representing the state of the world generation. If another plug-in has generated a world, this value will be set to true. If the plug-in processing this event, adds world geometry using the '''bz_addWorld''' methods ([[bz_addWorldBox]], [[bz_addWorldPyramid]] etc. ) then it must set this value to true.
+
   |Set to true if the world is generated (ie, not literally loaded from a file)
 
   |-
 
   |-
 
   |ctf
 
   |ctf
 
   |bool
 
   |bool
   |This value represents the game state being a Capture the Flag (CTF) type game. Mutually exclusive with other game type setings.
+
   |Set to true if the game is a [[CTF]]-type game
 
   |-
 
   |-
   |rabbit
+
   |rabit
 
   |bool
 
   |bool
   |This value represents the game state being a Rabbit Hunt type game. Mutually exclusive with other game type setings.
+
   |Set to true if the game is a [[Rabbit Hunt]]-type game
 
   |-
 
   |-
 
   |openFFA
 
   |openFFA
 
   |bool
 
   |bool
   |This value represents the game state being a [[Free For All]] type game. Mutually exclusive with other game type setings.
+
   |Set to true if the game is a [[Free For All]]-type game
  |-
+
  |worldBlob
+
  |char*
+
  |A pointer to a memory location from which to read the world stream.  Overrides worldFile.
+
 
   |-
 
   |-
 
   |worldFile
 
   |worldFile
 
   |[[bz_ApiString]]
 
   |[[bz_ApiString]]
   |The path to the map file that will be used when this event is completed. If the string is zero length, then either a plug-in defined map or a random map will be used.
+
   |Path to the world file, set to "" (empty string) if not used
 
   |-
 
   |-
 
   |eventTime
 
   |eventTime
 
   |double
 
   |double
   |Local Server time of the event.
+
   |Time of the event
 
   |}
 
   |}
 
 
==Uses==
 
==Uses==
This event is a modification event. It is the primary hook for plug-ins that wish to modify the world.  The available options are;
+
This event is a notification only event, none of the data returned can be changed.
 
+
===Map file override ===
+
If the plug-in wishes to force the server to use a specific map file, it can set the '''worldFile''' member.  This member may be set to any valid local path or an http:// or ftp:// URL.
+
 
+
The plug-in may instead use the worldFile member for information only, and write a valid BZW world into a contiguous memory location with a 0 terminating character, passing that pointer back to BZFS via the worldBlob member.  It is the caller's responsibility to free this memory; this may be done in the [[bz_eWorldFinalized]] event.
+
  
===Game Style overide===
+
[[Category:BZFS_API_Docs]]
The plug-in may change the game style flags to override the initial game mode.
+
[[Category:BZFS_API_Events]]

Please note that all contributions to BZFlagWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BZFlagWiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Templates used on this page: