C# Class Octgn.Networking.Handler

Show file Open project: octgn/OCTGN Class Usage Examples

Public Methods

Method Description
AddMarker ( Octgn.Play.Player player, Card card, System.Guid id, string name, ushort count, ushort oldCount, bool isScriptChange ) : void
AddPacks ( Octgn.Play.Player player, System.Guid packs, bool selfOnly ) : void
AnchorCard ( Card card, Octgn.Play.Player player, bool anchor ) : void
Binary ( ) : void
CancelLimited ( Octgn.Play.Player player ) : void
CardSwitchTo ( Octgn.Play.Player player, Card card, string alternate ) : void
Chat ( Octgn.Play.Player player, string text ) : void
Counter ( Octgn.Play.Player player, Octgn.Play.Counter counter, int value, bool isScriptChange ) : void
CreateAliasDeprecated ( int arg0, ulong ulongs ) : void
CreateCard ( int id, System.Guid type, string size, Octgn.Play.Group group ) : void

Creates new Cards as well as the corresponding CardIdentities. All cards are created in the same group.

CreateCardAt ( int id, System.Guid modelId, int x, int y, bool faceUp, bool persist ) : void

Creates new cards on the table, as well as the corresponding CardIdentities.

DeleteCard ( Card card, Octgn.Play.Player player ) : void
DontTake ( Octgn.Play.ControllableObject obj ) : void
Error ( string msg ) : void
Filter ( Card card, Color color ) : void
FreezeCardsVisibility ( Octgn.Play.Group group ) : void
GameState ( Octgn.Play.Player fromPlayer, string strstate ) : void
GameStateReq ( Octgn.Play.Player fromPlayer ) : void
GroupVis ( Octgn.Play.Player player, Octgn.Play.Group group, bool defined, bool visible ) : void
GroupVisAdd ( Octgn.Play.Player player, Octgn.Play.Group group, Octgn.Play.Player whom ) : void
GroupVisRemove ( Octgn.Play.Player player, Octgn.Play.Group group, Octgn.Play.Player whom ) : void
Handler ( ) : System
Highlight ( Card card, Color color ) : void
IsTableBackgroundFlipped ( bool isFlipped ) : void
Kick ( string reason ) : void
Leave ( Octgn.Play.Player player ) : void

Create new CardIdentities, which hide aliases to other CardIdentities

LoadDeck ( int id, System.Guid type, Octgn.Play.Group group, string size, string sleeve, bool limited ) : void

Loads a player deck.

LookAt ( Octgn.Play.Player player, int uid, Octgn.Play.Group group, bool look ) : void
LookAtBottom ( Octgn.Play.Player player, int uid, Octgn.Play.Group group, int count, bool look ) : void
LookAtTop ( Octgn.Play.Player player, int uid, Octgn.Play.Group group, int count, bool look ) : void
MoveCard ( Octgn.Play.Player player, int card, Octgn.Play.Group to, int idx, bool faceUp, bool isScriptMove ) : void
MoveCardAt ( Octgn.Play.Player player, int cards, int x, int y, int idx, bool faceUp, bool isScriptMove ) : void
NewPlayer ( byte id, string nick, ulong pkey, bool invertedTable, bool spectator ) : void
NextTurn ( Octgn.Play.Player player, bool force ) : void
Nick ( Octgn.Play.Player player, string nick ) : void
PassTo ( Octgn.Play.Player who, Octgn.Play.ControllableObject obj, Octgn.Play.Player player, bool requested ) : void

Completely remove all aliases from a group, e.g. before performing a shuffle.

Unalias some Cards, e.g. before a shuffle

