Photon Server API Documentation v5.0RC1

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.GameServer.GameUpdatesBatchEvent Photon.LoadBalancing.Operations.FindFriendsResponse Photon.LoadBalancing.Operations.GetLobbyStatsResponse Photon.LoadBalancing.ServerToServer.Events.RemoveGameEvent Photon.LoadBalancing.ServerToServer.Events.ReplicationHelperEvent Photon.LoadBalancing.ServerToServer.Events.UpdateAppStatsEvent Photon.LoadBalancing.ServerToServer.Events.UpdateGameEvent Photon.LoadBalancing.ServerToServer.Events.UpdateServerEvent Photon.LoadBalancing.ServerToServer.Operations.RegisterGameServerDataContract Photon.LoadBalancing.ServerToServer.Operations.RegisterGameServerResponse Photon.NameServer.Operations.AuthenticateResponse Photon.NameServer.Operations.GetRegionListResponse Photon.SocketServer.Rpc.Operation Photon.SocketServer.Security.EncryptionData

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

◆ DataContract() [1/2]

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.

◆ DataContract() [2/2]

Photon.SocketServer.Rpc.DataContract.DataContract ( )
inlineprotected

Initializes a new instance of the DataContract class.

Member Function Documentation

◆ GetErrorMessage()

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.

◆ ToDictionary()

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

◆ errorMessage

string Photon.SocketServer.Rpc.DataContract.errorMessage
protected

The error message.

◆ isValid

bool Photon.SocketServer.Rpc.DataContract.isValid
protected

The is valid.

Property Documentation

◆ IsValid

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.