Jump to content

Architecture

From fCraft Wiki
Revision as of 02:04, 12 January 2012 by F (talk | contribs)

fCraft setup consists of two shared modules (fCraft.dll and fCraftGUI.dll), a visual configuration tool (ConfigGUI.exe), and a choice of front-ends (ServerGUI.exe and ServerCLI.exe).

Project Directory Structure

  • AutoRankEditor - experimental
  • bin
    • Debug - binaries built in Debug, Debug_Events, Debug_IRC, and Debug_Scheduler configurations.
    • Release - binaries built in Release configuration.
  • ConfigCLI - experimental command-line config editor
  • ConfigGUI - graphical config editor
  • fCraft - shared components
    • AutoRank - fCraft.AutoRank namespace; AutoRankManager, conditions, and criteria.
    • Commands - fCraft, fCraft.Events namespaces; Command descriptors and handlers, Command/CommandDescriptor/CommandManager classes, CommandCategory enum.
    • Drawing - fCraft.Drawing, fCraft.Events namespaces; DrawOperation base class and Brush-related interfaces; BrushManager; copy/paste- and undo-related classes; Axis enum.
      • Brushes - fCraft.Drawing namespace; All brush implementations.
      • DrawOps - fCraft.Drawing namespace; All DrawOperation implementations.
    • MapConversion - fCraft.MapConversion namespace; MapUtility, class, MapFormat enum, IMapConverter implementations (importers and exporters), NBT and .INI utilities.
    • Network - fCraft, fCraft.Events namespaces; Heartbeat, IP bans, IRC, low-level network utilities, networking component of the Player class.
    • Player - fCraft, fCraft.Events namespaces; Permissions and ranks, player-related constants, PlayerDB and PlayerInfo, Player class, Chat.
    • System - fCraft, fCraft.Events namespaces; Config, Server central class, Logger, Scheduler.
    • Utils - fCraft, JetBrains.Annotations, System.IO.Compression namespaces; various utility classes, extension methods, Vector classes, code annotations.
    • World - fCraft namespace; World and WorldManager classes, Block enum, BlockDB classes, map generation, Zones.
  • fCraftGUI - fCraft.GUI namespace; graphical components shared by ServerGUI and ConfigGUI.
  • ServerCLI - fCraft.ServerCLI namespace; Command-line server front end.
  • ServerGUI - fCraft.ServerGUI namespace; Graphical server front end.
  • UpdateInstaller - fCraft.UpdateInstaller namespace; Self-extracting updater.
  • UpdateBuilder - fCraft.UpdateBuilder namespace; Zips files to include in the UpdateInstaller. Used only during the build process.

Key Classes

  • fCraft.Command
fCraft/Commands/Command.cs
A text scanner that aids parsing chat commands and their arguments.
  • fCraft.CommandDescriptor
fCraft/Commands/CommandDescriptor.cs'
Describes a chat command. Defines properties, permission requirements, and usage information. Specifies a handler method. Used to add regular commands.
  • fCraft.Drawing.DrawOperation
fCraft/Drawing/DrawOperation.cs
Abstract class representing a drawing operation. Used to add draw commands.
  • fCraft.Chat
fCraft/Player/Chat.cs
Helper class for handling and broadcasting player-generated chat.
  • fCraft.Permission
fCraft/Player/Permission.cs
Enumeration of all permission types/categories. Every rank definition contains a combination of these.
  • fCraft.Player
fCraft/Network/Player.Networking.cs, fCraft/Player/Player.cs, fCraft/Player/Player.Events.cs
Object representing volatile state ("session") of a connected player. For persistent state of a known player account, see PlayerInfo. Use "Info" property of the Player class to access the associated PlayerInfo record.
  • fCraft.PlayerDB
fCraft/Player/PlayerDB.cs
Persistent database of player information. Can be used to look up online or offline players and to gather statistics.
  • fCraft.PlayerInfo
fCraft/Player/PlayerInfo.Actions.cs, fCraft/Player/PlayerInfo.cs, fCraft/Player/PlayerInfo.Events.cs
Object representing persistent state ("record") of a player, online or offline. There is exactly one PlayerInfo object for each known Minecraft account. All data is stored in the PlayerDB.
  • fCraft.Rank
fCraft/Player/Rank.cs
A rank that can be assigned to a player. Each player can only hold one rank at a time. Each rank has a name, a set of permissions, and a set of restrictions on those permissions.
  • fCraft.ConfigKey
fCraft/System/ConfigKey.cs
Enumeration of available configuration keys. Config.cs contains extension methods for getting/setting keys, resetting key values, and getting key metadata.
  • fCraft.Logger
fCraft/System/Logger.cs
Central logging class. Logs to file, relays messages to the frontend, submits crash reports.
  • fCraft.Scheduler
fCraft/System/Scheduler.cs
A general-purpose task scheduler. Can be used to run tasks at certain times, once or periodically. Usable to offloading intensive tasks to the background.
  • fCraft.Server
fCraft/System/Server.cs
Core of an fCraft server. Manages startup/shutdown, online player sessions, and global events and scheduled tasks.
  • fCraft.Block
fCraft/World/Block.cs
Enumeration of all standard Minecraft Classic block types.
  • fCraft.Map
fCraft/World/Map.cs
Represents a loaded map file. Provides methods to get/set blocks, metadata, and zones.
  • fCraft.World
fCraft/World/World.cs, 'fCraft/World/World.Events.cs
Represents an entry on the world list. May or may not have a map file loaded. Manages players, access/build security, various metadata, flushing, locking, saving and backups.


Event Sequences