![]() |
fCraft
0.638
Custom Minecraft Server
|
Represents a connection to a Minecraft client. Handles low-level interactions (e.g. networking). More...
Inheritance diagram for fCraft.Player:
Collaboration diagram for fCraft.Player:Public Member Functions | |
| void | JoinWorld ([NotNull] World newWorld, WorldChangeReason reason) |
| void | JoinWorld ([NotNull] World newWorld, WorldChangeReason reason, Position position) |
| void | SendNow (Packet packet) |
| Send packet to player (not thread safe, sync, immediate). Should NEVER be used from any thread other than this session's ioThread. Not thread-safe (for performance reason). | |
| void | Send (Packet packet) |
| Send packet (thread-safe, async, priority queue). This is used for most packets (movement, chat, etc). | |
| void | SendLowPriority (Packet packet) |
| Send packet (thread-safe, asynchronous, delayed queue). This is currently only used for block updates. | |
| void | ClearLowPriotityOutputQueue () |
| void | ClearPriorityOutputQueue () |
| void | Kick ([NotNull] string message, LeaveReason leaveReason) |
| Kick (asynchronous). Immediately blocks all client input, but waits until client thread has sent the kick packet. | |
| void | WaitForDisconnect () |
| Blocks the calling thread until this session disconnects. | |
| void | ParseMessage ([NotNull] string rawMessage, bool fromConsole) |
| Parses a message on behalf of this player. | |
| void | SendToSpectators ([NotNull] string message,[NotNull] params object[] formatArgs) |
| Sends a message to all players who are spectating this player, e.g. to forward typed-in commands and PMs. "System color" code (&S) will be prepended to the message. If the message does not fit on one line, prefix ">" is prepended to each wrapped line. | |
| void | MessageWoMAlert ([NotNull] string message,[NotNull] params object[] formatArgs) |
| Sends a message as a WoM alert. Players who use World of Minecraft client will see this message on the left side of the screen. Other players will receive it as a normal message. "System color" code (&S) will be prepended to the message. | |
| void | Message ([NotNull] string message,[NotNull] params object[] formatArgs) |
| Sends a text message to this player. "System color" code (&S) will be prepended to the message. If the message does not fit on one line, prefix ">" is prepended to each wrapped line. | |
| void | MessagePrefixed ([NotNull] string prefix,[NotNull] string message,[NotNull] params object[] formatArgs) |
| Sends a text message to this player, prefixing each line. | |
| void | MessageNoPlayer ([NotNull] string playerName) |
| Prints "No players found matching ___" message. | |
| void | MessageNoWorld ([NotNull] string worldName) |
| Prints "No worlds found matching ___" message. | |
| void | MessageManyMatches ([NotNull] string itemType,[NotNull] IEnumerable< IClassy > items) |
| Prints a comma-separated list of matches (up to 30): "More than one ___ matched: ___, ___, ..." | |
| void | MessageNoAccess ([NotNull] params Permission[] permissions) |
| Prints "This command requires ___+ rank" message. | |
| void | MessageNoAccess ([NotNull] CommandDescriptor cmd) |
| Prints "This command requires ___+ rank" message. | |
| void | MessageNoRank ([NotNull] string rankName) |
| Prints "Unrecognized rank ___" message. | |
| void | MessageUnsafePath () |
| Prints "You cannot access files outside the map folder." message. | |
| void | MessageNoZone ([NotNull] string zoneName) |
| Prints "No zones found matching ___" message. | |
| void | MessageInvalidWorldName ([NotNull] string worldName) |
| Prints "Unacceptable world name" message, and requirements for world names. | |
| void | MessageInvalidPlayerName ([NotNull] string playerName) |
| Prints "___ is not a valid player name" message. | |
| void | MessageMuted () |
| Prints "You are muted for ___ longer" message. | |
| void | MessageMaxTimeSpan () |
| Prints "Specify a time range up to ___" message | |
| bool | IsIgnoring ([NotNull] PlayerInfo other) |
| Checks whether this player is currently ignoring a given PlayerInfo. | |
| bool | Ignore ([NotNull] PlayerInfo other) |
| Adds a given PlayerInfo to the ignore list. Not that ignores are not persistent, and are reset when a player disconnects. | |
| bool | Unignore ([NotNull] PlayerInfo other) |
| Removes a given PlayerInfo from the ignore list. | |
| void | Confirm ([NotNull] CommandReader cmd,[NotNull] string message,[NotNull] params object[] formatArgs) |
| Request player to confirm continuing with the command. Player is prompted to type "/ok", and when he/she does, the command is called again with IsConfirmed flag set. | |
| void | Confirm ([NotNull] ConfirmationCallback callback,[CanBeNull] object callbackParameter,[NotNull] string message,[NotNull] params object[] formatArgs) |
| Request player to confirm an action. Player is prompted to type "/ok", and when he/she does, custom callback will be called | |
| bool | ConfirmCancel () |
| Cancels any pending confirmation (/ok) prompt. | |
| bool | PlaceBlock (Vector3I coord, ClickAction action, Block type) |
| Handles manually-placed/deleted blocks. Returns true if player's action should result in a kick. | |
| void | SendBlock (Vector3I coords, Block block) |
| Sends a block change to THIS PLAYER ONLY. Does not affect the map. | |
| void | RevertBlock (Vector3I coords) |
| Gets the block from given location in player's world, and sends it (async) to the player. Used to undo player's attempted block placement/deletion. | |
| void | Bind (Block type, Block replacement) |
| void | ResetBind (Block type) |
| void | ResetBind ([NotNull] params Block[] types) |
| Block | GetBind (Block type) |
| void | ResetAllBinds () |
| bool | Can ([NotNull] params Permission[] permissions) |
| Returns true if player has ALL of the given permissions. | |
| bool | CanAny ([NotNull] params Permission[] permissions) |
| Returns true if player has ANY of the given permissions. | |
| bool | Can (Permission permission) |
| Returns true if player has the given permission. | |
| bool | Can (Permission permission,[NotNull] Rank other) |
| Returns true if player has the given permission, and is allowed to affect players of the given rank. | |
| bool | CanDraw (int volume) |
| Returns true if player is allowed to run draw commands that affect a given number of blocks. | |
| bool | CanJoin ([NotNull] World worldToJoin) |
| Returns true if player is allowed to join a given world. | |
| CanPlaceResult | CanPlace ([NotNull] Map map, Vector3I coords, Block newBlock, BlockChangeContext context) |
| Checks whether player is allowed to place a block on the current world at given coordinates. Raises the PlayerPlacingBlock event. | |
| bool | CanSee ([NotNull] Player other) |
| Whether this player can currently see another player as being online. Players can always see themselves. Super players (e.g. Console) can see all. Hidden players can only be seen by those of sufficient rank. | |
| bool | CanSeeMoving ([NotNull] Player otherPlayer) |
| Whether this player can currently see another player moving. Behaves very similarly to CanSee method, except when spectating: Spectators and spectatee cannot see each other. Spectators can only be seen by those who'd be able to see them hidden. | |
| bool | CanSee ([NotNull] World world) |
| Whether this player should see a given world on the /Worlds list by default. | |
| UndoState | UndoPop () |
| UndoState | DrawBegin ([CanBeNull] DrawOperation op) |
| void | UndoClear () |
| void | RedoClear () |
| void | SelectionAddMark (Vector3I pos, bool announce, bool executeCallbackIfNeeded) |
| void | SelectionExecute () |
| void | SelectionStart (int marksExpected,[NotNull] SelectionCallback callback,[CanBeNull] object args,[CanBeNull] params Permission[] requiredPermissions) |
| void | SelectionResetMarks () |
| void | SelectionCancel () |
| CopyState | GetCopyState () |
| Gets CopyState for currently-selected slot. May be null. | |
| CopyState | GetCopyState (int slot) |
| Gets CopyState for the given slot. May be null. | |
| CopyState | SetCopyState ([CanBeNull] CopyState state) |
| Stores given CopyState at the currently-selected slot. | |
| CopyState | SetCopyState ([CanBeNull] CopyState state, int slot) |
| Stores given CopyState at the given slot. | |
| bool | Spectate ([NotNull] Player target) |
| Starts spectating the given player. | |
| bool | StopSpectating () |
| Stops spectating. | |
| void | TeleportTo (Position pos) |
| Teleports player to a given coordinate within this map. | |
| void | ResetIdleTimer () |
| Resets the IdleTimer to 0. | |
| void | Kick ([NotNull] Player player,[CanBeNull] string reason, LeaveReason context, bool announce, bool raiseEvents, bool recordToPlayerDB) |
| Advanced kick command. | |
| override string | ToString () |
| Name formatted for the debugger. | |
Static Public Member Functions | |
| static AccountType | CheckPaidStatus ([NotNull] string name) |
| Checks whether a given player has a paid minecraft.net account. | |
| static bool | IsValidName ([NotNull] string name) |
| Ensures that a player name has the correct length and character set. | |
| static bool | ContainsValidCharacters ([NotNull] string name) |
| Ensures that a player name has the correct length and character set. | |
Public Attributes | |
| const int | FullPositionUpdateIntervalDefault = 20 |
| readonly bool | IsSuper |
| Position | Position |
| Player's position in the current world. | |
Static Public Attributes | |
| static int | FullPositionUpdateInterval = FullPositionUpdateIntervalDefault |
| static Player | Console |
| The godly pseudo-player for commands called from the server console. Console has all the permissions granted. Note that Player.Console.World is always null, and that prevents console from calling certain commands (like /TP). | |
| static int | AntispamMessageCount = 3 |
| Number of messages in a AntiSpamInterval seconds required to trigger the anti-spam filter | |
| static int | AntispamInterval = 4 |
| Interval in seconds to record number of message for anti-spam filter | |
Properties | |
| static int | SocketTimeout [get, set] |
| static bool | RelayAllUpdates [get, set] |
| LeaveReason | LeaveReason [get, set] |
| Reason that this player is about to leave / has left the server. Set by Kick. This value is undefined until the player is about to disconnect. | |
| IPAddress | IP [get, set] |
| Remote IP address of this player. | |
| BandwidthUseMode | BandwidthUseMode [get, set] |
| int | BytesSent [get, set] |
| Total bytes sent (to the client) this session. | |
| int | BytesReceived [get, set] |
| Total bytes received (from the client) this session. | |
| double | BytesSentRate [get, set] |
| Bytes sent (to the client) per second, averaged over the last several seconds. | |
| double | BytesReceivedRate [get, set] |
| Bytes received (from the client) per second, averaged over the last several seconds. | |
| SessionState | State [get, set] |
| Whether the player has completed the login sequence. | |
| bool | HasRegistered [get, set] |
| Whether the player has completed the login sequence. | |
| bool | HasFullyConnected [get, set] |
| Whether the player registered and then finished loading the world. | |
| bool | IsOnline [get] |
| Whether the client is currently connected. | |
| bool | IsVerified [get, set] |
| Whether the player name was verified at login. | |
| PlayerInfo | Info [get, set] |
| Persistent information record associated with this player. | |
| bool | IsPainting [get, set] |
| Whether the player is in paint mode (deleting blocks replaces them). Used by /Paint. | |
| bool | IsDeaf [get, set] |
| Whether player has blocked all incoming chat. Deaf players can't hear anything. | |
| World | World [get, set] |
| The world that the player is currently on. May be null. Use .JoinWorld() to make players teleport to another world. | |
| Map | WorldMap [get] |
| Map from the world that the player is on. Throws PlayerOpException if player does not have a world. Loads the map if it's not loaded. Guaranteed to not return null. | |
| DateTime | LoginTime [get, set] |
| Time when the session connected. | |
| DateTime | LastActiveTime [get, set] |
| Last time when the player was active (moving/messaging). UTC. | |
| DateTime | LastPatrolTime [get, set] |
| Last time when this player was patrolled by someone. | |
| CommandReader | LastCommand [get, set] |
| Last command called by the player. | |
| string | Name [get] |
| Plain version of the name (no formatting). | |
| string | ListName [get] |
| Name formatted for display in the player list. | |
| string | ClassyName [get] |
| Name formatted for display in chat. | |
| bool | IsUsingWoM [get, set] |
| Whether the client supports advanced WoM client functionality. | |
| MetadataCollection< object > | Metadata [get, set] |
| Metadata associated with the session/player. | |
| PlayerInfo[] | IgnoreList [get] |
| Returns a list of all currently-ignored players. | |
| ConfirmationCallback | ConfirmCallback [get, set] |
| Callback to be called when player types in "/ok" to confirm an action. Use Player.Confirm(...) methods to set this. | |
| object | ConfirmParameter [get, set] |
| Custom parameter to be passed to Player.ConfirmCallback. | |
| DateTime | ConfirmRequestTime [get, set] |
| Time when the confirmation was requested. UTC. | |
| Block | LastUsedBlockType [get, set] |
| Last blocktype used by the player. Make sure to use in conjunction with Player.GetBind() to ensure that bindings are properly applied. | |
| static int | MaxBlockPlacementRange [get, set] |
| Max distance that player may be from a block to reach it (hack detection). | |
| IBrush | Brush [get, set] |
| DrawOperation | LastDrawOp [get, set] |
| bool | DisableClickToMark [get, set] |
| Whether clicks should be registered towards selection marks. | |
| bool | IsMakingSelection [get] |
| Whether player is currently making a selection. | |
| int | SelectionMarkCount [get] |
| Number of selection marks so far. | |
| int | SelectionMarksExpected [get, set] |
| Number of marks expected to complete the selection. | |
| bool | IsRepeatingSelection [get, set] |
| Whether player is repeating a selection (/static) | |
| CopyState[] | CopyStates [get] |
| Returns a list of all CopyStates, indexed by slot. | |
| int | CopySlot [get, set] |
| Gets or sets the currently selected copy slot number. Should be between 0 and (MaxCopySlots-1). Note that fCraft adds 1 to CopySlot number when presenting it to players. So 0th slot is shown as "1st" by /CopySlot and related commands; 1st is shown as "2nd", etc. | |
| int | MaxCopySlots [get, set] |
| Gets or sets the maximum number of copy slots allocated to this player. Should be nonnegative. CopyStates are preserved when increasing the maximum. When decreasing the value, any CopyStates in slots that fall outside the new maximum are lost. | |
| Player | SpectatedPlayer [get] |
| Player currently being spectated. Use Spectate/StopSpectate methods to set. | |
| PlayerInfo | LastSpectatedPlayer [get, set] |
| While spectating, currently-specated player. When not spectating, most-recently-spectated player. | |
| bool | IsSpectating [get] |
| Whether this player is currently spectating someone. | |
| TimeSpan | IdleTime [get] |
| Time since the player was last active (moved, talked, or clicked). | |
| string | LastUsedPlayerName [get, set] |
| string | LastUsedWorldName [get, set] |
Properties inherited from fCraft.IClassy | |
| string | ClassyName [get] |
| Name optionally formatted with minecraft color codes or other decorations. | |
Events | |
| static EventHandler < PlayerConnectingEventArgs > | Connecting |
| Occurs when a player is connecting (cancelable). Player name is verified and bans are checked before this event is raised, but before the player is registered with the server. Player's state at this point is SessionState.Connecting. | |
| static EventHandler < PlayerConnectedEventArgs > | Connected |
| Occurs when a player has connected, but before the player has joined any world. Allows changing the player's starting world. Player's state at this point is SessionState.Connecting, and about to change to SessionState.LoadingMain | |
| static EventHandler < PlayerEventArgs > | Ready |
| Occurs after a player has connected and joined the starting world. Player's state at this point has just changed from SessionState.LoadingMain to SessionState.Online | |
| static EventHandler < PlayerMovingEventArgs > | Moving |
| Occurs when player is about to move (cancelable). | |
| static EventHandler < PlayerMovedEventArgs > | Moved |
| Occurs when player has moved. | |
| static EventHandler < PlayerClickingEventArgs > | Clicking |
| Occurs when player clicked a block (cancelable). Note that a click will not necessarily result in a block being placed or deleted. | |
| static EventHandler < PlayerClickedEventArgs > | Clicked |
| Occurs after a player has clicked a block. Note that a click will not necessarily result in a block being placed or deleted. | |
| static EventHandler < PlayerPlacingBlockEventArgs > | PlacingBlock |
| Occurs when a player is about to place a block. Permission checks are done before calling this event, and their result may be overridden. | |
| static EventHandler < PlayerPlacedBlockEventArgs > | PlacedBlock |
| Occurs when a player has placed a block. This event does not occur if the block placement was disallowed. | |
| static EventHandler < PlayerBeingKickedEventArgs > | BeingKicked |
| Occurs before a player is kicked (cancelable). Kick may be caused by /Kick, /Ban, /BanIP, or /BanAll commands, or by idling. Callbacks may override whether the kick will be announced or recorded in PlayerDB. | |
| static EventHandler < PlayerKickedEventArgs > | Kicked |
| Occurs after a player has been kicked. Specifically, it happens after kick has been announced and recorded to PlayerDB (if applicable), just before the target player disconnects. Kick may be caused by /Kick, /Ban, /BanIP, or /BanAll commands, or by idling. | |
| static EventHandler < PlayerHideChangedEventArgs > | HideChanged |
| Happens after a player has hidden or unhidden. | |
| static EventHandler < PlayerDisconnectedEventArgs > | Disconnected |
| Occurs when a player disconnects. | |
| static EventHandler < PlayerJoiningWorldEventArgs > | JoiningWorld |
| Occurs when a player intends to join a world (cancelable). | |
| static EventHandler < PlayerJoinedWorldEventArgs > | JoinedWorld |
| Occurs after a player has joined a world. | |
Represents a connection to a Minecraft client. Handles low-level interactions (e.g. networking).
Object representing volatile state ("session") of a connected player. For persistent state of a known player account, see PlayerInfo.
| bool fCraft.Player.Can | ( | [NotNull] params Permission[] | permissions | ) |
Returns true if player has ALL of the given permissions.
| bool fCraft.Player.Can | ( | Permission | permission | ) |
Returns true if player has the given permission.
| bool fCraft.Player.Can | ( | Permission | permission, |
| [NotNull] Rank | other | ||
| ) |
Returns true if player has the given permission, and is allowed to affect players of the given rank.
| bool fCraft.Player.CanAny | ( | [NotNull] params Permission[] | permissions | ) |
Returns true if player has ANY of the given permissions.
| bool fCraft.Player.CanDraw | ( | int | volume | ) |
Returns true if player is allowed to run draw commands that affect a given number of blocks.
| bool fCraft.Player.CanJoin | ( | [NotNull] World | worldToJoin | ) |
Returns true if player is allowed to join a given world.
| CanPlaceResult fCraft.Player.CanPlace | ( | [NotNull] Map | map, |
| Vector3I | coords, | ||
| Block | newBlock, | ||
| BlockChangeContext | context | ||
| ) |
Checks whether player is allowed to place a block on the current world at given coordinates. Raises the PlayerPlacingBlock event.
| bool fCraft.Player.CanSee | ( | [NotNull] Player | other | ) |
Whether this player can currently see another player as being online. Players can always see themselves. Super players (e.g. Console) can see all. Hidden players can only be seen by those of sufficient rank.
| bool fCraft.Player.CanSee | ( | [NotNull] World | world | ) |
Whether this player should see a given world on the /Worlds list by default.
| bool fCraft.Player.CanSeeMoving | ( | [NotNull] Player | otherPlayer | ) |
Whether this player can currently see another player moving. Behaves very similarly to CanSee method, except when spectating: Spectators and spectatee cannot see each other. Spectators can only be seen by those who'd be able to see them hidden.
|
static |
Checks whether a given player has a paid minecraft.net account.
| void fCraft.Player.ClearLowPriotityOutputQueue | ( | ) |
| void fCraft.Player.ClearPriorityOutputQueue | ( | ) |
| void fCraft.Player.Confirm | ( | [NotNull] CommandReader | cmd, |
| [NotNull] string | message, | ||
| [NotNull] params object[] | formatArgs | ||
| ) |
Request player to confirm continuing with the command. Player is prompted to type "/ok", and when he/she does, the command is called again with IsConfirmed flag set.
| cmd | Command that needs confirmation. |
| message | Message to print before "Type /ok to continue". |
| formatArgs | Optional String.Format() arguments, for the message. |
| ArgumentNullException | cmd, message, or formatArgs is null. |
| void fCraft.Player.Confirm | ( | [NotNull] ConfirmationCallback | callback, |
| [CanBeNull] object | callbackParameter, | ||
| [NotNull] string | message, | ||
| [NotNull] params object[] | formatArgs | ||
| ) |
Request player to confirm an action. Player is prompted to type "/ok", and when he/she does, custom callback will be called
| callback | Method to call when player confirms. |
| callbackParameter | Argument to pass to the callback. May be null. |
| message | Message to print before "Type /ok to continue". |
| formatArgs | Optional String.Format() arguments, for the message. |
| ArgumentNullException | callback, message, or formatArgs is null. |
| bool fCraft.Player.ConfirmCancel | ( | ) |
Cancels any pending confirmation (/ok) prompt.
|
static |
Ensures that a player name has the correct length and character set.
| UndoState fCraft.Player.DrawBegin | ( | [CanBeNull] DrawOperation | op | ) |
| CopyState fCraft.Player.GetCopyState | ( | ) |
Gets CopyState for currently-selected slot. May be null.
| CopyState fCraft.Player.GetCopyState | ( | int | slot | ) |
Gets CopyState for the given slot. May be null.
| slot | Slot number. Should be between 0 and (MaxCopySlots-1). |
| ArgumentOutOfRangeException | slot is not between 0 and (MaxCopySlots-1). |
| bool fCraft.Player.Ignore | ( | [NotNull] PlayerInfo | other | ) |
Adds a given PlayerInfo to the ignore list. Not that ignores are not persistent, and are reset when a player disconnects.
| other | Player to ignore. |
| bool fCraft.Player.IsIgnoring | ( | [NotNull] PlayerInfo | other | ) |
Checks whether this player is currently ignoring a given PlayerInfo.
|
static |
Ensures that a player name has the correct length and character set.
| void fCraft.Player.JoinWorld | ( | [NotNull] World | newWorld, |
| WorldChangeReason | reason | ||
| ) |
| void fCraft.Player.JoinWorld | ( | [NotNull] World | newWorld, |
| WorldChangeReason | reason, | ||
| Position | position | ||
| ) |
| void fCraft.Player.Kick | ( | [NotNull] string | message, |
| LeaveReason | leaveReason | ||
| ) |
Kick (asynchronous). Immediately blocks all client input, but waits until client thread has sent the kick packet.
| void fCraft.Player.Kick | ( | [NotNull] Player | player, |
| [CanBeNull] string | reason, | ||
| LeaveReason | context, | ||
| bool | announce, | ||
| bool | raiseEvents, | ||
| bool | recordToPlayerDB | ||
| ) |
Advanced kick command.
| player | Player who is kicking. |
| reason | Reason for kicking. May be null or blank if allowed by server configuration. |
| context | Classification of kick context. |
| announce | Whether the kick should be announced publicly on the server and IRC. |
| raiseEvents | Whether Player.BeingKicked and Player.Kicked events should be raised. |
| recordToPlayerDB | Whether the kick should be counted towards player's record. |
| void fCraft.Player.Message | ( | [NotNull] string | message, |
| [NotNull] params object[] | formatArgs | ||
| ) |
Sends a text message to this player. "System color" code (&S) will be prepended to the message. If the message does not fit on one line, prefix ">" is prepended to each wrapped line.
| message | A composite format string for the message. Same semantics as String.Format(). |
| formatArgs | An object array that contains zero or more objects to format. |
| ArgumentNullException | message or formatArgs is null. |
| FormatException | Message format is invalid. |
| void fCraft.Player.MessageInvalidPlayerName | ( | [NotNull] string | playerName | ) |
Prints "___ is not a valid player name" message.
| playerName | Given player name, deemed to be invalid. |
| void fCraft.Player.MessageInvalidWorldName | ( | [NotNull] string | worldName | ) |
Prints "Unacceptable world name" message, and requirements for world names.
| worldName | Given world name, deemed to be invalid. |
| void fCraft.Player.MessageManyMatches | ( | [NotNull] string | itemType, |
| [NotNull] IEnumerable< IClassy > | items | ||
| ) |
Prints a comma-separated list of matches (up to 30): "More than one ___ matched: ___, ___, ..."
| itemType | Type of item in the list. Should be singular (e.g. "player" or "world"). |
| items | List of zero or more matches. ClassyName properties are used in the list. |
| ArgumentNullException | itemType or items is null. |
| void fCraft.Player.MessageMaxTimeSpan | ( | ) |
Prints "Specify a time range up to ___" message
| void fCraft.Player.MessageMuted | ( | ) |
Prints "You are muted for ___ longer" message.
| void fCraft.Player.MessageNoAccess | ( | [NotNull] params Permission[] | permissions | ) |
Prints "This command requires ___+ rank" message.
| permissions | List of permissions required for the command. |
| ArgumentNullException | permissions is null. |
| ArgumentException | permissions array is empty. |
| void fCraft.Player.MessageNoAccess | ( | [NotNull] CommandDescriptor | cmd | ) |
Prints "This command requires ___+ rank" message.
| cmd | Command to check. |
| ArgumentNullException | cmd is null. |
| void fCraft.Player.MessageNoPlayer | ( | [NotNull] string | playerName | ) |
Prints "No players found matching ___" message.
| playerName | Given name, for which no players were found. |
| ArgumentNullException | playerName is null. |
| void fCraft.Player.MessageNoRank | ( | [NotNull] string | rankName | ) |
Prints "Unrecognized rank ___" message.
| rankName | Given name, for which no rank was found. |
| void fCraft.Player.MessageNoWorld | ( | [NotNull] string | worldName | ) |
Prints "No worlds found matching ___" message.
| worldName | Given name, for which no worlds were found. |
| ArgumentNullException | worldName is null. |
| void fCraft.Player.MessageNoZone | ( | [NotNull] string | zoneName | ) |
Prints "No zones found matching ___" message.
| zoneName | Given name, for which no zones was found. |
| void fCraft.Player.MessagePrefixed | ( | [NotNull] string | prefix, |
| [NotNull] string | message, | ||
| [NotNull] params object[] | formatArgs | ||
| ) |
Sends a text message to this player, prefixing each line.
| prefix | Prefix to prepend to prepend to each line after the 1st, if any line-wrapping occurs. Does NOT get prepended to first line. |
| message | A composite format string for the message. Same semantics as String.Format(). |
| formatArgs | An object array that contains zero or more objects to format. |
| ArgumentNullException | prefix, message, or formatArgs is null. |
| FormatException | Message format is invalid. |
| void fCraft.Player.MessageUnsafePath | ( | ) |
Prints "You cannot access files outside the map folder." message.
| void fCraft.Player.MessageWoMAlert | ( | [NotNull] string | message, |
| [NotNull] params object[] | formatArgs | ||
| ) |
Sends a message as a WoM alert. Players who use World of Minecraft client will see this message on the left side of the screen. Other players will receive it as a normal message. "System color" code (&S) will be prepended to the message.
| message | A composite format string for the message. Same semantics as String.Format(). |
| formatArgs | An object array that contains zero or more objects to format. |
| ArgumentNullException | message or formatArgs is null. |
| FormatException | Message format is invalid. |
| void fCraft.Player.ParseMessage | ( | [NotNull] string | rawMessage, |
| bool | fromConsole | ||
| ) |
Parses a message on behalf of this player.
| rawMessage | Message to parse. |
| fromConsole | Whether the message originates from console. |
| ArgumentNullException | rawMessage is null. |
| bool fCraft.Player.PlaceBlock | ( | Vector3I | coord, |
| ClickAction | action, | ||
| Block | type | ||
| ) |
Handles manually-placed/deleted blocks. Returns true if player's action should result in a kick.
| void fCraft.Player.RedoClear | ( | ) |
| void fCraft.Player.ResetAllBinds | ( | ) |
| void fCraft.Player.ResetBind | ( | Block | type | ) |
| void fCraft.Player.ResetBind | ( | [NotNull] params Block[] | types | ) |
| void fCraft.Player.ResetIdleTimer | ( | ) |
Resets the IdleTimer to 0.
| void fCraft.Player.RevertBlock | ( | Vector3I | coords | ) |
Gets the block from given location in player's world, and sends it (async) to the player. Used to undo player's attempted block placement/deletion.
| void fCraft.Player.SelectionAddMark | ( | Vector3I | pos, |
| bool | announce, | ||
| bool | executeCallbackIfNeeded | ||
| ) |
| void fCraft.Player.SelectionCancel | ( | ) |
| void fCraft.Player.SelectionExecute | ( | ) |
| void fCraft.Player.SelectionResetMarks | ( | ) |
| void fCraft.Player.SelectionStart | ( | int | marksExpected, |
| [NotNull] SelectionCallback | callback, | ||
| [CanBeNull] object | args, | ||
| [CanBeNull] params Permission[] | requiredPermissions | ||
| ) |
| void fCraft.Player.Send | ( | Packet | packet | ) |
Send packet (thread-safe, async, priority queue). This is used for most packets (movement, chat, etc).
Sends a block change to THIS PLAYER ONLY. Does not affect the map.
| coords | Coordinates of the block. |
| block | Block type to send. |
| void fCraft.Player.SendLowPriority | ( | Packet | packet | ) |
Send packet (thread-safe, asynchronous, delayed queue). This is currently only used for block updates.
| void fCraft.Player.SendNow | ( | Packet | packet | ) |
Send packet to player (not thread safe, sync, immediate). Should NEVER be used from any thread other than this session's ioThread. Not thread-safe (for performance reason).
| void fCraft.Player.SendToSpectators | ( | [NotNull] string | message, |
| [NotNull] params object[] | formatArgs | ||
| ) |
Sends a message to all players who are spectating this player, e.g. to forward typed-in commands and PMs. "System color" code (&S) will be prepended to the message. If the message does not fit on one line, prefix ">" is prepended to each wrapped line.
| message | A composite format string for the message. Same semantics as String.Format(). |
| formatArgs | An object array that contains zero or more objects to format. |
| ArgumentNullException | message or formatArgs is null. |
| FormatException | Message format is invalid. |
Stores given CopyState at the currently-selected slot.
| state | New content for the current slot. May be a CopyState object, or null. |
Stores given CopyState at the given slot.
| state | New content for the given slot. May be a CopyState object, or null. |
| slot | Slot number. Should be between 0 and (MaxCopySlots-1). |
| ArgumentOutOfRangeException | slot is not between 0 and (MaxCopySlots-1). |
| bool fCraft.Player.Spectate | ( | [NotNull] Player | target | ) |
Starts spectating the given player.
| target | Player to spectate. |
| ArgumentNullException | target is null. |
| PlayerOpException | This player does not have sufficient permissions, or is trying to spectate self. |
| bool fCraft.Player.StopSpectating | ( | ) |
Stops spectating.
| void fCraft.Player.TeleportTo | ( | Position | pos | ) |
Teleports player to a given coordinate within this map.
| override string fCraft.Player.ToString | ( | ) |
Name formatted for the debugger.
| void fCraft.Player.UndoClear | ( | ) |
| UndoState fCraft.Player.UndoPop | ( | ) |
| bool fCraft.Player.Unignore | ( | [NotNull] PlayerInfo | other | ) |
Removes a given PlayerInfo from the ignore list.
| other | PlayerInfo to unignore. |
| void fCraft.Player.WaitForDisconnect | ( | ) |
Blocks the calling thread until this session disconnects.
|
static |
Interval in seconds to record number of message for anti-spam filter
|
static |
Number of messages in a AntiSpamInterval seconds required to trigger the anti-spam filter
|
static |
The godly pseudo-player for commands called from the server console. Console has all the permissions granted. Note that Player.Console.World is always null, and that prevents console from calling certain commands (like /TP).
|
static |
| const int fCraft.Player.FullPositionUpdateIntervalDefault = 20 |
| readonly bool fCraft.Player.IsSuper |
|
getset |
|
getset |
|
getset |
Total bytes received (from the client) this session.
|
getset |
Bytes received (from the client) per second, averaged over the last several seconds.
|
getset |
Total bytes sent (to the client) this session.
|
getset |
Bytes sent (to the client) per second, averaged over the last several seconds.
|
get |
Name formatted for display in chat.
|
getset |
Callback to be called when player types in "/ok" to confirm an action. Use Player.Confirm(...) methods to set this.
|
getset |
Custom parameter to be passed to Player.ConfirmCallback.
|
getset |
Time when the confirmation was requested. UTC.
|
getset |
Gets or sets the currently selected copy slot number. Should be between 0 and (MaxCopySlots-1). Note that fCraft adds 1 to CopySlot number when presenting it to players. So 0th slot is shown as "1st" by /CopySlot and related commands; 1st is shown as "2nd", etc.
|
get |
Returns a list of all CopyStates, indexed by slot.
|
getset |
Whether clicks should be registered towards selection marks.
|
getset |
Whether the player registered and then finished loading the world.
|
getset |
Whether the player has completed the login sequence.
|
get |
Time since the player was last active (moved, talked, or clicked).
|
get |
Returns a list of all currently-ignored players.
|
getset |
Persistent information record associated with this player.
|
getset |
Remote IP address of this player.
|
getset |
Whether player has blocked all incoming chat. Deaf players can't hear anything.
|
get |
Whether player is currently making a selection.
|
get |
Whether the client is currently connected.
|
getset |
Whether the player is in paint mode (deleting blocks replaces them). Used by /Paint.
|
getset |
Whether player is repeating a selection (/static)
|
get |
Whether this player is currently spectating someone.
|
getset |
Whether the client supports advanced WoM client functionality.
|
getset |
Whether the player name was verified at login.
|
getset |
Last time when the player was active (moving/messaging). UTC.
|
getset |
Last command called by the player.
|
getset |
|
getset |
Last time when this player was patrolled by someone.
|
getset |
While spectating, currently-specated player. When not spectating, most-recently-spectated player.
|
getset |
Last blocktype used by the player. Make sure to use in conjunction with Player.GetBind() to ensure that bindings are properly applied.
|
getset |
|
getset |
|
getset |
Reason that this player is about to leave / has left the server. Set by Kick. This value is undefined until the player is about to disconnect.
|
get |
Name formatted for display in the player list.
|
getset |
Time when the session connected.
|
staticgetset |
Max distance that player may be from a block to reach it (hack detection).
|
getset |
Gets or sets the maximum number of copy slots allocated to this player. Should be nonnegative. CopyStates are preserved when increasing the maximum. When decreasing the value, any CopyStates in slots that fall outside the new maximum are lost.
|
getset |
Metadata associated with the session/player.
|
get |
Plain version of the name (no formatting).
|
staticgetset |
|
get |
Number of selection marks so far.
|
getset |
Number of marks expected to complete the selection.
|
staticgetset |
|
get |
Player currently being spectated. Use Spectate/StopSpectate methods to set.
|
getset |
Whether the player has completed the login sequence.
|
getset |
The world that the player is currently on. May be null. Use .JoinWorld() to make players teleport to another world.
|
get |
Map from the world that the player is on. Throws PlayerOpException if player does not have a world. Loads the map if it's not loaded. Guaranteed to not return null.
|
static |
Occurs before a player is kicked (cancelable). Kick may be caused by /Kick, /Ban, /BanIP, or /BanAll commands, or by idling. Callbacks may override whether the kick will be announced or recorded in PlayerDB.
|
static |
Occurs after a player has clicked a block. Note that a click will not necessarily result in a block being placed or deleted.
|
static |
Occurs when player clicked a block (cancelable). Note that a click will not necessarily result in a block being placed or deleted.
|
static |
Occurs when a player has connected, but before the player has joined any world. Allows changing the player's starting world. Player's state at this point is SessionState.Connecting, and about to change to SessionState.LoadingMain
|
static |
|
static |
Occurs when a player disconnects.
|
static |
Happens after a player has hidden or unhidden.
|
static |
Occurs after a player has joined a world.
|
static |
Occurs when a player intends to join a world (cancelable).
|
static |
Occurs after a player has been kicked. Specifically, it happens after kick has been announced and recorded to PlayerDB (if applicable), just before the target player disconnects. Kick may be caused by /Kick, /Ban, /BanIP, or /BanAll commands, or by idling.
|
static |
Occurs when player has moved.
|
static |
Occurs when player is about to move (cancelable).
|
static |
Occurs when a player has placed a block. This event does not occur if the block placement was disallowed.
|
static |
Occurs when a player is about to place a block. Permission checks are done before calling this event, and their result may be overridden.
|
static |
Occurs after a player has connected and joined the starting world. Player's state at this point has just changed from SessionState.LoadingMain to SessionState.Online