Photon Server API

Public Member Functions | Properties | List of all members
Photon.SocketServer.OperationRequest Class Reference

Each incoming operation is translated to an OperationRequest. It is then dispatched with PeerBase.OnOperationRequest. More...

Public Member Functions

 OperationRequest (byte operationCode, object dataContract)
 Initializes a new instance of the OperationRequest class. More...
 
 OperationRequest (byte operationCode, Dictionary< byte, object > parameters)
 Initializes a new instance of the OperationRequest class. This constructor sets the Parameters and the OperationCode. More...
 
 OperationRequest (byte operationCode)
 Initializes a new instance of the OperationRequest class. More...
 
 OperationRequest ()
 Initializes a new instance of the OperationRequest class. More...
 
void SetParameters (object dataContract)
 Converts properties of an object to Parameters. Included properties require the DataMemberAttribute. More...
 
void SetParameters (Dictionary< byte, object > parameters)
 Replaces the Parameters with parameters . More...
 

Properties

object this[byte parameterKey] [get, set]
 Gets or sets the paramter associated with the specified key. More...
 
byte OperationCode [get, set]
 Gets or sets the operation code. It determines how the server responds. More...
 
Dictionary< byte, object > Parameters [get, set]
 Gets or sets the request parameters. More...
 

Detailed Description

Each incoming operation is translated to an OperationRequest. It is then dispatched with PeerBase.OnOperationRequest.

Constructor & Destructor Documentation

◆ OperationRequest() [1/4]

Photon.SocketServer.OperationRequest.OperationRequest ( byte  operationCode,
object  dataContract 
)
inline

Initializes a new instance of the OperationRequest class.

Parameters
operationCodeThe operation Code.
dataContractAll properties of dataContract with the DataMemberAttribute are mapped to the Parameters dictionary.

◆ OperationRequest() [2/4]

Photon.SocketServer.OperationRequest.OperationRequest ( byte  operationCode,
Dictionary< byte, object >  parameters 
)
inline

Initializes a new instance of the OperationRequest class. This constructor sets the Parameters and the OperationCode.

Parameters
operationCodeDetermines the OperationCode.
parametersDetermines the Parameters.

◆ OperationRequest() [3/4]

Photon.SocketServer.OperationRequest.OperationRequest ( byte  operationCode)
inline

Initializes a new instance of the OperationRequest class.

Parameters
operationCodeThe operation Code.

◆ OperationRequest() [4/4]

Photon.SocketServer.OperationRequest.OperationRequest ( )
inline

Initializes a new instance of the OperationRequest class.

Member Function Documentation

◆ SetParameters() [1/2]

void Photon.SocketServer.OperationRequest.SetParameters ( Dictionary< byte, object >  parameters)
inline

Replaces the Parameters with parameters .

Parameters
parametersThe parameters to set.

◆ SetParameters() [2/2]

void Photon.SocketServer.OperationRequest.SetParameters ( object  dataContract)
inline

Converts properties of an object to Parameters. Included properties require the DataMemberAttribute.

Parameters
dataContractThe properties of this object are mapped to Parameters.

Property Documentation

◆ OperationCode

byte Photon.SocketServer.OperationRequest.OperationCode
getset

Gets or sets the operation code. It determines how the server responds.

◆ Parameters

Dictionary<byte, object> Photon.SocketServer.OperationRequest.Parameters
getset

Gets or sets the request parameters.

◆ this[byte parameterKey]

object Photon.SocketServer.OperationRequest.this[byte parameterKey]
getset

Gets or sets the paramter associated with the specified key.

Parameters
parameterKeyThe key of the parameter to get or set.
Returns
The parameter associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new paramter with the specified key.
Exceptions
System.NullReferenceExceptionThe Parameters property has not been initialized.