Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
ClientConstructOptions Class Reference
Inheritance diagram for ClientConstructOptions:
Inheritance graph
[legend]
Collaboration diagram for ClientConstructOptions:
Collaboration graph
[legend]

Public Member Functions

 ClientConstructOptions (nByte connectionProtocol=Photon::ConnectionProtocol::DEFAULT, bool autoLobbyStats=false, nByte regionSelectionMode=RegionSelectionMode::DEFAULT, bool useAlternativePorts=false, nByte serializationProtocol=Common::SerializationProtocol::DEFAULT)
 
 ~ClientConstructOptions (void)
 
 ClientConstructOptions (const ClientConstructOptions &toCopy)
 
ClientConstructOptionsoperator= (const ClientConstructOptions &toCopy)
 
nByte getConnectionProtocol (void) const
 
ClientConstructOptionssetConnectionProtocol (nByte connectionProtocol)
 
bool getAutoLobbyStats (void) const
 
ClientConstructOptionssetAutoLobbyStats (bool autoLobbyStats)
 
nByte getRegionSelectionMode (void) const
 
ClientConstructOptionssetRegionSelectionMode (nByte regionSelectionMode)
 
bool getUseAlternativePorts (void) const
 
ClientConstructOptionssetUseAlternativePorts (bool useAlternativePorts)
 
nByte getSerializationProtocol (void) const
 
ClientConstructOptionssetSerializationProtocol (nByte serializationProtocol)
 
virtual Common::JStringtoString (Common::JString &retStr, bool withTypes=false) const
 
virtual JStringtoString (JString &retStr, bool withTypes=false) const=0
 
JString toString (bool withTypes=false) const
 
- Public Member Functions inherited from ToString
virtual ~ToString (void)
 
virtual JString typeToString (void) const
 
JString toString (bool withTypes=false) const
 

Detailed Description

This class aggregates the various optional parameters that can be passed to the constructor of class Client.

See also
Client::connect()

Constructor & Destructor Documentation

◆ ClientConstructOptions() [1/2]

ClientConstructOptions ( nByte  connectionProtocol = Photon::ConnectionProtocol::DEFAULT,
bool  autoLobbyStats = false,
nByte  regionSelectionMode = RegionSelectionMode::DEFAULT,
bool  useAlternativePorts = false,
nByte  serializationProtocol = Common::SerializationProtocol::DEFAULT 
)

Constructor: Creates a new instance with the specified parameters.

Parameters
connectionProtocolThe protocol to use to connect to the Photon servers. Must match one of the constants specified in ConnectionProtocol.
autoLobbyStatsPass true, if you want to automatically receive updates for the lobby stats, false otherwise. Call opLobbyStats() to explicitly request a lobby stats update.
regionSelectionModeDetermines how the Photon Cloud Region to which the Client connects should be selected. Must match one of the constants specified in RegionSelectionMode. This parameter gets ignored when connecting to Photon Server.
useAlternativePortsDetermines if the the standard or the alternative port range should be used. This parameter currently is only relevant when ConnectionProtocol::UDP is passed for parameter connectionProtocol and gets ignored otherwise. A router or firewall might block connections that use one port-range but don't block connections that use the other, so when connecting with one range fails, then you may want to try with the other one.
serializationProtocolThe protocol to use for serialization an deserialization of data. Must match one of the constants specified in SerializationProtocol.

◆ ~ClientConstructOptions()

Destructor.

◆ ClientConstructOptions() [2/2]

Copy-Constructor: Creates a new instance that is a deep copy of the argument instance.

Parameters
toCopyThe instance to copy.

Member Function Documentation

◆ operator=()

ClientConstructOptions & operator= ( const ClientConstructOptions toCopy)

operator=.

Makes a deep copy of its right operand into its left operand.

This overwrites old data in the left operand.

◆ getConnectionProtocol()

nByte getConnectionProtocol ( void  ) const
Returns
the currently set ConnectionProtocol
See also
setConnectionProtocol(), ConnectionProtocol

◆ setConnectionProtocol()

ClientConstructOptions & setConnectionProtocol ( nByte  connectionProtocol)

Sets the ConnectionProtocol.

Parameters
connectionProtocolThe protocol to use to connect to the Photon servers. Must match one of the constants specified in ConnectionProtocol.
Returns
a reference to the instance on which it was called to allow for chaining multiple setter calls
See also
getConnectionProtocol(), ConnectionProtocol

◆ getAutoLobbyStats()

bool getAutoLobbyStats ( void  ) const
Returns
the value of the autoLobbyStats flag
See also
setAutoLobbyStats()

◆ setAutoLobbyStats()

ClientConstructOptions & setAutoLobbyStats ( bool  autoLobbyStats)

Sets the value of the autoLobbyStats flag.

Parameters
autoLobbyStatsPass true, if you want to automatically receive updates for the lobby stats, false otherwise. Call opLobbyStats() to explicitly request a lobby stats update.
Returns
a reference to the instance on which it was called to allow for chaining multiple setter calls
See also
getAutoLobbyStats()

◆ getRegionSelectionMode()

nByte getRegionSelectionMode ( void  ) const
Returns
the currently set RegionSelectionMode
See also
setRegionSelectionMode(), RegionSelectionMode

◆ setRegionSelectionMode()

ClientConstructOptions & setRegionSelectionMode ( nByte  regionSelectionMode)

Sets the RegionSelectionMode.

Parameters
regionSelectionModeDetermines how the Photon Cloud Region to which the Client connects should be selected. Must match one of the constants specified in RegionSelectionMode.
Returns
a reference to the instance on which it was called to allow for chaining multiple setter calls
See also
getRegionSelectionMode(), RegionSelectionMode

◆ getUseAlternativePorts()

bool getUseAlternativePorts ( void  ) const
Returns
the value of the useAlternativePorts flag
See also
setUseAlternativePorts()

◆ setUseAlternativePorts()

ClientConstructOptions & setUseAlternativePorts ( bool  useAlternativePorts)

Sets the value of the useAlternativePorts flag.

Parameters
useAlternativePortsDetermines if the the standard or the alternative port range should be used. This parameter currently is only relevant when ConnectionProtocol::UDP is passed for parameter connectionProtocol and gets ignored otherwise. A router or firewall might block connections that use one port-range but don't block connections that use the other, so when connecting with one range fails, then you may want to try with the other one.
See also
getUseAlternativePorts()

◆ getSerializationProtocol()

nByte getSerializationProtocol ( void  ) const
Returns
the currently set SerializationProtocol
See also
setSerializationProtocol(), SerializationProtocol

◆ setSerializationProtocol()

ClientConstructOptions & setSerializationProtocol ( nByte  serializationProtocol)

Sets the SerializationProtocol.

Parameters
serializationProtocolThe protocol to use for serialization an deserialization of data. Must match one of the constants specified in SerializationProtocol.
Returns
a reference to the instance on which it was called to allow for chaining multiple setter calls
See also
getSerializationProtocol(), SerializationProtocol

◆ toString() [1/3]

JString & toString ( Common::JString retStr,
bool  withTypes = false 
) const
virtual
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

Implements ToString.

◆ toString() [2/3]

toString
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

◆ toString() [3/3]

JString toString

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.
See also
JString