C# Class TDSM.Core.Data.AuthenticatedUsers

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

Public Methods

Method Description
CreateUser ( string username, string password, bool op = false ) : bool

Creates a user.

DeleteUser ( string username ) : bool

Removes a user from the database by name

FindUsersByPrefix ( string search ) : string[]

Finds a list of users matching a prefix

GetUser ( string username ) : DbPlayer

Gets the user from the database by name

GetUserPassword ( string username ) : string

Gets the user password.

UpdateUser ( string username, bool op = false ) : bool

Updates a user in the database.

UpdateUser ( string username, string password ) : bool

Updates a user in the database.

UpdateUser ( string username, string password, bool op = false ) : bool

Updates a user in the database.

UserExists ( string username ) : bool

Checks if a user exists

Private Methods

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

Method Details

CreateUser() public static method

Creates a user.
public static CreateUser ( string username, string password, bool op = false ) : bool
username string Username.
password string Password.
op bool If set to true op.
return bool

DeleteUser() public static method

Removes a user from the database by name
public static DeleteUser ( string username ) : bool
username string Username.
return bool

FindUsersByPrefix() public static method

Finds a list of users matching a prefix
public static FindUsersByPrefix ( string search ) : string[]
search string Search.
return string[]

GetUser() public static method

Gets the user from the database by name
public static GetUser ( string username ) : DbPlayer
username string Username.
return DbPlayer

GetUserPassword() public static method

Gets the user password.
public static GetUserPassword ( string username ) : string
username string Username.
return string

UpdateUser() public static method

Updates a user in the database.
public static UpdateUser ( string username, bool op = false ) : bool
username string Username.
op bool If set to true op.
return bool

UpdateUser() public static method

Updates a user in the database.
public static UpdateUser ( string username, string password ) : bool
username string Username.
password string Password.
return bool

UpdateUser() public static method

Updates a user in the database.
public static UpdateUser ( string username, string password, bool op = false ) : bool
username string Username.
password string Password.
op bool If set to true op.
return bool

UserExists() public static method

Checks if a user exists
public static UserExists ( string username ) : bool
username string Username.
return bool