C# Class BlottoBeats.Library.Networking.BBServerConnection

Server object used to store data about the server
显示文件 Open project: Zwolf11/BlottoBeats Class Usage Examples

Public Methods

Method Description
Authenticate ( Credentials credentials, bool register ) : UserToken

Sends an authentication request to the server. Returns a UserToken object if successful, or null otherwise.

BBServerConnection ( ) : System

Initializes a new connection to a BlottoBeats Server with a default ip address of localhost and a default port of 3000

BBServerConnection ( string ipAddress, int port ) : System

Initializes a new connection to a BlottoBeats Server with the given IP address and port

SendRequest ( BBRequest request ) : BBResponse

Sends a BBRequest to the server

Test ( ) : bool

Tests the server to see if the connection is valid

VerifyToken ( UserToken token ) : bool

Sends a request to the server to verify a user token is valid.

Method Details

Authenticate() public method

Sends an authentication request to the server. Returns a UserToken object if successful, or null otherwise.
public Authenticate ( Credentials credentials, bool register ) : UserToken
credentials BlottoBeats.Library.Authentication.Credentials Credentials object that contains the username and password of the user.
register bool True if registering a new user, false if verifying a current one.
return BlottoBeats.Library.Authentication.UserToken

BBServerConnection() public method

Initializes a new connection to a BlottoBeats Server with a default ip address of localhost and a default port of 3000
public BBServerConnection ( ) : System
return System

BBServerConnection() public method

Initializes a new connection to a BlottoBeats Server with the given IP address and port
public BBServerConnection ( string ipAddress, int port ) : System
ipAddress string IP address of the server
port int Port to connect to the server with
return System

SendRequest() public method

Sends a BBRequest to the server
public SendRequest ( BBRequest request ) : BBResponse
request BBRequest The BBRequest to send
return BBResponse

Test() public method

Tests the server to see if the connection is valid
public Test ( ) : bool
return bool

VerifyToken() public method

Sends a request to the server to verify a user token is valid.
public VerifyToken ( UserToken token ) : bool
token BlottoBeats.Library.Authentication.UserToken Token to verify
return bool