C# Класс fCraft.PlayerInfo

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Ban ( [ player, [ reason, bool announce, bool raiseEvents ) : void

Bans given player. Kicks if online. Throws PlayerOpException on problems.

BanAll ( [ player, [ reason, bool announce, bool raiseEvents ) : void

Bans given player, their IP, and all other accounts on IP. All players from IP are kicked. Throws PlayerOpException on problems.

BanIP ( [ player, [ reason, bool announce, bool raiseEvents ) : void

Bans given player and their IP address. All players from IP are kicked. Throws PlayerOpException on problems.

ChangeRank ( [ player, [ newRank, [ reason, bool announce, bool raiseEvents, bool auto ) : void

Changes rank of the player (promotes or demotes). Throws PlayerOpException on problems.

Freeze ( [ player, bool announce, bool raiseEvents ) : void

Freezes this player (prevents from moving, building, and from using most commands). Throws PlayerOpException on problems.

Mute ( [ player, System.TimeSpan duration, bool announce, bool raiseEvents ) : void

Mutes this player (prevents from writing chat messages).

Unban ( [ player, [ reason, bool announce, bool raiseEvents ) : void

Unbans a player. Throws PlayerOpException on problems.

UnbanAll ( [ player, [ reason, bool announce, bool raiseEvents ) : void

Unbans given player, their IP address, and all other accounts on IP. Throws PlayerOpException on problems.

UnbanIP ( [ player, [ reason, bool announce, bool raiseEvents ) : void

Unbans given player and their IP address. Throws PlayerOpException on problems.

Unfreeze ( [ player, bool announce, bool raiseEvents ) : void

Unfreezes this player. Throws PlayerOpException on problems.

Unmute ( [ player, bool announce, bool raiseEvents ) : void

Unmutes this player (allows them to write chat again).

Приватные методы

Метод Описание
BanPlayerInfoInternal ( [ player, [ reason, bool unban, bool announce, bool raiseEvents ) : void
ProcessBan ( [ bannedBy, [ bannedByName, [ banReason ) : bool
ProcessUnban ( [ unbannedByName, [ unbanReason ) : bool
RaiseBanChangedEvent ( [ e ) : void
RaiseBanChangingEvent ( [ e ) : void
RaiseCreatedEvent ( [ info, bool isUnrecognized ) : void
RaiseCreatingEvent ( [ e ) : void
RaiseFreezeChangedEvent ( [ target, [ freezer, bool unfreezing, bool announce ) : void
RaiseFreezeChangingEvent ( [ target, [ freezer, bool unfreezing, bool announce ) : bool
RaiseMuteChangedEvent ( [ target, [ muter, System.TimeSpan duration, bool unmuting, bool announce ) : void
RaiseMuteChangingEvent ( [ target, [ muter, System.TimeSpan duration, bool unmuting, bool announce ) : bool
RaiseRankChangedEvent ( [ playerInfo, [ rankChanger, [ oldRank, [ reason, RankChangeType rankChangeType, bool announce ) : void
RaiseRankChangingEvent ( [ playerInfo, [ rankChanger, [ newRank, [ reason, RankChangeType rankChangeType, bool announce ) : bool
Unfreeze ( ) : void
Unmute ( ) : void

Описание методов

Ban() публичный метод

Bans given player. Kicks if online. Throws PlayerOpException on problems.
public Ban ( [ player, [ reason, bool announce, bool raiseEvents ) : void
player [ Player who is banning.
reason [ Reason for ban. May be empty, if permitted by server configuration.
announce bool Whether ban should be publicly announced on the server.
raiseEvents bool Whether BanChanging and BanChanged events should be raised.
Результат void

BanAll() публичный метод

Bans given player, their IP, and all other accounts on IP. All players from IP are kicked. Throws PlayerOpException on problems.
public BanAll ( [ player, [ reason, bool announce, bool raiseEvents ) : void
player [ Player who is banning.
reason [ Reason for ban. May be empty, if permitted by server configuration.
announce bool Whether ban should be publicly announced on the server.
raiseEvents bool Whether AddingIPBan, AddedIPBan, /// BanChanging, and BanChanged events should be raised.
Результат void

BanIP() публичный метод

Bans given player and their IP address. All players from IP are kicked. Throws PlayerOpException on problems.
public BanIP ( [ player, [ reason, bool announce, bool raiseEvents ) : void
player [ Player who is banning.
reason [ Reason for ban. May be empty, if permitted by server configuration.
announce bool Whether ban should be publicly announced on the server.
raiseEvents bool Whether AddingIPBan, AddedIPBan, /// BanChanging, and BanChanged events should be raised.
Результат void

ChangeRank() публичный метод

Changes rank of the player (promotes or demotes). Throws PlayerOpException on problems.
public ChangeRank ( [ player, [ newRank, [ reason, bool announce, bool raiseEvents, bool auto ) : void
player [ Player who originated the promotion/demotion action.
newRank [ New rank.
reason [ Reason for promotion/demotion.
announce bool Whether rank change should be publicly announced or not.
raiseEvents bool Whether PlayerInfo.RankChanging and PlayerInfo.RankChanged events should be raised.
auto bool Whether rank change should be marked as "automatic" or manual.
Результат void

Freeze() публичный метод

Freezes this player (prevents from moving, building, and from using most commands). Throws PlayerOpException on problems.
public Freeze ( [ player, bool announce, bool raiseEvents ) : void
player [ Player who is doing the freezing.
announce bool Whether to announce freezing publicly on the server.
raiseEvents bool Whether to raise PlayerInfo.FreezeChanging and PlayerInfo.FreezeChanged events.
Результат void

Mute() публичный метод

Mutes this player (prevents from writing chat messages).
public Mute ( [ player, System.TimeSpan duration, bool announce, bool raiseEvents ) : void
player [ Player who is doing the muting.
duration System.TimeSpan Duration of the mute. If a player is already muted for same or greater length of time, /// PlayerOpException is thrown with NoActionNeeded code. If a player is already muted for a shorter length of time, /// the mute duration is extended.
announce bool Whether to announce muting publicly on the sever.
raiseEvents bool Whether to raise PlayerInfo.MuteChanging and MuteChanged events.
Результат void

Unban() публичный метод

Unbans a player. Throws PlayerOpException on problems.
public Unban ( [ player, [ reason, bool announce, bool raiseEvents ) : void
player [ Player who is unbanning.
reason [ Reason for unban. May be empty, if permitted by server configuration.
announce bool Whether unban should be publicly announced on the server.
raiseEvents bool Whether BanChanging and BanChanged events should be raised.
Результат void

UnbanAll() публичный метод

Unbans given player, their IP address, and all other accounts on IP. Throws PlayerOpException on problems.
public UnbanAll ( [ player, [ reason, bool announce, bool raiseEvents ) : void
player [ Player who is unbanning.
reason [ Reason for unban. May be empty, if permitted by server configuration.
announce bool Whether unban should be publicly announced on the server.
raiseEvents bool Whether RemovingIPBan, RemovedIPBan, /// BanChanging, and BanChanged events should be raised.
Результат void

UnbanIP() публичный метод

Unbans given player and their IP address. Throws PlayerOpException on problems.
public UnbanIP ( [ player, [ reason, bool announce, bool raiseEvents ) : void
player [ Player who is unbanning.
reason [ Reason for unban. May be empty, if permitted by server configuration.
announce bool Whether unban should be publicly announced on the server.
raiseEvents bool Whether RemovingIPBan, RemovedIPBan, /// BanChanging, and BanChanged events should be raised.
Результат void

Unfreeze() публичный метод

Unfreezes this player. Throws PlayerOpException on problems.
public Unfreeze ( [ player, bool announce, bool raiseEvents ) : void
player [ Player who is doing the unfreezing.
announce bool Whether to announce freezing publicly on the server.
raiseEvents bool Whether to raise PlayerInfo.FreezeChanging and PlayerInfo.FreezeChanged events.
Результат void

Unmute() публичный метод

Unmutes this player (allows them to write chat again).
public Unmute ( [ player, bool announce, bool raiseEvents ) : void
player [ Player who is doing the unmuting.
announce bool Whether to announce unmuting publicly on the sever.
raiseEvents bool Whether to raise PlayerInfo.MuteChanging and MuteChanged events.
Результат void