Peek ( Octgn.Play.Player player, Card card ) : void
Ping ( ) : void
PlaySound ( Octgn.Play.Player player, string name ) : void
PlayerDisconnect ( Octgn.Play.Player player ) : void
PlayerSetGlobalVariable ( Octgn.Play.Player p, string name, string oldValue, string value ) : void
PlayerSettings ( Octgn.Play.Player player, bool invertedTable, bool spectator ) : void
PlayerState ( Octgn.Play.Player player, byte b ) : void
Print ( Octgn.Play.Player player, string text ) : void
Random ( int result ) : void
Ready ( Octgn.Play.Player player ) : void
ReceiveMessage ( byte data ) : void
RemoteCall ( Octgn.Play.Player fromplayer, string func, string args ) : void
RemoveMarker ( Octgn.Play.Player player, Card card, System.Guid id, string name, ushort count, ushort oldCount, bool isScriptChange ) : void
Reset ( Octgn.Play.Player player ) : void
ResetCardProperties ( Card card, Octgn.Play.Player player ) : void
Rotate ( Octgn.Play.Player player, Card card, CardOrientation rot ) : void
SetBoard ( string name ) : void
SetCardProperty ( Card card, Octgn.Play.Player player, string name, string val, string valtype ) : void
SetGlobalVariable ( string name, string oldValue, string value ) : void
SetPhase ( byte phase, byte nextPhase, bool force ) : void
SetPlayerColor ( Octgn.Play.Player player, string colorHex ) : void
Settings ( bool twoSidedTable, bool allowSpectators, bool muteSpectators ) : void
ShuffleDeprecated ( Octgn.Play.Group arg0, int ints ) : void
Shuffled ( Octgn.Play.Player player, Octgn.Play.Group group, int card, short pos ) : void

Part of a shuffle process.

Start ( ) : void
StartLimited ( Octgn.Play.Player player, System.Guid packs ) : void
StopPhase ( Octgn.Play.Player player, byte phase ) : void
StopTurn ( Octgn.Play.Player player ) : void
TakeFrom ( Octgn.Play.ControllableObject obj, Octgn.Play.Player to ) : void
Target ( Octgn.Play.Player player, Card card, bool isScriptChange ) : void
TargetArrow ( Octgn.Play.Player player, Card card, Card otherCard, bool isScriptChange ) : void
TransferMarker ( Octgn.Play.Player player, Card from, Card to, System.Guid id, string name, ushort count, ushort oldCount, bool isScriptChange ) : void
Turn ( Octgn.Play.Player player, Card card, bool up ) : void
UnaliasDeprecated ( int arg0, ulong ulongs ) : void
UnaliasGrpDeprecated ( Octgn.Play.Group arg0 ) : void
Untarget ( Octgn.Play.Player player, Card card, bool isScriptChange ) : void
Welcome ( byte id, System.Guid gameSessionId, bool waitForGameState ) : void

Private Methods

Method Description
CreateCard ( IList id, IList type, IList groups, IList sizes, string sleeveUrl = "" ) : void

Creates new Cards as well as the corresponding CardIdentities. The cards may be in different groups.

Method Details

AddMarker() public method

public AddMarker ( Octgn.Play.Player player, Card card, System.Guid id, string name, ushort count, ushort oldCount, bool isScriptChange ) : void
player Octgn.Play.Player
card Octgn.Play.Card
id System.Guid
name string
count ushort
oldCount ushort
isScriptChange bool
return void

AddPacks() public method

public AddPacks ( Octgn.Play.Player player, System.Guid packs, bool selfOnly ) : void
player Octgn.Play.Player
packs System.Guid
selfOnly bool
return void

AnchorCard() public method

public AnchorCard ( Card card, Octgn.Play.Player player, bool anchor ) : void
card Octgn.Play.Card
player Octgn.Play.Player
anchor bool
return void

Binary() public method

public Binary ( ) : void
return void

CancelLimited() public method

public CancelLimited ( Octgn.Play.Player player ) : void
player Octgn.Play.Player
return void

CardSwitchTo() public method

public CardSwitchTo ( Octgn.Play.Player player, Card card, string alternate ) : void
player Octgn.Play.Player
card Octgn.Play.Card
alternate string
return void

Chat() public method

public Chat ( Octgn.Play.Player player, string text ) : void
player Octgn.Play.Player
text string
return void

Counter() public method

public Counter ( Octgn.Play.Player player, Octgn.Play.Counter counter, int value, bool isScriptChange ) : void
player Octgn.Play.Player
counter Octgn.Play.Counter
value int
isScriptChange bool
return void

