fCraft  0.638
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
fCraft.WorldManager Class Reference

Manages the world list. Handles loading/unloading, renaming, map changes, and more. More...

Static Public Member Functions

static World FindMainWorld (Player player)
 
static void SaveWorldList ()
 Saves the current world list to worlds.xml. Thread-safe.
 
static World FindWorldExact ([NotNull] string name)
 Finds a world by full name. Target world is not guaranteed to have a loaded map.
 
static World[] FindWorldsNoEvent ([NotNull] string name)
 Finds all worlds that match the given world name. Autocompletes. Does not raise SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.
 
static World[] FindWorlds ([CanBeNull] Player player,[NotNull] string name)
 Finds all worlds that match the given name. Autocompletes. Raises SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.
 
static World FindWorldOrPrintMatches ([NotNull] Player player,[NotNull] string worldName)
 Tries to find a single world by full or partial name. Returns null if zero or multiple worlds matched.
 
static World AddWorld ([CanBeNull] Player player,[NotNull] string name,[CanBeNull] Map map, bool preload)
 Creates a new world and adds it to the current list of worlds being managed by WorldManager.
 
static void RenameWorld ([NotNull] World world,[NotNull] string newName, bool moveMapFile, bool overwrite)
 Changes the name of the given world.
 
static void RemoveWorld ([NotNull] World worldToDelete)
 Removes the specified world from the list of worlds being managed by WorldManager.
 
static int CountLoadedWorlds ()
 Number of all worlds that are currently loaded.
 
static int CountLoadedWorlds ([NotNull] Player observer)
 Number of worlds that are currently loaded and can be seen by the specified observer.
 
static IEnumerable< WorldListLoadedWorlds ()
 List of all the worlds that are currently loaded.
 
static IEnumerable< WorldListLoadedWorlds ([NotNull] Player observer)
 List of worlds that are currently loaded and can be seen by the specified observer.
 
static string FindMapFile ([NotNull] Player player,[NotNull] string fileName)
 Searches for a map using the specified fileName. Prints any errors/warnings directly to the player.
 

Public Attributes

const string BuildSecurityXmlTagName = "BuildSecurity"
 

Properties

static World[] Worlds [get, set]
 List of worlds currently being managed by WorldManager.
 
static World MainWorld [get, set]
 Gets or sets the default main world. That's the world that players first join upon connecting. The map of the new main world is preloaded, and old one is unloaded, if needed.
 

Events

static EventHandler
< MainWorldChangingEventArgs
MainWorldChanging
 Occurs when the main world is being changed (cancelable).
 
static EventHandler
< MainWorldChangedEventArgs
MainWorldChanged
 Occurs after the main world has been changed.
 
static EventHandler
< SearchingForWorldEventArgs
SearchingForWorld
 Occurs when a player is searching for worlds (with autocompletion). The list of worlds in the search results may be replaced.
 
static EventHandler
< WorldCreatingEventArgs
WorldCreating
 Occurs before a new world is created/added (cancelable).
 
static EventHandler
< WorldCreatedEventArgs
WorldCreated
 Occurs after a new world is created/added.
 

Detailed Description

Manages the world list. Handles loading/unloading, renaming, map changes, and more.

Member Function Documentation

static World fCraft.WorldManager.AddWorld ( [CanBeNull] Player  player,
[NotNull] string  name,
[CanBeNull] Map  map,
bool  preload 
)
static

Creates a new world and adds it to the current list of worlds being managed by WorldManager.

Parameters
playerPlayer who is adding the world. May be null.
nameName of the world being added. May NOT be null.
mapMap to assign to the newly created world. May be null.
preloadWhether or not the map should be preloaded.
Returns
Newly-created world.
Exceptions
ArgumentNullExceptionname is null.
WorldOpExceptionGiven world name is invalid; a world with this name already exists; or an event callback cancels the addition.
static int fCraft.WorldManager.CountLoadedWorlds ( )
static

Number of all worlds that are currently loaded.

Returns
Number of all loaded worlds.
static int fCraft.WorldManager.CountLoadedWorlds ( [NotNull] Player  observer)
static

