C# Класс BF2Statistics.ASP.StatsManager

The StatsManager is used to provide methods that allow you to Validate ASP servers, Authorize game server IP addresses to post snapshot data, and import snapshot data into the stats database.
Показать файл Открыть проект

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

Метод Описание
ExportPlayerXml ( string XmlPath, int Pid, string Name ) : void

Exports a players stats and history into an Xml file

GenerateNewAIPid ( ) : int

Returns a new PID number for use when creating a new AI Bot for the stats database

GenerateNewPlayerPid ( ) : int

Returns a new PID number for use when creating a new player for the stats database

ImportPlayerXml ( string XmlPath ) : void

Imports a Player XML Sheet from the specified path

IsAuthorizedGameServer ( IPAddress RemoteIP ) : bool

Returns whether the specified IP address is authorized to POST snapshot data to this ASP server. All local IP address are automatically authorized.

Load ( StatsDatabase Driver ) : void

Method to be called everytime the HttpStatsServer is started

QueueServerSnapshot ( string Data, IPAddress ServerAddress ) : void

Adds a server's posted snapshot into the Snapshot Processing Queue, which will process the snapshot as soon as possible. This method is Non-Blocking.

Any errors that occur during the actual import of the data will be logged inside the StatsDebug log

ValidateASPService ( string Url ) : void

Returns whether the specified URI is a valid, and available ASP Service

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

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

If not already running, Whenever a snapshot is added to the Processing Queue, This method will get called to Dequeue and process all snapshots

StatsManager ( ) : System

Static constructor to register for Queue Events

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

ExportPlayerXml() публичный статический Метод

Exports a players stats and history into an Xml file
public static ExportPlayerXml ( string XmlPath, int Pid, string Name ) : void
XmlPath string The folder path to where the XML will be saved
Pid int Player ID
Name string Player Name
Результат void

GenerateNewAIPid() публичный статический Метод

Returns a new PID number for use when creating a new AI Bot for the stats database
public static GenerateNewAIPid ( ) : int
Результат int

GenerateNewPlayerPid() публичный статический Метод

Returns a new PID number for use when creating a new player for the stats database
public static GenerateNewPlayerPid ( ) : int
Результат int

ImportPlayerXml() публичный статический Метод

Imports a Player XML Sheet from the specified path
public static ImportPlayerXml ( string XmlPath ) : void
XmlPath string The full path to the XML file
Результат void

IsAuthorizedGameServer() публичный статический Метод

Returns whether the specified IP address is authorized to POST snapshot data to this ASP server. All local IP address are automatically authorized.
public static IsAuthorizedGameServer ( IPAddress RemoteIP ) : bool
RemoteIP System.Net.IPAddress The server IP to authorize
Результат bool

Load() публичный статический Метод

Method to be called everytime the HttpStatsServer is started
public static Load ( StatsDatabase Driver ) : void
Driver BF2Statistics.Database.StatsDatabase
Результат void

QueueServerSnapshot() публичный статический Метод

Adds a server's posted snapshot into the Snapshot Processing Queue, which will process the snapshot as soon as possible. This method is Non-Blocking.
Any errors that occur during the actual import of the data will be logged inside the StatsDebug log
/// Thrown if the Server IP is not authorized to post game data to this server /// /// Thrown if the provided Snapshot data is not valid, and cannot be processed ///
public static QueueServerSnapshot ( string Data, IPAddress ServerAddress ) : void
Data string The snapshot data provided by the server.
ServerAddress System.Net.IPAddress The IP address of the server.
Результат void

ValidateASPService() публичный статический Метод

Returns whether the specified URI is a valid, and available ASP Service
public static ValidateASPService ( string Url ) : void
Url string The root url to the ASP server. Dont include the /ASP/ path!
Результат void