Photon Unity Networking 2 2.45

Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
AppSettings Class Reference

Settings for Photon application(s) and the server to connect to. More...

Public Member Functions

string ToStringFull ()
 ToString but with more details. More...
 
AppSettings CopyTo (AppSettings d)
 

Static Public Member Functions

static bool IsAppId (string val)
 Checks if a string is a Guid by attempting to create one. More...
 

Public Attributes

string AppIdRealtime
 AppId for Realtime or PUN. More...
 
string AppIdFusion
 AppId for Photon Fusion. More...
 
string AppIdChat
 AppId for Photon Chat. More...
 
string AppIdVoice
 AppId for Photon Voice. More...
 
string AppVersion
 The AppVersion can be used to identify builds and will split the AppId distinct "Virtual AppIds" (important for matchmaking). More...
 
bool UseNameServer = true
 If false, the app will attempt to connect to a Master Server (which is obsolete but sometimes still necessary). More...
 
string FixedRegion
 Can be set to any of the Photon Cloud's region names to directly connect to that region. More...
 
string BestRegionSummaryFromStorage
 Set to a previous BestRegionSummary value before connecting. More...
 
string Server
 The address (hostname or IP) of the server to connect to. More...
 
int Port
 If not null, this sets the port of the first Photon server to connect to (that will "forward" the client as needed). More...
 
string ProxyServer
 The address (hostname or IP and port) of the proxy server. More...
 
ConnectionProtocol Protocol = ConnectionProtocol.Udp
 The network level protocol to use. More...
 
bool EnableProtocolFallback = true
 Enables a fallback to another protocol in case a connect to the Name Server fails. More...
 
AuthModeOption AuthMode = AuthModeOption.Auth
 Defines how authentication is done. On each system, once or once via a WSS connection (safe). More...
 
bool EnableLobbyStatistics
 If true, the client will request the list of currently available lobbies. More...
 
DebugLevel NetworkLogging = DebugLevel.ERROR
 Log level for the network lib. More...
 

Properties

bool IsMasterServerAddress [get]
 If true, the Server field contains a Master Server address (if any address at all). More...
 
bool IsBestRegion [get]
 If true, the client should fetch the region list from the Name Server and find the one with best ping. More...
 
bool IsDefaultNameServer [get]
 If true, the default nameserver address for the Photon Cloud should be used. More...
 
bool IsDefaultPort [get]
 If true, the default ports for a protocol will be used. More...
 

Detailed Description

Settings for Photon application(s) and the server to connect to.

This is Serializable for Unity, so it can be included in ScriptableObject instances.

Member Function Documentation

◆ IsAppId()

static bool IsAppId ( string  val)
static

Checks if a string is a Guid by attempting to create one.

Parameters
valThe potential guid to check.
Returns
True if new Guid(val) did not fail.

◆ ToStringFull()

string ToStringFull ( )

ToString but with more details.

Member Data Documentation

◆ AppIdChat

string AppIdChat

AppId for Photon Chat.

◆ AppIdFusion

string AppIdFusion

AppId for Photon Fusion.

◆ AppIdRealtime

string AppIdRealtime

AppId for Realtime or PUN.

◆ AppIdVoice

string AppIdVoice

AppId for Photon Voice.

◆ AppVersion

string AppVersion

The AppVersion can be used to identify builds and will split the AppId distinct "Virtual AppIds" (important for matchmaking).

◆ AuthMode

AuthModeOption AuthMode = AuthModeOption.Auth

Defines how authentication is done. On each system, once or once via a WSS connection (safe).

◆ BestRegionSummaryFromStorage

string BestRegionSummaryFromStorage

Set to a previous BestRegionSummary value before connecting.

This is a value used when the client connects to the "Best Region".
If this is null or empty, all regions gets pinged. Providing a previous summary on connect, speeds up best region selection and makes the previously selected region "sticky".

Unity clients should store the BestRegionSummary in the PlayerPrefs. You can store the new result by implementing IConnectionCallbacks.OnConnectedToMaster. If LoadBalancingClient.SummaryToCache is not null, store this string. To avoid storing the value multiple times, you could set SummaryToCache to null.

◆ EnableLobbyStatistics

bool EnableLobbyStatistics

If true, the client will request the list of currently available lobbies.

◆ EnableProtocolFallback

bool EnableProtocolFallback = true

Enables a fallback to another protocol in case a connect to the Name Server fails.

See: LoadBalancingClient.EnableProtocolFallback.

◆ FixedRegion

string FixedRegion

Can be set to any of the Photon Cloud's region names to directly connect to that region.

if this IsNullOrEmpty() AND UseNameServer == true, use BestRegion. else, use a server

◆ NetworkLogging

DebugLevel NetworkLogging = DebugLevel.ERROR

Log level for the network lib.

◆ Port

int Port

If not null, this sets the port of the first Photon server to connect to (that will "forward" the client as needed).

◆ Protocol

ConnectionProtocol Protocol = ConnectionProtocol.Udp

The network level protocol to use.

◆ ProxyServer

string ProxyServer

The address (hostname or IP and port) of the proxy server.

◆ Server

string Server

The address (hostname or IP) of the server to connect to.

◆ UseNameServer

bool UseNameServer = true

If false, the app will attempt to connect to a Master Server (which is obsolete but sometimes still necessary).

if true, Server points to a NameServer (or is null, using the default), else it points to a MasterServer.

Property Documentation

◆ IsBestRegion

bool IsBestRegion
get

If true, the client should fetch the region list from the Name Server and find the one with best ping.

See "Best Region" in the online docs.

◆ IsDefaultNameServer

bool IsDefaultNameServer
get

If true, the default nameserver address for the Photon Cloud should be used.

◆ IsDefaultPort

bool IsDefaultPort
get

If true, the default ports for a protocol will be used.

◆ IsMasterServerAddress

bool IsMasterServerAddress
get

If true, the Server field contains a Master Server address (if any address at all).