C# Class ImaginationServer.Common.DbUtils

Utility class, used for managing the Redis database.
Inheritance: IDisposable
Afficher le fichier Open project: Miclebrick/Imagination-Server Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
UpdateCharacter ( Character character ) : void

Method Details

AccountExists() public méthode

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

AddCharacter() public méthode

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

CharacterExists() public méthode

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?
Résultat bool

CharacterExists() public méthode

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

CreateAccount() public méthode

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.
Résultat ImaginationServer.Common.Data.Account

DbUtils() public méthode

public DbUtils ( ) : System
Résultat System

DeleteAccount() public méthode

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

DeleteCharacter() public méthode

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

Dispose() public méthode

public Dispose ( ) : void
Résultat void

GetAccount() public méthode

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

GetCharacter() public méthode

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?
Résultat ImaginationServer.Common.Data.Character

GetCharacter() public méthode

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

UpdateAccount() public méthode

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.
Résultat void