Quantum 3 3.1.0

Classes | Enumerations
Photon.Realtime Namespace Reference

Classes

class  ActorProperties
 Class for constants. These (byte) values define "well known" properties for an Actor / Player. More...
 
class  AppSettings
 Settings for Photon application(s) and the server to connect to. More...
 
class  AsyncConfig
 The Photon Realtime async extension configuration is used in all async calls and will use the Global if not explicitly set. More...
 
class  AsyncExtensions
 Extensions methods to wrap Photon Realtime API calls into System.Threading.Tasks. More...
 
class  AsyncOperationHandler
 The operation handler is used to monitor the Photon Realtime operation callbacks for an async task. More...
 
class  AuthenticationFailedException
 Is used by the AsyncExtensions to signal authentication errors during connect. More...
 
class  AuthenticationValues
 Container for user authentication in Photon. Set AuthValues before you connect - all else is handled. More...
 
class  ConnectionCallbacksContainer
 Container type for callbacks defined by IConnectionCallbacks. See AddCallbackTarget. More...
 
class  ConnectionHandler
 Handler class to use threading to keep a RealtimeClient connection alive (calling SendAcksOnly if it was not called in time). More...
 
class  ConnectionServiceScope
 Can be used inside a using-scope to keep updating the connection. More...
 
class  DisconnectException
 Is used by the AsyncExtensions to signal disconnects. More...
 
class  EnterRoomArgs
 Parameters for creating rooms. More...
 
class  EnterRoomParams
 Renamed to EnterRoomArgs. More...
 
class  ErrorCode
 ErrorCode defines the default codes associated with Photon client/server communication. More...
 
class  ErrorInfo
 Class wrapping the received EventCode.ErrorInfo event. More...
 
class  EventBetter
 Allows registering for individual callbacks of the Photon Realtime API, using Message Types. More...
 
class  EventCode
 Class for constants. These values are for events defined by Photon Realtime. More...
 
class  Extensions
 This static class defines some useful extension methods for several existing classes (e.g. Vector3, float and others). More...
 
class  FindFriendsArgs
 Options for OpFindFriends can be combined to filter which rooms of friends are returned. More...
 
class  FindFriendsOptions
 Renamed to FindFriendsArgs. More...
 
class  FriendInfo
 Stores info about a friend's online state and in which room he/she is. More...
 
class  GamePropertyKey
 Class for constants. These (byte) values are for "well known" room/game properties used in Photon Realtime. More...
 
interface  IConnectionCallbacks
 Collection of "organizational" callbacks for the Realtime Api to cover: Connection and Regions. More...
 
interface  IErrorInfoCallback
 Interface for EventCode.ErrorInfo event callback for the Realtime Api. More...
 
interface  IInRoomCallbacks
 Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching. More...
 
interface  ILobbyCallbacks
 Collection of "organizational" callbacks for the Realtime Api to cover the Lobby. More...
 
interface  IMatchmakingCallbacks
 Collection of "organizational" callbacks for the Realtime Api to cover Matchmaking. More...
 
interface  IOnEventCallback
 Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent. More...
 
interface  IOnMessageCallback
 Called for any incoming messages. For "raw" messages the message parameter is an ArraySegment<byte>. More...
 
class  JoinRandomRoomArgs
 Parameters for the matchmaking of JoinRandomRoom and JoinRandomOrCreateRoom. More...
 
class  Log
 Static class to provide customizable log functionality. More...
 
struct  MatchmakingArguments
 The arguments list for the matchmaking extension method ConnectToRoomAsync(). More...
 
class  MatchMakingCallbacksContainer
 Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets. More...
 
class  MatchmakingExtensions
 An extension class to wrap some of the most common Photon matchmaking calls. More...
 
class  MatchmakingReconnectInformation
 Reconnection information storage. Internally runs Set(RealtimeClient, TimeSpan) during MatchmakingExtensions.ConnectToRoomAsync(RealtimeClient, MatchmakingArguments). More...
 
class  OnConnectedMsg
 Callback message for OnConnected callback. More...
 
class  OnConnectedToMasterMsg
 Callback message for OnConnectedToMaster callback. More...
 
class  OnCreatedRoomMsg
 Callback message for OnCreatedRoom callback. More...
 
class  OnCreateRoomFailedMsg
 Callback message for OnCreateRoomFailed callback. More...
 
class  OnCustomAuthenticationFailedMsg
 Callback message for OnCustomAuthenticationFailed callback. More...
 
class  OnCustomAuthenticationResponseMsg
 Callback message for OnCustomAuthenticationResponse callback. More...
 
class  OnDisconnectedMsg
 Callback message for OnDisconnected callback. More...
 
class  OnErrorInfoMsg
 Callback message for OnErrorInfo callback. More...
 
class  OnFriendListUpdateMsg
 Callback message for OnFriendListUpdate callback. More...
 
class  OnJoinedLobbyMsg
 Callback message for OnJoinedLobby callback. More...
 
class  OnJoinedRoomMsg
 Callback message for OnJoinedRoom callback. More...
 
class  OnJoinRandomFailedMsg
 Callback message for OnJoinRandomFailed callback. More...
 
class  OnJoinRoomFailedMsg
 Callback message for OnJoinRoomFailed callback. More...
 
class  OnLeftLobbyMsg
 Callback message for OnLeftLobby callback. More...
 
class  OnLeftRoomMsg
 Callback message for OnLeftRoom callback. More...
 
class  OnLobbyStatisticsUpdateMsg
 Callback message for OnLobbyStatisticsUpdate callback. More...
 
class  OnMasterClientSwitchedMsg
 Callback message for OnMasterClientSwitched callback. More...
 
class  OnPlayerEnteredRoomMsg
 Callback message for OnPlayerEnteredRoom callback. More...
 
class  OnPlayerLeftRoomMsg
 Callback message for OnPlayerLeftRoom callback. More...
 
class  OnPlayerPropertiesUpdateMsg
 Callback message for OnPlayerPropertiesUpdate callback. More...
 
class  OnRegionListReceivedMsg
 Callback message for OnRegionList callback. More...
 
class  OnRoomListUpdateMsg
 Callback message for OnRoomListUpdate callback. More...
 
class  OnRoomPropertiesUpdateMsg
 Callback message for OnRoomPropertiesUpdate callback. More...
 
class  OperationCode
 Class for constants. Contains operation codes. More...
 
class  OperationException
 Is used by the AsyncExtensions to signal that the requested operation failed. More...
 
class  OperationStartException
 Is used by the AsyncExtensions to signal that the operation could not be started. More...
 
class  OperationTimeoutException
 Is used by the AsyncExtensions to signal that the operation timed out. The operation timeout is controlled by the AsyncConfig.OperationTimeoutSec. More...
 
class  OpJoinRandomRoomParams
 Renamed to JoinRandomRoomArgs. More...
 
class  ParameterCode
 Class for constants. Codes for parameters of Operations and Events. More...
 
class  PhotonPing
 Abstract implementation of PhotonPing, ase for pinging servers to find the "Best Region". More...
 
class  PingMono
 Uses C# Socket class from System.Net.Sockets (as Unity usually does). More...
 
class  Player
 Summarizes a "player" within a room, identified (in that room) by ID (or "actorNumber"). More...
 
class  ProtocolPorts
 Container for port definitions for the RealtimeClient. Ports that are non-zero can be used to override assigned ports coming from the server. More...
 
struct  RaiseEventArgs
 Aggregates several less-often used args for operation RaiseEvent. See field descriptions for usage details. More...
 
class  RealtimeClient
 Main class of the Photon Realtime API. It keeps (connection) state and will automatically execute transitions from Name Server to Master Server and Game Servers. More...
 
class  Region
 Summarizes a region's properties for Best Region selection and pinging. More...
 
class  RegionHandler
 Provides methods to work with Photon's regions (Photon Cloud) and can be use to find the one with best ping. More...
 
class  RegionPinger
 Wraps the ping attempts and workflow for a single region. More...
 
class  Room
 This class represents a room a client joins/joined. More...
 
class  RoomInfo
 A simplified room with just the info required to list and join, used for the room listing in the lobby. The properties are not settable (IsOpen, MaxPlayers, etc). More...
 
class  RoomOptions
 Wraps up common room properties needed when you create rooms. Read the individual entries for more details. More...
 
struct  ServerPorts
 Struct to keep port-values per server. More...
 
class  SystemConnectionSummary
 The SystemConnectionSummary (SBS) is useful to analyze low level connection issues in Unity. This requires a ConnectionHandler in the scene. More...
 
class  TypedLobby
 Refers to a specific lobby on the server. More...
 
class  TypedLobbyInfo
 Info for a lobby on the server. Used when AppSettings.EnableLobbyStatistics is true (can be passed to ConnectUsingSettings). More...
 

Enumerations

enum  AuthModeOption
 Options for authentication modes. From "classic" auth on each server to AuthOnce (on NameServer). More...
 
enum  ClientAppType
 Defines which sort of app the RealtimeClient is used for: Realtime or Voice. More...
 
enum  ClientState
 State values for a client, which handles switching Photon server types, some operations, etc. More...
 
enum  CommandEventSubcode : byte
 Used with EventCode.CommandEvent (220) by some first party plugins (e.g. Matchmaking Tickets and Voice Interest Management). More...
 
enum  CustomAuthenticationType : byte
 Options for optional "Custom Authentication" services used with Photon. Used by OpAuthenticate after connecting to Photon. More...
 
enum  DisconnectCause
 Enumeration of causes for Disconnects (used in RealtimeClient.DisconnectedCause). More...
 
enum  EncryptionMode
 Defines how the communication gets encrypted. More...
 
enum  EventCaching : byte
 Lite - OpRaiseEvent allows you to cache events and automatically send them to joining players in a room. Events are cached per event code and player: Event 100 (example!) can be stored once per player. Cached events can be modified, replaced and removed. More...
 
enum  JoinMode : byte
 Defines possible values for OpJoinRoom and OpJoinOrCreate. It tells the server if the room can be only be joined normally, created implicitly or found on a web-service for Turnbased games. More...
 
enum  LobbyType : byte
 Types of lobbies define their behaviour and capabilities. Check each value for details. More...
 
enum  MatchmakingMode : byte
 Options for matchmaking rules for OpJoinRandom. More...
 
enum  PropertyTypeFlag : byte
 Flags for "types of properties", being used as filter in OpGetProperties. More...
 
enum  ReceiverGroup : byte
 Lite - OpRaiseEvent lets you chose which actors in the room should receive events. By default, events are sent to "Others" but you can overrule this. More...
 
enum  ServerConnection
 Available server (types) for internally used field: server. More...
 

Enumeration Type Documentation

◆ ClientState

State values for a client, which handles switching Photon server types, some operations, etc.

Enumerator
PeerCreated 

Peer is created but not used yet.

Authenticating 

Transition state while connecting to a server. On the Photon Cloud this sends the AppId and AuthenticationValues (UserID).

Authenticated 

Not Used.

JoiningLobby 

The client sent an OpJoinLobby and if this was done on the Master Server, it will result in. Depending on the lobby, it gets room listings.

JoinedLobby 

The client is in a lobby, connected to the MasterServer. Depending on the lobby, it gets room listings.

DisconnectingFromMasterServer 

Transition from MasterServer to GameServer.

ConnectingToGameServer 

Transition to GameServer (client authenticates and joins/creates a room).

ConnectedToGameServer 

Connected to GameServer (going to auth and join game).

Joining 

Transition state while joining or creating a room on GameServer.

Joined 

The client entered a room. The CurrentRoom and Players are known and you can now raise events.

Leaving 

Transition state when leaving a room.

DisconnectingFromGameServer 

Transition from GameServer to MasterServer (after leaving a room/game).

ConnectingToMasterServer 

Connecting to MasterServer (includes sending authentication values).

Disconnecting 

The client disconnects (from any server). This leads to state Disconnected.

Disconnected 

The client is no longer connected (to any server). Connect to MasterServer to go on.

ConnectedToMasterServer 

Connected to MasterServer. You might use matchmaking or join a lobby now.

ConnectingToNameServer 

Client connects to the NameServer. This process includes low level connecting and setting up encryption. When done, state becomes ConnectedToNameServer.

ConnectedToNameServer 

Client is connected to the NameServer and established encryption already. You should call OpGetRegions.

DisconnectingFromNameServer 

Clients disconnects (specifically) from the NameServer (usually to connect to the MasterServer).

ConnectWithFallbackProtocol 

Client was unable to connect to Name Server and will attempt to connect with an alternative network protocol (TCP).

◆ DisconnectCause

Enumeration of causes for Disconnects (used in RealtimeClient.DisconnectedCause).

Read the individual descriptions to find out what to do about this type of disconnect.

Enumerator
None 

No error was tracked.

ExceptionOnConnect 

OnStatusChanged: The server is not available or the address is wrong. Make sure the port is provided and the server is up.

DnsExceptionOnConnect 

OnStatusChanged: Dns resolution for a hostname failed. The exception for this is being caught and logged with error level.

ServerAddressInvalid 

OnStatusChanged: The server address was parsed as IPv4 illegally. An illegal address would be e.g. 192.168.1.300. IPAddress.TryParse() will let this pass but our check won't.

Exception 

OnStatusChanged: Some internal exception caused the socket code to fail. This may happen if you attempt to connect locally but the server is not available. In doubt: Contact Exit Games.

ServerTimeout 

OnStatusChanged: The server disconnected this client due to timing out (missing acknowledgement from the client).

ClientTimeout 

OnStatusChanged: This client detected that the server's responses are not received in due time.

DisconnectByServerLogic 

OnStatusChanged: The server disconnected this client from within the room's logic (the C# code).

DisconnectByServerReasonUnknown 

OnStatusChanged: The server disconnected this client for unknown reasons.

InvalidAuthentication 

OnOperationResponse: Authenticate in the Photon Cloud with invalid AppId. Update your subscription or contact Exit Games.

CustomAuthenticationFailed 

OnOperationResponse: Authenticate in the Photon Cloud with invalid client values or custom authentication setup in Cloud Dashboard.

AuthenticationTicketExpired 

The authentication ticket should provide access to any Photon Cloud server without doing another authentication-service call. However, the ticket expired.

MaxCcuReached 

OnOperationResponse: Authenticate (temporarily) failed when using a Photon Cloud subscription without CCU Burst. Update your subscription.

InvalidRegion 

OnOperationResponse: Authenticate when the app's Photon Cloud subscription is locked to some (other) region(s). Update your subscription or master server address.

OperationNotAllowedInCurrentState 

OnOperationResponse: Operation that's (currently) not available for this client (not authorized usually). Only tracked for op Authenticate.

DisconnectByClientLogic 

