This class contains data that is sent to clients with PhotonPeer.SendEvent. The IRpcProtocol serializes EventData with SerializeEventData. SetParameters(object) converts properties that are flagged with DataMemberAttribute into the Parameters dictionary.
More...
|
static void | SendTo< TPeer > (IEventData eventData, IEnumerable< TPeer > peers, SendParameters sendParameters) |
| Sends an event to a list of peers. This method serializes the data just once per protocol instead of once per peer. More...
|
|
This class contains data that is sent to clients with PhotonPeer.SendEvent. The IRpcProtocol serializes EventData with SerializeEventData. SetParameters(object) converts properties that are flagged with DataMemberAttribute into the Parameters dictionary.
◆ EventData() [1/4]
Photon.SocketServer.EventData.EventData |
( |
byte |
eventCode, |
|
|
object |
dataContract |
|
) |
| |
|
inline |
Initializes a new instance of the EventData class.
- Parameters
-
eventCode | The event Code. |
dataContract | All properties of dataContract with the DataMemberAttribute are mapped to the Parameters dictionary. |
◆ EventData() [2/4]
Photon.SocketServer.EventData.EventData |
( |
byte |
eventCode, |
|
|
Dictionary< byte, object > |
parameters |
|
) |
| |
|
inline |
◆ EventData() [3/4]
Photon.SocketServer.EventData.EventData |
( |
byte |
eventCode | ) |
|
|
inline |
Initializes a new instance of the EventData class.
- Parameters
-
◆ EventData() [4/4]
Photon.SocketServer.EventData.EventData |
( |
| ) |
|
|
inline |
Initializes a new instance of the EventData class.
◆ SendTo< TPeer >() [1/2]
void Photon.SocketServer.EventData.SendTo< TPeer > |
( |
IEnumerable< TPeer > |
peers, |
|
|
SendParameters |
sendParameters |
|
) |
| |
|
inline |
Sends the event to a list of peers. This method serializes the data just once per protocol instead of once per peer.
- Parameters
-
peers | The peers to send the event to. |
sendParameters | The send Options. |
- Template Parameters
-
◆ SendTo< TPeer >() [2/2]
static void Photon.SocketServer.EventData.SendTo< TPeer > |
( |
IEventData |
eventData, |
|
|
IEnumerable< TPeer > |
peers, |
|
|
SendParameters |
sendParameters |
|
) |
| |
|
inlinestatic |
Sends an event to a list of peers. This method serializes the data just once per protocol instead of once per peer.
- Parameters
-
eventData | The event to send. |
peers | The peers to send the event to. |
sendParameters | The send Options. |
- Template Parameters
-
◆ Serialize()
◆ SetParameters() [1/2]
void Photon.SocketServer.EventData.SetParameters |
( |
Dictionary< byte, object > |
parameters | ) |
|
|
inline |
Replaces the Parameters with parameters .
- Parameters
-
parameters | The parameters to set. |
◆ SetParameters() [2/2]
void Photon.SocketServer.EventData.SetParameters |
( |
object |
dataContract | ) |
|
|
inline |
Converts properties of an object to Parameters. Included properties require the DataMemberAttribute.
- Parameters
-
dataContract | The properties of this object are mapped to Parameters. |
◆ Code
byte Photon.SocketServer.EventData.Code |
|
getset |
Gets or sets the event code.
◆ Parameters
Dictionary<byte, object> Photon.SocketServer.EventData.Parameters |
|
getset |
Gets or sets the event parameters that will be sent to the client.
◆ this[byte parameterKey]
object Photon.SocketServer.EventData.this[byte parameterKey] |
|
getset |
Gets or sets the paramter associated with the specified key.
- Parameters
-
parameterKey | The 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.NullReferenceException | The Parameters property has not been initialized. |