C# Class WebSocketServer.Client

Represents a single client connected to the game server. This class also handles the send/receive for the web socket connection.
Inheritance: IDisposable
Mostrar archivo Open project: qJake/planning-poker Class Usage Examples

Public Methods

Method Description
Client ( CardServer parent, WebSocketConnection connection ) : System

Initializes a new instance of the Client class with the specified game server and underlying web socket connection.

Dispose ( ) : void

Closes the web socket connection and disposes of this client.

SendError ( string source, string message ) : void

Sends an error through the underlying web socket connection to the browser/client.

SendMessage ( string command ) : void

Sends a message through the underlying web socket connection to the browser/client.

Private Methods

Method Description
Connected ( ) : void

Event handler method for the "OnOpen" event from the web socket.

DiscardActiveRound ( ) : void
Disconnected ( ) : void

Event handler method for the "OnClose" event from the web socket.

FinalizeVote ( string vote ) : void
FlipCards ( ) : void
GetCardList ( ) : void
NewRoundRequest ( string title ) : void
ReceiveMessage ( string message ) : void

Event handler method for the "OnMessage" event from the web socket.

RegisterAdmin ( string pass ) : void
RegisterClient ( string name, string spectator ) : void
RegisterVote ( string vote ) : void
RestartRound ( ) : void
SetCards ( string newCards ) : void
SetSetting ( string key, string value ) : void
SortCards ( ) : void
SwapSpectator ( ) : void
TakeMajority ( ) : void
UndoVote ( ) : void

Method Details

Client() public method

Initializes a new instance of the Client class with the specified game server and underlying web socket connection.
public Client ( CardServer parent, WebSocketConnection connection ) : System
parent CardServer The game server that this client is connected to.
connection WebSocketConnection The underlying web socket connection that is associated with this client.
return System

Dispose() public method

Closes the web socket connection and disposes of this client.
public Dispose ( ) : void
return void

SendError() public method

Sends an error through the underlying web socket connection to the browser/client.
public SendError ( string source, string message ) : void
source string The source of the error.
message string The error message.
return void

SendMessage() public method

Sends a message through the underlying web socket connection to the browser/client.
public SendMessage ( string command ) : void
command string The command to send.
return void