C# Class SharpMod.Player

Inheritance: Entity
Afficher le fichier Open project: txdv/sharpmod Class Usage Examples

Méthodes publiques

Méthode Description
Ban ( string message, int minutes ) : void

Issue the server commands to ban a player by ip.

ExecuteCommand ( string command ) : void

Executes a supplied command on the client side of the player.

Find ( string target ) : Player
FindByAuthId ( string authId ) : Player

Finds an active Player by authid.

FindByName ( string name ) : Player

Finds an active Player by name

FindByUserId ( int id ) : Player
FindByUserId ( string id ) : Player
GetInfoKeyValue ( string key ) : string

Gets a specific value for a key from the infokeybuffer

GetPlayer ( IntPtr entity ) : Player

Gets a Player according to the entity pointer. Needed most of the time for internal engine calls, since the entity pointer is used a lot.

GetUserID ( Player player ) : int
GiveItem ( string itemname ) : Entity
Kick ( string message ) : void

Issue the server command to kick this player.

PrintCenter ( string text ) : void

Prints some text to the Player central screen

PrintChat ( string text ) : void

Prints some text to the players text in one color.

PrintConsole ( string text ) : void

Prints some text to the Players Console.

RegisterCommand ( string str, ClientCommandDelegate handler ) : void
ReloadAllPrivileges ( ) : void
ReloadPrivileges ( ) : void
SetInfoKeyValue ( string key, string val ) : void

Sets some specific InfoKeyValue according to a key.

StripUserWeapons ( ) : void
ToString ( ) : string

Returns a string representation of the player class

UpdateUserInfo ( ) : void
UpdateUserInfo ( string infoString ) : void

Méthodes protégées

Méthode Description
OnAssignPrivileges ( AssignPrivilegesEventArgs args ) : void
OnAuthorize ( AuthorizeEventArgs args ) : void
OnCommand ( CommandEventArgs args ) : void
OnConnect ( ConnectEventArgs args ) : void
OnDisconnect ( DisconnectEventArgs args ) : void
OnPlayerAssignPrivileges ( AssignPrivilegesEventArgs args ) : void
OnPlayerAuthorize ( AuthorizeEventArgs args ) : void
OnPlayerClientDisconnect ( DisconnectEventArgs args ) : void
OnPlayerCommand ( CommandEventArgs args ) : void
OnPlayerConnect ( ConnectEventArgs args ) : void
OnPlayerPutInServer ( PutInServerEventArgs args ) : void
OnPutInServer ( PutInServerEventArgs args ) : void

Private Methods

Méthode Description
OnAssignPrivileges ( Player player, Privileges privileges ) : void
OnAuthorize ( Player player ) : void
OnCommand ( IntPtr entity ) : void
OnConnect ( IntPtr entity, string name, string address, string reject_reason ) : bool
OnDisconnect ( IntPtr entity ) : void
OnPutInServer ( IntPtr entity ) : void
Player ( IntPtr entity ) : System

Constructor for internal building of Players

Release ( ) : void

Releases the event handlers

ResolvedBans ( BanInfo information ) : void
ResolvedPrivileges ( PlayerInfo pi, Privileges priv ) : void

Method Details

Ban() public méthode

Issue the server commands to ban a player by ip.
public Ban ( string message, int minutes ) : void
message string /// A reason to kick/ban ///
minutes int /// The amount of minutes to ban a player by ip ///
Résultat void

ExecuteCommand() public méthode

Executes a supplied command on the client side of the player.
public ExecuteCommand ( string command ) : void
command string /// A command as a string which must end with ; ///
Résultat void

Find() public static méthode

public static Find ( string target ) : Player
target string
Résultat Player

FindByAuthId() public static méthode

Finds an active Player by authid.
public static FindByAuthId ( string authId ) : Player
authId string /// AuthId to search by ///
Résultat Player

FindByName() public static méthode

Finds an active Player by name
public static FindByName ( string name ) : Player
name string /// Name to search by ///
Résultat Player

FindByUserId() public static méthode

public static FindByUserId ( int id ) : Player
id int
Résultat Player

FindByUserId() public static méthode

public static FindByUserId ( string id ) : Player
id string
Résultat Player

