C# Class ImaginationServer.Common.DbUtils

Utility class, used for managing the Redis database.
Inheritance: IDisposable
ファイルを表示 Open project: Miclebrick/Imagination-Server Class Usage Examples

Public Methods

Method Description
AccountExists ( string username ) : bool

Does an account of this username exist?

AddCharacter ( Character character ) : void

Adds/updates a character to the database.

CharacterExists ( long id, bool notRaw ) : bool

Does a character of this ID exist?

CharacterExists ( string username ) : bool

Does a character of this username exist?

CreateAccount ( string username, string password ) : Account

Creates an account with specified username and password.

DbUtils ( ) : System
DeleteAccount ( Account account ) : void

Deletes the specified account.

DeleteCharacter ( Character character ) : void

Removes a character from the database, and its owner account.

Dispose ( ) : void
GetAccount ( string username ) : Account

Retrieves the data of account with the specified username.

GetCharacter ( long id, bool notRaw = false ) : Character

Gets a character from their ID.

GetCharacter ( string name ) : Character

Gets a character from their name.

UpdateAccount ( Account account ) : void

Updates the data of an existing account. (Maybe you want to change the password, or add/remove users, or ban/unban the account?)

Private Methods

Method Description
UpdateCharacter ( Character character ) : void

Method Details

AccountExists() public method

Does an account of this username exist?
public AccountExists ( string username ) : bool
username string The username of the supposed account.
return bool

AddCharacter() public method

Adds/updates a character to the database.
public AddCharacter ( Character character ) : void
character ImaginationServer.Common.Data.Character The character to add.
return void

CharacterExists() public method

Does a character of this ID exist?
public CharacterExists ( long id, bool notRaw ) : bool
id long The ID of the supposed character.
notRaw bool Is this not raw?
return bool

CharacterExists() public method

Does a character of this username exist?
public CharacterExists ( string username ) : bool
username string The username of the supposed character.
return bool

CreateAccount() public method

Creates an account with specified username and password.
public CreateAccount ( string username, string password ) : Account
username string The username of the account.
password string The password of the account.
return ImaginationServer.Common.Data.Account

DbUtils() public method

public DbUtils ( ) : System
return System

DeleteAccount() public method

Deletes the specified account.
public DeleteAccount ( Account account ) : void
account ImaginationServer.Common.Data.Account The account to delete.
return void

DeleteCharacter() public method

Removes a character from the database, and its owner account.
public DeleteCharacter ( Character character ) : void
character ImaginationServer.Common.Data.Character The character to delete.
return void

Dispose() public method

public Dispose ( ) : void
return void

GetAccount() public method

Retrieves the data of account with the specified username.
public GetAccount ( string username ) : Account
username string The username of the account.
return ImaginationServer.Common.Data.Account

GetCharacter() public method

Gets a character from their ID.
public GetCharacter ( long id, bool notRaw = false ) : Character
id long The character ID.
notRaw bool Is this not raw?
return ImaginationServer.Common.Data.Character

GetCharacter() public method

Gets a character from their name.
public GetCharacter ( string name ) : Character
name string The character's name.
return ImaginationServer.Common.Data.Character

UpdateAccount() public method

Updates the data of an existing account. (Maybe you want to change the password, or add/remove users, or ban/unban the account?)
public UpdateAccount ( Account account ) : void
account ImaginationServer.Common.Data.Account The account to update.
return void