C# Class TDSM.Core.Data.Authentication

Authenticated users.
显示文件 Open project: DeathCradle/Terraria-s-Dedicated-Server-Mod

Public Methods

Method Description
CreatePlayer ( string name, string password, bool op = false ) : DbPlayer

Creates a user.

DeletePlayer ( string name ) : bool

Removes a player from the database by name

FindPlayersByPrefix ( string search, bool includeOp = false ) : string[]

Finds a list of users matching a prefix

GetPlayer ( string name, IDbConnection connection = null, IDbTransaction transaction = null ) : DbPlayer

Gets the player from the database by name

GetPlayerPasword ( string name ) : string

Gets the players password.

PlayerExists ( string name ) : bool

Checks if a player exists

UpdatePlayer ( string name, string password, bool op = null ) : bool

Updates a player in the database.

Private Methods

Method Description
Hash ( string username, string password ) : string

Method Details

CreatePlayer() public static method

Creates a user.
public static CreatePlayer ( string name, string password, bool op = false ) : DbPlayer
name string The players name.
password string Password.
op bool If set to true op.
return DbPlayer

DeletePlayer() public static method

Removes a player from the database by name
public static DeletePlayer ( string name ) : bool
name string The players name.
return bool

FindPlayersByPrefix() public static method

Finds a list of users matching a prefix
public static FindPlayersByPrefix ( string search, bool includeOp = false ) : string[]
search string Search.
includeOp bool
return string[]

GetPlayer() public static method

Gets the player from the database by name
public static GetPlayer ( string name, IDbConnection connection = null, IDbTransaction transaction = null ) : DbPlayer
name string Player name.
connection IDbConnection
transaction IDbTransaction
return DbPlayer

GetPlayerPasword() public static method

Gets the players password.
public static GetPlayerPasword ( string name ) : string
name string Player name.
return string

PlayerExists() public static method

Checks if a player exists
public static PlayerExists ( string name ) : bool
name string Player name.
return bool

UpdatePlayer() public static method

Updates a player in the database.
public static UpdatePlayer ( string name, string password, bool op = null ) : bool
name string The players name.
password string Password.
op bool If set to true op.
return bool