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 eGetWorldEvent: Difference between revisions

From BZFlagWiki
Jump to navigation Jump to search
Zehra (talk | contribs)
redirect, since events are in official docs
Tag: New redirect
 
Line 1: Line 1:
{{BZFS_API_Doc}}
#REDIRECT [[Category:BZFS API Docs]]
{{BZFS_API_Events}}
 
==Overview==
The '''bz_eGetWorldEvent''' is an API event that is called before the [[BZFS]] server defines the world.
 
==Data==
'''bz_eGetWorldEvent''' returns the '''bz_GetWorldEventData_V1''' data class.
 
  {| border="1" cellpadding="20" cellspacing="0"
  !name
  !type
  !value description
  |-
  |eventType   
  |[[Event(API)|bz_eEventType]]
  |bz_eGetWorldEvent
  |-
  |generated
  |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.
  |-
  |ctf
  |bool
  |This value represents the game state being a Capture the Flag (CTF) type game. Mutually exclusive with other game type setings.
  |-
  |rabbit
  |bool
  |This value represents the game state being a Rabbit Hunt type game. Mutually exclusive with other game type setings.
  |-
  |openFFA
  |bool
  |This value represents the game state being a [[Free For All]] type game. Mutually exclusive with other game type setings.
  |-
  |worldBlob
  |char*
  |A pointer to a memory location from which to read the world stream.  Overrides worldFile.
  |-
  |worldFile
  |[[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.
  |-
  |eventTime
  |double
  |Local Server time of the event.
  |}
 
==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;
 
===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===
The plug-in may change the game style flags to override the initial game mode.

Latest revision as of 02:07, 27 November 2025