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
Afficher le fichier Open project: qJake/planning-poker Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat System

Dispose() public méthode

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

SendError() public méthode

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.
Résultat void

SendMessage() public méthode

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