C# 클래스 BF2Statistics.Gamespy.GpcmClient

Gamespy Client Manager This class is used to proccess the client login process, create new user accounts, and fetch profile information gpcm.gamespy.com
상속: IDisposable
파일 보기 프로젝트 열기: BF2Statistics/ControlCenter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
ConnectionId int
Created System.DateTime

보호된 프로퍼티들

프로퍼티 타입 설명
Crc BF2Statistics.Utilities.Crc16

공개 메소드들

메소드 설명
Disconnect ( int code ) : void

Logs the client out of the game client, and closes the stream

Codes: 0 => Client sends the "logout" command 1 => The login timer elapsed and the client wasnt logged in or this object was disposed, forcefully disconnected 2 => Invalid login query, or username was incorrect 3 => Incorrect Password 4 => An error occured while trying to login the client (could be database related) 5 => Cant create account, username exists already 6 => Error Creating new account in database 7 => Invalid query for account creation, or an exception was thrown while trying to create account 8 => Remote Connection closed the Stream or was un-readchable 9 => Forced server shutdown [No events called, database sessions are not updated, and EventArgs are disposed]

Dispose ( ) : void

Disposes of the client object. The connection is no longer closed here and the Disconnect even is NO LONGER fired

Equals ( object Obj ) : bool
GetHashCode ( ) : int
GpcmClient ( GamespyTcpStream ConnectionStream, int ConnectionId ) : System

Constructor

ProcessLogin ( string>.Dictionary Recv ) : void

This method verifies the login information sent by the client, and returns encrypted data for the client to verify as well

SendKeepAlive ( ) : void

Polls the connection, and checks for drops

SendServerChallenge ( ) : void

This method starts off by sending a random string 10 characters in length, known as the Server challenge key. This is used by the client to return a client challenge key, which is used to validate login information later.

비공개 메소드들

메소드 설명
ConvertToKeyValue ( string parts ) : string>.Dictionary

Converts a recived parameter array from the client string to a keyValue pair dictionary

CreateNewUser ( string>.Dictionary Recv ) : void

Whenever the "newuser" command is recieved, this method is called to add the new users information into the database

GenerateProof ( string challenge1, string challenge2 ) : string

Generates an MD5 hash, which is used to verify the clients login information

GenerateRandomString ( int length ) : string

Generates a random alpha-numeric string

GenerateSig ( ) : string

Generates a random signature

SendProfile ( ) : void

This method is called when the client requests for the Account profile

Stream_DataReceived ( string message ) : void

Event called when a complete message has been recieved

Stream_OnDisconnect ( ) : void

Event fired when the stream disconnects. Even though its 1 line, we un-register it at one point, so it needs to be here

UpdateUser ( string>.Dictionary Recv ) : void

Updates the Users Country code when sent by the client

메소드 상세

Disconnect() 공개 메소드

Logs the client out of the game client, and closes the stream
Codes: 0 => Client sends the "logout" command 1 => The login timer elapsed and the client wasnt logged in or this object was disposed, forcefully disconnected 2 => Invalid login query, or username was incorrect 3 => Incorrect Password 4 => An error occured while trying to login the client (could be database related) 5 => Cant create account, username exists already 6 => Error Creating new account in database 7 => Invalid query for account creation, or an exception was thrown while trying to create account 8 => Remote Connection closed the Stream or was un-readchable 9 => Forced server shutdown [No events called, database sessions are not updated, and EventArgs are disposed]
public Disconnect ( int code ) : void
code int /// The disconnect code. If set to 9, the OnDisconect event will not be called, the database /// will not be updated to reset everyone's session code, and the EventArgs objects will NOT /// be returned to the IO pool. You should only set to 9 for a planned server shutdown. ///
리턴 void

Dispose() 공개 메소드

Disposes of the client object. The connection is no longer closed here and the Disconnect even is NO LONGER fired
public Dispose ( ) : void
리턴 void

Equals() 공개 메소드

public Equals ( object Obj ) : bool
Obj object
리턴 bool

GetHashCode() 공개 메소드

public GetHashCode ( ) : int
리턴 int

GpcmClient() 공개 메소드

Constructor
public GpcmClient ( GamespyTcpStream ConnectionStream, int ConnectionId ) : System
ConnectionStream BF2Statistics.Gamespy.Net.GamespyTcpStream
ConnectionId int
리턴 System

ProcessLogin() 공개 메소드

This method verifies the login information sent by the client, and returns encrypted data for the client to verify as well
public ProcessLogin ( string>.Dictionary Recv ) : void
Recv string>.Dictionary
리턴 void

SendKeepAlive() 공개 메소드

Polls the connection, and checks for drops
public SendKeepAlive ( ) : void
리턴 void

SendServerChallenge() 공개 메소드

This method starts off by sending a random string 10 characters in length, known as the Server challenge key. This is used by the client to return a client challenge key, which is used to validate login information later.
public SendServerChallenge ( ) : void
리턴 void

프로퍼티 상세

ConnectionId 공개적으로 프로퍼티

Indicates the connection ID for this connection
public int ConnectionId
리턴 int

Crc 보호되어 있는 정적으로 프로퍼티

Our CRC16 object for generating Checksums
protected static Crc16,BF2Statistics.Utilities Crc
리턴 BF2Statistics.Utilities.Crc16

Created 공개적으로 프로퍼티

Indicates the date and time this connection was created
public DateTime,System Created
리턴 System.DateTime