CreateAliasDeprecated() public method

public CreateAliasDeprecated ( int arg0, ulong ulongs ) : void
arg0 int
ulongs ulong
return void

CreateCard() public method

Creates new Cards as well as the corresponding CardIdentities. All cards are created in the same group.
public CreateCard ( int id, System.Guid type, string size, Octgn.Play.Group group ) : void
id int An array with the new CardIdentity ids.
type System.Guid An array containing the corresponding CardModel guids (encrypted)
size string
group Octgn.Play.Group The group, in which the cards are added.
return void

CreateCardAt() public method

Creates new cards on the table, as well as the corresponding CardIdentities.
public CreateCardAt ( int id, System.Guid modelId, int x, int y, bool faceUp, bool persist ) : void
id int An array with the new CardIdentity ids
modelId System.Guid
x int The x position of the cards on the table.
y int The y position of the cards on the table.
faceUp bool Whether the cards are face up or not.
persist bool
return void

DeleteCard() public method

public DeleteCard ( Card card, Octgn.Play.Player player ) : void
card Octgn.Play.Card
player Octgn.Play.Player
return void

DontTake() public method

public DontTake ( Octgn.Play.ControllableObject obj ) : void
obj Octgn.Play.ControllableObject
return void

Error() public method

public Error ( string msg ) : void
msg string
return void

Filter() public method

public Filter ( Card card, Color color ) : void
card Octgn.Play.Card
color Color
return void

FreezeCardsVisibility() public method

public FreezeCardsVisibility ( Octgn.Play.Group group ) : void
group Octgn.Play.Group
return void

GameState() public method

public GameState ( Octgn.Play.Player fromPlayer, string strstate ) : void
fromPlayer Octgn.Play.Player
strstate string
return void

GameStateReq() public method

public GameStateReq ( Octgn.Play.Player fromPlayer ) : void
fromPlayer Octgn.Play.Player
return void

GroupVis() public method

public GroupVis ( Octgn.Play.Player player, Octgn.Play.Group group, bool defined, bool visible ) : void
player Octgn.Play.Player
group Octgn.Play.Group
defined bool
visible bool
return void

GroupVisAdd() public method

public GroupVisAdd ( Octgn.Play.Player player, Octgn.Play.Group group, Octgn.Play.Player whom ) : void
player Octgn.Play.Player
group Octgn.Play.Group
whom Octgn.Play.Player
return void

GroupVisRemove() public method

public GroupVisRemove ( Octgn.Play.Player player, Octgn.Play.Group group, Octgn.Play.Player whom ) : void
player Octgn.Play.Player
group Octgn.Play.Group
whom Octgn.Play.Player
return void

Handler() public method

public Handler ( ) : System
return System

Highlight() public method

public Highlight ( Card card, Color color ) : void
card Octgn.Play.Card
color Color
return void

IsTableBackgroundFlipped() public method

public IsTableBackgroundFlipped ( bool isFlipped ) : void
isFlipped bool
return void

Kick() public method

public Kick ( string reason ) : void
reason string
return void

Leave() public method

Create new CardIdentities, which hide aliases to other CardIdentities
public Leave ( Octgn.Play.Player player ) : void
player Octgn.Play.Player
return void

LoadDeck() public method

Loads a player deck.
public LoadDeck ( int id, System.Guid type, Octgn.Play.Group group, string size, string sleeve, bool limited ) : void
id int An array containing the loaded CardIdentity ids.
type System.Guid An array containing the corresponding CardModel guids (encrypted).
group Octgn.Play.Group An array indicating the group the cards must be loaded into.
size string
sleeve string
limited bool
return void

LookAt() public method

public LookAt ( Octgn.Play.Player player, int uid, Octgn.Play.Group group, bool look ) : void
player Octgn.Play.Player
uid int
group Octgn.Play.Group
look bool
return void

LookAtBottom() public method