Number of worlds that are currently loaded and can be seen by the specified observer.

Parameters
observerPlayer to observe as.
Returns
Number of worlds the specified player has permission to observe.
static World fCraft.WorldManager.FindMainWorld ( Player  player)
static
static string fCraft.WorldManager.FindMapFile ( [NotNull] Player  player,
[NotNull] string  fileName 
)
static

Searches for a map using the specified fileName. Prints any errors/warnings directly to the player.

Parameters
playerPlayer who is doing the search.
fileNameFileName of the map to be searched for.
Returns
Full source file name. Null if file could not be found, or an error occurred.
Exceptions
ArgumentNullExceptionplayer or fileName is null.
static World fCraft.WorldManager.FindWorldExact ( [NotNull] string  name)
static

Finds a world by full name. Target world is not guaranteed to have a loaded map.

Returns
World if found, or null if not found.
static World fCraft.WorldManager.FindWorldOrPrintMatches ( [NotNull] Player  player,
[NotNull] string  worldName 
)
static

Tries to find a single world by full or partial name. Returns null if zero or multiple worlds matched.

Parameters
playerPlayer who will receive messages regarding zero or multiple matches.
worldNameFull or partial world name.
static World [] fCraft.WorldManager.FindWorlds ( [CanBeNull] Player  player,
[NotNull] string  name 
)
static

Finds all worlds that match the given name. Autocompletes. Raises SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.

Parameters
playerPlayer who is calling the query. May be null.
nameFull or partial world name.
Returns
An array of 0 or more worlds that matched the name.
static World [] fCraft.WorldManager.FindWorldsNoEvent ( [NotNull] string  name)
static

Finds all worlds that match the given world name. Autocompletes. Does not raise SearchingForWorld event. Target worlds are not guaranteed to have a loaded map.

static IEnumerable<World> fCraft.WorldManager.ListLoadedWorlds ( )
static

List of all the worlds that are currently loaded.

Returns
List of all loaded worlds.
static IEnumerable<World> fCraft.WorldManager.ListLoadedWorlds ( [NotNull] Player  observer)
static

List of worlds that are currently loaded and can be seen by the specified observer.

Parameters
observerPlayer to observe as.
Returns
List of worlds the specified player has permission to observe.
static void fCraft.WorldManager.RemoveWorld ( [NotNull] World  worldToDelete)
static

Removes the specified world from the list of worlds being managed by WorldManager.

Parameters
worldToDeleteWorld to be deleted.
static void fCraft.WorldManager.RenameWorld ( [NotNull] World  world,
[NotNull] string  newName,
bool  moveMapFile,
bool  overwrite 
)
static

Changes the name of the given world.

static void fCraft.WorldManager.SaveWorldList ( )
static

Saves the current world list to worlds.xml. Thread-safe.

Member Data Documentation

const string fCraft.WorldManager.BuildSecurityXmlTagName = "BuildSecurity"

Property Documentation

World fCraft.WorldManager.MainWorld
staticgetset

Gets or sets the default main world. That's the world that players first join upon connecting. The map of the new main world is preloaded, and old one is unloaded, if needed.

Exceptions
System.ArgumentNullException
Exceptions
fCraft.WorldOpException
World [] fCraft.WorldManager.Worlds
staticgetset

List of worlds currently being managed by WorldManager.

Event Documentation

EventHandler<MainWorldChangedEventArgs> fCraft.WorldManager.MainWorldChanged
static

Occurs after the main world has been changed.

EventHandler<MainWorldChangingEventArgs> fCraft.WorldManager.MainWorldChanging
static

Occurs when the main world is being changed (cancelable).

EventHandler<SearchingForWorldEventArgs> fCraft.WorldManager.SearchingForWorld
static

Occurs when a player is searching for worlds (with autocompletion). The list of worlds in the search results may be replaced.

EventHandler<WorldCreatedEventArgs> fCraft.WorldManager.WorldCreated
static

Occurs after a new world is created/added.

EventHandler<WorldCreatingEventArgs> fCraft.WorldManager.WorldCreating
static

Occurs before a new world is created/added (cancelable).


The documentation for this class was generated from the following file: