Method | Description | |
---|---|---|
BeginNewRound ( string title ) : bool |
Begins a new round.
|
|
BroadcastClientList ( ) : void |
Sends the most recent client list to all of the clients.
|
|
BroadcastError ( |
Broadcasts an error message to all clients. If an origin is specified, the message is not re-broadcast back to the origin.
|
|
BroadcastGameState ( ) : void |
Broadcasts the current game state to each of the connected clients.
|
|
BroadcastMessage ( |
Broadcasts a JSON message to all clients. If an origin is specified, the message is not re-broadcast back to the origin.
|
|
CardServer ( string adminPass ) : System.Collections.Generic |
Initializes a new instance of the CardServer class, with the specified admin password.
|
|
DiscardActiveRound ( ) : void |
Discards the active round and all of its associted data.
|
|
GetRoundState ( ) : Newtonsoft.Json.Linq.JObject |
Compiles the state of the current round and serializes it as a JObject.
|
|
GetSetting ( string key, string defaultValue ) : string |
Retrieves a setting, or returns the default value if the setting doesn't exist.
|
|
NewClient ( WebSocketConnection conn ) : void |
Accepts a new WebSocketConnection object and creates a new game Client based on it.
|
|
RegisterAdmin ( |
Attempts to register the specified client as an admin using the specified password. This checks against the server password, and will return true if the password was correct (and the client was elevated to an admin), otherwise it returns false.
|
|
RegisterVote ( |
Registers a new vote for the specified client, with the specified vote value.
|
|
RemoveClient ( |
Removes the specified client from the game, usually due to a disconnect. This also cleans up their votes and other game data.
|
|
SortCards ( ) : bool |
Sorts the cards from lowest to highest using the VoteComparer class.
|
|
UndoVote ( |
Removes a vote that the client previously registered.
|
|
UpdateSetting ( string name, string value ) : void |
Helper method to update a setting with a value, or add it if it doesn't exist yet.
|
Method | Description | |
---|---|---|
AutoSortOnFlip ( ) : void |
Helper method; when called, if the "AutoSort" setting is on, this will flip the cards.
|
|
CheckVoteCount ( ) : void |
Checks if everyone who is logged in, and is playing, has voted. If so, after a 1s delay, the cards are flipped.
|
public BeginNewRound ( string title ) : bool | ||
title | string | The title of the new round. |
return | bool |
public BroadcastError ( |
||
origin | Optionally, a client origin which the error will not be broadcast back to. Set to |
|
source | string | The source of the error. |
message | string | The error message to broadcast. |
sendBack | bool | Whether or not to send the error back to the origin client or not. |
return | void |
public BroadcastMessage ( |
||
origin | Optionally, a client origin which the message will not be broadcast back to. Set to |
|
message | string | The message to broadcast. |
return | void |
public CardServer ( string adminPass ) : System.Collections.Generic | ||
adminPass | string | The admin password for this game. |
return | System.Collections.Generic |
public GetRoundState ( ) : Newtonsoft.Json.Linq.JObject | ||
return | Newtonsoft.Json.Linq.JObject |
public GetSetting ( string key, string defaultValue ) : string | ||
key | string | The key of the setting to retrieve. |
defaultValue | string | The default value, if the setting was not found in the store. |
return | string |
public NewClient ( WebSocketConnection conn ) : void | ||
conn | WebSocketConnection | The connection to use for the new client. |
return | void |
public RegisterAdmin ( |
||
c | The client requesting administrative priveleges. | |
pass | string | The password that the client provided, to be checked against the actual password for the server. |
return | bool |
public RegisterVote ( |
||
c | The client who voted. | |
vote | string | The value of the vote. |
return | bool |
public RemoveClient ( |
||
c | The client to remove. | |
return | void |
public UndoVote ( |
||
c | The client whose vote to remove. | |
return | bool |
public UpdateSetting ( string name, string value ) : void | ||
name | string | The name (or key) of the setting. |
value | string | The value of the setting. |
return | void |