C# 클래스 BF2Statistics.Redirector

Provides Methods to apply and remove Gamespy Redirects
파일 보기 프로젝트 열기: BF2Statistics/ControlCenter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Bf2StatsHost string
DnsCacheReport BF2Statistics.Gamespy.Redirector.GamespyDnsReport
GamespyHosts string[]
GamespyServerAddress System.Net.IPAddress
StatsServerAddress System.Net.IPAddress

공개 메소드들

메소드 설명
ApplyRedirectsAsync ( IProgress Progress ) : Task

Applies the specified IP address redirects for the chosen redirect method

Initialize ( ) : Task

The main entry point for the redirector

RebuildDNSCache ( CancellationToken CancelToken ) : void

Preforms the pings required to fill the dns cache. The reason we ping, is because once the HOSTS file is locked, any request made to a url (when the DNS cache is empty), will skip the hosts file, because it cant be read. If we ping first, then the DNS cache fills up with the IP addresses in the hosts file.

RemoveRedirects ( ) : void

Remove the redirects currently active

SetRedirectMode ( RedirectMode Mode ) : bool

Sets a new Redirect method. Using this method removes any previous redirects

VerifyDNSCache ( IProgress Progress = null ) : bool

Queries the DNS Cache for the Gamespy hosts, and verifies that the IP addresses in the DNS Cache match that of the desired redirect IP

비공개 메소드들

메소드 설명
DnsFlushResolverCache ( ) : UInt32
DnsFlushResolverCacheEntry ( string hostName ) : int
RemoveRedirects ( HostsFile HostFile ) : void

Removes all gamespy related redirects in the specified hosts file container

메소드 상세

ApplyRedirectsAsync() 공개 정적인 메소드

Applies the specified IP address redirects for the chosen redirect method
public static ApplyRedirectsAsync ( IProgress Progress ) : Task
Progress IProgress
리턴 Task

Initialize() 공개 정적인 메소드

The main entry point for the redirector
public static Initialize ( ) : Task
리턴 Task

RebuildDNSCache() 공개 정적인 메소드

Preforms the pings required to fill the dns cache. The reason we ping, is because once the HOSTS file is locked, any request made to a url (when the DNS cache is empty), will skip the hosts file, because it cant be read. If we ping first, then the DNS cache fills up with the IP addresses in the hosts file.
public static RebuildDNSCache ( CancellationToken CancelToken ) : void
CancelToken System.Threading.CancellationToken
리턴 void

RemoveRedirects() 공개 정적인 메소드

Remove the redirects currently active
public static RemoveRedirects ( ) : void
리턴 void

SetRedirectMode() 공개 정적인 메소드

Sets a new Redirect method. Using this method removes any previous redirects
public static SetRedirectMode ( RedirectMode Mode ) : bool
Mode RedirectMode The new redirect mode
리턴 bool

VerifyDNSCache() 공개 정적인 메소드

Queries the DNS Cache for the Gamespy hosts, and verifies that the IP addresses in the DNS Cache match that of the desired redirect IP
public static VerifyDNSCache ( IProgress Progress = null ) : bool
Progress IProgress
리턴 bool

프로퍼티 상세

Bf2StatsHost 공개적으로 정적으로 프로퍼티

Returns the hostname for the battlefield 2 stats server
public static string Bf2StatsHost
리턴 string

DnsCacheReport 공개적으로 정적으로 프로퍼티

Gets the last DnsCacheReport object generated by the VerifyDNSCache method
public static GamespyDnsReport,BF2Statistics.Gamespy.Redirector DnsCacheReport
리턴 BF2Statistics.Gamespy.Redirector.GamespyDnsReport

GamespyHosts 공개적으로 정적으로 프로퍼티

Returns an array of all gamespy related service hostnames
public static string[] GamespyHosts
리턴 string[]

GamespyServerAddress 공개적으로 정적으로 프로퍼티

Gets or Sets the Gamespy Server address. If redirects are enabled, changes will not take effect until they are removed.
public static IPAddress,System.Net GamespyServerAddress
리턴 System.Net.IPAddress

StatsServerAddress 공개적으로 정적으로 프로퍼티

Gets or Sets the Stats Server address. If redirects are enabled, changes will not take effect until they are removed.
public static IPAddress,System.Net StatsServerAddress
리턴 System.Net.IPAddress