C# Класс BlottoBeats.Library.Networking.BBServerConnection

Server object used to store data about the server
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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.

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

Authenticate() публичный Метод

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.
Результат BlottoBeats.Library.Authentication.UserToken

BBServerConnection() публичный Метод

Initializes a new connection to a BlottoBeats Server with a default ip address of localhost and a default port of 3000
public BBServerConnection ( ) : System
Результат System

BBServerConnection() публичный Метод

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
Результат System

SendRequest() публичный Метод

Sends a BBRequest to the server
public SendRequest ( BBRequest request ) : BBResponse
request BBRequest The BBRequest to send
Результат BBResponse

Test() публичный Метод

Tests the server to see if the connection is valid
public Test ( ) : bool
Результат bool

VerifyToken() публичный Метод

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
Результат bool