Photon .NET Client API 4.1.4.8

Public Member Functions | Public Attributes | Properties | List of all members
ExitGames.Client.Photon.EventData Class Reference

A Photon Event consists of a Code value and a Parameters Dictionary with the event's content (if any). More...

Public Member Functions

 EventData ()
 
override string ToString ()
 ToString() override. More...
 
string ToStringFull ()
 Extensive output of the event content. More...
 

Public Attributes

byte Code
 The event code identifies the type of event. More...
 
readonly ParameterDictionary Parameters
 The Parameters of an event is a Dictionary<byte, object>. More...
 
byte SenderKey = 254
 Defines the event key containing the Sender of the event. More...
 
byte CustomDataKey = 245
 Defines the event key containing the Custom Data of the event. More...
 

Properties

object this[byte key] [get, set]
 Access to the Parameters of a Photon-defined event. Custom Events only use Code, Sender and CustomData. More...
 
int? Sender [get, set]
 Accesses the Sender of the event via the indexer and SenderKey. The result is cached. More...
 
object CustomData [get, set]
 Accesses the Custom Data of the event via the indexer and CustomDataKey. The result is cached. More...
 

Detailed Description

A Photon Event consists of a Code value and a Parameters Dictionary with the event's content (if any).

The indexer of this class provides access to the values in Parameters. It wraps the null check for Parameters and uses TryGetValue() for the provided key.

Photon servers use events to send information which is not triggered by a client's operation requests (those get responses). The Realtime API allows you to send custom events with any Code and content via OpRaiseEvent.

Constructor & Destructor Documentation

◆ EventData()

ExitGames.Client.Photon.EventData.EventData ( )
inline

Member Function Documentation

◆ ToString()

override string ExitGames.Client.Photon.EventData.ToString ( )
inline

ToString() override.

Returns
Short output of "Event" and it's Code.

◆ ToStringFull()

string ExitGames.Client.Photon.EventData.ToStringFull ( )
inline

Extensive output of the event content.

Returns
To be used in debug situations only, as it returns a string for each value.

Member Data Documentation

◆ Code

byte ExitGames.Client.Photon.EventData.Code

The event code identifies the type of event.

◆ CustomDataKey

byte ExitGames.Client.Photon.EventData.CustomDataKey = 245

Defines the event key containing the Custom Data of the event.

Defaults to Data key of Realtime API events (RaiseEvent): 245. Can be set to any other value on demand.

◆ Parameters

readonly ParameterDictionary ExitGames.Client.Photon.EventData.Parameters

The Parameters of an event is a Dictionary<byte, object>.

◆ SenderKey

byte ExitGames.Client.Photon.EventData.SenderKey = 254

Defines the event key containing the Sender of the event.

Defaults to Sender key of Realtime API events (RaiseEvent): 254. Can be set to Chat API's ChatParameterCode.Sender: 5.

Property Documentation

◆ CustomData

object ExitGames.Client.Photon.EventData.CustomData
getset

Accesses the Custom Data of the event via the indexer and CustomDataKey. The result is cached.

Accesses this event's Parameters[CustomDataKey], which may be null.

◆ Sender

int? ExitGames.Client.Photon.EventData.Sender
getset

Accesses the Sender of the event via the indexer and SenderKey. The result is cached.

Accesses this event's Parameters[CustomDataKey], which may be null. In that case, this returns 0 (identifying the server as sender).

◆ this[byte key]

object ExitGames.Client.Photon.EventData.this[byte key]
getset

Access to the Parameters of a Photon-defined event. Custom Events only use Code, Sender and CustomData.

Parameters
keyThe key byte-code of a Photon event value.
Returns
The Parameters value, or null if the key does not exist in Parameters.

The documentation for this class was generated from the following file: