Photon Server API
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
Photon.SocketServer.Rpc.DataContract Class Reference

This class is a common base class for all data contracts. Properties flagged with the DataMemberAttribute can be converted from/to a dictionary. More...

Inheritance diagram for Photon.SocketServer.Rpc.DataContract:
Photon.Common.Authentication.AuthenticationToken Photon.LoadBalancing.Events.AppStatsEvent Photon.LoadBalancing.Events.GameListEvent Photon.LoadBalancing.Events.GameServerOfflineEvent Photon.LoadBalancing.Events.QueueEvent Photon.LoadBalancing.LoadShedding.LatencyOperation Photon.LoadBalancing.Operations.FindFriendsResponse Photon.LoadBalancing.Operations.GetLobbyStatsResponse Photon.LoadBalancing.ServerToServer.Events.AuthenticateUpdateEvent Photon.LoadBalancing.ServerToServer.Events.RemoveGameEvent Photon.LoadBalancing.ServerToServer.Events.UpdateAppStatsEvent Photon.LoadBalancing.ServerToServer.Events.UpdateGameEvent Photon.LoadBalancing.ServerToServer.Events.UpdateServerEvent Photon.LoadBalancing.ServerToServer.Operations.RegisterGameServerResponse Photon.SocketServer.Rpc.Operation

Public Member Functions

string GetErrorMessage ()
 Gets a message containing descriptive entries for each missing or invalid paramter. More...
 
Dictionary< byte, object > ToDictionary ()
 Converts all properties flagged with the DataMemberAttribute to a dictionary. More...
 

Protected Member Functions

 DataContract (IRpcProtocol protocol, IDictionary< byte, object > dataMembers)
 Initializes a new instance of the DataContract class. The params dictionary is mapped to properties flagged with the DataMemberAttribute. Check the IsValid property after creation to determine if all paramters have been initialized correctly. More...
 
 DataContract ()
 Initializes a new instance of the DataContract class. More...
 

Protected Attributes

string errorMessage
 The error message. More...
 
bool isValid
 The is valid. More...
 

Properties

bool IsValid [get]
 Gets a value indicating whether all operation parameter are initialized. Call the GetErrorMessage method to get a detailed description for all missing parameters. More...
 

Detailed Description

This class is a common base class for all data contracts. Properties flagged with the DataMemberAttribute can be converted from/to a dictionary.

Constructor & Destructor Documentation

Photon.SocketServer.Rpc.DataContract.DataContract ( IRpcProtocol  protocol,
IDictionary< byte, object >  dataMembers 
)
inlineprotected

Initializes a new instance of the DataContract class. The params dictionary is mapped to properties flagged with the DataMemberAttribute. Check the IsValid property after creation to determine if all paramters have been initialized correctly.

Parameters
protocolThere are some protcol specific types that need to be converted to other C# types, IRpcProtocol.TryConvertParameter is used for this purpose.
dataMembersA dictionary that contains the received parameters.
Photon.SocketServer.Rpc.DataContract.DataContract ( )
inlineprotected

Initializes a new instance of the DataContract class.

Member Function Documentation

string Photon.SocketServer.Rpc.DataContract.GetErrorMessage ( )
inline

Gets a message containing descriptive entries for each missing or invalid paramter.

Returns
A string containing descriptive entries for each missing or invalid paramter.
Dictionary<byte, object> Photon.SocketServer.Rpc.DataContract.ToDictionary ( )
inline

Converts all properties flagged with the DataMemberAttribute to a dictionary.

Returns
A dictionary with properties that are flagged with the DataMemberAttribute.

Member Data Documentation

string Photon.SocketServer.Rpc.DataContract.errorMessage
protected

The error message.

bool Photon.SocketServer.Rpc.DataContract.isValid
protected

The is valid.

Property Documentation

bool Photon.SocketServer.Rpc.DataContract.IsValid
get

Gets a value indicating whether all operation parameter are initialized. Call the GetErrorMessage method to get a detailed description for all missing parameters.

true if this instance is valid; otherwise, false.