GetInfoKeyValue() public méthode

Gets a specific value for a key from the infokeybuffer
public GetInfoKeyValue ( string key ) : string
key string /// The key name ///
Résultat string

GetPlayer() public static méthode

Gets a Player according to the entity pointer. Needed most of the time for internal engine calls, since the entity pointer is used a lot.
public static GetPlayer ( IntPtr entity ) : Player
entity System.IntPtr /// A pointer to the entity class ///
Résultat Player

GetUserID() public static méthode

public static GetUserID ( Player player ) : int
player Player
Résultat int

GiveItem() public méthode

public GiveItem ( string itemname ) : Entity
itemname string
Résultat Entity

Kick() public méthode

Issue the server command to kick this player.
public Kick ( string message ) : void
message string /// A reason for kicking ///
Résultat void

OnAssignPrivileges() protected static méthode

protected static OnAssignPrivileges ( AssignPrivilegesEventArgs args ) : void
args AssignPrivilegesEventArgs
Résultat void

OnAuthorize() protected static méthode

protected static OnAuthorize ( AuthorizeEventArgs args ) : void
args AuthorizeEventArgs
Résultat void

OnCommand() protected static méthode

protected static OnCommand ( CommandEventArgs args ) : void
args CommandEventArgs
Résultat void

OnConnect() protected static méthode

protected static OnConnect ( ConnectEventArgs args ) : void
args ConnectEventArgs
Résultat void

OnDisconnect() protected static méthode

protected static OnDisconnect ( DisconnectEventArgs args ) : void
args DisconnectEventArgs
Résultat void

OnPlayerAssignPrivileges() protected méthode

protected OnPlayerAssignPrivileges ( AssignPrivilegesEventArgs args ) : void
args AssignPrivilegesEventArgs
Résultat void

OnPlayerAuthorize() protected méthode

protected OnPlayerAuthorize ( AuthorizeEventArgs args ) : void
args AuthorizeEventArgs
Résultat void

OnPlayerClientDisconnect() protected méthode

protected OnPlayerClientDisconnect ( DisconnectEventArgs args ) : void
args DisconnectEventArgs
Résultat void

OnPlayerCommand() protected méthode

protected OnPlayerCommand ( CommandEventArgs args ) : void
args CommandEventArgs
Résultat void

OnPlayerConnect() protected méthode

protected OnPlayerConnect ( ConnectEventArgs args ) : void
args ConnectEventArgs
Résultat void

OnPlayerPutInServer() protected méthode

protected OnPlayerPutInServer ( PutInServerEventArgs args ) : void
args PutInServerEventArgs
Résultat void

OnPutInServer() protected static méthode

protected static OnPutInServer ( PutInServerEventArgs args ) : void
args PutInServerEventArgs
Résultat void

PrintCenter() public méthode

Prints some text to the Player central screen
public PrintCenter ( string text ) : void
text string /// Text to print ///
Résultat void

PrintChat() public méthode

Prints some text to the players text in one color.
public PrintChat ( string text ) : void
text string /// Text to print ///
Résultat void

PrintConsole() public méthode

Prints some text to the Players Console.
public PrintConsole ( string text ) : void
text string /// Text to print ///
Résultat void

RegisterCommand() public static méthode

public static RegisterCommand ( string str, ClientCommandDelegate handler ) : void
str string
handler ClientCommandDelegate
Résultat void

ReloadAllPrivileges() public static méthode

public static ReloadAllPrivileges ( ) : void
Résultat void

ReloadPrivileges() public méthode

public ReloadPrivileges ( ) : void
Résultat void

SetInfoKeyValue() public méthode

Sets some specific InfoKeyValue according to a key.
public SetInfoKeyValue ( string key, string val ) : void
key string /// The key ///
val string /// The value which has to be set to the key ///
Résultat void

StripUserWeapons() public méthode

public StripUserWeapons ( ) : void
Résultat void

ToString() public méthode

Returns a string representation of the player class
public ToString ( ) : string
Résultat string

UpdateUserInfo() public méthode

public UpdateUserInfo ( ) : void
Résultat void

UpdateUserInfo() public méthode

public UpdateUserInfo ( string infoString ) : void
infoString string
Résultat void