C# Класс ImaginationServer.Common.DbUtils

Utility class, used for managing the Redis database.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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?)

Приватные методы

Метод Описание
UpdateCharacter ( Character character ) : void

Описание методов

AccountExists() публичный Метод

Does an account of this username exist?
public AccountExists ( string username ) : bool
username string The username of the supposed account.
Результат bool

AddCharacter() публичный Метод

Adds/updates a character to the database.
public AddCharacter ( Character character ) : void
character ImaginationServer.Common.Data.Character The character to add.
Результат void

CharacterExists() публичный Метод

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?
Результат bool

CharacterExists() публичный Метод

Does a character of this username exist?
public CharacterExists ( string username ) : bool
username string The username of the supposed character.
Результат bool

CreateAccount() публичный Метод

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.
Результат ImaginationServer.Common.Data.Account

DbUtils() публичный Метод

public DbUtils ( ) : System
Результат System

DeleteAccount() публичный Метод

Deletes the specified account.
public DeleteAccount ( Account account ) : void
account ImaginationServer.Common.Data.Account The account to delete.
Результат void

DeleteCharacter() публичный Метод

Removes a character from the database, and its owner account.
public DeleteCharacter ( Character character ) : void
character ImaginationServer.Common.Data.Character The character to delete.
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

GetAccount() публичный Метод

Retrieves the data of account with the specified username.
public GetAccount ( string username ) : Account
username string The username of the account.
Результат ImaginationServer.Common.Data.Account

GetCharacter() публичный Метод

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?
Результат ImaginationServer.Common.Data.Character

GetCharacter() публичный Метод

Gets a character from their name.
public GetCharacter ( string name ) : Character
name string The character's name.
Результат ImaginationServer.Common.Data.Character

UpdateAccount() публичный Метод

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.
Результат void