C# Class BF2Statistics.Web.HttpServer

The ASP Server is used to emulate the official Gamespy BF2 Stats Server HTTP Requests, and provide players with the ability to run thier own BF2 Ranking system on thier personal PC's.
Show file Open project: BF2Statistics/ControlCenter

Public Properties

Property Type Description
AcceptableMethods string[]
LocalIPs List
ModelType System.Type
SessionRequests int

Public Methods

Method Description
ClearRazorCache ( ) : void

Removes all of the Razor Engine built temporary files from the AppData/Temp folder

Start ( ) : void

Start the ASP listener, and Connects to the stats database

Stop ( ) : void

Stops the ASP listener, and unbinds from the port.

Private Methods

Method Description
CreateHttpListener ( ) : void

Creates the HttpListener object, and configures the prefixes

CreateRazorService ( ) : void

Creates the Razor Engine Service needed to properly handle the cshtml files

GetASPController ( HttpClient Client, string Document ) : ASPController

Returns the specified ASPController object for handling the ASP response, or null if the Document does not have a controller

GetBf2StatsController ( string Document, HttpClient Client ) : Controller

Returns the specified Controller object for handling the bf2stats response, or null if the Document does not have a controller

HandleRequest ( IAsyncResult Sync ) : void

Accepts the connection

HttpServer ( ) : System

Static constructor

ProcessRequest ( HttpClient Client ) : void

Handles the Http Connecting client and processes the HttpResponse

Method Details

ClearRazorCache() public static method

Removes all of the Razor Engine built temporary files from the AppData/Temp folder
public static ClearRazorCache ( ) : void
return void

Start() public static method

Start the ASP listener, and Connects to the stats database
public static Start ( ) : void
return void

Stop() public static method

Stops the ASP listener, and unbinds from the port.
public static Stop ( ) : void
return void

Property Details

AcceptableMethods public static property

An array of http request methods that this server will accept
public static string[] AcceptableMethods
return string[]

LocalIPs public static property

A List of local IP addresses for this machine
public static List LocalIPs
return List

ModelType public static property

Gets the default ModelType for bf2stats pages
public static Type,System ModelType
return System.Type

SessionRequests public static property

Number of session web requests
public static int SessionRequests
return int