[This is preliminary documentation and is subject to change.]

Core of an fCraft server. Manages startup/shutdown, online player sessions, and global events and scheduled tasks.

Namespace: fCraft
Assembly: fCraft (in fCraft.dll) Version: 0.6.2.4 (0.6.2.4)

Syntax

   
 C# 
public static class Server

Members

               
 All Members  Fields   Properties   Methods   Events  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
BackupData()()()()
BindIPEndPointCallback(ServicePoint, IPEndPoint, Int32)
CalculateMaxPacketsPerUpdate(World)
CancelShutdown()()()()
Attempts to cancel the shutdown timer.
CheckConnectionsInterval
CheckIdlesInterval
CountPlayers(Boolean)
Counts online players, optionally including hidden ones.
CountVisiblePlayers(Player)
Counts online players whom the given observer can see.
CPUUsageLastMinute
CPUUsageTotal
ExternalIP
FindPlayerOrPrintMatches(Player, String, Boolean, Boolean)
Find player by name using autocompletion. Returns null and prints message if none or multiple players matched. Raises Player.SearchingForPlayer event, which may modify search results.
FindPlayers(String, Boolean)
Finds a player by name, using autocompletion. Returns ALL matching players, including hidden ones.
FindPlayers(Player, String, Boolean)
Finds a player by name, using autocompletion. Does not include hidden players.
GCInterval
GetArg(ArgKey)
Returns value of a given command-line argument (if present). Use HasArg to check flag arguments.
GetArgList()()()()
Produces a list of arguments that were passed to this instance of fCraft.
GetArgString()()()()
Produces a string containing all recognized arguments that wereset/passed to this instance of fCraft.
GetRandomString(Int32)
HasArg(ArgKey)
Checks whether a command-line argument was set.
Initialized
Occurs when the server has been initialized.
Initializing
Occurs when the server is about to be initialized.
InitLibrary(IEnumerable<(Of <<'(String>)>>))
Reads command-line switches and sets up paths and logging. This should be called before any other library function. Note to frontend devs: Subscribe to log-related events before calling this. Does not raise any events besides Logger.Logged. Throws exceptions on failure.
InitServer()()()()
Initialized various server subsystems. This should be called after InitLibrary and before StartServer. Loads config, PlayerDB, IP bans, AutoRank settings, builds a list of commands, and prepares the IRC bot. Raises Server.Initializing and Server.Initialized events, and possibly Logger.Logged events. Throws exceptions on failure.
InternalIP
IsIP(String)
IsMonitoringCPUUsage
IsRunning
IsShuttingDown
MakePlayerConnectedMessage(Player, Boolean, World)
Message(String)
Broadcasts a message to all online players. Shorthand for Server.Players.Message
Message(String, array<Object>[]()[][])
Broadcasts a message to all online players. Shorthand for Server.Players.Message
Message(Player, String)
Broadcasts a message to all online players except one. Shorthand for Server.Players.Except(except).Message
Message(Player, String, array<Object>[]()[][])
Broadcasts a message to all online players except one. Shorthand for Server.Players.Except(except).Message
PlayerListChanged
Occurs when the player list has just changed (any time players connected or disconnected).
Players
Port
ReplaceTextKeywords(Player, String)
RequestGC()()()()
SearchingForPlayer
Occurs when a player is searching for players (with autocompletion). The list of players in the search results may be replaced.
SessionConnected
Occurs any time a new session has connected, but before any communication is done.
SessionConnecting
Occurs any time the server receives an incoming connection (cancellable).
SessionDisconnected
Occurs when a connection is closed or lost.
Shutdown(ShutdownParams, Boolean)
Initiates the server shutdown with given parameters.
ShutdownBegan
Occurs when the server is about to start shutting down.
ShutdownEnded
Occurs when the server finished shutting down.
Started
Occurs when the server has just started.
Starting
Occurs when the server is about to start.
StartServer()()()()
Starts the server: Creates Console pseudoplayer, loads the world list, starts listening for incoming connections, sets up scheduled tasks and starts the scheduler, starts the heartbeat, and connects to IRC. Raises Server.Starting and Server.Started events. May throw an exception on hard failure.
StartTime
Time when the server started (UTC). Used to check uptime.
UnregisterPlayer(Player)
Uri
VerifyName(String, String, String)

Inheritance Hierarchy

System..::..Object
  fCraft..::..Server

See Also