OnStatusChanged: The client disconnected from within the logic (the C# code).

DisconnectByOperationLimit 

The client called an operation too frequently and got disconnected due to hitting the OperationLimit. This triggers a client-side disconnect, too.

To protect the server, some operations have a limit. When an OperationResponse fails with ErrorCode.OperationLimitReached, the client disconnects.

DisconnectByDisconnectMessage 

The client received a "Disconnect Message" from the server. Check the debug logs for details.

ApplicationQuit 

Used in case the application quits. Can be useful to not load new scenes or re-connect in OnDisconnected.

ConnectionHandler.OnDisable() will use this, if the Unity engine already called OnApplicationQuit (ConnectionHandler.AppQuits = true).

ClientServiceInactivity 

Used by the ConnectionHandler to end a connection for lack of RealtimeClient.Service calls.

Without calling Service (or SendOutgoingCommands and DispatchIncomingCommands), the network connection does not process messages and events. This can happen if apps are in the background or the main loop is paused (due to loading assets, etc).

ConnectionHandler.KeepAliveInBackground defines how long the connection is kept alive without calls to Service. Closing such connections prevents clients from staying connected "forever" without actually processing network updates (which would waste CCUs and connections).

◆ ServerConnection

Available server (types) for internally used field: server.

Photon uses 3 different roles of servers: Name Server, Master Server and Game Server.

Enumerator
MasterServer 

This server is where matchmaking gets done and where clients can get lists of rooms in lobbies.

GameServer 

This server handles a number of rooms to execute and relay the messages between players (in a room).

NameServer 

This server is used initially to get the address (IP) of a Master Server for a specific region. Not used for Photon OnPremise (self hosted).

◆ ClientAppType

Defines which sort of app the RealtimeClient is used for: Realtime or Voice.

Enumerator
Detect 

Default client type. Detects type by checking AppSettings of one (and only one) is set of: AppIdRealtime, AppIdFusion or AppIdQuantum.

Realtime 

Realtime apps are for gaming / interaction. Also used by PUN 2.

Voice 

Voice apps stream audio.

Chat 

Chat apps distribute messages in channels for a large number of subscribers.

Fusion 

Fusion clients are for matchmaking and relay in Photon Fusion.

Quantum 

Quantum clients are for matchmaking and relay in Photon Quantum.

Video 

Video apps stream video (and audio).

VoiceOrVideo 

Can be used when components work for either App Type.

Have a look at AppSettings.GetAppId(ClientAppType ct).

◆ EncryptionMode

Defines how the communication gets encrypted.

Enumerator
PayloadEncryption 

This is the default encryption mode: Messages get encrypted only on demand (when you send operations with the "encrypt" parameter set to true).

DatagramEncryptionGCM 

Datagram Encryption with GCM.

◆ JoinMode

enum Photon.Realtime.JoinMode : byte
strong

Defines possible values for OpJoinRoom and OpJoinOrCreate. It tells the server if the room can be only be joined normally, created implicitly or found on a web-service for Turnbased games.

These values are not directly used by a game but implicitly set.

Enumerator
Default 

Regular join. The room must exist.

CreateIfNotExists 

Join or create the room if it's not existing. Used for OpJoinOrCreate for example.

JoinOrRejoin 

The room might be out of memory and should be loaded (if possible) from a Turnbased web-service.

RejoinOnly 

Only re-join will be allowed. If the user is not yet in the room, this will fail.

◆ MatchmakingMode

enum Photon.Realtime.MatchmakingMode : byte
strong

Options for matchmaking rules for OpJoinRandom.

Enumerator
FillRoom 

Fills up rooms (oldest first) to get players together as fast as possible. Default.

Makes most sense with MaxPlayers > 0 and games that can only start with more players.

SerialMatching 

Distributes players across available rooms sequentially but takes filter into account. Without filter, rooms get players evenly distributed.

RandomMatching 

Joins a (fully) random room. Expected properties must match but aside from this, any available room might be selected.

◆ ReceiverGroup

enum Photon.Realtime.ReceiverGroup : byte
strong

Lite - OpRaiseEvent lets you chose which actors in the room should receive events. By default, events are sent to "Others" but you can overrule this.

Enumerator
Others 

Default value (not sent). Anyone else gets my event.

All 

Everyone in the current room (including this peer) will get this event.

MasterClient 

The server sends this event only to the actor with the lowest actorNumber.

The "master client" does not have special rights but is the one who is in this room the longest time.

◆ EventCaching

enum Photon.Realtime.EventCaching : byte
strong

Lite - OpRaiseEvent allows you to cache events and automatically send them to joining players in a room. Events are cached per event code and player: Event 100 (example!) can be stored once per player. Cached events can be modified, replaced and removed.

Caching works only combination with ReceiverGroup options Others and All.

Enumerator
DoNotCache 

Default value (not sent).

AddToRoomCache 

Adds an event to the room's cache

AddToRoomCacheGlobal 

Adds this event to the cache for actor 0 (becoming a "globally owned" event in the cache).

RemoveFromRoomCache 

Remove fitting event from the room's cache.

RemoveFromRoomCacheForActorsLeft 

Removes events of players who already left the room (cleaning up).

SliceIncreaseIndex 

Increase the index of the sliced cache.

SliceSetIndex 

Set the index of the sliced cache. You must set RaiseEventArgs.CacheSliceIndex for this.

SlicePurgeIndex 

Purge cache slice with index. Exactly one slice is removed from cache. You must set RaiseEventArgs.CacheSliceIndex for this.

SlicePurgeUpToIndex 

Purge cache slices with specified index and anything lower than that. You must set RaiseEventArgs.CacheSliceIndex for this.

◆ CommandEventSubcode

Used with EventCode.CommandEvent (220) by some first party plugins (e.g. Matchmaking Tickets and Voice Interest Management).

Enumerator
GenerateTicket 

Targets "Ticket Plugin".

UpdateMute 

Targets "Voice Interest Management Plugin".

UpdateProximity 

Targets "Voice Interest Management Plugin".

◆ PropertyTypeFlag

Flags for "types of properties", being used as filter in OpGetProperties.

Enumerator
None 

(0x00) Flag type for no property type.

Game 

(0x01) Flag type for game-attached properties.

Actor 

(0x02) Flag type for actor related propeties.

GameAndActor 

(0x01) Flag type for game AND actor properties. Equal to 'Game'

◆ LobbyType

enum Photon.Realtime.LobbyType : byte
strong

Types of lobbies define their behaviour and capabilities. Check each value for details.

Values of this enum must be matched by the server.

Enumerator
Default 

Standard type and behaviour: While joined to this lobby clients get room-lists and JoinRandomRoom can use a simple filter to match properties (perfectly).

Sql 

This lobby type lists rooms like Default but JoinRandom has a parameter for SQL-like "where" clauses for filtering. This allows bigger, less, or and and combinations.

SqlLobby 

Use LobbyType.Sql

AsyncRandom 

This lobby does not send lists of games. It is only used for OpJoinRandomRoom. It keeps rooms available for a while when there are only inactive users left.

AsyncRandomLobby 

Use LobbyType.AsyncRandom

◆ AuthModeOption

Options for authentication modes. From "classic" auth on each server to AuthOnce (on NameServer).

Enumerator
Auth 

Authenticate on each server.

AuthOnce 

Authenticate once on the Name Server and use Token otherwise.

AuthOnceWss 

Authenticate once on the Name Server and use Token otherwise. Connections to Name Server is WSS (secure).

◆ CustomAuthenticationType

Options for optional "Custom Authentication" services used with Photon. Used by OpAuthenticate after connecting to Photon.

Enumerator
Custom 

Use a custom authentication service. Currently, the only implemented option.

Steam 

Authenticates users by their Steam Account. Set Steam's ticket as "ticket" via AddAuthParameter().

Facebook 

Authenticates users by their Facebook Account. Set Facebook's token as "token" via AddAuthParameter().

Oculus 

Authenticates users by their Oculus Account and token. Set Oculus' userid as "userid" and nonce as "nonce" via AddAuthParameter().

PlayStation4 

Authenticates users by their PSN Account and token on PS4. Set token as "token", env as "env" and userName as "userName" via AddAuthParameter().

Xbox 

Authenticates users by their Xbox Account. Pass the XSTS token via SetAuthPostData(byte[]).

Viveport 

Authenticates users by their HTC Viveport Account. Set userToken as "userToken" via AddAuthParameter().

NintendoSwitch 

Authenticates users by their NSA ID. Set Nintendo's token as "token" and appversion as "appversion" via AddAuthParameter(). The appversion is optional.

PlayStation5 

Authenticates users by their PSN Account and token on PS5. Set token as "token", env as "env" and userName as "userName" via AddAuthParameter().

Epic 

Authenticates users with Epic Online Services (EOS). Set token as "token" and ownershipToken as "ownershipToken" via AddAuthParameter(). The ownershipToken is optional.

FacebookGaming 

Authenticates users with Facebook Gaming api. Set Facebook's token as "token" via AddAuthParameter().

None 

Disables custom authentication. Same as not providing any AuthenticationValues for connect (more precisely for: OpAuthenticate).