C# Класс BF2Statistics.Database.StatsDatabase

A class to provide common tasks against the Stats Database
Наследование: BF2Statistics.Database.DatabaseDriver, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
LatestVersion System.Version
PlayerTables string[]
StatsTables string[]
VersionList System.Version[]

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

Метод Описание
CreateSqlTables ( IProgress TaskProgress = null ) : void

Tells the Database to install the Stats tables into the database

DeletePlayer ( int Pid, IProgress TaskProgress = null ) : void

Removes a player, based on pid, from the stats database

GetPlayerAwards ( int Pid ) : object>>.List

Returns a list of awards a player has earned

MigrateTables ( ) : void

If there is any table updates that need to be applied, calling this method will apply each update until the current database version is up to date

MigrateTables ( System.Version ToVersion ) : void

If there is any table updates that need to be applied, calling this method will apply each update until the specifed update version

PlayerExists ( int Pid ) : bool

Returns whether or not a player exists in the "player" table

StatsDatabase ( ) : System

Creates a connection to the Stats Database

Truncate ( ) : void

Clears all stats data from the stats database

Защищенные методы

Метод Описание
GetTablesVersion ( ) : void

Fetches the current tables version

We have this in a seperate method because the table migration fetches the the version everytime an update is applied

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

Метод Описание
CreateMysqlTables ( IProgress TaskProgress ) : void

On a new Mysql database, this method will create the default tables

CreateSqliteTables ( IProgress TaskProgress ) : void

On a new Sqlite database, this method will create the default tables

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

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

Tells the Database to install the Stats tables into the database
public CreateSqlTables ( IProgress TaskProgress = null ) : void
TaskProgress IProgress
Результат void

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

Removes a player, based on pid, from the stats database
public DeletePlayer ( int Pid, IProgress TaskProgress = null ) : void
Pid int The players Id
TaskProgress IProgress The progress object to report to.
Результат void

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

Returns a list of awards a player has earned
public GetPlayerAwards ( int Pid ) : object>>.List
Pid int The Player ID
Результат object>>.List

GetTablesVersion() защищенный Метод

Fetches the current tables version
We have this in a seperate method because the table migration fetches the the version everytime an update is applied
protected GetTablesVersion ( ) : void
Результат void

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

If there is any table updates that need to be applied, calling this method will apply each update until the current database version is up to date
public MigrateTables ( ) : void
Результат void

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

If there is any table updates that need to be applied, calling this method will apply each update until the specifed update version
public MigrateTables ( System.Version ToVersion ) : void
ToVersion System.Version
Результат void

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

Returns whether or not a player exists in the "player" table
public PlayerExists ( int Pid ) : bool
Pid int The Player ID
Результат bool

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

Creates a connection to the Stats Database
public StatsDatabase ( ) : System
Результат System

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

Clears all stats data from the stats database
public Truncate ( ) : void
Результат void

Описание свойств

LatestVersion публичное статическое свойство

Indicates the most up to date database table version
public static Version,System LatestVersion
Результат System.Version

PlayerTables публичное статическое свойство

An array of Table names that contain only player data
public static string[] PlayerTables
Результат string[]

StatsTables публичное статическое свойство

An array of all Stats specific table names
public static string[] StatsTables
Результат string[]

VersionList публичное статическое свойство

An array of all table versions that we can migrate from if updating from an old database tables version
public static Version[],System VersionList
Результат System.Version[]