public LookAtBottom ( Octgn.Play.Player player, int uid, Octgn.Play.Group group, int count, bool look ) : void
player Octgn.Play.Player
uid int
group Octgn.Play.Group
count int
look bool
return void

LookAtTop() public method

public LookAtTop ( Octgn.Play.Player player, int uid, Octgn.Play.Group group, int count, bool look ) : void
player Octgn.Play.Player
uid int
group Octgn.Play.Group
count int
look bool
return void

MoveCard() public method

public MoveCard ( Octgn.Play.Player player, int card, Octgn.Play.Group to, int idx, bool faceUp, bool isScriptMove ) : void
player Octgn.Play.Player
card int
to Octgn.Play.Group
idx int
faceUp bool
isScriptMove bool
return void

MoveCardAt() public method

public MoveCardAt ( Octgn.Play.Player player, int cards, int x, int y, int idx, bool faceUp, bool isScriptMove ) : void
player Octgn.Play.Player
cards int
x int
y int
idx int
faceUp bool
isScriptMove bool
return void

NewPlayer() public method

public NewPlayer ( byte id, string nick, ulong pkey, bool invertedTable, bool spectator ) : void
id byte
nick string
pkey ulong
invertedTable bool
spectator bool
return void

NextTurn() public method

public NextTurn ( Octgn.Play.Player player, bool force ) : void
player Octgn.Play.Player
force bool
return void

Nick() public method

public Nick ( Octgn.Play.Player player, string nick ) : void
player Octgn.Play.Player
nick string
return void

PassTo() public method

Completely remove all aliases from a group, e.g. before performing a shuffle. Unalias some Cards, e.g. before a shuffle
public PassTo ( Octgn.Play.Player who, Octgn.Play.ControllableObject obj, Octgn.Play.Player player, bool requested ) : void
who Octgn.Play.Player
obj Octgn.Play.ControllableObject
player Octgn.Play.Player
requested bool
return void

Peek() public method

public Peek ( Octgn.Play.Player player, Card card ) : void
player Octgn.Play.Player
card Octgn.Play.Card
return void

Ping() public method

public Ping ( ) : void
return void

PlaySound() public method

public PlaySound ( Octgn.Play.Player player, string name ) : void
player Octgn.Play.Player
name string
return void

PlayerDisconnect() public method

public PlayerDisconnect ( Octgn.Play.Player player ) : void
player Octgn.Play.Player
return void

PlayerSetGlobalVariable() public method

public PlayerSetGlobalVariable ( Octgn.Play.Player p, string name, string oldValue, string value ) : void
p Octgn.Play.Player
name string
oldValue string
value string
return void

PlayerSettings() public method

public PlayerSettings ( Octgn.Play.Player player, bool invertedTable, bool spectator ) : void
player Octgn.Play.Player
invertedTable bool
spectator bool
return void

PlayerState() public method

public PlayerState ( Octgn.Play.Player player, byte b ) : void
player Octgn.Play.Player
b byte
return void

Print() public method

public Print ( Octgn.Play.Player player, string text ) : void
player Octgn.Play.Player
text string
return void

Random() public method

public Random ( int result ) : void
result int
return void

Ready() public method

public Ready ( Octgn.Play.Player player ) : void
player Octgn.Play.Player
return void

ReceiveMessage() public method

public ReceiveMessage ( byte data ) : void
data byte
return void

RemoteCall() public method

public RemoteCall ( Octgn.Play.Player fromplayer, string func, string args ) : void
fromplayer Octgn.Play.Player
func string
args string
return void

RemoveMarker() public method

public RemoveMarker ( Octgn.Play.Player player, Card card, System.Guid id, string name, ushort count, ushort oldCount, bool isScriptChange ) : void
player Octgn.Play.Player
card Octgn.Play.Card
id System.Guid
name string
count ushort
oldCount ushort
isScriptChange bool
return void

Reset() public method

public Reset ( Octgn.Play.Player player ) : void
player Octgn.Play.Player
return void

ResetCardProperties() public method

public ResetCardProperties ( Card card, Octgn.Play.Player player ) : void
card Octgn.Play.Card
player Octgn.Play.Player
return void

