C# 클래스 TShockAPI.DB.UserManager

UserManager - Methods for dealing with database users and other user functionality within TShock.
파일 보기 프로젝트 열기: NyxStudios/TShock 1 사용 예제들

공개 메소드들

메소드 설명
AddUser ( User user ) : void

Adds a given username to the database

GetUser ( User user ) : User

Gets a user object by a user object.

GetUserByID ( int id ) : User

Gets a user object by their user ID.

GetUserByName ( string name ) : User

Gets a user object by name.

GetUserID ( string username ) : int

Gets the database ID of a given user object from the database.

GetUsers ( ) : List

Gets all users from the database.

GetUsersByName ( string username, bool notAtStart = false ) : List

Gets all users from the database with a username that starts with or contains username

RemoveUser ( User user ) : void

Removes a given username from the database

SetUserGroup ( User user, string group ) : void

Sets the group for a given username

SetUserPassword ( User user, string password ) : void

Sets the Hashed Password for a given username

SetUserUUID ( User user, string uuid ) : void

Sets the UUID for a given username

UpdateLogin ( User user ) : void

Updates the last accessed time for a database user to the current time.

UserManager ( IDbConnection db ) : System

Creates a UserManager object. During instantiation, this method will verify the table structure against the format below.

비공개 메소드들

메소드 설명
LoadUserFromResult ( User user, QueryResult result ) : User

Fills out the fields of a User object with the results from a QueryResult object.

메소드 상세

AddUser() 공개 메소드

Adds a given username to the database
public AddUser ( User user ) : void
user User User user
리턴 void

GetUser() 공개 메소드

Gets a user object by a user object.
public GetUser ( User user ) : User
user User The user object to search by.
리턴 User

GetUserByID() 공개 메소드

Gets a user object by their user ID.
public GetUserByID ( int id ) : User
id int The user's ID.
리턴 User

GetUserByName() 공개 메소드

Gets a user object by name.
public GetUserByName ( string name ) : User
name string The user's name.
리턴 User

GetUserID() 공개 메소드

Gets the database ID of a given user object from the database.
public GetUserID ( string username ) : int
username string The username of the user to query for.
리턴 int

GetUsers() 공개 메소드

Gets all users from the database.
public GetUsers ( ) : List
리턴 List

GetUsersByName() 공개 메소드

Gets all users from the database with a username that starts with or contains username
public GetUsersByName ( string username, bool notAtStart = false ) : List
username string Rough username search. "n" will match "n", "na", "nam", "name", etc
notAtStart bool If is not the first part of the username. If true then "name" would match "name", "username", "wordsnamewords", etc
리턴 List

RemoveUser() 공개 메소드

Removes a given username from the database
public RemoveUser ( User user ) : void
user User User user
리턴 void

SetUserGroup() 공개 메소드

Sets the group for a given username
public SetUserGroup ( User user, string group ) : void
user User User user
group string string group
리턴 void

SetUserPassword() 공개 메소드

Sets the Hashed Password for a given username
public SetUserPassword ( User user, string password ) : void
user User User user
password string string password
리턴 void

SetUserUUID() 공개 메소드

Sets the UUID for a given username
public SetUserUUID ( User user, string uuid ) : void
user User User user
uuid string string uuid
리턴 void

UpdateLogin() 공개 메소드

Updates the last accessed time for a database user to the current time.
public UpdateLogin ( User user ) : void
user User The user object to modify.
리턴 void

UserManager() 공개 메소드

Creates a UserManager object. During instantiation, this method will verify the table structure against the format below.
public UserManager ( IDbConnection db ) : System
db IDbConnection The database to connect to.
리턴 System