C# Class BF2Statistics.Database.StatsDatabase

A class to provide common tasks against the Stats Database
Inheritance: BF2Statistics.Database.DatabaseDriver, IDisposable
Afficher le fichier Open project: BF2Statistics/ControlCenter Class Usage Examples

Méthodes publiques

Свойство Type Description
LatestVersion System.Version
PlayerTables string[]
StatsTables string[]
VersionList System.Version[]

Méthodes publiques

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

Méthodes protégées

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

Private Methods

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

Method Details

CreateSqlTables() public méthode

Tells the Database to install the Stats tables into the database
public CreateSqlTables ( IProgress TaskProgress = null ) : void
TaskProgress IProgress
Résultat void

DeletePlayer() public méthode

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

GetPlayerAwards() public méthode

Returns a list of awards a player has earned
public GetPlayerAwards ( int Pid ) : object>>.List
Pid int The Player ID
Résultat object>>.List

GetTablesVersion() protected méthode

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

MigrateTables() public méthode

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

MigrateTables() public méthode

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

PlayerExists() public méthode

Returns whether or not a player exists in the "player" table
public PlayerExists ( int Pid ) : bool
Pid int The Player ID
Résultat bool

StatsDatabase() public méthode

Creates a connection to the Stats Database
public StatsDatabase ( ) : System
Résultat System

Truncate() public méthode

Clears all stats data from the stats database
public Truncate ( ) : void
Résultat void

Property Details

LatestVersion public_oe static_oe property

Indicates the most up to date database table version
public static Version,System LatestVersion
Résultat System.Version

PlayerTables public_oe static_oe property

An array of Table names that contain only player data
public static string[] PlayerTables
Résultat string[]

StatsTables public_oe static_oe property

An array of all Stats specific table names
public static string[] StatsTables
Résultat string[]

VersionList public_oe static_oe property

An array of all table versions that we can migrate from if updating from an old database tables version
public static Version[],System VersionList
Résultat System.Version[]