This class aggregates the various optional parameters that can be passed to Client::connect().
- See also
- Client::connect()
◆ ConnectOptions() [1/2]
Constructor: Creates a new instance with the specified parameters.
- Note
- on XBox consoles the value of parameter 'tryUseDatagramEncryption' is ignored and the client always behaves as if it was 'true'.
- Parameters
-
authenticationValues | An instance of class AuthenticationValues - optional, defaults to a default-constructed AuthenticationValues instance. |
username | The users display name as shown to other users - not to be confused with the users unique ID for identification and authentication purposes, which is part of the AuthenticationValues - optional, defaults to an empty string. |
serverAddress | A null terminated string containing the IP address or domain name and optionally the port number to connect to. IP addresses can be in IPv4 or IPv6 format, examples: L"192.168.0.1", L"192.168.0.1:5055", L"udp.gameserver.com", L"udp.gameserver.com:5055", L"[2002:C0A8:1::]", L"[2002:C0A8:1::]:5055". Note that IPv6 addresses must include square brackets to indicate where the address itself ends and the port begins. If no port is given, then the default port for the chosen protocol and server type will be used. - optional, defaults to the address of Photon Cloud. |
serverType | One of the values in ServerType. Must match the type of the Photon server that is reachable at the given address and port. Should be ServerType::NAME_SERVER for the Photon Cloud and for self-hosted Photon 5 or higher Server instances and ServerType::MASTER_SERVER for self-hosted Photon 4 Server instances. You should NOT directly pass the address of a regions master server with Photon Cloud or with Photon 5 Server and up, but you should always connect to the name server when you connect to Photon Cloud or to Photon 5 Server and up. - optional, defaults to ServerType::NAME_SERVER. |
tryUseDatagramEncryption | defaults to 'false'. Setting this to 'true' results in encryption-key exchange via an initial WSS-connection and in all UDP traffic getting encrypted, if all of the following is true: the argument for 'serverType' is ServerType::NAME_SERVER, the connection protocol specified in the constructor is ConnectionProtocol::UDP, the Photon Client for the platform supports UDP encryption and the Photon client for the platform supports ConnectionProtocol::WSS. If any of these conditions is false, then the value of this parameter is ignored and the client behaves as if it was 'false'. - optional defaults to false. |
◆ ~ConnectOptions()
◆ ConnectOptions() [2/2]
Copy-Constructor: Creates a new instance that is a deep copy of the argument instance.
- Parameters
-
toCopy | The instance to copy. |
◆ operator=()
operator=.
Makes a deep copy of its right operand into its left operand.
This overwrites old data in the left operand.
◆ getAuthenticationValues()
◆ setAuthenticationValues()
◆ getUsername()
const JString & getUsername |
( |
void |
| ) |
const |
◆ setUsername()
Sets the user name.
Please see AuthenticationValues for further information.
- Parameters
-
username | The users display name as shown to other users - not to be confused with the users unique ID for identification and authentication purposes, which is part of the AuthenticationValues. |
- Returns
- a reference to the instance on which it was called to allow for chaining multiple setter calls
- See also
- getUsername()
◆ getServerAddress()
const JString & getServerAddress |
( |
void |
| ) |
const |
◆ setServerAddress()
Sets the server address.
- Parameters
-
serverAddress | A null terminated string containing the IP address or domain name and optionally the port number to connect to. IP addresses can be in IPv4 or IPv6 format, examples: L"192.168.0.1", L"192.168.0.1:5055", L"udp.gameserver.com", L"udp.gameserver.com:5055", L"[2002:C0A8:1::]", L"[2002:C0A8:1::]:5055". Note that IPv6 addresses must include square brackets to indicate where the address itself ends and the port begins. If no port is given, then the default port for the chosen protocol and server type will be used. Defaults to the address of Photon Cloud. |
- Returns
- a reference to the instance on which it was called to allow for chaining multiple setter calls
- See also
- getServerAddress()
◆ getServerType()
nByte getServerType |
( |
void |
| ) |
const |
◆ setServerType()
Sets the ServerType.
- Parameters
-
serverType | One of the values in ServerType. Must match the type of the Photon server that is reachable at the given address and port. Should be ServerType::NAME_SERVER for the Photon Cloud and for self-hosted Photon 5 or higher Server instances and ServerType::MASTER_SERVER for self-hosted Photon 4 Server instances. You should NOT directly pass the address of a regions master server with Photon Cloud or with Photon 5 Server, but you should always connect to the name server when you connect to Photon Cloud or to Photon 5 Server and up. |
- Returns
- a reference to the instance on which it was called to allow for chaining multiple setter calls
- See also
- getServerType(), ServerType
◆ getTryUseDatagramEncryption()
bool getTryUseDatagramEncryption |
( |
void |
| ) |
const |
- Returns
- the currently set value for the tryUseDatagramEncryption flag
- See also
- setServerType()
◆ setTryUseDatagramEncryption()
ConnectOptions & setTryUseDatagramEncryption |
( |
bool |
tryUseDatagramEncryption | ) |
|
Sets the value for the tryUseDatagramEncryption flag.
- Note
- on XBox consoles the value of parameter 'tryUseDatagramEncryption' is ignored and the client always behaves as if it was 'true'.
- Parameters
-
tryUseDatagramEncryption | defaults to 'false'. Setting this to 'true' results in encryption-key exchange via an initial WSS-connection and in all UDP traffic getting encrypted, if all of the following is true: the argument for 'serverType' is ServerType::NAME_SERVER, the connection protocol specified in the constructor is ConnectionProtocol::UDP, the Photon Client for the platform supports UDP encryption and the Photon client for the platform supports ConnectionProtocol::WSS. If any of these conditions is false, then the value of this parameter is ignored and the client behaves as if it was 'false'. |
- Returns
- a reference to the instance on which it was called to allow for chaining multiple setter calls
- See also
- getTryUseDatagramEncryption()
◆ toString() [1/3]
- Parameters
-
retStr | reference 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 |
withTypes | set 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]
- Parameters
-
retStr | reference 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 |
withTypes | set 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]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
withTypes | set 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