Rotate() public method

public Rotate ( Octgn.Play.Player player, Card card, CardOrientation rot ) : void
player Octgn.Play.Player
card Octgn.Play.Card
rot CardOrientation
return void

SetBoard() public method

public SetBoard ( string name ) : void
name string
return void

SetCardProperty() public method

public SetCardProperty ( Card card, Octgn.Play.Player player, string name, string val, string valtype ) : void
card Octgn.Play.Card
player Octgn.Play.Player
name string
val string
valtype string
return void

SetGlobalVariable() public method

public SetGlobalVariable ( string name, string oldValue, string value ) : void
name string
oldValue string
value string
return void

SetPhase() public method

public SetPhase ( byte phase, byte nextPhase, bool force ) : void
phase byte
nextPhase byte
force bool
return void

SetPlayerColor() public method

public SetPlayerColor ( Octgn.Play.Player player, string colorHex ) : void
player Octgn.Play.Player
colorHex string
return void

Settings() public method

public Settings ( bool twoSidedTable, bool allowSpectators, bool muteSpectators ) : void
twoSidedTable bool
allowSpectators bool
muteSpectators bool
return void

ShuffleDeprecated() public method

public ShuffleDeprecated ( Octgn.Play.Group arg0, int ints ) : void
arg0 Octgn.Play.Group
ints int
return void

Shuffled() public method

Part of a shuffle process.
public Shuffled ( Octgn.Play.Player player, Octgn.Play.Group group, int card, short pos ) : void
player Octgn.Play.Player
group Octgn.Play.Group The group being shuffled.
card int An array containing the CardIdentity ids to shuffle.
pos short
return void

Start() public method

public Start ( ) : void
return void

StartLimited() public method

public StartLimited ( Octgn.Play.Player player, System.Guid packs ) : void
player Octgn.Play.Player
packs System.Guid
return void

StopPhase() public method

public StopPhase ( Octgn.Play.Player player, byte phase ) : void
player Octgn.Play.Player
phase byte
return void

StopTurn() public method

public StopTurn ( Octgn.Play.Player player ) : void
player Octgn.Play.Player
return void

TakeFrom() public method

public TakeFrom ( Octgn.Play.ControllableObject obj, Octgn.Play.Player to ) : void
obj Octgn.Play.ControllableObject
to Octgn.Play.Player
return void

Target() public method

public Target ( Octgn.Play.Player player, Card card, bool isScriptChange ) : void
player Octgn.Play.Player
card Octgn.Play.Card
isScriptChange bool
return void

TargetArrow() public method

public TargetArrow ( Octgn.Play.Player player, Card card, Card otherCard, bool isScriptChange ) : void
player Octgn.Play.Player
card Octgn.Play.Card
otherCard Octgn.Play.Card
isScriptChange bool
return void

TransferMarker() public method

public TransferMarker ( Octgn.Play.Player player, Card from, Card to, System.Guid id, string name, ushort count, ushort oldCount, bool isScriptChange ) : void
player Octgn.Play.Player
from Octgn.Play.Card
to Octgn.Play.Card
id System.Guid
name string
count ushort
oldCount ushort
isScriptChange bool
return void

Turn() public method

public Turn ( Octgn.Play.Player player, Card card, bool up ) : void
player Octgn.Play.Player
card Octgn.Play.Card
up bool
return void

UnaliasDeprecated() public method

public UnaliasDeprecated ( int arg0, ulong ulongs ) : void
arg0 int
ulongs ulong
return void

UnaliasGrpDeprecated() public method

public UnaliasGrpDeprecated ( Octgn.Play.Group arg0 ) : void
arg0 Octgn.Play.Group
return void

Untarget() public method

public Untarget ( Octgn.Play.Player player, Card card, bool isScriptChange ) : void
player Octgn.Play.Player
card Octgn.Play.Card
isScriptChange bool
return void

Welcome() public method

public Welcome ( byte id, System.Guid gameSessionId, bool waitForGameState ) : void
id byte
gameSessionId System.Guid
waitForGameState bool
return void