Photon Unity Networking 2: Main Page

Photon Unity Networking 2 2.39

Main Page

Introduction

Photon is a real-time multiplayer game development framework that is fast, lean and flexible. Photon consists of a server and multiple client SDKs for major platforms.

Photon Unity Network (PUN) is our is our take on a Unity specific, high-level solution: Matchmaking, easy to use callbacks, components to synchronize GameObjects, Remote Procedure Calls (RPCs) and similar features provide a great start. Beyond that is a solid, extensive API for more advanced control.

Full source code is available, so you can scale this package to support any type of multiplayer game you come up with.

This package is compatible with the managed Photon Cloud service, which runs Photon Servers for you. A setup window registers you (for free) in less than a minute.

Most notable features:

  • Dead-easy API
  • Lots of demos and an extensive PUN Basics Tutorial
  • Server available as hosted service (free for development) or as "On Premise"
  • Load-balanced! Scales across servers (with no extra effort)
  • Outstanding performance of the Photon Server
  • Dedicated servers. No NAT punch-through needed
  • Offline mode: re-use your multiplayer code in singleplayer game modes

Documentation And Learning

There is an Online Documentation, which is considered a manual for PUN. This might become your primary source for information.

This is the Reference Documentation for PUN. It summarizes the most important classes in the Public API module and explains each class, method and field individually. This is generated from the source of PUN and should be used to look up details on usage and parameters.

Aside from that, there are also Demos in the PUN package itself and a PUN Basics Tutorial online, which you should check out.

First Steps

Import PUN into a new, empty project. Register via the pop up "wizard" (ALT+P) to get you a free Photon Cloud subscription (saving an initial AppId for you). Now you're ready to run and dissect the Demos.

Make sure to open and code the PUN Basics Tutorial.

© Exit Games ®, all rights reserved.
Documentation Contact Terms Status


Photon Unity Networking 2: General Documentation

General Documentation

Table of Contents

  • Photon Unity Networking - First steps
  • Photon
    • Exit Games Cloud
      • Subscriptions bought in Asset Store
    • Photon Server SDK

Brief overview of Photon, subscriptions, hosting options and how to start.

Photon Unity Networking - First steps

When you import PUN, the "Wizard" window will pop up. If not, find it in the Window menu as "Photon Unity Networking". In the Wizard, either enter your email address to register for the Photon Cloud, enter the AppId of an existing account or skip this step for the time being.

The Wizard creates a configuration in the project, named: PhotonServerSettings.

PUN consists of quite a few files, however most functionality is concentrated into: Photon.Pun.PhotonNetwork. This class contains all functions and variables typically needed. If you ever have custom requirements, you can always modify the source files - this plugin is just an implementation of Photon after all.

To learn how this API works, visit the online documentation for PUN

Photon

Photon Unity Networking (PUN) always connects to a dedicated Photon server, which provides matchmaking, load balancing and in-room communication for players.

Behind the scenes PUN uses more than one server: A "Name Server" acts as point of entry and provides a list of regional "Master Servers". A Master Server keeps track of rooms and provides the Matchmaking, while several "Game Servers" run the actual rooms (matches).

Exit Games Cloud

The Exit Games Cloud provides hosted and load balanced Photon servers for you, fully managed by Exit Games. Free trials are available and subscription costs for commercial use are competitively low.

The Public Cloud service runs a fixed logic, so the clients need to be authoritative.

Clients are separated by “application id” (identifies your game title) and a “game version”. Changing the game version helps separate players with new and old client builds.

Subscriptions bought in Asset Store

Follow these steps when you bought an asset that includes a Photon Cloud subscription:

  • Open the Dashboard and login.
    https://dashboard.photonengine.com
  • Select the application to upgrade and click "Add Coupon / PUN+".
  • Enter your Unity Invoice Number.

Find your Unity Invoice Number in the Unity AssetStore:
https://www.assetstore.unity3d.com/en/#!/account/transactions
From the drop-down select the payment method used in your purchase.
Navigate to your purchase and copy the number following the "#" symbol (excluding the "#" and spaces).

Photon Server SDK

As alternative to the Photon Cloud service, you can run your own server and develop server side logic on top of our "Load Balancing" C# solution. This gives you full control of the server logic.

The Photon Server SDK can be downloaded at this link

Read about how to start the server here.


Photon Unity Networking 2: Network Simulation GUI

Network Simulation GUI

Simple GUI element to control the built-in network condition simulation.

The Photon client library can simulate network conditions for lag (message delay) and loss, which can be a good tool for developer when testing with a local server or on near perfect network conditions.

To use it, add the component Photon.Pun.UtilityScripts.PhotonLagSimulationGui to an enabled GameObject in your scene. At runtime, the top left of the screen shows the current roundtrip time (RTT) and the controls for network simulation:

  • RTT: The roundtrip time is the average of milliseconds until a message was acknowledged by the server. The variance value (behind the +/-) shows how stable the rtt is (a lower value being better).
  • "Sim" toggle: Enables and disables the simulation. A sudden, big change of network conditions might result in disconnects.
  • "Lag" slider: Adds a fixed delay to all outgoing and incoming messages. In milliseconds.
  • "Jit" slider: Adds a random delay of "up to X milliseconds" per message.
  • "Loss" slider: Drops the set percentage of messages. You can expect less than 2% drop in the internet today.


Photon Unity Networking 2: Network Statistics GUI

Network Statistics GUI

The PhotonStatsGui is a simple GUI component to track and show network-metrics at runtime.

Usage

Just add the Photon.Pun.UtilityScripts.PhotonStatsGui component to any active GameObject in the hierarchy. A window appears (at runtime) and shows the message count.

A few toggles let you configure the window:

  • buttons: Show buttons for "stats on", "reset stats" and "to log"
  • traffic: Show lower level network traffic (bytes per direction)
  • health: Show timing of sending, dispatches and their longest gaps

Message Statistics

The top most values showns are counter for "messages". Any operation, response and event are counted. Shown are the total count of outgoing, incoming and the sum of those messages as total and as average for the timespan that is tracked.

Traffic Statistics

These are the byte and packet counters. Anything that leaves or arrives via network is counted here. Even if there are few messages, they could be huge by accident and still cause less powerful clients to drop connection. You also see that there are packages sent when you don't send messages. They keeps the connection alive.

Health Statistics

The block beginning with "longest delta between" is about the performance of your client. We measure how much time passed between consecutive calls of send and dispatch. Usually they should be called ten times per second. If these values go beyond one second, you should check why Update() calls are delayed.

Button "Reset"

This resets the stats but keeps tracking them. This is useful to track message counts for different situations.

Button "To Log"

Pressing this simply logs the current stat values. This can be useful to have a overview how things evolved or just as reference.

Button "Stats On" (Enabling Traffic Stats)

The Photon library can track various network statistics but usually this feature is turned off. The PhotonStatsGui will enable the tracking and show those values.

The "stats on" toggle in the Gui controls if traffic stats are collected at all. The "Traffic Stats On" checkbox in the Inspector is the same value.


Photon Unity Networking 2: Public API Module

Public API Module

The Public API module rounds up the most commonly used classes of PUN.

The classes which are most commonly used, are grouped into a Public API module, which is only a documentation structure. Classes like Photon.Pun.PhotonNetwork and Photon.Pun.MonoBehaviourPunCallbacks are good entry points to learn how to code with PUN.

Typically, classes for internal use are not public but there are a few exceptions to this where access may be of use, if you know what you're doing.

Open the Public API module


Photon Unity Networking 2: Modules

Modules
Here is a list of all modules:
Public API | Groups the most important classes that you need to understand early on
Optional Gui Elements | Useful GUI elements for PUN
Callbacks | Callback Interfaces


Photon Unity Networking 2: Public API

Classes | Enumerations | Functions
Public API

Groups the most important classes that you need to understand early on. More...

Classes

class | PhotonNetwork
The main class to use the PhotonNetwork plugin. This class is static. More...
class | PhotonView
A PhotonView identifies an object across the network (viewID) and configures how the controlling client updates remote instances. More...
struct | PhotonMessageInfo
Container class for info about a particular message, RPC or update. More...
class | PhotonStream
This container is used in OnPhotonSerializeView() to either provide incoming data of a PhotonView or for you to provide it. More...

Enumerations

enum | ClientState
State values for a client, which handles switching Photon server types, some operations, etc. More...
enum | PunLogLevel
Used to define the level of logging output created by the PUN classes. Either log errors, info (some more) or full. More...
enum | RpcTarget
Enum of "target" options for RPCs. These define which remote clients get your RPC call. More...

Functions

void OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More...

Detailed Description

Groups the most important classes that you need to understand early on.

Enumeration Type Documentation

◆ ClientState

enum ClientState
strong

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 or ConnectToRegionMaster.
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).

◆ PunLogLevel

enum PunLogLevel
strong

Used to define the level of logging output created by the PUN classes. Either log errors, info (some more) or full.

Enumerator
ErrorsOnly | Show only errors. Minimal output. Note: Some might be "runtime errors" which you have to expect.
Informational | Logs some of the workflow, calls and results.
Full | Every available log call gets into the console/log. Only use for debugging.

◆ RpcTarget

enum RpcTarget
strong

Enum of "target" options for RPCs. These define which remote clients get your RPC call.

Enumerator
All

Sends the RPC to everyone else and executes it immediately on this client. Player who join later will not execute this RPC.

Others

Sends the RPC to everyone else. This client does not execute the RPC. Player who join later will not execute this RPC.

MasterClient

Sends the RPC to MasterClient only. Careful: The MasterClient might disconnect before it executes the RPC and that might cause dropped RPCs.

AllBuffered

Sends the RPC to everyone else and executes it immediately on this client. New players get the RPC when they join as it's buffered (until this client leaves).

OthersBuffered

Sends the RPC to everyone. This client does not execute the RPC. New players get the RPC when they join as it's buffered (until this client leaves).

AllViaServer

Sends the RPC to everyone (including this client) through the server.

This client executes the RPC like any other when it received it from the server. Benefit: The server's order of sending the RPCs is the same on all clients.

AllBufferedViaServer

Sends the RPC to everyone (including this client) through the server and buffers it for players joining later.

This client executes the RPC like any other when it received it from the server. Benefit: The server's order of sending the RPCs is the same on all clients.

Function Documentation

◆ OnPhotonSerializeView()

void OnPhotonSerializeView | ( | PhotonStream | stream,
 |  | PhotonMessageInfo | info
 | ) |  |

Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.

This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.

Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.

Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.

To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.

If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).

Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".

Implemented in PhotonAnimatorView, CullingHandler, PhotonTransformViewClassic, PhotonTransformView, PhotonRigidbodyView, PhotonRigidbody2DView, and SmoothSyncMovement.


Photon Unity Networking 2: PhotonNetwork Class Reference

  • Photon
  • Pun
  • PhotonNetwork
Classes | Static Public Member Functions | Static Public Attributes | Properties | List of all members
PhotonNetwork Class Reference
Public API

The main class to use the PhotonNetwork plugin. This class is static. More...

Static Public Member Functions

static bool | ConnectUsingSettings ()
Connect to Photon as configured in the PhotonServerSettings file. More...
static bool | ConnectUsingSettings (AppSettings appSettings, bool startInOfflineMode=false)
static bool | ConnectToMaster (string masterServerAddress, int port, string appID)
Connect to a Photon Master Server by address, port, appID. More...
static bool | ConnectToBestCloudServer ()
Connect to the Photon Cloud region with the lowest ping (on platforms that support Unity's Ping). More...
static bool | ConnectToRegion (string region)
Connects to the Photon Cloud region of choice. More...
static void | Disconnect ()
Makes this client disconnect from the photon server, a process that leaves any room and calls OnDisconnected on completion. More...
static bool | Reconnect ()
Can be used to reconnect to the master server after a disconnect. More...
static void | NetworkStatisticsReset ()
Resets the traffic stats and re-enables them. More...
static string | NetworkStatisticsToString ()
Only available when NetworkStatisticsEnabled was used to gather some stats. More...
static int | GetPing ()
The current roundtrip time to the photon server. More...
static void | FetchServerTimestamp ()
Refreshes the server timestamp (async operation, takes a roundtrip). More...
static void | SendAllOutgoingCommands ()
Can be used to immediately send the RPCs and Instantiates just called, so they are on their way to the other players. More...
static bool | CloseConnection (Player kickPlayer)
Request a client to disconnect/kick, which happens if EnableCloseConnection is set to true. Only the master client can do this. More...
static bool | SetMasterClient (Player masterClientPlayer)
Asks the server to assign another player as Master Client of your current room. More...
static bool | JoinRandomRoom ()
Joins a random room that matches the filter. Will callback: OnJoinedRoom or OnJoinRandomFailed. More...
static bool | JoinRandomRoom (Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers)
Joins a random room that matches the filter. Will callback: OnJoinedRoom or OnJoinRandomFailed. More...
static bool | JoinRandomRoom (Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, MatchmakingMode matchingType, TypedLobby typedLobby, string sqlLobbyFilter, string[] expectedUsers=null)
Joins a random room that matches the filter. Will callback: OnJoinedRoom or OnJoinRandomFailed. More...
static bool | JoinRandomOrCreateRoom (Hashtable expectedCustomRoomProperties=null, byte expectedMaxPlayers=0, MatchmakingMode matchingType=MatchmakingMode.FillRoom, TypedLobby typedLobby=null, string sqlLobbyFilter=null, string roomName=null, RoomOptions roomOptions=null, string[] expectedUsers=null)
Attempts to join a room that matches the specified filter and creates a room if none found. More...
static bool | CreateRoom (string roomName, RoomOptions roomOptions=null, TypedLobby typedLobby=null, string[] expectedUsers=null)
Creates a new room. Will callback: OnCreatedRoom and OnJoinedRoom or OnCreateRoomFailed. More...
static bool | JoinOrCreateRoom (string roomName, RoomOptions roomOptions, TypedLobby typedLobby, string[] expectedUsers=null)
Joins a specific room by name and creates it on demand. Will callback: OnJoinedRoom or OnJoinRoomFailed. More...
static bool | JoinRoom (string roomName, string[] expectedUsers=null)
Joins a room by name. Will callback: OnJoinedRoom or OnJoinRoomFailed. More...
static bool | RejoinRoom (string roomName)
Rejoins a room by roomName (using the userID internally to return). Will callback: OnJoinedRoom or OnJoinRoomFailed. More...
static bool | ReconnectAndRejoin ()
When the client lost connection during gameplay, this method attempts to reconnect and rejoin the room. More...
static bool | LeaveRoom (bool becomeInactive=true)
Leave the current room and return to the Master Server where you can join or create rooms (see remarks). More...
static bool | JoinLobby ()
On MasterServer this joins the default lobby which list rooms currently in use. More...
static bool | JoinLobby (TypedLobby typedLobby)
On a Master Server you can join a lobby to get lists of available rooms. More...
static bool | LeaveLobby ()
Leave a lobby to stop getting updates about available rooms. More...
static bool | FindFriends (string[] friendsToFind)
Requests the rooms and online status for a list of friends and saves the result in PhotonNetwork.Friends. More...
static bool | GetCustomRoomList (TypedLobby typedLobby, string sqlLobbyFilter)
Fetches a custom list of games from the server, matching a (non-empty) SQL-like filter. Triggers OnRoomListUpdate callback. More...
static bool | SetPlayerCustomProperties (Hashtable customProperties)
Sets this (local) player's properties and synchronizes them to the other players (don't modify them directly). More...
static void | RemovePlayerCustomProperties (string[] customPropertiesToDelete)
Locally removes Custom Properties of "this" player. Important: This does not synchronize the change! Useful when you switch rooms. More...
static bool | RaiseEvent (byte eventCode, object eventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions)
Sends fully customizable events in a room. Events consist of at least an EventCode (0..199) and can have content. More...
static bool | AllocateViewID (PhotonView view)
Allocates a viewID for the current/local player. More...
static bool | AllocateSceneViewID (PhotonView view)
static bool | AllocateRoomViewID (PhotonView view)
Enables the Master Client to allocate a viewID for room objects. More...
static int | AllocateViewID (bool roomObject)
Allocates a viewID for the current/local player or the room. More...
static int | AllocateViewID (int ownerId)
Allocates a viewID for the current/local player or the room. More...
static GameObject | Instantiate (string prefabName, Vector3 position, Quaternion rotation, byte group=0, object[] data=null)
static GameObject | InstantiateSceneObject (string prefabName, Vector3 position, Quaternion rotation, byte group=0, object[] data=null)
static GameObject | InstantiateRoomObject (string prefabName, Vector3 position, Quaternion rotation, byte group=0, object[] data=null)
static void | Destroy (PhotonView targetView)
Network-Destroy the GameObject associated with the PhotonView, unless the PhotonView is static or not under this client's control. More...
static void | Destroy (GameObject targetGo)
Network-Destroy the GameObject, unless it is static or not under this client's control. More...
static void | DestroyPlayerObjects (Player targetPlayer)
Network-Destroy all GameObjects, PhotonViews and their RPCs of targetPlayer. Can only be called on local player (for "self") or Master Client (for anyone). More...
static void | DestroyPlayerObjects (int targetPlayerId)
Network-Destroy all GameObjects, PhotonViews and their RPCs of this player (by ID). Can only be called on local player (for "self") or Master Client (for anyone). More...
static void | DestroyAll ()
Network-Destroy all GameObjects, PhotonViews and their RPCs in the room. Removes anything buffered from the server. Can only be called by Master Client (for anyone). More...
static void | RemoveRPCs (Player targetPlayer)
Remove all buffered RPCs from server that were sent by targetPlayer. Can only be called on local player (for "self") or Master Client (for anyone). More...
static void | RemoveRPCs (PhotonView targetPhotonView)
Remove all buffered RPCs from server that were sent via targetPhotonView. The Master Client and the owner of the targetPhotonView may call this. More...
static HashSet< GameObject > | FindGameObjectsWithComponent (Type type)
Finds the GameObjects with Components of a specific type (using FindObjectsOfType). More...
static void | SetInterestGroups (byte group, bool enabled)
Enable/disable receiving events from a given Interest Group. More...
static void | LoadLevel (int levelNumber)
This method wraps loading a level asynchronously and pausing network messages during the process. More...
static void | LoadLevel (string levelName)
This method wraps loading a level asynchronously and pausing network messages during the process. More...
static bool | WebRpc (string name, object parameters, bool sendAuthCookie=false)
This operation makes Photon call your custom web-service by name (path) with the given parameters. More...
static void | LoadOrCreateSettings (bool reload=false)
static void | AddCallbackTarget (object target)
Registers an object for callbacks for the implemented callback-interfaces. More...
static void | RemoveCallbackTarget (object target)
Removes the target object from callbacks for its implemented callback-interfaces. More...
static void | DestroyPlayerObjects (int playerId, bool localOnly)
Destroys all Instantiates and RPCs locally and (if not localOnly) sends EvDestroy(player) and clears related events in the server buffer. More...
static void | DestroyAll (bool localOnly)
static bool | LocalCleanPhotonView (PhotonView view)
static PhotonView | GetPhotonView (int viewID)
static void | RegisterPhotonView (PhotonView netView)
static void | OpCleanActorRpcBuffer (int actorNumber)
Removes the RPCs of someone else (to be used as master). This won't clean any local caches. It just tells the server to forget a player's RPCs and instantiates. More...
static void | OpRemoveCompleteCacheOfPlayer (int actorNumber)
Instead removing RPCs or Instantiates, this removed everything cached by the actor. More...
static void | OpRemoveCompleteCache ()
static void | CleanRpcBufferIfMine (PhotonView view)
static void | OpCleanRpcBuffer (PhotonView view)
Cleans server RPCs for PhotonView (without any further checks). More...
static void | RemoveRPCsInGroup (int group)
Remove all buffered RPCs from server that were sent in the targetGroup, if this is the Master Client or if this controls the individual PhotonView. More...
static bool | RemoveBufferedRPCs (int viewId=0, string methodName=null, int[] callersActorNumbers=null)
Clear buffered RPCs based on filter parameters. More...
static void | SetLevelPrefix (byte prefix)
Sets level prefix for PhotonViews instantiated later on. Don't set it if you need only one! More...
static void | SetInterestGroups (byte[] disableGroups, byte[] enableGroups)
Enable/disable receiving on given Interest Groups (applied to PhotonViews). More...
static void | SetSendingEnabled (byte group, bool enabled)
Enable/disable sending on given group (applied to PhotonViews) More...
static void | SetSendingEnabled (byte[] disableGroups, byte[] enableGroups)
Enable/disable sending on given groups (applied to PhotonViews) More...

Static Public Attributes

const string | PunVersion = "2.39"
Version number of PUN. Used in the AppVersion, which separates your playerbase in matchmaking. More...
static LoadBalancingClient | NetworkingClient
The LoadBalancingClient is part of Photon Realtime and wraps up multiple servers and states for PUN. More...
static readonly int | MAX_VIEW_IDS = 1000
The maximum number of assigned PhotonViews per player (or scene). See the General Documentation topic "Limitations" on how to raise this limitation. More...
const string | ServerSettingsFileName = "PhotonServerSettings"
Name of the PhotonServerSettings file (used to load and by PhotonEditor to save new files). More...
static ConnectMethod | ConnectMethod = ConnectMethod.NotCalled
Tracks, which Connect method was called last. More...
static PunLogLevel | LogLevel = PunLogLevel.ErrorsOnly
Controls how verbose PUN is. More...
static bool | EnableCloseConnection = false
Used to enable reaction to CloseConnection events. Default: false. More...
static float | PrecisionForVectorSynchronization = 0.000099f
The minimum difference that a Vector2 or Vector3(e.g. a transforms rotation) needs to change before we send it via a PhotonView's OnSerialize/ObservingComponent. More...
static float | PrecisionForQuaternionSynchronization = 1.0f
The minimum angle that a rotation needs to change before we send it via a PhotonView's OnSerialize/ObservingComponent. More...
static float | PrecisionForFloatSynchronization = 0.01f
The minimum difference between floats before we send it via a PhotonView's OnSerialize/ObservingComponent. More...
static float | MinimalTimeScaleToDispatchInFixedUpdate = -1f
Affects if the PhotonHandler dispatches incoming messages in LateUpdate or FixedUpdate (default). More...
static bool | UseRpcMonoBehaviourCache
While enabled, the MonoBehaviours on which we call RPCs are cached, avoiding costly GetComponents<MonoBehaviour>() calls. More...
static bool | RunRpcCoroutines = true
If an RPC method is implemented as coroutine, it gets started, unless this value is false. More...
static int | ObjectsInOneUpdate = 20
Defines how many updated produced by OnPhotonSerialize() are batched into one message. More...
const int | SyncViewId = 0
const int | SyncCompressed = 1
const int | SyncNullValues = 2
const int | SyncFirstValue = 3

Properties

static string | GameVersion [get, set]
Version number of your game. Setting this updates the AppVersion, which separates your playerbase in matchmaking. More...
static string | AppVersion [get]
Sent to Photon Server to specify the "Virtual AppId". More...
static ServerSettings | PhotonServerSettings [get]
Serialized server settings, written by the Setup Wizard for use in ConnectUsingSettings. More...
static string? | ServerAddress [get]
Currently used server address (no matter if master or game server). More...
static string? | CloudRegion [get]
Currently used Cloud Region (if any). As long as the client is not on a Master Server or Game Server, the region is not yet defined. More...
static string? | CurrentCluster [get]
The cluster name provided by the Name Server. More...
static string | BestRegionSummaryInPreferences [get, set]
Used to store and access the "Best Region Summary" in the Player Preferences. More...
static bool | IsConnected [get]
False until you connected to Photon initially. True immediately after Connect-call, in offline mode, while connected to any server and even while switching servers. More...
static bool | IsConnectedAndReady [get]
A refined version of connected which is true only if your connection to the server is ready to accept operations like join, leave, etc. More...
static ClientState? | NetworkClientState [get]
Directly provides the network-level client state, unless in OfflineMode. More...
static ServerConnection?? | Server [get]
The server (type) this client is currently connected or connecting to. More...
static AuthenticationValues? | AuthValues [get, set]
A user's authentication values used during connect. More...
static TypedLobby | CurrentLobby [get]
The lobby that will be used when PUN joins a lobby or creates a game. This is defined when joining a lobby or creating rooms More...
static Room? | CurrentRoom [get]
Get the room we're currently in (also when in OfflineMode). Null if we aren't in any room. More...
static Player | LocalPlayer [get]
This client's Player instance is always available, unless the app shuts down. More...
static string | NickName [get, set]
Set to synchronize the player's nickname with everyone in the room(s) you enter. This sets PhotonNetwork.player.NickName. More...
static Player[] | PlayerList [get]
A sorted copy of the players-list of the current room. This is using Linq, so better cache this value. Update when players join / leave. More...
static Player[] | PlayerListOthers [get]
A sorted copy of the players-list of the current room, excluding this client. This is using Linq, so better cache this value. Update when players join / leave. More...
static bool | OfflineMode [get, set]
Offline mode can be set to re-use your multiplayer code in singleplayer game modes. When this is on PhotonNetwork will not create any connections and there is near to no overhead. Mostly usefull for reusing RPC's and PhotonNetwork.Instantiate More...
static bool | AutomaticallySyncScene [get, set]
Defines if all clients in a room should automatically load the same level as the Master Client. More...
static bool | EnableLobbyStatistics [get]
If enabled, the client will get a list of available lobbies from the Master Server. More...
static bool | InLobby [get]
True while this client is in a lobby. More...
static int | SendRate [get, set]
Defines how many times per second the PhotonHandler should send data, if any is queued. Default: 30. More...
static int | SerializationRate [get, set]
Defines how many times per second OnPhotonSerialize should be called on PhotonViews for controlled objects. More...
static bool | IsMessageQueueRunning [get, set]
Can be used to pause dispatching of incoming events (RPCs, Instantiates and anything else incoming). More...
static double | Time [get]
Photon network time, synched with the server. More...
static int | ServerTimestamp [get]
The current server's millisecond timestamp. More...
static float? | KeepAliveInBackground [get, set]
Defines how many seconds PUN keeps the connection after Unity's OnApplicationPause(true) call. Default: 60 seconds. More...
static bool | IsMasterClient [get]
Are we the master client? More...
static Player | MasterClient [get]
The Master Client of the current room or null (outside of rooms). More...
static bool | InRoom [get]
Is true while being in a room (NetworkClientState == ClientState.Joined). More...
static int | CountOfPlayersOnMaster [get]
The count of players currently looking for a room (available on MasterServer in 5sec intervals). More...
static int | CountOfPlayersInRooms [get]
Count of users currently playing your app in some room (sent every 5sec by Master Server). Use PhotonNetwork.PlayerList.Length or PhotonNetwork.CurrentRoom.PlayerCount to get the count of players in the room you're in! More...
static int | CountOfPlayers [get]
The count of players currently using this application (available on MasterServer in 5sec intervals). More...
static int | CountOfRooms [get]
The count of rooms currently in use (available on MasterServer in 5sec intervals). More...
static bool | NetworkStatisticsEnabled [get, set]
Enables or disables the collection of statistics about this client's traffic. More...
static int | ResentReliableCommands [get]
Count of commands that got repeated (due to local repeat-timing before an ACK was received). More...
static bool | CrcCheckEnabled [get, set]
Crc checks can be useful to detect and avoid issues with broken datagrams. Can be enabled while not connected. More...
static int | PacketLossByCrcCheck [get]
If CrcCheckEnabled, this counts the incoming packages that don't have a valid CRC checksum and got rejected. More...
static int | MaxResendsBeforeDisconnect [get, set]
Defines the number of times a reliable message can be resent before not getting an ACK for it will trigger a disconnect. Default: 5. More...
static int | QuickResends [get, set]
In case of network loss, reliable messages can be repeated quickly up to 3 times. More...
static bool | UseAlternativeUdpPorts [get, set]
Replaced by ServerPortOverrides. More...
static PhotonPortDefinition? | ServerPortOverrides [get, set]
Defines overrides for server ports. Used per server-type if > 0. Important: If you change the transport protocol, adjust the overrides, too. More...
static PhotonView[] | PhotonViews [get]
Gets the photon views. More...
static NonAllocDictionary< int, PhotonView >.ValueIterator | PhotonViewCollection [get]
Returns a new iterable collection of current photon views. More...
static int | ViewCount [get]
static IPunPrefabPool | PrefabPool [get, set]
An Object Pool can be used to keep and reuse instantiated object instances. Replaces Unity's default Instantiate and Destroy methods. More...
static float | LevelLoadingProgress [get]
Represents the scene loading progress when using LoadLevel(). More...

Detailed Description

The main class to use the PhotonNetwork plugin. This class is static.

Member Function Documentation

◆ AddCallbackTarget()

static void AddCallbackTarget ( object target )
static

Registers an object for callbacks for the implemented callback-interfaces.

The covered callback interfaces are: IConnectionCallbacks, IMatchmakingCallbacks, ILobbyCallbacks, IInRoomCallbacks, IOnEventCallback and IWebRpcCallback.

See: .Net Callbacks

Parameters
target The object that registers to get callbacks from PUN's LoadBalancingClient.

◆ AllocateRoomViewID()

static bool AllocateRoomViewID ( PhotonView view )
static

Enables the Master Client to allocate a viewID for room objects.

Returns
True if a viewId was assigned. False if the PhotonView already had a non-zero viewID or if this client is not the Master Client.

◆ AllocateViewID() [1/3]

static int AllocateViewID ( bool roomObject )
static

Allocates a viewID for the current/local player or the room.

Parameters
roomObject Use true, to allocate a room viewID and false to allocate a viewID for the local player.
Returns
Returns a viewID (combined owner and sequential number) that can be assigned as PhotonView.ViewID.

◆ AllocateViewID() [2/3]

static int AllocateViewID ( int ownerId )
static

Allocates a viewID for the current/local player or the room.

Parameters
ownerId ActorNumber to allocate a viewID for.
Returns
Returns a viewID (combined owner and sequential number) that can be assigned as PhotonView.ViewID.

◆ AllocateViewID() [3/3]

static bool AllocateViewID ( PhotonView view )
static

Allocates a viewID for the current/local player.

Returns
True if a viewId was assigned. False if the PhotonView already had a non-zero viewID.

◆ CloseConnection()

static bool CloseConnection ( Player kickPlayer )
static

Request a client to disconnect/kick, which happens if EnableCloseConnection is set to true. Only the master client can do this.

Only the target player gets this event. That player will disconnect if EnableCloseConnection = true.

Parameters
kickPlayer The Player to kick.

◆ ConnectToBestCloudServer()

static bool ConnectToBestCloudServer ( )
static

Connect to the Photon Cloud region with the lowest ping (on platforms that support Unity's Ping).

Will save the result of pinging all cloud servers in PlayerPrefs. Calling this the first time can take +-2 seconds. The ping result can be overridden via PhotonNetwork.OverrideBestCloudServer(..) This call can take up to 2 seconds if it is the first time you are using this, all cloud servers will be pinged to check for the best region.

The PUN Setup Wizard stores your appID in a settings file and applies a server address/port. To connect to the Photon Cloud, a valid AppId must be in the settings file (shown in the Photon Cloud Dashboard). https://dashboard.photonengine.com

Connecting to the Photon Cloud might fail due to:

  • Invalid AppId
  • Network issues
  • Invalid region
  • Subscription CCU limit reached
  • etc.

In general check out the DisconnectCause from the IConnectionCallbacks.OnDisconnected callback.

Returns
If this client is going to connect to cloud server based on ping. Even if true, this does not guarantee a connection but the attempt is being made.

◆ ConnectToMaster()

static bool ConnectToMaster | ( | string | masterServerAddress,
 |  | int | port,
 |  | string | appID
 | ) |  |
static

Connect to a Photon Master Server by address, port, appID.

To connect to the Photon Cloud, a valid AppId must be in the settings file (shown in the Photon Cloud Dashboard). https://dashboard.photonengine.com

Connecting to the Photon Cloud might fail due to:

  • Invalid AppId
  • Network issues
  • Invalid region
  • Subscription CCU limit reached
  • etc.

In general check out the DisconnectCause from the IConnectionCallbacks.OnDisconnected callback.

Parameters
masterServerAddress | The server's address (either your own or Photon Cloud address).
port | The server's port to connect to.
appID | Your application ID (Photon Cloud provides you with a GUID for your game).

◆ ConnectToRegion()

static bool ConnectToRegion ( string region )
static

Connects to the Photon Cloud region of choice.

It's typically enough to define the region code ("eu", "us", etc). Connecting to a specific cluster may be necessary, when regions get sharded and you support friends / invites.

In all other cases, you should not define a cluster as this allows the Name Server to distribute clients as needed. A random, load balanced cluster will be selected.

The Name Server has the final say to assign a cluster as available. If the requested cluster is not available another will be assigned.

Once connected, check the value of CurrentCluster.

◆ ConnectUsingSettings()

static bool ConnectUsingSettings ( )
static

Connect to Photon as configured in the PhotonServerSettings file.

Implement IConnectionCallbacks, to make your game logic aware of state changes. Especially, IConnectionCallbacks.ConnectedToMasterServer is useful to react when the client can do matchmaking.

This method will disable OfflineMode (which won't destroy any instantiated GOs) and it will set IsMessageQueueRunning to true.

Your Photon configuration is created by the PUN Wizard and contains the AppId, region for Photon Cloud games, the server address among other things.

To ignore the settings file, set the relevant values and connect by calling ConnectToMaster, ConnectToRegion.

To connect to the Photon Cloud, a valid AppId must be in the settings file (shown in the Photon Cloud Dashboard).

Connecting to the Photon Cloud might fail due to:

  • Invalid AppId
  • Network issues
  • Invalid region
  • Subscription CCU limit reached
  • etc.

In general check out the DisconnectCause from the IConnectionCallbacks.OnDisconnected callback.

◆ CreateRoom()

static bool CreateRoom | ( | string | roomName,
 |  | RoomOptions | roomOptions = null,
 |  | TypedLobby | typedLobby = null,
 |  | string[] | expectedUsers = null
 | ) |  |
static

Creates a new room. Will callback: OnCreatedRoom and OnJoinedRoom or OnCreateRoomFailed.

When successful, this calls the callbacks OnCreatedRoom and OnJoinedRoom (the latter, cause you join as first player). In all error cases, OnCreateRoomFailed gets called.

Creating a room will fail if the room name is already in use or when the RoomOptions clashing with one another. Check the EnterRoomParams reference for the various room creation options.

If you don't want to create a unique room-name, pass null or "" as name and the server will assign a roomName (a GUID as string).

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

More about PUN matchmaking: https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby

Parameters
roomName | Unique name of the room to create. Pass null or "" to make the server generate a name.
roomOptions | Common options for the room like MaxPlayers, initial custom room properties and similar. See RoomOptions type..
typedLobby | If null, the room is automatically created in the currently used lobby (which is "default" when you didn't join one explicitly).
expectedUsers | Optional list of users (by UserId) who are expected to join this game and who you want to block a slot for.
Returns
If the operation got queued and will be sent.

◆ Destroy() [1/2]

static void Destroy ( GameObject targetGo )
static

Network-Destroy the GameObject, unless it is static or not under this client's control.

Destroying a networked GameObject includes:

  • Removal of the Instantiate call from the server's room buffer.
  • Removing RPCs buffered for PhotonViews that got created indirectly with the PhotonNetwork.Instantiate call.
  • Sending a message to other clients to remove the GameObject also (affected by network lag).

Usually, when you leave a room, the GOs get destroyed automatically. If you have to destroy a GO while not in a room, the Destroy is only done locally.

Destroying networked objects works only if they got created with PhotonNetwork.Instantiate(). Objects loaded with a scene are ignored, no matter if they have PhotonView components.

The GameObject must be under this client's control:

  • Instantiated and owned by this client.
  • Instantiated objects of players who left the room are controlled by the Master Client.
  • Room-owned game objects are controlled by the Master Client.
  • GameObject can be destroyed while client is not in a room.
Returns
Nothing. Check error debug log for any issues.

◆ Destroy() [2/2]

static void Destroy ( PhotonView targetView )
static

Network-Destroy the GameObject associated with the PhotonView, unless the PhotonView is static or not under this client's control.

Destroying a networked GameObject while in a Room includes:

  • Removal of the Instantiate call from the server's room buffer.
  • Removing RPCs buffered for PhotonViews that got created indirectly with the PhotonNetwork.Instantiate call.
  • Sending a message to other clients to remove the GameObject also (affected by network lag).

Usually, when you leave a room, the GOs get destroyed automatically. If you have to destroy a GO while not in a room, the Destroy is only done locally.

Destroying networked objects works only if they got created with PhotonNetwork.Instantiate(). Objects loaded with a scene are ignored, no matter if they have PhotonView components.

The GameObject must be under this client's control:

  • Instantiated and owned by this client.
  • Instantiated objects of players who left the room are controlled by the Master Client.
  • Room-owned game objects are controlled by the Master Client.
  • GameObject can be destroyed while client is not in a room.
Returns
Nothing. Check error debug log for any issues.

◆ DestroyAll()

static void DestroyAll ( )
static

Network-Destroy all GameObjects, PhotonViews and their RPCs in the room. Removes anything buffered from the server. Can only be called by Master Client (for anyone).

Can only be called by Master Client (for anyone). Unlike the Destroy methods, this will remove anything from the server's room buffer. If your game buffers anything beyond Instantiate and RPC calls, that will be cleaned as well from server.

Destroying all includes:

  • Remove anything from the server's room buffer (Instantiate, RPCs, anything buffered).
  • Sending a message to other clients to destroy everything locally, too (affected by network lag).

Destroying networked objects works only if they got created with PhotonNetwork.Instantiate(). Objects loaded with a scene are ignored, no matter if they have PhotonView components.

Returns
Nothing. Check error debug log for any issues.

◆ DestroyPlayerObjects() [1/3]

static void DestroyPlayerObjects | ( | int | playerId,
 |  | bool | localOnly
 | ) |  |
static

Destroys all Instantiates and RPCs locally and (if not localOnly) sends EvDestroy(player) and clears related events in the server buffer.

◆ DestroyPlayerObjects() [2/3]

static void DestroyPlayerObjects ( int targetPlayerId )
static

Network-Destroy all GameObjects, PhotonViews and their RPCs of this player (by ID). Can only be called on local player (for "self") or Master Client (for anyone).

Destroying a networked GameObject includes:

  • Removal of the Instantiate call from the server's room buffer.
  • Removing RPCs buffered for PhotonViews that got created indirectly with the PhotonNetwork.Instantiate call.
  • Sending a message to other clients to remove the GameObject also (affected by network lag).

Destroying networked objects works only if they got created with PhotonNetwork.Instantiate(). Objects loaded with a scene are ignored, no matter if they have PhotonView components.

Returns
Nothing. Check error debug log for any issues.

◆ DestroyPlayerObjects() [3/3]

static void DestroyPlayerObjects ( Player targetPlayer )
static

Network-Destroy all GameObjects, PhotonViews and their RPCs of targetPlayer. Can only be called on local player (for "self") or Master Client (for anyone).

Destroying a networked GameObject includes:

  • Removal of the Instantiate call from the server's room buffer.
  • Removing RPCs buffered for PhotonViews that got created indirectly with the PhotonNetwork.Instantiate call.
  • Sending a message to other clients to remove the GameObject also (affected by network lag).

Destroying networked objects works only if they got created with PhotonNetwork.Instantiate(). Objects loaded with a scene are ignored, no matter if they have PhotonView components.

Returns
Nothing. Check error debug log for any issues.

◆ Disconnect()

static void Disconnect ( )
static

Makes this client disconnect from the photon server, a process that leaves any room and calls OnDisconnected on completion.

When you disconnect, the client will send a "disconnecting" message to the server. This speeds up leave/disconnect messages for players in the same room as you (otherwise the server would timeout this client's connection). When used in OfflineMode, the state-change and event-call OnDisconnected are immediate. Offline mode is set to false as well. Once disconnected, the client can connect again. Use ConnectUsingSettings.

◆ FetchServerTimestamp()

static void FetchServerTimestamp ( )
static

Refreshes the server timestamp (async operation, takes a roundtrip).

Can be useful if a bad connection made the timestamp unusable or imprecise.

◆ FindFriends()

static bool FindFriends ( string[] friendsToFind )
static

Requests the rooms and online status for a list of friends and saves the result in PhotonNetwork.Friends.

Works only on Master Server to find the rooms played by a selected list of users.

The result will be stored in PhotonNetwork.Friends when available. That list is initialized on first use of OpFindFriends (before that, it is null). To refresh the list, call FindFriends again (in 5 seconds or 10 or 20).

Users identify themselves by setting a unique userId in the PhotonNetwork.AuthValues. See remarks of AuthenticationValues for info about how this is set and used.

The list of friends must be fetched from some other source (not provided by Photon).

Internal: The server response includes 2 arrays of info (each index matching a friend from the request): ParameterCode.FindFriendsResponseOnlineList = bool[] of online states ParameterCode.FindFriendsResponseRoomIdList = string[] of room names (empty string if not in a room)

Parameters
friendsToFind Array of friend (make sure to use unique NickName or AuthValues).
Returns
If the operation could be sent (requires connection, only one request is allowed at any time). Always false in offline mode.

◆ FindGameObjectsWithComponent()

static HashSet<GameObject> FindGameObjectsWithComponent ( Type type )
static

Finds the GameObjects with Components of a specific type (using FindObjectsOfType).

Parameters
type Type must be a Component
Returns
HashSet with GameObjects that have a specific type of Component.

◆ GetCustomRoomList()

static bool GetCustomRoomList | ( | TypedLobby | typedLobby,
 |  | string | sqlLobbyFilter
 | ) |  |
static

Fetches a custom list of games from the server, matching a (non-empty) SQL-like filter. Triggers OnRoomListUpdate callback.

Operation is only available for lobbies of type SqlLobby and the filter can not be empty. It will check those conditions and fail locally, returning false. This is an async request.

Note: You don't have to join a lobby to query it. Rooms need to be "attached" to a lobby, which can be done via the typedLobby parameter in CreateRoom, JoinOrCreateRoom, etc..

When done, OnRoomListUpdate gets called.

https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby/::sql_lobby_type

Parameters
typedLobby | The lobby to query. Has to be of type SqlLobby.
sqlLobbyFilter | The sql query statement.
Returns
If the operation could be sent (has to be connected).

◆ GetPing()

static int GetPing ( )
static

The current roundtrip time to the photon server.

Returns
Roundtrip time (to server and back).

◆ JoinLobby() [1/2]

static bool JoinLobby ( )
static

On MasterServer this joins the default lobby which list rooms currently in use.

The room list is sent and refreshed by the server using ILobbyCallbacks.OnRoomListUpdate.

Per room you should check if it's full or not before joining. Photon also lists rooms that are full, unless you close and hide them (room.open = false and room.visible = false).

In best case, you make your clients join random games, as described here: https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby

You can show your current players and room count without joining a lobby (but you must be on the master server). Use: CountOfPlayers, CountOfPlayersOnMaster, CountOfPlayersInRooms and CountOfRooms.

You can use more than one lobby to keep the room lists shorter. See JoinLobby(TypedLobby lobby). When creating new rooms, they will be "attached" to the currently used lobby or the default lobby.

You can use JoinRandomRoom without being in a lobby!

◆ JoinLobby() [2/2]

static bool JoinLobby ( TypedLobby typedLobby )
static

On a Master Server you can join a lobby to get lists of available rooms.

The room list is sent and refreshed by the server using ILobbyCallbacks.OnRoomListUpdate.

Any client can "make up" any lobby on the fly. Splitting rooms into multiple lobbies will keep each list shorter. However, having too many lists might ruin the matchmaking experience.

In best case, you create a limited number of lobbies. For example, create a lobby per game-mode: "koth" for king of the hill and "ffa" for free for all, etc.

There is no listing of lobbies at the moment.

Sql-typed lobbies offer a different filtering model for random matchmaking. This might be more suited for skillbased-games. However, you will also need to follow the conventions for naming filterable properties in sql-lobbies! Both is explained in the matchmaking doc linked below.

In best case, you make your clients join random games, as described here: https://doc.photonengine.com/en-us/realtime/current/reference/matchmaking-and-lobby

Per room you should check if it's full or not before joining. Photon does list rooms that are full, unless you close and hide them (room.open = false and room.visible = false).

You can show your games current players and room count without joining a lobby (but you must be on the master server). Use: CountOfPlayers, CountOfPlayersOnMaster, CountOfPlayersInRooms and CountOfRooms.

When creating new rooms, they will be "attached" to the currently used lobby or the default lobby.

You can use JoinRandomRoom without being in a lobby!

Parameters
typedLobby A typed lobby to join (must have name and type).

◆ JoinOrCreateRoom()

static bool JoinOrCreateRoom | ( | string | roomName,
 |  | RoomOptions | roomOptions,
 |  | TypedLobby | typedLobby,
 |  | string[] | expectedUsers = null
 | ) |  |
static

Joins a specific room by name and creates it on demand. Will callback: OnJoinedRoom or OnJoinRoomFailed.

Useful when players make up a room name to meet in: All involved clients call the same method and whoever is first, also creates the room.

When successful, the client will enter the specified room. The client which creates the room, will callback both OnCreatedRoom and OnJoinedRoom. Clients that join an existing room will only callback OnJoinedRoom. In all error cases, OnJoinRoomFailed gets called.

Joining a room will fail, if the room is full, closed or when the user already is present in the room (checked by userId).

To return to a room, use OpRejoinRoom.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

If you set room properties in roomOptions, they get ignored when the room is existing already. This avoids changing the room properties by late joining players.

You can define an array of expectedUsers, to block player slots in the room for these users. The corresponding feature in Photon is called "Slot Reservation" and can be found in the doc pages.

More about PUN matchmaking: https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby

Parameters
roomName | Name of the room to join. Must be non null.
roomOptions | Options for the room, in case it does not exist yet. Else these values are ignored.
typedLobby | Lobby you want a new room to be listed in. Ignored if the room was existing and got joined.
expectedUsers | Optional list of users (by UserId) who are expected to join this game and who you want to block a slot for.
Returns
If the operation got queued and will be sent.

◆ JoinRandomOrCreateRoom()

static bool JoinRandomOrCreateRoom | ( | Hashtable | expectedCustomRoomProperties = null,
 |  | byte | expectedMaxPlayers = 0,
 |  | MatchmakingMode | matchingType = MatchmakingMode.FillRoom,
 |  | TypedLobby | typedLobby = null,
 |  | string | sqlLobbyFilter = null,
 |  | string | roomName = null,
 |  | RoomOptions | roomOptions = null,
 |  | string[] | expectedUsers = null
 | ) |  |
static

Attempts to join a room that matches the specified filter and creates a room if none found.

This operation is a combination of filter-based random matchmaking with the option to create a new room, if no fitting room exists. The benefit of that is that the room creation is done by the same operation and the room can be found by the very next client, looking for similar rooms.

There are separate parameters for joining and creating a room.

This method can only be called while connected to a Master Server. This client's State is set to ClientState.Joining immediately.

Either IMatchmakingCallbacks.OnJoinedRoom or IMatchmakingCallbacks.OnCreatedRoom gets called.

Should the creation on the Master Server, IMatchmakingCallbacks.OnJoinRandomFailed gets called. Should the "join" on the Game Server fail, IMatchmakingCallbacks.OnJoinRoomFailed gets called.

Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

Returns
If the operation will be sent (requires connection to Master Server).

◆ JoinRandomRoom() [1/3]

static bool JoinRandomRoom ( )
static

Joins a random room that matches the filter. Will callback: OnJoinedRoom or OnJoinRandomFailed.

Used for random matchmaking. You can join any room or one with specific properties defined in opJoinRandomRoomParams.

This operation fails if no rooms are fitting or available (all full, closed, in another lobby or not visible). It may also fail when actually joining the room which was found. Rooms may close, become full or empty anytime.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

More about PUN matchmaking: https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby

◆ JoinRandomRoom() [2/3]

static bool JoinRandomRoom | ( | Hashtable | expectedCustomRoomProperties,
 |  | byte | expectedMaxPlayers
 | ) |  |
static

Joins a random room that matches the filter. Will callback: OnJoinedRoom or OnJoinRandomFailed.

Used for random matchmaking. You can join any room or one with specific properties defined in opJoinRandomRoomParams.

This operation fails if no rooms are fitting or available (all full, closed, in another lobby or not visible). It may also fail when actually joining the room which was found. Rooms may close, become full or empty anytime.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

More about PUN matchmaking: https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby

Parameters
expectedCustomRoomProperties | Filters for rooms that match these custom properties (string keys and values). To ignore, pass null.
expectedMaxPlayers | Filters for a particular maxplayer setting. Use 0 to accept any maxPlayer value.
Returns
If the operation got queued and will be sent.

◆ JoinRandomRoom() [3/3]

static bool JoinRandomRoom | ( | Hashtable | expectedCustomRoomProperties,
 |  | byte | expectedMaxPlayers,
 |  | MatchmakingMode | matchingType,
 |  | TypedLobby | typedLobby,
 |  | string | sqlLobbyFilter,
 |  | string[] | expectedUsers = null
 | ) |  |
static

Joins a random room that matches the filter. Will callback: OnJoinedRoom or OnJoinRandomFailed.

Used for random matchmaking. You can join any room or one with specific properties defined in opJoinRandomRoomParams.

This operation fails if no rooms are fitting or available (all full, closed, in another lobby or not visible). It may also fail when actually joining the room which was found. Rooms may close, become full or empty anytime.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

More about PUN matchmaking: https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby

Parameters
expectedCustomRoomProperties | Filters for rooms that match these custom properties (string keys and values). To ignore, pass null.
expectedMaxPlayers | Filters for a particular maxplayer setting. Use 0 to accept any maxPlayer value.
matchingType | Selects one of the available matchmaking algorithms. See MatchmakingMode enum for options.
typedLobby | The lobby in which you want to lookup a room. Pass null, to use the default lobby. This does not join that lobby and neither sets the lobby property.
sqlLobbyFilter | A filter-string for SQL-typed lobbies.
expectedUsers | Optional list of users (by UserId) who are expected to join this game and who you want to block a slot for.
Returns
If the operation got queued and will be sent.

◆ JoinRoom()

static bool JoinRoom | ( | string | roomName,
 |  | string[] | expectedUsers = null
 | ) |  |
static

Joins a room by name. Will callback: OnJoinedRoom or OnJoinRoomFailed.

Useful when using lobbies or when players follow friends or invite each other.

When successful, the client will enter the specified room and callback via OnJoinedRoom. In all error cases, OnJoinRoomFailed gets called.

Joining a room will fail if the room is full, closed, not existing or when the user already is present in the room (checked by userId).

To return to a room, use OpRejoinRoom. When players invite each other and it's unclear who's first to respond, use OpJoinOrCreateRoom instead.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

More about PUN matchmaking: https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby

OnJoinRoomFailed OnJoinedRoom

Parameters
roomName | Unique name of the room to join.
expectedUsers | Optional list of users (by UserId) who are expected to join this game and who you want to block a slot for.
Returns
If the operation got queued and will be sent.

◆ LeaveLobby()

static bool LeaveLobby ( )
static

Leave a lobby to stop getting updates about available rooms.

This does not reset PhotonNetwork.lobby! This allows you to join this particular lobby later easily.

The values CountOfPlayers, CountOfPlayersOnMaster, CountOfPlayersInRooms and CountOfRooms are received even without being in a lobby.

You can use JoinRandomRoom without being in a lobby.

◆ LeaveRoom()

static bool LeaveRoom ( bool becomeInactive = true )
static

Leave the current room and return to the Master Server where you can join or create rooms (see remarks).

This will clean up all (network) GameObjects with a PhotonView, unless you changed autoCleanUp to false. Returns to the Master Server.

In OfflineMode, the local "fake" room gets cleaned up and OnLeftRoom gets called immediately.

In a room with playerTTL < 0, LeaveRoom just turns a client inactive. The player stays in the room's player list and can return later on. Setting becomeInactive to false deliberately, means to "abandon" the room, despite the playerTTL allowing you to come back.

In a room with playerTTL == 0, become inactive has no effect (clients are removed from the room right away).

Parameters
becomeInactive If this client becomes inactive in a room with playerTTL < 0. Defaults to true.

◆ LoadLevel() [1/2]

static void LoadLevel ( int levelNumber )
static

This method wraps loading a level asynchronously and pausing network messages during the process.

While loading levels in a networked game, it makes sense to not dispatch messages received by other players. LoadLevel takes care of that by setting PhotonNetwork.IsMessageQueueRunning = false until the scene loaded.

To sync the loaded level in a room, set PhotonNetwork.AutomaticallySyncScene to true. The Master Client of a room will then sync the loaded level with every other player in the room. Note that this works only for a single active scene and that reloading the scene is not supported. The Master Client will actually reload a scene but other clients won't.

You should make sure you don't fire RPCs before you load another scene (which doesn't contain the same GameObjects and PhotonViews).

LoadLevel uses SceneManager.LoadSceneAsync().

Check the progress of the LevelLoading using PhotonNetwork.LevelLoadingProgress.

Calling LoadLevel before the previous scene finished loading is not recommended. If AutomaticallySyncScene is enabled, PUN cancels the previous load (and prevent that from becoming the active scene). If AutomaticallySyncScene is off, the previous scene loading can finish. In both cases, a new scene is loaded locally.

Parameters
levelNumber Build-index number of the level to load. When using level numbers, make sure they are identical on all clients.

◆ LoadLevel() [2/2]

static void LoadLevel ( string levelName )
static

This method wraps loading a level asynchronously and pausing network messages during the process.

While loading levels in a networked game, it makes sense to not dispatch messages received by other players. LoadLevel takes care of that by setting PhotonNetwork.IsMessageQueueRunning = false until the scene loaded.

To sync the loaded level in a room, set PhotonNetwork.AutomaticallySyncScene to true. The Master Client of a room will then sync the loaded level with every other player in the room. Note that this works only for a single active scene and that reloading the scene is not supported. The Master Client will actually reload a scene but other clients won't.

You should make sure you don't fire RPCs before you load another scene (which doesn't contain the same GameObjects and PhotonViews).

LoadLevel uses SceneManager.LoadSceneAsync().

Check the progress of the LevelLoading using PhotonNetwork.LevelLoadingProgress.

Calling LoadLevel before the previous scene finished loading is not recommended. If AutomaticallySyncScene is enabled, PUN cancels the previous load (and prevent that from becoming the active scene). If AutomaticallySyncScene is off, the previous scene loading can finish. In both cases, a new scene is loaded locally.

Parameters
levelName Name of the level to load. Make sure it's available to all clients in the same room.

◆ NetworkStatisticsReset()

static void NetworkStatisticsReset ( )
static

Resets the traffic stats and re-enables them.

◆ NetworkStatisticsToString()

static string NetworkStatisticsToString ( )
static

Only available when NetworkStatisticsEnabled was used to gather some stats.

Returns
A string with vital networking statistics.

◆ OpCleanActorRpcBuffer()

static void OpCleanActorRpcBuffer ( int actorNumber )
static

Removes the RPCs of someone else (to be used as master). This won't clean any local caches. It just tells the server to forget a player's RPCs and instantiates.

Parameters
actorNumber

◆ OpCleanRpcBuffer()

static void OpCleanRpcBuffer ( PhotonView view )
static

Cleans server RPCs for PhotonView (without any further checks).

◆ OpRemoveCompleteCacheOfPlayer()

static void OpRemoveCompleteCacheOfPlayer ( int actorNumber )
static

Instead removing RPCs or Instantiates, this removed everything cached by the actor.

Parameters
actorNumber

◆ RaiseEvent()

static bool RaiseEvent | ( | byte | eventCode,
 |  | object | eventContent,
 |  | RaiseEventOptions | raiseEventOptions,
 |  | SendOptions | sendOptions
 | ) |  |
static

Sends fully customizable events in a room. Events consist of at least an EventCode (0..199) and can have content.

To receive events, implement IOnEventCallback in any class and register it via PhotonNetwork.AddCallbackTarget. See IOnEventCallback.OnEvent.

The eventContent is optional. If set, eventContent must be a "serializable type", something that the client can turn into a byte[] basically. Most basic types and arrays of them are supported, including Unity's Vector2, Vector3, Quaternion. Transforms are not supported.

You can turn a class into a "serializable type" by following the example in CustomTypes.cs.

The RaiseEventOptions have some (less intuitive) combination rules: If you set targetActors (an array of Player.ID values), the receivers parameter gets ignored. When using event caching, the targetActors, receivers and interestGroup can't be used. Buffered events go to all. When using cachingOption removeFromRoomCache, the eventCode and content are actually not sent but used as filter.

Parameters
eventCode | A byte identifying the type of event. You might want to use a code per action or to signal which content can be expected. Allowed: 0..199.
eventContent | Some serializable object like string, byte, integer, float (etc) and arrays of those. Hashtables with byte keys are good to send variable content.
raiseEventOptions | Allows more complex usage of events. If null, RaiseEventOptions.Default will be used (which is fine).
sendOptions | Send options for reliable, encryption etc..
Returns
False if event could not be sent.

◆ Reconnect()

static bool Reconnect ( )
static

Can be used to reconnect to the master server after a disconnect.

After losing connection, you can use this to connect a client to the region Master Server again. Cache the room name you're in and use RejoinRoom(roomname) to return to a game. Common use case: Press the Lock Button on a iOS device and you get disconnected immediately.

◆ ReconnectAndRejoin()

static bool ReconnectAndRejoin ( )
static

When the client lost connection during gameplay, this method attempts to reconnect and rejoin the room.

This method re-connects directly to the game server which was hosting the room PUN was in before. If the room was shut down in the meantime, PUN will call OnJoinRoomFailed and return this client to the Master Server.

Check the return value, if this client will attempt a reconnect and rejoin (if the conditions are met). If ReconnectAndRejoin returns false, you can still attempt a Reconnect and Rejoin.

Similar to PhotonNetwork.RejoinRoom, this requires you to use unique IDs per player (the UserID).

Rejoining room will not send any player properties. Instead client will receive up-to-date ones from server. If you want to set new player properties, do it once rejoined.

Returns
False, if there is no known room or game server to return to. Then, this client does not attempt the ReconnectAndRejoin.

◆ RejoinRoom()

static bool RejoinRoom ( string roomName )
static

Rejoins a room by roomName (using the userID internally to return). Will callback: OnJoinedRoom or OnJoinRoomFailed.

After losing connection, you might be able to return to a room and continue playing, if the client is reconnecting fast enough. Use Reconnect() and this method. Cache the room name you're in and use RejoinRoom(roomname) to return to a game.

Note: To be able to Rejoin any room, you need to use UserIDs! You also need to set RoomOptions.PlayerTtl.

Important: Instantiate() and use of RPCs is not yet supported. The ownership rules of PhotonViews prevent a seamless return to a game, if you use PhotonViews. Use Custom Properties and RaiseEvent with event caching instead.

Common use case: Press the Lock Button on a iOS device and you get disconnected immediately.

Rejoining room will not send any player properties. Instead client will receive up-to-date ones from server. If you want to set new player properties, do it once rejoined.

◆ RemoveBufferedRPCs()

static bool RemoveBufferedRPCs | ( | int | viewId = 0,
 |  | string | methodName = null,
 |  | int[] | callersActorNumbers = null
 | ) |  |
static

Clear buffered RPCs based on filter parameters.

Parameters
viewId | The viewID of the PhotonView where the RPC has been called on. We actually need its ViewID. If 0 (default) is provided, all PhotonViews/ViewIDs are considered.
methodName | The RPC method name, if possible we will use its hash shortcut for efficiency. If none (null or empty string) is provided all RPC method names are considered.
callersActorNumbers | The actor numbers of the players who called/buffered the RPC. For example if two players buffered the same RPC you can clear the buffered RPC of one and keep the other. If none (null or empty array) is provided all senders are considered.
Returns
If the operation could be sent to the server.

◆ RemoveCallbackTarget()

static void RemoveCallbackTarget ( object target )
static

Removes the target object from callbacks for its implemented callback-interfaces.

The covered callback interfaces are: IConnectionCallbacks, IMatchmakingCallbacks, ILobbyCallbacks, IInRoomCallbacks, IOnEventCallback and IWebRpcCallback.

See: .Net Callbacks

Parameters
target The object that unregisters from getting callbacks.

◆ RemovePlayerCustomProperties()

static void RemovePlayerCustomProperties ( string[] customPropertiesToDelete )
static

Locally removes Custom Properties of "this" player. Important: This does not synchronize the change! Useful when you switch rooms.

Use this method with care. It can create inconsistencies of state between players! This only changes the player.customProperties locally. This can be useful to clear your Custom Properties between games (let's say they store which turn you made, kills, etc).

SetPlayerCustomProperties() syncs and can be used to set values to null while in a room. That can be considered "removed" while in a room.

If customPropertiesToDelete is null or has 0 entries, all Custom Properties are deleted (replaced with a new Hashtable). If you specify keys to remove, those will be removed from the Hashtable but other keys are unaffected.

Parameters
customPropertiesToDelete List of Custom Property keys to remove. See remarks.

◆ RemoveRPCs() [1/2]

static void RemoveRPCs ( PhotonView targetPhotonView )
static

Remove all buffered RPCs from server that were sent via targetPhotonView. The Master Client and the owner of the targetPhotonView may call this.

This method requires either:

  • The targetPhotonView is owned by this client (Instantiated by it).
  • This client is the Master Client (can remove any PhotonView's RPCs).
Parameters
targetPhotonView RPCs buffered for this PhotonView get removed from server buffer.

◆ RemoveRPCs() [2/2]

static void RemoveRPCs ( Player targetPlayer )
static

Remove all buffered RPCs from server that were sent by targetPlayer. Can only be called on local player (for "self") or Master Client (for anyone).

This method requires either:

  • This is the targetPlayer's client.
  • This client is the Master Client (can remove any Player's RPCs).

If the targetPlayer calls RPCs at the same time that this is called, network lag will determine if those get buffered or cleared like the rest.

Parameters
targetPlayer This player's buffered RPCs get removed from server buffer.

◆ RemoveRPCsInGroup()

static void RemoveRPCsInGroup ( int group )
static

Remove all buffered RPCs from server that were sent in the targetGroup, if this is the Master Client or if this controls the individual PhotonView.

This method requires either:

  • This client is the Master Client (can remove any RPCs per group).
  • Any other client: each PhotonView is checked if it is under this client's control. Only those RPCs are removed.
Parameters
group Interest group that gets all RPCs removed.

◆ SendAllOutgoingCommands()

static void SendAllOutgoingCommands ( )
static

Can be used to immediately send the RPCs and Instantiates just called, so they are on their way to the other players.

This could be useful if you do a RPC to load a level and then load it yourself. While loading, no RPCs are sent to others, so this would delay the "load" RPC. You can send the RPC to "others", use this method, disable the message queue (by IsMessageQueueRunning) and then load.

◆ SetInterestGroups() [1/2]

static void SetInterestGroups | ( | byte | group,
 |  | bool | enabled
 | ) |  |
static

Enable/disable receiving events from a given Interest Group.

A client can tell the server which Interest Groups it's interested in. The server will only forward events for those Interest Groups to that client (saving bandwidth and performance).

See: https://doc.photonengine.com/en-us/pun/v2/gameplay/interestgroups

See: https://doc.photonengine.com/en-us/pun/v2/demos-and-tutorials/package-demos/culling-demo

Parameters
group | The interest group to affect.
enabled | Sets if receiving from group to enabled (or not).

◆ SetInterestGroups() [2/2]

static void SetInterestGroups | ( | byte[] | disableGroups,
 |  | byte[] | enableGroups
 | ) |  |
static

Enable/disable receiving on given Interest Groups (applied to PhotonViews).

A client can tell the server which Interest Groups it's interested in. The server will only forward events for those Interest Groups to that client (saving bandwidth and performance).

See: https://doc.photonengine.com/en-us/pun/v2/gameplay/interestgroups

See: https://doc.photonengine.com/en-us/pun/v2/demos-and-tutorials/package-demos/culling-demo

Parameters
disableGroups | The interest groups to disable (or null).
enableGroups | The interest groups to enable (or null).

◆ SetLevelPrefix()

static void SetLevelPrefix ( byte prefix )
static

Sets level prefix for PhotonViews instantiated later on. Don't set it if you need only one!

Important: If you don't use multiple level prefixes, simply don't set this value. The default value is optimized out of the traffic.

This won't affect existing PhotonViews (they can't be changed yet for existing PhotonViews).

Messages sent with a different level prefix will be received but not executed. This affects RPCs, Instantiates and synchronization.

Be aware that PUN never resets this value, you'll have to do so yourself.

Parameters
prefix Max value is short.MaxValue = 255

◆ SetMasterClient()

static bool SetMasterClient ( Player masterClientPlayer )
static

Asks the server to assign another player as Master Client of your current room.

RPCs and RaiseEvent have the option to send messages only to the Master Client of a room. SetMasterClient affects which client gets those messages.

This method calls an operation on the server to set a new Master Client, which takes a roundtrip. In case of success, this client and the others get the new Master Client from the server.

SetMasterClient tells the server which current Master Client should be replaced with the new one. It will fail, if anything switches the Master Client moments earlier. There is no callback for this error. All clients should get the new Master Client assigned by the server anyways.

See also: PhotonNetwork.MasterClient

On v3 servers: The ReceiverGroup.MasterClient (usable in RPCs) is not affected by this (still points to lowest player.ID in room). Avoid using this enum value (and send to a specific player instead).

If the current Master Client leaves, PUN will detect a new one by "lowest player ID". Implement OnMasterClientSwitched to get a callback in this case. The PUN-selected Master Client might assign a new one.

Make sure you don't create an endless loop of Master-assigning! When selecting a custom Master Client, all clients should point to the same player, no matter who actually assigns this player.

Locally the Master Client is immediately switched, while remote clients get an event. This means the game is tempoarily without Master Client like when a current Master Client leaves.

When switching the Master Client manually, keep in mind that this user might leave and not do it's work, just like any Master Client.

Parameters
masterClientPlayer The player to become the next Master Client.
Returns
False when this operation couldn't be done. Must be in a room (not in OfflineMode).

◆ SetPlayerCustomProperties()

static bool SetPlayerCustomProperties ( Hashtable customProperties )
static

Sets this (local) player's properties and synchronizes them to the other players (don't modify them directly).

While in a room, your properties are synced with the other players. CreateRoom, JoinRoom and JoinRandomRoom will all apply your player's custom properties when you enter the room. The whole Hashtable will get sent. Minimize the traffic by setting only updated key/values.

If the Hashtable is null, the custom properties will be cleared. Custom properties are never cleared automatically, so they carry over to the next room, if you don't change them.

Don't set properties by modifying PhotonNetwork.player.customProperties!

Parameters
customProperties Only string-typed keys will be used from this hashtable. If null, custom properties are all deleted.
Returns
False if customProperties is empty or have zero string keys. True in offline mode. True if not in a room and this is the local player (use this to cache properties to be sent when joining a room). Otherwise, returns if this operation could be sent to the server.

◆ SetSendingEnabled() [1/2]

static void SetSendingEnabled | ( | byte | group,
 |  | bool | enabled
 | ) |  |
static

Enable/disable sending on given group (applied to PhotonViews)

This does not interact with the Photon server-side. It's just a client-side setting to suppress updates, should they be sent to one of the blocked groups.

This setting is not particularly useful, as it means that updates literally never reach the server or anyone else. Use with care.

Parameters
group | The interest group to affect.
enabled | Sets if sending to group is enabled (or not).

◆ SetSendingEnabled() [2/2]

static void SetSendingEnabled | ( | byte[] | disableGroups,
 |  | byte[] | enableGroups
 | ) |  |
static

Enable/disable sending on given groups (applied to PhotonViews)

This does not interact with the Photon server-side. It's just a client-side setting to suppress updates, should they be sent to one of the blocked groups.

This setting is not particularly useful, as it means that updates literally never reach the server or anyone else. Use with care.

Parameters
enableGroups | The interest groups to enable sending on (or null).
disableGroups | The interest groups to disable sending on (or null).

◆ WebRpc()

static bool WebRpc | ( | string | name,
 |  | object | parameters,
 |  | bool | sendAuthCookie = false
 | ) |  |
static

This operation makes Photon call your custom web-service by name (path) with the given parameters.

This is a server-side feature which must be setup in the Photon Cloud Dashboard prior to use. https://doc.photonengine.com/en-us/pun/v2/gameplay/web-extensions/webrpc The Parameters will be converted into JSon format, so make sure your parameters are compatible.

See Photon.Realtime.IWebRpcCallback.OnWebRpcResponse on how to get a response.

It's important to understand that the OperationResponse only tells if the WebRPC could be called. The content of the response contains any values your web-service sent and the error/success code. In case the web-service failed, an error code and a debug message are usually inside the OperationResponse.

The class WebRpcResponse is a helper-class that extracts the most valuable content from the WebRPC response.

Example callback implementation:

public void OnWebRpcResponse(OperationResponse response)
{
    WebRpcResponse webResponse = new WebRpcResponse(operationResponse);
    if (webResponse.ReturnCode != 0) { //...
    }
    switch (webResponse.Name) { //...
    }
    // and so on
}

Member Data Documentation

◆ ConnectMethod

          ConnectMethod ConnectMethod = ConnectMethod.NotCalled

static

Tracks, which Connect method was called last.

ConnectToMaster sets this to ConnectToMaster. ConnectToRegion sets this to ConnectToRegion. ConnectToBestCloudServer sets this to ConnectToBest. PhotonNetwork.ConnectUsingSettings will call either ConnectToMaster, ConnectToRegion or ConnectToBest, depending on the settings.

◆ EnableCloseConnection

          bool EnableCloseConnection = false

static

Used to enable reaction to CloseConnection events. Default: false.

Using CloseConnection is a security risk, as exploiters can send the event as Master Client.

In best case, a game would implement this "disconnect others" independently from PUN in game-code with some security checks.

◆ LogLevel

          PunLogLevel LogLevel = PunLogLevel.ErrorsOnly

static

Controls how verbose PUN is.

◆ MAX_VIEW_IDS

          readonly int MAX_VIEW_IDS = 1000

static

The maximum number of assigned PhotonViews per player (or scene). See the General Documentation topic "Limitations" on how to raise this limitation.

◆ MinimalTimeScaleToDispatchInFixedUpdate

          float MinimalTimeScaleToDispatchInFixedUpdate = -1f

static

Affects if the PhotonHandler dispatches incoming messages in LateUpdate or FixedUpdate (default).

By default the PhotonHandler component dispatches incoming messages in FixedUpdate.

When the Time.timeScale is low, FixedUpdate is called less frequently up to a point where updates may get paused. PUN can automatically dispatch messages in LateUpdate for low timeScale values (when Time.timeScale is lower than this value).

PUN will use either FixedUpdate or LateUpdate but not both (as of v2.23).

When you use this value, be aware that Instantiates and RPCs execute with a changed timing within a frame. If Instantiate is called from FixedUpdate, the physics engine seems to run for instantiated objects before the engine calls Start() on them.

By default, this value is -1f, so there is no fallback to LateUpdate.

◆ NetworkingClient

          LoadBalancingClient NetworkingClient

static

The LoadBalancingClient is part of Photon Realtime and wraps up multiple servers and states for PUN.

◆ ObjectsInOneUpdate

          int ObjectsInOneUpdate = 20

static

Defines how many updated produced by OnPhotonSerialize() are batched into one message.

A low number increases overhead, a high number might lead to fragmented messages.

◆ PrecisionForFloatSynchronization

          float PrecisionForFloatSynchronization = 0.01f

static

The minimum difference between floats before we send it via a PhotonView's OnSerialize/ObservingComponent.

◆ PrecisionForQuaternionSynchronization

          float PrecisionForQuaternionSynchronization = 1.0f

static

The minimum angle that a rotation needs to change before we send it via a PhotonView's OnSerialize/ObservingComponent.

◆ PrecisionForVectorSynchronization

          float PrecisionForVectorSynchronization = 0.000099f

static

The minimum difference that a Vector2 or Vector3(e.g. a transforms rotation) needs to change before we send it via a PhotonView's OnSerialize/ObservingComponent.

Note that this is the sqrMagnitude. E.g. to send only after a 0.01 change on the Y-axix, we use 0.01f*0.01f=0.0001f. As a remedy against float inaccuracy we use 0.000099f instead of 0.0001f.

◆ PunVersion

          const string PunVersion = "2.39"

static

Version number of PUN. Used in the AppVersion, which separates your playerbase in matchmaking.

◆ RunRpcCoroutines

          bool RunRpcCoroutines = true

static

If an RPC method is implemented as coroutine, it gets started, unless this value is false.

As starting coroutines causes a little memnory garbage, you may want to disable this option but it is also good enough to not return IEnumerable from methods with the attribite PunRPC.

◆ ServerSettingsFileName

          const string ServerSettingsFileName = "PhotonServerSettings"

static

Name of the PhotonServerSettings file (used to load and by PhotonEditor to save new files).

◆ UseRpcMonoBehaviourCache

          bool UseRpcMonoBehaviourCache

static

While enabled, the MonoBehaviours on which we call RPCs are cached, avoiding costly GetComponents<MonoBehaviour>() calls.

RPCs are called on the MonoBehaviours of a target PhotonView. Those have to be found via GetComponents.

When set this to true, the list of MonoBehaviours gets cached in each PhotonView. You can use photonView.RefreshRpcMonoBehaviourCache() to manually refresh a PhotonView's list of MonoBehaviours on demand (when a new MonoBehaviour gets added to a networked GameObject, e.g.).

Property Documentation

◆ AppVersion

          string AppVersion

staticget

Sent to Photon Server to specify the "Virtual AppId".

Sent with the operation Authenticate. When using PUN, you should set the GameVersion or use ConnectUsingSettings().

◆ AuthValues

          AuthenticationValues? AuthValues

staticgetset

A user's authentication values used during connect.

Set these before calling Connect if you want custom authentication. These values set the userId, if and how that userId gets verified (server-side), etc..

If authentication fails for any values, PUN will call your implementation of OnCustomAuthenticationFailed(string debugMessage). See Photon.Realtime.IConnectionCallbacks.OnCustomAuthenticationFailed.

◆ AutomaticallySyncScene

          bool AutomaticallySyncScene

staticgetset

Defines if all clients in a room should automatically load the same level as the Master Client.

When enabled, clients load the same scene that is active on the Master Client. When a client joins a room, the scene gets loaded even before the callback OnJoinedRoom gets called.

To synchronize the loaded level, the Master Client should use PhotonNetwork.LoadLevel, which notifies the other clients before starting to load the scene. If the Master Client loads a level directly via Unity's API, PUN will notify the other players after the scene loading completed (using SceneManager.sceneLoaded).

Internally, a Custom Room Property is set for the loaded scene. On change, clients use LoadLevel if they are not in the same scene.

Note that this works only for a single active scene and that reloading the scene is not supported. The Master Client will actually reload a scene but other clients won't. To get everyone to reload, the game can send an RPC or event to trigger the loading.

◆ BestRegionSummaryInPreferences

          string BestRegionSummaryInPreferences

staticgetset

Used to store and access the "Best Region Summary" in the Player Preferences.

Set this value to null before you connect, to discard the previously selected Best Region for the client.

◆ CloudRegion

          string? CloudRegion

staticget

Currently used Cloud Region (if any). As long as the client is not on a Master Server or Game Server, the region is not yet defined.

◆ CountOfPlayers

          int CountOfPlayers

staticget

The count of players currently using this application (available on MasterServer in 5sec intervals).

◆ CountOfPlayersInRooms

          int CountOfPlayersInRooms

staticget

Count of users currently playing your app in some room (sent every 5sec by Master Server). Use PhotonNetwork.PlayerList.Length or PhotonNetwork.CurrentRoom.PlayerCount to get the count of players in the room you're in!

◆ CountOfPlayersOnMaster

          int CountOfPlayersOnMaster

staticget

The count of players currently looking for a room (available on MasterServer in 5sec intervals).

◆ CountOfRooms

          int CountOfRooms

staticget

The count of rooms currently in use (available on MasterServer in 5sec intervals).

◆ CrcCheckEnabled

          bool CrcCheckEnabled

staticgetset

Crc checks can be useful to detect and avoid issues with broken datagrams. Can be enabled while not connected.

◆ CurrentCluster

          string? CurrentCluster

staticget

The cluster name provided by the Name Server.

The value is provided by the OpResponse for OpAuthenticate/OpAuthenticateOnce. See ConnectToRegion.

Null until set.

Note that the Name Server may assign another cluster, if the requested one is not configured or available.

◆ CurrentLobby

          TypedLobby CurrentLobby

staticget

The lobby that will be used when PUN joins a lobby or creates a game. This is defined when joining a lobby or creating rooms

The default lobby uses an empty string as name. So when you connect or leave a room, PUN automatically gets you into a lobby again.

Check PhotonNetwork.InLobby if the client is in a lobby. (masterServerAndLobby)

◆ CurrentRoom

          Room? CurrentRoom

staticget

Get the room we're currently in (also when in OfflineMode). Null if we aren't in any room.

LoadBalancing Client is not aware of the Photon Offline Mode, so never use PhotonNetwork.NetworkingClient.CurrentRoom will be null if you are using OffLine Mode, while PhotonNetwork.CurrentRoom will be set when offlineMode is true

◆ EnableLobbyStatistics

          bool EnableLobbyStatistics

staticget

If enabled, the client will get a list of available lobbies from the Master Server.

Set this value before the client connects to the Master Server. While connected to the Master Server, a change has no effect.

Implement OptionalInfoCallbacks.OnLobbyStatisticsUpdate, to get the list of used lobbies.

The lobby statistics can be useful if your title dynamically uses lobbies, depending (e.g.) on current player activity or such. In this case, getting a list of available lobbies, their room-count and player-count can be useful info.

ConnectUsingSettings sets this to the PhotonServerSettings value.

◆ GameVersion

          string GameVersion

staticgetset

Version number of your game. Setting this updates the AppVersion, which separates your playerbase in matchmaking.

In PUN, the GameVersion is only one component of the LoadBalancingClient.AppVersion. Setting the GameVersion will also set the LoadBalancingClient.AppVersion to: value+'_'+ PhotonNetwork.PunVersion.

The AppVersion is used to split your playerbase as needed. One AppId may have various AppVersions and each is a separate set of users for matchmaking.

The AppVersion gets sent in the "Authenticate" step. This means you can set the GameVersion right after calling ConnectUsingSettings (e.g.) and the new value will be used on the server. Once the client is connected, authentication is done and the value won't be sent to the server anymore.

◆ InLobby

          bool InLobby

staticget

True while this client is in a lobby.

Implement IPunCallbacks.OnRoomListUpdate() for a notification when the list of rooms becomes available or updated.

You are automatically leaving any lobby when you join a room! Lobbies only exist on the Master Server (whereas rooms are handled by Game Servers).

◆ InRoom

          bool InRoom

staticget

Is true while being in a room (NetworkClientState == ClientState.Joined).

Aside from polling this value, game logic should implement IMatchmakingCallbacks in some class and react when that gets called.

Many actions can only be executed in a room, like Instantiate or Leave, etc.

 A client can join a room in offline mode. In that case, don't use LoadBalancingClient.InRoom, which does not cover offline mode.

◆ IsConnected

          bool IsConnected

staticget

False until you connected to Photon initially. True immediately after Connect-call, in offline mode, while connected to any server and even while switching servers.

It is recommended to use the IConnectionCallbacks to establish a connection workflow. Also have a look at IsConnectedAndReady, which provides more info on when you can call operations at all.

◆ IsConnectedAndReady

          bool IsConnectedAndReady

staticget

A refined version of connected which is true only if your connection to the server is ready to accept operations like join, leave, etc.

◆ IsMasterClient

          bool IsMasterClient

staticget

Are we the master client?

◆ IsMessageQueueRunning

          bool IsMessageQueueRunning

staticgetset

Can be used to pause dispatching of incoming events (RPCs, Instantiates and anything else incoming).

While IsMessageQueueRunning == false, the OnPhotonSerializeView calls are not done and nothing is sent by a client. Also, incoming messages will be queued until you re-activate the message queue.

This can be useful if you first want to load a level, then go on receiving data of PhotonViews and RPCs. The client will go on receiving and sending acknowledgements for incoming packages and your RPCs/Events. This adds "lag" and can cause issues when the pause is longer, as all incoming messages are just queued.

◆ KeepAliveInBackground

          float? KeepAliveInBackground

staticgetset

Defines how many seconds PUN keeps the connection after Unity's OnApplicationPause(true) call. Default: 60 seconds.

It's best practice to disconnect inactive apps/connections after a while but to also allow users to take calls, etc.. We think a reasonable background timeout is 60 seconds.

To handle the timeout, implement: OnDisconnected(), as usual. Your application will "notice" the background disconnect when it becomes active again (running the Update() loop).

If you need to separate this case from others, you need to track if the app was in the background (there is no special callback by PUN).

Info: PUN is running a "fallback thread" to send ACKs to the server, even when Unity is not calling Update() regularly. This helps keeping the connection while loading scenes and assets and when the app is in the background.

Note: Some platforms (e.g. iOS) don't allow to keep a connection while the app is in background. In those cases, this value does not change anything, the app immediately loses connection in background.

Unity's OnApplicationPause() callback is broken in some exports (Android) of some Unity versions. Make sure OnApplicationPause() gets the callbacks you expect on the platform you target! Check PhotonHandler.OnApplicationPause(bool pause) to see the implementation.

◆ LevelLoadingProgress

          float LevelLoadingProgress

staticget

Represents the scene loading progress when using LoadLevel().

The value is 0 if the app never loaded a scene with LoadLevel(). During async scene loading, the value is between 0 and 1. Once any scene completed loading, it stays at 1 (signaling "done").

The level loading progress. Ranges from 0 to 1.

◆ LocalPlayer

          Player LocalPlayer

staticget

This client's Player instance is always available, unless the app shuts down.

Useful (e.g.) to set the Custom Player Properties or the NickName for this client anytime. When the client joins a room, the Custom Properties and other values are synced.

◆ MasterClient

          Player MasterClient

staticget

The Master Client of the current room or null (outside of rooms).

Can be used as "authoritative" client/player to make descisions, run AI or other.

If the current Master Client leaves the room (leave/disconnect), the server will quickly assign someone else. If the current Master Client times out (closed app, lost connection, etc), messages sent to this client are effectively lost for the others! A timeout can take 10 seconds in which no Master Client is active.

Implement the method IPunCallbacks.OnMasterClientSwitched to be called when the Master Client switched.

Use PhotonNetwork.SetMasterClient, to switch manually to some other player / client.

With OfflineMode == true, this always returns the PhotonNetwork.player.

◆ MaxResendsBeforeDisconnect

          int MaxResendsBeforeDisconnect

staticgetset

Defines the number of times a reliable message can be resent before not getting an ACK for it will trigger a disconnect. Default: 5.

Less resends mean quicker disconnects, while more can lead to much more lag without helping. Min: 3. Max: 10.

◆ NetworkClientState

          ClientState? NetworkClientState

staticget

Directly provides the network-level client state, unless in OfflineMode.

In context of PUN, you should usually use IsConnected or IsConnectedAndReady.

This is the lower level connection state. Keep in mind that PUN uses more than one server, so the client may become Disconnected, even though it's just switching servers.

While OfflineMode is true, this is ClientState.Joined (after create/join) or ConnectedToMasterServer in all other cases.

◆ NetworkStatisticsEnabled

          bool NetworkStatisticsEnabled

staticgetset

Enables or disables the collection of statistics about this client's traffic.

If you encounter issues with clients, the traffic stats are a good starting point to find solutions. Only with enabled stats, you can use GetVitalStats

◆ NickName

          string NickName

staticgetset

Set to synchronize the player's nickname with everyone in the room(s) you enter. This sets PhotonNetwork.player.NickName.

The NickName is just a nickname and does not have to be unique or backed up with some account.

 Set the value any time (e.g. before you connect) and it will be available to everyone you play with.

 Access the names of players by: Player.NickName.

 PhotonNetwork.PlayerListOthers is a list of other players - each contains the NickName the remote player set.

◆ OfflineMode

          bool OfflineMode

staticgetset

Offline mode can be set to re-use your multiplayer code in singleplayer game modes. When this is on PhotonNetwork will not create any connections and there is near to no overhead. Mostly usefull for reusing RPC's and PhotonNetwork.Instantiate

◆ PacketLossByCrcCheck

          int PacketLossByCrcCheck

staticget

If CrcCheckEnabled, this counts the incoming packages that don't have a valid CRC checksum and got rejected.

◆ PhotonServerSettings

          ServerSettings PhotonServerSettings

staticget

Serialized server settings, written by the Setup Wizard for use in ConnectUsingSettings.

◆ PhotonViewCollection

          NonAllocDictionary<int, PhotonView>.ValueIterator PhotonViewCollection

staticget

Returns a new iterable collection of current photon views.

You can iterate over all PhotonViews in a simple foreach loop. To use this in a while-loop, assign the new iterator to a variable and then call MoveNext on that.

◆ PhotonViews

          PhotonView [] PhotonViews

staticget

Gets the photon views.

This is an expensive operation as it returns a copy of the internal list.

The photon views.

◆ PlayerList

          Player [] PlayerList

staticget

A sorted copy of the players-list of the current room. This is using Linq, so better cache this value. Update when players join / leave.

◆ PlayerListOthers

          Player [] PlayerListOthers

staticget

A sorted copy of the players-list of the current room, excluding this client. This is using Linq, so better cache this value. Update when players join / leave.

◆ PrefabPool

          IPunPrefabPool PrefabPool

staticgetset

An Object Pool can be used to keep and reuse instantiated object instances. Replaces Unity's default Instantiate and Destroy methods.

Defaults to the DefaultPool type. To use a GameObject pool, implement IPunPrefabPool and assign it here. Prefabs are identified by name.

◆ QuickResends

          int QuickResends

staticgetset

In case of network loss, reliable messages can be repeated quickly up to 3 times.

When reliable messages get lost more than once, subsequent repeats are delayed a bit to allow the network to recover.

 With this option, the repeats 2 and 3 can be sped up. This can help avoid timeouts but also it increases the speed in which gaps are closed.

 When you set this, increase PhotonNetwork.MaxResendsBeforeDisconnect to 6 or 7.

◆ ResentReliableCommands

          int ResentReliableCommands

staticget

Count of commands that got repeated (due to local repeat-timing before an ACK was received).

If this value increases a lot, there is a good chance that a timeout disconnect will happen due to bad conditions.

◆ SendRate

          int SendRate

staticgetset

Defines how many times per second the PhotonHandler should send data, if any is queued. Default: 30.

This value defines how often PUN will call the low level PhotonPeer to put queued outgoing messages into a datagram to be sent. This is implemented in the PhotonHandler component, which integrates PUN into the Unity game loop. The PhotonHandler.MaxDatagrams value defines how many datagrams can be sent in one iteration.

This value does not affect how often updates are written by PhotonViews. That is controlled by the SerializationRate. To avoid send-delays for PhotonView updates, PUN will also send data at the end of frames that wrote data in OnPhotonSerializeView, so sending may actually be more frequent than the SendRate.

Messages queued due to RPCs and RaiseEvent, will be sent with at least SendRate frequency. They are included, when OnPhotonSerialize wrote updates and triggers early sending.

Setting this value does not adjust the SerializationRate anymore (as of PUN 2.24).

Sending less often will aggregate messages in datagrams, which avoids overhead on the network. It is also important to not push too many datagrams per frame. Three to five seem to be the sweet spot.

Keep your target platform in mind: mobile networks are usually slower. WiFi is slower with more variance and bursts of loss.

A low framerate (as in Update calls) will affect sending of messages.

◆ SerializationRate

          int SerializationRate

staticgetset

Defines how many times per second OnPhotonSerialize should be called on PhotonViews for controlled objects.

This value defines how often PUN will call OnPhotonSerialize on controlled network objects. This is implemented in the PhotonHandler component, which integrates PUN into the Unity game loop.

The updates written in OnPhotonSerialize will be queued temporarily and sent in the next LateUpdate, so a high SerializationRate also causes more sends. The idea is to keep the delay short during which written updates are queued.

Calling RPCs will not trigger a send.

A low framerate will affect how frequent updates are written and how "on time" they are.

A lower rate takes up less performance but the receiving side needs to interpolate longer times between updates.

◆ Server

          ServerConnection?? Server

staticget

The server (type) this client is currently connected or connecting to.

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

◆ ServerAddress

          string? ServerAddress

staticget

Currently used server address (no matter if master or game server).

◆ ServerPortOverrides

          PhotonPortDefinition? ServerPortOverrides

staticgetset

Defines overrides for server ports. Used per server-type if > 0. Important: If you change the transport protocol, adjust the overrides, too.

LoadBalancingClient.ServerPortOverrides

◆ ServerTimestamp

          int ServerTimestamp

staticget

The current server's millisecond timestamp.

This can be useful to sync actions and events on all clients in one room. The timestamp is based on the server's Environment.TickCount.

It will overflow from a positive to a negative value every so often, so be careful to use only time-differences to check the Time delta when things happen.

This is the basis for PhotonNetwork.Time.

◆ Time

          double Time

staticget

Photon network time, synched with the server.

v1.55

 This time value depends on the server's Environment.TickCount. It is different per server but inside a Room, all clients should have the same value (Rooms are on one server only).

 This is not a DateTime!

Use this value with care:

 It can start with any positive value.

 It will "wrap around" from 4294967.295 to 0!

◆ UseAlternativeUdpPorts

          bool UseAlternativeUdpPorts

staticgetset

Replaced by ServerPortOverrides.

        © Exit Games ®, all rights reserved.

        Documentation

        Contact

        Terms

        Status


Photon Unity Networking 2: PhotonView Class Reference

  • Pun
  • PhotonView
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
PhotonView Class Reference
Public API

A PhotonView identifies an object across the network (viewID) and configures how the controlling client updates remote instances. More...

Inherits MonoBehaviour.

Public Types

enum ObservableSearch

Public Member Functions

void | OnPreNetDestroy (PhotonView rootView)
void | RequestOwnership ()
Depending on the PhotonView's OwnershipTransfer setting, any client can request to become owner of the PhotonView. More...
void | TransferOwnership (Player newOwner)
Transfers the ownership of this PhotonView (and GameObject) to another player. More...
void | TransferOwnership (int newOwnerId)
Transfers the ownership of this PhotonView (and GameObject) to another player. More...
void | FindObservables (bool force=false)
Will find IPunObservable components on this GameObject and nested children and add them to the ObservedComponents list. More...
void | SerializeView (PhotonStream stream, PhotonMessageInfo info)
void | DeserializeView (PhotonStream stream, PhotonMessageInfo info)
void | RefreshRpcMonoBehaviourCache ()
Can be used to refesh the list of MonoBehaviours on this GameObject while PhotonNetwork.UseRpcMonoBehaviourCache is true. More...
void | RPC (string methodName, RpcTarget target, params object[] parameters)
Call a RPC method of this GameObject on remote clients of this room (or on all, including this client). More...
void | RpcSecure (string methodName, RpcTarget target, bool encrypt, params object[] parameters)
Call a RPC method of this GameObject on remote clients of this room (or on all, including this client). More...
void | RPC (string methodName, Player targetPlayer, params object[] parameters)
Call a RPC method of this GameObject on remote clients of this room (or on all, including this client). More...
void | RpcSecure (string methodName, Player targetPlayer, bool encrypt, params object[] parameters)
Call a RPC method of this GameObject on remote clients of this room (or on all, including this client). More...
void | AddCallbackTarget (IPhotonViewCallback obj)
Add object to all applicable callback interfaces. Object must implement at least one IOnPhotonViewCallback derived interface. More...
void | RemoveCallbackTarget (IPhotonViewCallback obj)
Remove object from all applicable callback interfaces. Object must implement at least one IOnPhotonViewCallback derived interface. More...
void | AddCallback< T > (IPhotonViewCallback obj)
Add object to this PhotonView's callback. T is the IOnPhotonViewCallback derived interface you want added to its associated callback list. Supplying IOnPhotonViewCallback (the interface base class) as T will add ALL implemented IOnPhotonViewCallback Interfaces found on the object. More...
void | RemoveCallback< T > (IPhotonViewCallback obj)
Remove object from this PhotonView's callback list for T. T is the IOnPhotonViewCallback derived interface you want removed from its associated callback list. Supplying IOnPhotonViewCallback (the interface base class) as T will remove ALL implemented IOnPhotonViewCallback Interfaces found on the object. More...
override string | ToString ()

Static Public Member Functions

static PhotonView | Get (Component component)
static PhotonView | Get (GameObject gameObj)
static PhotonView | Find (int viewID)
Finds the PhotonView Component with a viewID in the scene More...

Public Attributes

byte | Group = 0
int | prefixField = -1
ViewSynchronization | Synchronization = ViewSynchronization.UnreliableOnChange
OwnershipOption OwnershipTransfer = OwnershipOption.Fixed
Defines if ownership of this PhotonView is fixed, can be requested or simply taken. More...
ObservableSearch | observableSearch = ObservableSearch.Manual
Default to manual so existing PVs in projects default to same as before. Reset() changes this to AutoAll for new implementations.
List< Component > | ObservedComponents
int | sceneViewId = 0
This field is the Scene ViewID (0 if not used). loaded with the scene, used in Awake().
int | InstantiationId
bool | isRuntimeInstantiated

Properties

int | Prefix [get, set]
object[] | InstantiationData [get, set]
This is the InstantiationData that was passed when calling PhotonNetwork.Instantiate* (if that was used to spawn this prefab) More...
bool | IsSceneView [get]
bool | IsRoomView [get]
True if the PhotonView was loaded with the scene (game object) or instantiated with InstantiateRoomObject. More...
bool | IsOwnerActive [get]
bool | IsMine [get]
True if the PhotonView is "mine" and can be controlled by this client. More...
bool | AmController [get]
Player | Controller [get]
int | CreatorActorNr [get]
bool | AmOwner [get]
Player | Owner [get]
The owner of a PhotonView is the creator of an object by default Ownership can be transferred and the owner may not be in the room anymore. Objects in the scene don't have an owner. More...
int?? | OwnerActorNr [get, set]
int?? | ControllerActorNr [get, set]
int | ViewID [get, set]
The ID of the PhotonView. Identifies it in a networked game (per room). More...

Detailed Description

A PhotonView identifies an object across the network (viewID) and configures how the controlling client updates remote instances.

Member Function Documentation

◆ AddCallback< T >()

void AddCallback< T > ( IPhotonViewCallback obj )

Add object to this PhotonView's callback. T is the IOnPhotonViewCallback derived interface you want added to its associated callback list. Supplying IOnPhotonViewCallback (the interface base class) as T will add ALL implemented IOnPhotonViewCallback Interfaces found on the object.

Type Constraints
T : class
T : IPhotonViewCallback

◆ AddCallbackTarget()

void AddCallbackTarget ( IPhotonViewCallback obj )

Add object to all applicable callback interfaces. Object must implement at least one IOnPhotonViewCallback derived interface.

Parameters
obj An object that implements OnPhotonView callback interface(s).

◆ Find()

static PhotonView Find ( int viewID )
static

Finds the PhotonView Component with a viewID in the scene

Parameters
viewID
Returns
The PhotonView with ViewID. Returns null if none found

◆ FindObservables()

void FindObservables ( bool force = false )

Will find IPunObservable components on this GameObject and nested children and add them to the ObservedComponents list.

This is called via PhotonView.Awake(), which in turn is called immediately by the engine's AddComponent method.

Changing the ObservedComponents of a PhotonView at runtime can be problematic, if other clients are not also updating their list.

Parameters
force If true, FindObservables will work as if observableSearch is AutoFindActive.

◆ RefreshRpcMonoBehaviourCache()

void RefreshRpcMonoBehaviourCache ( )

Can be used to refesh the list of MonoBehaviours on this GameObject while PhotonNetwork.UseRpcMonoBehaviourCache is true.

Set PhotonNetwork.UseRpcMonoBehaviourCache to true to enable the caching. Uses this.GetComponents<MonoBehaviour>() to get a list of MonoBehaviours to call RPCs on (potentially).

While PhotonNetwork.UseRpcMonoBehaviourCache is false, this method has no effect, because the list is refreshed when a RPC gets called.

◆ RemoveCallback< T >()

void RemoveCallback< T > ( IPhotonViewCallback obj )

Remove object from this PhotonView's callback list for T. T is the IOnPhotonViewCallback derived interface you want removed from its associated callback list. Supplying IOnPhotonViewCallback (the interface base class) as T will remove ALL implemented IOnPhotonViewCallback Interfaces found on the object.

Type Constraints
T : class
T : IPhotonViewCallback

◆ RemoveCallbackTarget()

void RemoveCallbackTarget ( IPhotonViewCallback obj )

Remove object from all applicable callback interfaces. Object must implement at least one IOnPhotonViewCallback derived interface.

Parameters
obj An object that implements OnPhotonView callback interface(s).

◆ RequestOwnership()

void RequestOwnership ( )

Depending on the PhotonView's OwnershipTransfer setting, any client can request to become owner of the PhotonView.

Requesting ownership can give you control over a PhotonView, if the OwnershipTransfer setting allows that. The current owner might have to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request.

The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.

◆ RPC() [1/2]

void RPC | ( | string | methodName,
 |  | Player | targetPlayer,
 |  | params object[] | parameters
 | ) |  |

Call a RPC method of this GameObject on remote clients of this room (or on all, including this client).

Remote Procedure Calls are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method.

This method allows you to make an RPC calls on a specific player's client. Of course, calls are affected by this client's lag and that of remote clients.

Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client.

See: Remote Procedure Calls.

Parameters
methodName | The name of a fitting method that was has the RPC attribute.
targetPlayer | The group of targets and the way the RPC gets sent.
parameters | The parameters that the RPC method has (must fit this call!).

◆ RPC() [2/2]

void RPC | ( | string | methodName,
 |  | RpcTarget | target,
 |  | params object[] | parameters
 | ) |  |

Call a RPC method of this GameObject on remote clients of this room (or on all, including this client).

Remote Procedure Calls are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method.

RPC calls can target "All" or the "Others". Usually, the target "All" gets executed locally immediately after sending the RPC. The "*ViaServer" options send the RPC to the server and execute it on this client when it's sent back. Of course, calls are affected by this client's lag and that of remote clients.

Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client.

See: Remote Procedure Calls.

Parameters
methodName | The name of a fitting method that was has the RPC attribute.
target | The group of targets and the way the RPC gets sent.
parameters | The parameters that the RPC method has (must fit this call!).

◆ RpcSecure() [1/2]

void RpcSecure | ( | string | methodName,
 |  | Player | targetPlayer,
 |  | bool | encrypt,
 |  | params object[] | parameters
 | ) |  |

Call a RPC method of this GameObject on remote clients of this room (or on all, including this client).

Remote Procedure Calls are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method.

This method allows you to make an RPC calls on a specific player's client. Of course, calls are affected by this client's lag and that of remote clients.

Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client.

See: Remote Procedure Calls.

param name="methodName">The name of a fitting method that was has the RPC attribute.

param name="targetPlayer">The group of targets and the way the RPC gets sent.

param name="encrypt">

param name="parameters">The parameters that the RPC method has (must fit this call!).

◆ RpcSecure() [2/2]

void RpcSecure | ( | string | methodName,
 |  | RpcTarget | target,
 |  | bool | encrypt,
 |  | params object[] | parameters
 | ) |  |

Call a RPC method of this GameObject on remote clients of this room (or on all, including this client).

Remote Procedure Calls are an essential tool in making multiplayer games with PUN. It enables you to make every client in a room call a specific method.

RPC calls can target "All" or the "Others". Usually, the target "All" gets executed locally immediately after sending the RPC. The "*ViaServer" options send the RPC to the server and execute it on this client when it's sent back. Of course, calls are affected by this client's lag and that of remote clients.

Each call automatically is routed to the same PhotonView (and GameObject) that was used on the originating client.

See: Remote Procedure Calls.

param name="methodName">The name of a fitting method that was has the RPC attribute.

param name="target">The group of targets and the way the RPC gets sent.

param name="encrypt">

param name="parameters">The parameters that the RPC method has (must fit this call!).

◆ TransferOwnership() [1/2]

void TransferOwnership ( int newOwnerId )

Transfers the ownership of this PhotonView (and GameObject) to another player.

The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.

◆ TransferOwnership() [2/2]

void TransferOwnership ( Player newOwner )

Transfers the ownership of this PhotonView (and GameObject) to another player.

The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.

Member Data Documentation

◆ OwnershipTransfer

OwnershipOption OwnershipTransfer = OwnershipOption.Fixed

Defines if ownership of this PhotonView is fixed, can be requested or simply taken.

Note that you can't edit this value at runtime. The options are described in enum OwnershipOption. The current owner has to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request.

Property Documentation

◆ InstantiationData

object [] InstantiationData
getset

This is the InstantiationData that was passed when calling PhotonNetwork.Instantiate* (if that was used to spawn this prefab)

◆ IsMine

bool IsMine
get

True if the PhotonView is "mine" and can be controlled by this client.

PUN has an ownership concept that defines who can control and destroy each PhotonView. True in case the controller matches the local Player. True if this is a scene photonview (null owner and ownerId == 0) on the Master client.

◆ IsRoomView

bool IsRoomView
get

True if the PhotonView was loaded with the scene (game object) or instantiated with InstantiateRoomObject.

Room objects are not owned by a particular player but belong to the scene. Thus they don't get destroyed when their creator leaves the game and the current Master Client can control them (whoever that is). The ownerId is 0 (player IDs are 1 and up).

◆ Owner

Player Owner
get

The owner of a PhotonView is the creator of an object by default Ownership can be transferred and the owner may not be in the room anymore. Objects in the scene don't have an owner.

The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.

Ownership can be transferred to another player with PhotonView.TransferOwnership or any player can request ownership by calling the PhotonView's RequestOwnership method. The current owner has to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request.

◆ ViewID

int ViewID
getset

The ID of the PhotonView. Identifies it in a networked game (per room).

See: Network Instantiation


Photon Unity Networking 2: PhotonMessageInfo Struct Reference

  • Pun
  • PhotonMessageInfo
Public Member Functions | Public Attributes | Properties | List of all members
PhotonMessageInfo Struct Reference
Public API

Container class for info about a particular message, RPC or update. More...

Public Member Functions

PhotonMessageInfo (Player player, int timestamp, PhotonView view)
override string ToString ()

Public Attributes

readonly Player | Sender
The sender of a message / event. May be null. More...
readonly PhotonView | photonView

Properties

double | timestamp [get]
double | SentServerTime [get]
int | SentServerTimestamp [get]

Detailed Description

Container class for info about a particular message, RPC or update.

Member Data Documentation

◆ Sender

readonly Player Sender

The sender of a message / event. May be null.


Photon Unity Networking 2: PhotonStream Class Reference

  • Pun
  • PhotonStream
Public Member Functions | Properties | List of all members
PhotonStream Class Reference
Public API

This container is used in OnPhotonSerializeView() to either provide incoming data of a PhotonView or for you to provide it. More...

Public Member Functions

PhotonStream (bool write, object[] incomingData)
Creates a stream and initializes it. Used by PUN internally. More...
void | SetReadStream (object[] incomingData, int pos=0)
object | ReceiveNext ()
Read next piece of data from the stream when IsReading is true. More...
object | PeekNext ()
Read next piece of data from the stream without advancing the "current" item. More...
void | SendNext (object obj)
Add another piece of data to send it when IsWriting is true. More...
bool | CopyToListAndClear (List< object > target)
object[] | ToArray ()
Turns the stream into a new object[]. More...
void | Serialize (ref bool myBool)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref int myInt)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref string value)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref char value)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref short value)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref float obj)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref Player obj)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref Vector3 obj)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref Vector2 obj)
Will read or write the value, depending on the stream's IsWriting value. More...
void | Serialize (ref Quaternion obj)
Will read or write the value, depending on the stream's IsWriting value. More...

Properties

bool | IsWriting [get]
If true, this client should add data to the stream to send it. More...
bool | IsReading [get]
If true, this client should read data send by another client. More...
int? | Count [get]
Count of items in the stream. More...

Detailed Description

This container is used in OnPhotonSerializeView() to either provide incoming data of a PhotonView or for you to provide it.

The IsWriting property will be true if this client is the "owner" of the PhotonView (and thus the GameObject). Add data to the stream and it's sent via the server to the other players in a room. On the receiving side, IsWriting is false and the data should be read.

Send as few data as possible to keep connection quality up. An empty PhotonStream will not be sent.

Use either Serialize() for reading and writing or SendNext() and ReceiveNext(). The latter two are just explicit read and write methods but do about the same work as Serialize(). It's a matter of preference which methods you use.

Constructor & Destructor Documentation

◆ PhotonStream()

PhotonStream | ( | bool | write,
 |  | object[] | incomingData
 | ) |  |

Creates a stream and initializes it. Used by PUN internally.

Member Function Documentation

◆ PeekNext()

object PeekNext ( )

Read next piece of data from the stream without advancing the "current" item.

◆ ReceiveNext()

object ReceiveNext ( )

Read next piece of data from the stream when IsReading is true.

◆ SendNext()

void SendNext ( object obj )

Add another piece of data to send it when IsWriting is true.

◆ Serialize() [1/10]

void Serialize ( ref bool myBool )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [2/10]

void Serialize ( ref char value )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [3/10]

void Serialize ( ref float obj )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [4/10]

void Serialize ( ref int myInt )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [5/10]

void Serialize ( ref Player obj )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [6/10]

void Serialize ( ref Quaternion obj )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [7/10]

void Serialize ( ref short value )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [8/10]

void Serialize ( ref string value )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [9/10]

void Serialize ( ref Vector2 obj )

Will read or write the value, depending on the stream's IsWriting value.

◆ Serialize() [10/10]

void Serialize ( ref Vector3 obj )

Will read or write the value, depending on the stream's IsWriting value.

◆ ToArray()

object [] ToArray ( )

Turns the stream into a new object[].

Property Documentation

◆ Count

int? Count
get

Count of items in the stream.

◆ IsReading

bool IsReading
get

If true, this client should read data send by another client.

◆ IsWriting

bool IsWriting
get

If true, this client should add data to the stream to send it.


Photon Unity Networking 2: Optional Gui Elements

Classes
Optional Gui Elements

Useful GUI elements for PUN. More...

Classes

class | PhotonLagSimulationGui
This MonoBehaviour is a basic GUI for the Photon client's network-simulation feature. It can modify lag (fixed delay), jitter (random lag) and packet loss. More...
class | PhotonStatsGui
Basic GUI to show traffic and health statistics of the connection to Photon, toggled by shift+tab. More...

Detailed Description

Useful GUI elements for PUN.


Photon Unity Networking 2: PhotonLagSimulationGui Class Reference

  • Pun
  • UtilityScripts
  • PhotonLagSimulationGui
Public Member Functions | Public Attributes | Properties | List of all members
PhotonLagSimulationGui Class Reference
Optional Gui Elements

This MonoBehaviour is a basic GUI for the Photon client's network-simulation feature. It can modify lag (fixed delay), jitter (random lag) and packet loss. More...

Inherits MonoBehaviour.

Public Member Functions

void | Start ()
void | OnGUI ()

Public Attributes

Rect | WindowRect = new Rect(0, 100, 120, 100)
Positioning rect for window. More...
int | WindowId = 101
Unity GUI Window ID (must be unique or will cause issues). More...
bool | Visible = true
Shows or hides GUI (does not affect settings). More...

Properties

PhotonPeer Peer [get, set]
The peer currently in use (to set the network simulation). More...

Detailed Description

This MonoBehaviour is a basic GUI for the Photon client's network-simulation feature. It can modify lag (fixed delay), jitter (random lag) and packet loss.

Member Data Documentation

◆ Visible

bool Visible = true

Shows or hides GUI (does not affect settings).

◆ WindowId

int WindowId = 101

Unity GUI Window ID (must be unique or will cause issues).

◆ WindowRect

Rect WindowRect = new Rect(0, 100, 120, 100)

Positioning rect for window.

Property Documentation

◆ Peer

PhotonPeer Peer
getset

The peer currently in use (to set the network simulation).


Photon Unity Networking 2: PhotonStatsGui Class Reference

  • Pun
  • UtilityScripts
  • PhotonStatsGui
Public Member Functions | Public Attributes | List of all members
PhotonStatsGui Class Reference
Optional Gui Elements

Basic GUI to show traffic and health statistics of the connection to Photon, toggled by shift+tab. More...

Inherits MonoBehaviour.

Public Member Functions

void | Start ()
void | Update ()
Checks for shift+tab input combination (to toggle statsOn). More...
void | OnGUI ()
void | TrafficStatsWindow (int windowID)

Public Attributes

bool | statsWindowOn = true
Shows or hides GUI (does not affect if stats are collected). More...
bool | statsOn = true
Option to turn collecting stats on or off (used in Update()). More...
bool | healthStatsVisible
Shows additional "health" values of connection. More...
bool | trafficStatsOn
Shows additional "lower level" traffic stats. More...
bool | buttonsOn
Show buttons to control stats and reset them. More...
Rect | statsRect = new Rect(0, 100, 200, 50)
Positioning rect for window. More...
int | WindowId = 100
Unity GUI Window ID (must be unique or will cause issues). More...

Detailed Description

Basic GUI to show traffic and health statistics of the connection to Photon, toggled by shift+tab.

The shown health values can help identify problems with connection losses or performance. Example: If the time delta between two consecutive SendOutgoingCommands calls is a second or more, chances rise for a disconnect being caused by this (because acknowledgements to the server need to be sent in due time).

Member Function Documentation

◆ Update()

void Update ( )

Checks for shift+tab input combination (to toggle statsOn).

Member Data Documentation

◆ buttonsOn

bool buttonsOn

Show buttons to control stats and reset them.

◆ healthStatsVisible

bool healthStatsVisible

Shows additional "health" values of connection.

◆ statsOn

bool statsOn = true

Option to turn collecting stats on or off (used in Update()).

◆ statsRect

Rect statsRect = new Rect(0, 100, 200, 50)

Positioning rect for window.

◆ statsWindowOn

bool statsWindowOn = true

Shows or hides GUI (does not affect if stats are collected).

◆ trafficStatsOn

bool trafficStatsOn

Shows additional "lower level" traffic stats.

◆ WindowId

int WindowId = 100

Unity GUI Window ID (must be unique or will cause issues).


Photon Unity Networking 2: Callbacks

Classes
Callbacks

Callback Interfaces. More...

Classes

interface | IConnectionCallbacks
Collection of "organizational" callbacks for the Realtime Api to cover: Connection and Regions. 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 | IInRoomCallbacks
Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching. More...
interface | IOnEventCallback
Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent. More...
interface | IWebRpcCallback
Interface for "WebRpc" callbacks for the Realtime Api. Currently includes only responses for Web RPCs. More...
interface | IErrorInfoCallback
Interface for EventCode.ErrorInfo event callback for the Realtime Api. More...
interface | IPunObservable
Defines the OnPhotonSerializeView method to make it easy to implement correctly for observable scripts. More...
interface | IPunInstantiateMagicCallback
class | MonoBehaviourPunCallbacks
This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use. More...

Detailed Description

Callback Interfaces.


Photon Unity Networking 2: IConnectionCallbacks Interface Reference

  • Realtime
  • IConnectionCallbacks
Public Member Functions | List of all members
IConnectionCallbacks Interface Reference
Callbacks

Collection of "organizational" callbacks for the Realtime Api to cover: Connection and Regions. More...

Inherited by MonoBehaviourPunCallbacks, ConnectionCallbacksContainer, and SupportLogger.

Public Member Functions

void | OnConnected ()
Called to signal that the "low level connection" got established but before the client can call operation on the server. More...
void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or an explicit disconnect call More...
void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...

Detailed Description

Collection of "organizational" callbacks for the Realtime Api to cover: Connection and Regions.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnConnected()

void OnConnected ( )

Called to signal that the "low level connection" got established but before the client can call operation on the server.

After the (low level transport) connection is established, the client will automatically send the Authentication operation, which needs to get a response before the client can call other operations.

Your logic should wait for either: OnRegionListReceived or OnConnectedToMaster.

This callback is useful to detect if the server can be reached at all (technically). Most often, it's enough to implement OnDisconnected(DisconnectCause cause) and check for the cause.

This is not called for transitions from the masterserver to game servers.

Implemented in ConnectionCallbacksContainer, SupportLogger, and MonoBehaviourPunCallbacks.

◆ OnConnectedToMaster()

void OnConnectedToMaster ( )

Called when the client is connected to the Master Server and ready for matchmaking and other tasks.

The list of available rooms won't become available unless you join a lobby via LoadBalancingClient.OpJoinLobby. You can join rooms and create them even without being in a lobby. The default lobby is used in that case.

Implemented in ConnectionCallbacksContainer, MonoBehaviourPunCallbacks, SupportLogger, and ConnectAndJoinRandom.

◆ OnCustomAuthenticationFailed()

void OnCustomAuthenticationFailed ( string debugMessage )

Called when the custom authentication failed. Followed by disconnect!

Custom Authentication can fail due to user-input, bad tokens/secrets. If authentication is successful, this method is not called. Implement OnJoinedLobby() or OnConnectedToMaster() (as usual).

During development of a game, it might also fail due to wrong configuration on the server side. In those cases, logging the debugMessage is very important.

Unless you setup a custom authentication service for your app (in the Dashboard), this won't be called!

Parameters
debugMessage Contains a debug message why authentication failed. This has to be fixed during development.

Implemented in ConnectionCallbacksContainer, MonoBehaviourPunCallbacks, and SupportLogger.

◆ OnCustomAuthenticationResponse()

void OnCustomAuthenticationResponse ( Dictionary< string, object > data )

Called when your Custom Authentication service responds with additional data.

Custom Authentication services can include some custom data in their response. When present, that data is made available in this callback as Dictionary. While the keys of your data have to be strings, the values can be either string or a number (in Json). You need to make extra sure, that the value type is the one you expect. Numbers become (currently) int64.

Example: void OnCustomAuthenticationResponse(Dictionary<string, object> data) { ... }

https://doc.photonengine.com/en-us/realtime/current/reference/custom-authentication

Implemented in ConnectionCallbacksContainer, SupportLogger, and MonoBehaviourPunCallbacks.

◆ OnDisconnected()

void OnDisconnected ( DisconnectCause cause )

Called after disconnecting from the Photon server. It could be a failure or an explicit disconnect call

The reason for this disconnect is provided as DisconnectCause.

Implemented in ConnectionCallbacksContainer, SupportLogger, MonoBehaviourPunCallbacks, and ConnectAndJoinRandom.

◆ OnRegionListReceived()

void OnRegionListReceived ( RegionHandler regionHandler )

Called when the Name Server provided a list of regions for your title.

Check the RegionHandler class description, to make use of the provided values.

Parameters
regionHandler The currently used RegionHandler.

Implemented in ConnectionCallbacksContainer, SupportLogger, and MonoBehaviourPunCallbacks.


Photon Unity Networking 2: ILobbyCallbacks Interface Reference

  • Realtime
  • ILobbyCallbacks
Public Member Functions | List of all members
ILobbyCallbacks Interface Reference
Callbacks

Collection of "organizational" callbacks for the Realtime Api to cover the Lobby. More...

Inherited by MonoBehaviourPunCallbacks, LobbyCallbacksContainer, and SupportLogger.

Public Member Functions

void | OnJoinedLobby ()
Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
void | OnLeftLobby ()
Called after leaving a lobby. More...
void | OnRoomListUpdate (List< RoomInfo > roomList)
Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
void | OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
Called when the Master Server sent an update for the Lobby Statistics. More...

Detailed Description

Collection of "organizational" callbacks for the Realtime Api to cover the Lobby.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnJoinedLobby()

void OnJoinedLobby ( )

Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate.

While in the lobby, the roomlist is automatically updated in fixed intervals (which you can't modify in the public cloud). The room list gets available via OnRoomListUpdate.

Implemented in SupportLogger, MonoBehaviourPunCallbacks, and ConnectAndJoinRandom.

◆ OnLeftLobby()

void OnLeftLobby ( )

Called after leaving a lobby.

When you leave a lobby, OpCreateRoom and OpJoinRandomRoom automatically refer to the default lobby.

Implemented in SupportLogger, and MonoBehaviourPunCallbacks.

◆ OnLobbyStatisticsUpdate()

void OnLobbyStatisticsUpdate ( List< TypedLobbyInfo > lobbyStatistics )

Called when the Master Server sent an update for the Lobby Statistics.

This callback has two preconditions: EnableLobbyStatistics must be set to true, before this client connects. And the client has to be connected to the Master Server, which is providing the info about lobbies.

Implemented in MonoBehaviourPunCallbacks, and SupportLogger.

◆ OnRoomListUpdate()

void OnRoomListUpdate ( List< RoomInfo > roomList )

Called for any update of the room-listing while in a lobby (InLobby) on the Master Server.

Each item is a RoomInfo which might include custom properties (provided you defined those as lobby-listed when creating a room). Not all types of lobbies provide a listing of rooms to the client. Some are silent and specialized for server-side matchmaking.

Implemented in SupportLogger, and MonoBehaviourPunCallbacks.


Photon Unity Networking 2: IMatchmakingCallbacks Interface Reference

  • Realtime
  • IMatchmakingCallbacks
Public Member Functions | List of all members
IMatchmakingCallbacks Interface Reference
Callbacks

Collection of "organizational" callbacks for the Realtime Api to cover Matchmaking. More...

Inherited by MonoBehaviourPunCallbacks, PhotonHandler, OnJoinedInstantiate, PhotonTeamsManager, MatchMakingCallbacksContainer, and SupportLogger.

Public Member Functions

void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...

Detailed Description

Collection of "organizational" callbacks for the Realtime Api to cover Matchmaking.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnCreatedRoom()

void OnCreatedRoom ( )

Called when this client created a room and entered it. OnJoinedRoom() will be called as well.

This callback is only called on the client which created a room (see OpCreateRoom).

As any client might close (or drop connection) anytime, there is a chance that the creator of a room does not execute OnCreatedRoom.

If you need specific room properties or a "start signal", implement OnMasterClientSwitched() and make each new MasterClient check the room's state.

Implemented in MatchMakingCallbacksContainer, SupportLogger, PhotonHandler, OnJoinedInstantiate, and MonoBehaviourPunCallbacks.

◆ OnCreateRoomFailed()

void OnCreateRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when the server couldn't create a room (OpCreateRoom failed).

Creating a room may fail for various reasons. Most often, the room already exists (roomname in use) or the RoomOptions clash and it's impossible to create the room.

When creating a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implemented in MatchMakingCallbacksContainer, SupportLogger, PhotonHandler, OnJoinedInstantiate, and MonoBehaviourPunCallbacks.

◆ OnFriendListUpdate()

void OnFriendListUpdate ( List< FriendInfo > friendList )

Called when the server sent the response to a FindFriends request.

After calling OpFindFriends, the Master Server will cache the friend list and send updates to the friend list. The friends includes the name, userId, online state and the room (if any) for each requested user/friend.

Use the friendList to update your UI and store it, if the UI should highlight changes.

Implemented in MatchMakingCallbacksContainer, MonoBehaviourPunCallbacks, SupportLogger, and OnJoinedInstantiate.

◆ OnJoinedRoom()

void OnJoinedRoom ( )

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Implemented in MatchMakingCallbacksContainer, SupportLogger, PhotonHandler, MonoBehaviourPunCallbacks, OnJoinedInstantiate, ConnectAndJoinRandom, PlayerNumbering, and PunTeams.

◆ OnJoinRandomFailed()

void OnJoinRandomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when a previous OpJoinRandom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

This operation is only ever sent to the Master Server. Once a room is found by the Master Server, the client will head off to the designated Game Server and use the operation Join on the Game Server.

When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implemented in MatchMakingCallbacksContainer, SupportLogger, MonoBehaviourPunCallbacks, PhotonHandler, OnJoinedInstantiate, and ConnectAndJoinRandom.

◆ OnJoinRoomFailed()

void OnJoinRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when a previous OpJoinRoom call failed on the server.

Joining a room may fail for various reasons. Most often, the room is full or does not exist anymore (due to someone else being faster or closing the room).

When joining a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implemented in MatchMakingCallbacksContainer, SupportLogger, PhotonHandler, OnJoinedInstantiate, and MonoBehaviourPunCallbacks.

◆ OnLeftRoom()

void OnLeftRoom ( )

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Implemented in MatchMakingCallbacksContainer, SupportLogger, PhotonHandler, OnJoinedInstantiate, MonoBehaviourPunCallbacks, PlayerNumbering, and PunTeams.


Photon Unity Networking 2: IInRoomCallbacks Interface Reference

  • Realtime
  • IInRoomCallbacks
Public Member Functions | List of all members
IInRoomCallbacks Interface Reference
Callbacks

Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching. More...

Inherited by MonoBehaviourPunCallbacks, PhotonHandler, PhotonTeamsManager, InRoomCallbacksContainer, and SupportLogger.

Public Member Functions

void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...

Detailed Description

Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnMasterClientSwitched()

void OnMasterClientSwitched ( Player newMasterClient )

Called after switching to a new MasterClient when the current one leaves.

This is not called when this client enters a room. The former MasterClient is still in the player list when this method get called.

Implemented in SupportLogger, PhotonHandler, and MonoBehaviourPunCallbacks.

◆ OnPlayerEnteredRoom()

void OnPlayerEnteredRoom ( Player newPlayer )

Called when a remote player entered the room. This Player is already added to the playerlist.

If your game starts with a certain number of players, this callback can be useful to check the Room.playerCount and find out if you can start.

Implemented in SupportLogger, PhotonHandler, MonoBehaviourPunCallbacks, PlayerNumbering, and PunTeams.

◆ OnPlayerLeftRoom()

void OnPlayerLeftRoom ( Player otherPlayer )

Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive.

If another player leaves the room or if the server detects a lost connection, this callback will be used to notify your game logic.

Depending on the room's setup, players may become inactive, which means they may return and retake their spot in the room. In such cases, the Player stays in the Room.Players dictionary.

If the player is not just inactive, it gets removed from the Room.Players dictionary, before the callback is called.

Implemented in SupportLogger, PhotonHandler, MonoBehaviourPunCallbacks, PlayerNumbering, and PunTeams.

◆ OnPlayerPropertiesUpdate()

void OnPlayerPropertiesUpdate | ( | Player | targetPlayer,
 |  | Hashtable | changedProps
 | ) |  |

Called when custom player-properties are changed. Player and the changed properties are passed as object[].

Changing properties must be done by Player.SetCustomProperties, which causes this callback locally, too.

Parameters
targetPlayer | Contains Player that changed.
changedProps | Contains the properties that changed.

Implemented in SupportLogger, MonoBehaviourPunCallbacks, PhotonHandler, PlayerNumbering, and PunTeams.

◆ OnRoomPropertiesUpdate()

void OnRoomPropertiesUpdate ( Hashtable propertiesThatChanged )

Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties.

Since v1.25 this method has one parameter: Hashtable propertiesThatChanged.
Changing properties must be done by Room.SetCustomProperties, which causes this callback locally, too.

Parameters
propertiesThatChanged

Implemented in SupportLogger, MonoBehaviourPunCallbacks, PunTurnManager, PhotonHandler, and CountdownTimer.


Photon Unity Networking 2: IOnEventCallback Interface Reference

  • Realtime
  • IOnEventCallback
Public Member Functions | List of all members
IOnEventCallback Interface Reference
Callbacks

Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent. More...

Inherited by PunTurnManager.

Public Member Functions

void OnEvent (EventData photonEvent)
Called for any incoming events. More...

Detailed Description

Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnEvent()

void OnEvent ( EventData photonEvent )

Called for any incoming events.

To receive events, implement IOnEventCallback in any class and register it via AddCallbackTarget (either in LoadBalancingClient or PhotonNetwork).

With the EventData.Sender you can look up the Player who sent the event.

It is best practice to assign an eventCode for each different type of content and action, so the Code will be essential to read the incoming events.

Implemented in PunTurnManager.


Photon Unity Networking 2: IWebRpcCallback Interface Reference

  • Realtime
  • IWebRpcCallback
Public Member Functions | List of all members
IWebRpcCallback Interface Reference
Callbacks

Interface for "WebRpc" callbacks for the Realtime Api. Currently includes only responses for Web RPCs. More...

Inherited by MonoBehaviourPunCallbacks, and WebRpcCallbacksContainer.

Public Member Functions

void OnWebRpcResponse (OperationResponse response)
Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc. More...

Detailed Description

Interface for "WebRpc" callbacks for the Realtime Api. Currently includes only responses for Web RPCs.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnWebRpcResponse()

void OnWebRpcResponse ( OperationResponse response )

Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc.

Important: The response.ReturnCode is 0 if Photon was able to reach your web-service.
The content of the response is what your web-service sent. You can create a WebRpcResponse from it.
Example: WebRpcResponse webResponse = new WebRpcResponse(operationResponse);

Please note: Class OperationResponse is in a namespace which needs to be "used":
using ExitGames.Client.Photon; // includes OperationResponse (and other classes)

public void OnWebRpcResponse(OperationResponse response) { Debug.LogFormat("WebRPC operation response {0}", response.ToStringFull()); switch (response.ReturnCode) { case ErrorCode.Ok: WebRpcResponse webRpcResponse = new WebRpcResponse(response); Debug.LogFormat("Parsed WebRPC response {0}", response.ToStringFull()); if (string.IsNullOrEmpty(webRpcResponse.Name)) { Debug.LogError("Unexpected: WebRPC response did not contain WebRPC method name"); } if (webRpcResponse.ResultCode == 0) // success { switch (webRpcResponse.Name) { // todo: add your code here case GetGameListWebRpcMethodName: // example // ... break; } } else if (webRpcResponse.ResultCode == -1) { Debug.LogErrorFormat("Web server did not return ResultCode for WebRPC method=\"{0}", Message={1}", webRpcResponse.Name, webRpcResponse.Message); } else { Debug.LogErrorFormat("Web server returned ResultCode={0} for WebRPC method=\"{1}", Message={2}", webRpcResponse.ResultCode, webRpcResponse.Name, webRpcResponse.Message); } break; case ErrorCode.ExternalHttpCallFailed: // web service unreachable Debug.LogErrorFormat("WebRPC call failed as request could not be sent to the server. {0}", response.DebugMessage); break; case ErrorCode.HttpLimitReached: // too many WebRPCs in a short period of time // the debug message should contain the limit exceeded Debug.LogErrorFormat("WebRPCs rate limit exceeded: {0}", response.DebugMessage); break; case ErrorCode.InvalidOperation: // WebRPC not configured at all OR not configured properly OR trying to send on name server if (PhotonNetwork.Server == ServerConnection.NameServer) { Debug.LogErrorFormat("WebRPC not supported on NameServer. {0}", response.DebugMessage); } else { Debug.LogErrorFormat("WebRPC not properly configured or not configured at all. {0}", response.DebugMessage); } break; default: // other unknown error, unexpected Debug.LogErrorFormat("Unexpected error, {0} {1}", response.ReturnCode, response.DebugMessage); break; } }

Implemented in MonoBehaviourPunCallbacks.


Photon Unity Networking 2: IErrorInfoCallback Interface Reference

  • Realtime
  • IErrorInfoCallback
Public Member Functions | List of all members
IErrorInfoCallback Interface Reference
Callbacks

Interface for EventCode.ErrorInfo event callback for the Realtime Api. More...

Inherited by MonoBehaviourPunCallbacks, and ErrorInfoCallbacksContainer.

Public Member Functions

void OnErrorInfo (ErrorInfo errorInfo)
Called when the client receives an event from the server indicating that an error happened there. More...

Detailed Description

Interface for EventCode.ErrorInfo event callback for the Realtime Api.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnErrorInfo()

void OnErrorInfo ( ErrorInfo errorInfo )

Called when the client receives an event from the server indicating that an error happened there.

In most cases this could be either:

  1. an error from webhooks plugin (if HasErrorInfo is enabled), read more here: https://doc.photonengine.com/en-us/realtime/current/gameplay/web-extensions/webhooks#options
  2. an error sent from a custom server plugin via PluginHost.BroadcastErrorInfoEvent, see example here: https://doc.photonengine.com/en-us/server/current/plugins/manual#handling_http_response
  3. an error sent from the server, for example, when the limit of cached events has been exceeded in the room (all clients will be disconnected and the room will be closed in this case) read more here: https://doc.photonengine.com/en-us/realtime/current/gameplay/cached-events#special_considerations

If you implement IOnEventCallback.OnEvent or LoadBalancingClient.EventReceived you will also get this event.

Parameters
errorInfo Object containing information about the error

Implemented in MonoBehaviourPunCallbacks.


Photon Unity Networking 2: IPunObservable Interface Reference

  • Pun
  • IPunObservable
Public Member Functions | List of all members
IPunObservable Interface Reference
Callbacks

Defines the OnPhotonSerializeView method to make it easy to implement correctly for observable scripts. More...

Inherited by PhotonAnimatorView, PhotonRigidbody2DView, PhotonRigidbodyView, PhotonTransformView, PhotonTransformViewClassic, CullingHandler, and SmoothSyncMovement.

Public Member Functions

void OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More...

Detailed Description

Defines the OnPhotonSerializeView method to make it easy to implement correctly for observable scripts.


Photon Unity Networking 2: IPunInstantiateMagicCallback Interface Reference

  • Pun
  • IPunInstantiateMagicCallback
Public Member Functions | List of all members
IPunInstantiateMagicCallback Interface Reference
Callbacks

Public Member Functions

void OnPhotonInstantiate (PhotonMessageInfo info)


Photon Unity Networking 2: MonoBehaviourPunCallbacks Class Reference

  • Pun
  • MonoBehaviourPunCallbacks
Public Member Functions | List of all members
MonoBehaviourPunCallbacks Class Reference
Callbacks

This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use. More...

Inherits MonoBehaviourPun, IConnectionCallbacks, IMatchmakingCallbacks, IInRoomCallbacks, ILobbyCallbacks, IWebRpcCallback, and IErrorInfoCallback.

Inherited by ConnectAndJoinRandom, CountdownTimer, PlayerNumbering, PunTeams, and PunTurnManager.

Public Member Functions

virtual void | OnEnable ()
virtual void | OnDisable ()
virtual void | OnConnected ()
Called to signal that the raw connection got established but before the client can call operation on the server. More...
virtual void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
virtual void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...
virtual void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
virtual void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
virtual void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
virtual void | OnJoinedLobby ()
Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
virtual void | OnLeftLobby ()
Called after leaving a lobby. More...
virtual void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or intentional More...
virtual void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
virtual void | OnRoomListUpdate (List< RoomInfo > roomList)
Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
virtual void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
virtual void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
virtual void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
virtual void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
virtual void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
virtual void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
virtual void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
virtual void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
virtual void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
virtual void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...
virtual void | OnWebRpcResponse (OperationResponse response)
Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc. More...
virtual void | OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
Called when the Master Server sent an update for the Lobby Statistics. More...
virtual void | OnErrorInfo (ErrorInfo errorInfo)
Called when the client receives an event from the server indicating that an error happened there. More...

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use.

By extending this class, you can implement individual methods as override.

Do not add new

MonoBehaviour.OnEnable

or

MonoBehaviour.OnDisable

Instead, you should override those and call

base.OnEnable

and

base.OnDisable

.

Visual Studio and MonoDevelop should provide the list of methods when you begin typing "override". Your implementation does not have to call "base.method()".

This class implements all callback interfaces and extends Photon.Pun.MonoBehaviourPun.

Member Function Documentation

◆ OnConnected()

virtual void OnConnected ( )
virtual

Called to signal that the raw connection got established but before the client can call operation on the server.

After the (low level transport) connection is established, the client will automatically send the Authentication operation, which needs to get a response before the client can call other operations.

Your logic should wait for either: OnRegionListReceived or OnConnectedToMaster.

This callback is useful to detect if the server can be reached at all (technically). Most often, it's enough to implement OnDisconnected().

This is not called for transitions from the masterserver to game servers.

Implements IConnectionCallbacks.

◆ OnConnectedToMaster()

virtual void OnConnectedToMaster ( )
virtual

Called when the client is connected to the Master Server and ready for matchmaking and other tasks.

The list of available rooms won't become available unless you join a lobby via LoadBalancingClient.OpJoinLobby. You can join rooms and create them even without being in a lobby. The default lobby is used in that case.

Implements IConnectionCallbacks.

Reimplemented in ConnectAndJoinRandom.

◆ OnCreatedRoom()

virtual void OnCreatedRoom ( )
virtual

Called when this client created a room and entered it. OnJoinedRoom() will be called as well.

This callback is only called on the client which created a room (see OpCreateRoom).

As any client might close (or drop connection) anytime, there is a chance that the creator of a room does not execute OnCreatedRoom.

If you need specific room properties or a "start signal", implement OnMasterClientSwitched() and make each new MasterClient check the room's state.

Implements IMatchmakingCallbacks.

◆ OnCreateRoomFailed()

virtual void OnCreateRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |
virtual

Called when the server couldn't create a room (OpCreateRoom failed).

The most common cause to fail creating a room, is when a title relies on fixed room-names and the room already exists.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnCustomAuthenticationFailed()

virtual void OnCustomAuthenticationFailed ( string debugMessage )
virtual

Called when the custom authentication failed. Followed by disconnect!

Custom Authentication can fail due to user-input, bad tokens/secrets. If authentication is successful, this method is not called. Implement OnJoinedLobby() or OnConnectedToMaster() (as usual).

During development of a game, it might also fail due to wrong configuration on the server side. In those cases, logging the debugMessage is very important.

Unless you setup a custom authentication service for your app (in the Dashboard), this won't be called!

Parameters
debugMessage Contains a debug message why authentication failed. This has to be fixed during development.

Implements IConnectionCallbacks.

◆ OnCustomAuthenticationResponse()

virtual void OnCustomAuthenticationResponse ( Dictionary< string, object > data )
virtual

Called when your Custom Authentication service responds with additional data.

Custom Authentication services can include some custom data in their response. When present, that data is made available in this callback as Dictionary. While the keys of your data have to be strings, the values can be either string or a number (in Json). You need to make extra sure, that the value type is the one you expect. Numbers become (currently) int64.

Example: void OnCustomAuthenticationResponse(Dictionary<string, object> data) { ... }

https://doc.photonengine.com/en-us/realtime/current/reference/custom-authentication

Implements IConnectionCallbacks.

◆ OnDisconnected()

virtual void OnDisconnected ( DisconnectCause cause )
virtual

Called after disconnecting from the Photon server. It could be a failure or intentional

The reason for this disconnect is provided as DisconnectCause.

Implements IConnectionCallbacks.

Reimplemented in ConnectAndJoinRandom.

◆ OnErrorInfo()

virtual void OnErrorInfo ( ErrorInfo errorInfo )
virtual

Called when the client receives an event from the server indicating that an error happened there.

In most cases this could be either:

  1. an error from webhooks plugin (if HasErrorInfo is enabled), read more here: https://doc.photonengine.com/en-us/realtime/current/gameplay/web-extensions/webhooks#options
  2. an error sent from a custom server plugin via PluginHost.BroadcastErrorInfoEvent, see example here: https://doc.photonengine.com/en-us/server/current/plugins/manual#handling_http_response
  3. an error sent from the server, for example, when the limit of cached events has been exceeded in the room (all clients will be disconnected and the room will be closed in this case) read more here: https://doc.photonengine.com/en-us/realtime/current/gameplay/cached-events#special_considerations
Parameters
errorInfo object containing information about the error

Implements IErrorInfoCallback.

◆ OnFriendListUpdate()

virtual void OnFriendListUpdate ( List< FriendInfo > friendList )
virtual

Called when the server sent the response to a FindFriends request.

After calling OpFindFriends, the Master Server will cache the friend list and send updates to the friend list. The friends includes the name, userId, online state and the room (if any) for each requested user/friend.

Use the friendList to update your UI and store it, if the UI should highlight changes.

Implements IMatchmakingCallbacks.

◆ OnJoinedLobby()

virtual void OnJoinedLobby ( )
virtual

Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate.

While in the lobby, the roomlist is automatically updated in fixed intervals (which you can't modify in the public cloud). The room list gets available via OnRoomListUpdate.

Implements ILobbyCallbacks.

Reimplemented in ConnectAndJoinRandom.

◆ OnJoinedRoom()

virtual void OnJoinedRoom ( )
virtual

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Implements IMatchmakingCallbacks.

Reimplemented in ConnectAndJoinRandom, PlayerNumbering, and PunTeams.

◆ OnJoinRandomFailed()

virtual void OnJoinRandomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |
virtual

Called when a previous OpJoinRandom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

Reimplemented in ConnectAndJoinRandom.

◆ OnJoinRoomFailed()

virtual void OnJoinRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |
virtual

Called when a previous OpJoinRoom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnLeftLobby()

virtual void OnLeftLobby ( )
virtual

Called after leaving a lobby.

When you leave a lobby, OpCreateRoom and OpJoinRandomRoom automatically refer to the default lobby.

Implements ILobbyCallbacks.

◆ OnLeftRoom()

virtual void OnLeftRoom ( )
virtual

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Implements IMatchmakingCallbacks.

Reimplemented in PlayerNumbering, and PunTeams.

◆ OnLobbyStatisticsUpdate()

virtual void OnLobbyStatisticsUpdate ( List< TypedLobbyInfo > lobbyStatistics )
virtual

Called when the Master Server sent an update for the Lobby Statistics.

This callback has two preconditions: EnableLobbyStatistics must be set to true, before this client connects. And the client has to be connected to the Master Server, which is providing the info about lobbies.

Implements ILobbyCallbacks.

◆ OnMasterClientSwitched()

virtual void OnMasterClientSwitched ( Player newMasterClient )
virtual

Called after switching to a new MasterClient when the current one leaves.

This is not called when this client enters a room. The former MasterClient is still in the player list when this method get called.

Implements IInRoomCallbacks.

◆ OnPlayerEnteredRoom()

virtual void OnPlayerEnteredRoom ( Player newPlayer )
virtual

Called when a remote player entered the room. This Player is already added to the playerlist.

If your game starts with a certain number of players, this callback can be useful to check the Room.playerCount and find out if you can start.

Implements IInRoomCallbacks.

Reimplemented in PlayerNumbering, and PunTeams.

◆ OnPlayerLeftRoom()

virtual void OnPlayerLeftRoom ( Player otherPlayer )
virtual

Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive.

If another player leaves the room or if the server detects a lost connection, this callback will be used to notify your game logic.

Depending on the room's setup, players may become inactive, which means they may return and retake their spot in the room. In such cases, the Player stays in the Room.Players dictionary.

If the player is not just inactive, it gets removed from the Room.Players dictionary, before the callback is called.

Implements IInRoomCallbacks.

Reimplemented in PlayerNumbering, and PunTeams.

◆ OnPlayerPropertiesUpdate()

virtual void OnPlayerPropertiesUpdate | ( | Player | targetPlayer,
 |  | Hashtable | changedProps
 | ) |  |
virtual

Called when custom player-properties are changed. Player and the changed properties are passed as object[].

Changing properties must be done by Player.SetCustomProperties, which causes this callback locally, too.

Parameters
targetPlayer | Contains Player that changed.
changedProps | Contains the properties that changed.

Implements IInRoomCallbacks.

Reimplemented in PlayerNumbering, and PunTeams.

◆ OnRegionListReceived()

virtual void OnRegionListReceived ( RegionHandler regionHandler )
virtual

Called when the Name Server provided a list of regions for your title.

Check the RegionHandler class description, to make use of the provided values.

Parameters
regionHandler The currently used RegionHandler.

Implements IConnectionCallbacks.

◆ OnRoomListUpdate()

virtual void OnRoomListUpdate ( List< RoomInfo > roomList )
virtual

Called for any update of the room-listing while in a lobby (InLobby) on the Master Server.

Each item is a RoomInfo which might include custom properties (provided you defined those as lobby-listed when creating a room). Not all types of lobbies provide a listing of rooms to the client. Some are silent and specialized for server-side matchmaking.

Implements ILobbyCallbacks.

◆ OnRoomPropertiesUpdate()

virtual void OnRoomPropertiesUpdate ( Hashtable propertiesThatChanged )
virtual

Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties.

Since v1.25 this method has one parameter: Hashtable propertiesThatChanged.
Changing properties must be done by Room.SetCustomProperties, which causes this callback locally, too.

Parameters
propertiesThatChanged

Implements IInRoomCallbacks.

Reimplemented in PunTurnManager, and CountdownTimer.

◆ OnWebRpcResponse()

virtual void OnWebRpcResponse ( OperationResponse response )
virtual

Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc.

Important: The response.ReturnCode is 0 if Photon was able to reach your web-service.
The content of the response is what your web-service sent. You can create a WebRpcResponse from it.
Example: WebRpcResponse webResponse = new WebRpcResponse(operationResponse);

Please note: Class OperationResponse is in a namespace which needs to be "used":
using ExitGames.Client.Photon; // includes OperationResponse (and other classes)

public void OnWebRpcResponse(OperationResponse response) { Debug.LogFormat("WebRPC operation response {0}", response.ToStringFull()); switch (response.ReturnCode) { case ErrorCode.Ok: WebRpcResponse webRpcResponse = new WebRpcResponse(response); Debug.LogFormat("Parsed WebRPC response {0}", response.ToStringFull()); if (string.IsNullOrEmpty(webRpcResponse.Name)) { Debug.LogError("Unexpected: WebRPC response did not contain WebRPC method name"); } if (webRpcResponse.ResultCode == 0) // success { switch (webRpcResponse.Name) { // todo: add your code here case GetGameListWebRpcMethodName: // example // ... break; } } else if (webRpcResponse.ResultCode == -1) { Debug.LogErrorFormat("Web server did not return ResultCode for WebRPC method=\"{0}", Message={1}", webRpcResponse.Name, webRpcResponse.Message); } else { Debug.LogErrorFormat("Web server returned ResultCode={0} for WebRPC method=\"{1}", Message={2}", webRpcResponse.ResultCode, webRpcResponse.Name, webRpcResponse.Message); } break; case ErrorCode.ExternalHttpCallFailed: // web service unreachable Debug.LogErrorFormat("WebRPC call failed as request could not be sent to the server. {0}", response.DebugMessage); break; case ErrorCode.HttpLimitReached: // too many WebRPCs in a short period of time // the debug message should contain the limit exceeded Debug.LogErrorFormat("WebRPCs rate limit exceeded: {0}", response.DebugMessage); break; case ErrorCode.InvalidOperation: // WebRPC not configured at all OR not configured properly OR trying to send on name server if (PhotonNetwork.Server == ServerConnection.NameServer) { Debug.LogErrorFormat("WebRPC not supported on NameServer. {0}", response.DebugMessage); } else { Debug.LogErrorFormat("WebRPC not properly configured or not configured at all. {0}", response.DebugMessage); } break; default: // other unknown error, unexpected Debug.LogErrorFormat("Unexpected error, {0} {1}", response.ReturnCode, response.DebugMessage); break; } }

Implements IWebRpcCallback.


Photon Unity Networking 2: Package Functions

Here is a list of all documented namespace members with links to the namespaces they belong to:
  • AuthModeOption : Photon.Realtime
  • ChatDisconnectCause : Photon.Chat
  • ChatState : Photon.Chat
  • ClientAppType : Photon.Realtime
  • ClientState : Photon.Realtime
  • ConnectMethod : Photon.Pun
  • CustomAuthenticationType : Photon.Chat , Photon.Realtime
  • DisconnectCause : Photon.Realtime
  • EncryptionMode : Photon.Realtime
  • EventCaching : Photon.Realtime
  • JoinMode : Photon.Realtime
  • LobbyType : Photon.Realtime
  • MatchmakingMode : Photon.Realtime
  • OwnershipOption : Photon.Pun
  • PropertyTypeFlag : Photon.Realtime
  • PunLogLevel : Photon.Pun
  • ReceiverGroup : Photon.Realtime
  • RpcTarget : Photon.Pun
  • ServerConnection : Photon.Realtime


Photon Unity Networking 2: Package Functions

  • AuthModeOption : Photon.Realtime
  • ChatDisconnectCause : Photon.Chat
  • ChatState : Photon.Chat
  • ClientAppType : Photon.Realtime
  • ClientState : Photon.Realtime
  • ConnectMethod : Photon.Pun
  • CustomAuthenticationType : Photon.Chat , Photon.Realtime
  • DisconnectCause : Photon.Realtime
  • EncryptionMode : Photon.Realtime
  • EventCaching : Photon.Realtime
  • JoinMode : Photon.Realtime
  • LobbyType : Photon.Realtime
  • MatchmakingMode : Photon.Realtime
  • OwnershipOption : Photon.Pun
  • PropertyTypeFlag : Photon.Realtime
  • PunLogLevel : Photon.Pun
  • ReceiverGroup : Photon.Realtime
  • RpcTarget : Photon.Pun
  • ServerConnection : Photon.Realtime


Photon Unity Networking 2: Class List

Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 12345]
▼N Photon |
▼N Chat |
C AuthenticationValues | Container for user authentication in Photon. Set AuthValues before you connect - all else is handled
C ChannelCreationOptions |
C ChannelWellKnownProperties |
C ChatAppSettings | Settings for Photon application(s) and the server to connect to
C ChatChannel | A channel of communication in Photon Chat, updated by ChatClient and provided as READ ONLY
C ChatClient | Central class of the Photon Chat API to connect, handle channels and messages
C ChatEventCode | Wraps up internally used constants in Photon Chat events. You don't have to use them directly usually
C ChatOperationCode | Wraps up codes for operations used internally in Photon Chat. You don't have to use them directly usually
C ChatParameterCode | Wraps up codes for parameters (in operations and events) used internally in Photon Chat. You don't have to use them directly usually
C ChatPeer | Provides basic operations of the Photon Chat server. This internal class is used by public ChatClient
C ChatUserStatus | Contains commonly used status values for SetOnlineStatus. You can define your own
C ErrorCode | ErrorCode defines the default codes associated with Photon client/server communication
C IChatClientListener | Callback interface for Chat client side. Contains callback methods to notify your app about updates. Must be provided to new ChatClient in constructor
C ParameterCode | Class for constants. Codes for parameters of Operations and Events
▼N Pun |
►N UtilityScripts |
C ButtonInsideScrollList | Button inside scroll list will stop scrolling ability of scrollRect container, so that when pressing down on a button and draggin up and down will not affect scrolling. this doesn't do anything if no scrollRect component found in Parent Hierarchy
C ByteComparer |
C CellTree | Represents the tree accessible from its root node
C CellTreeNode | Represents a single node of the tree
C ConnectAndJoinRandom | Simple component to call ConnectUsingSettings and to get into a PUN room easily
C CountdownTimer | This is a basic, network-synced CountdownTimer based on properties
C CullArea | Represents the cull area used for network culling
C CullingHandler | Handles the network culling
C EventSystemSpawner | Event system spawner. Will add an EventSystem GameObject with an EventSystem component and a StandaloneInputModule component. Use this in additive scene loading context where you would otherwise get a "Multiple EventSystem in scene... this is not supported" error from Unity
C GraphicToggleIsOnTransition | Use this on toggles texts to have some color transition on the text depending on the isOn State
C IPunTurnManagerCallbacks |
C MoveByKeys | Very basic component to move a GameObject by WASD and Space
C OnClickDestroy | Destroys the networked GameObject either by PhotonNetwork.Destroy or by sending an RPC which calls Object.Destroy()
C OnClickInstantiate | Instantiates a networked GameObject on click
C OnClickRpc | This component will instantiate a network GameObject when in a room and the user click on that component's GameObject. Uses PhysicsRaycaster for positioning
C OnEscapeQuit | This component will quit the application when escape key is pressed
C OnJoinedInstantiate | This component will instantiate a network GameObject when a room is joined
C OnPointerOverTooltip | Set focus to a given photonView when pointed is over
C OnStartDelete | This component will destroy the GameObject it is attached to (in Start())
C PhotonLagSimulationGui | This MonoBehaviour is a basic GUI for the Photon client's network-simulation feature. It can modify lag (fixed delay), jitter (random lag) and packet loss
C PhotonStatsGui | Basic GUI to show traffic and health statistics of the connection to Photon, toggled by shift+tab
C PhotonTeam |
C PhotonTeamExtensions | Extension methods for the Player class that make use of PhotonTeamsManager
C PhotonTeamsManager | Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension
C PlayerNumbering | Implements consistent numbering in a room/game with help of room properties. Access them by Player.GetPlayerNumber() extension
C PlayerNumberingExtensions | Extension used for PlayerRoomIndexing and Player class
C PointedAtGameObjectInfo | Display ViewId, OwnerActorNr, IsCeneView and IsMine when clicked
C PunPlayerScores | Scoring system for PhotonPlayer
C PunTeams | Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension
C PunTurnManager | Pun turnBased Game manager. Provides an Interface (IPunTurnManagerCallbacks) for the typical turn flow and logic, between players Provides Extensions for Player, Room and RoomInfo to feature dedicated api for TurnBased Needs
C ScoreExtensions |
C SmoothSyncMovement | Smoothed out movement for network gameobjects
C StatesGui | Output detailed information about Pun Current states, using the old Unity UI framework
►C TabViewManager | Tab view manager. Handles Tab views activation and deactivation, and provides a Unity Event Callback when a tab was selected
C Tab |
C TabChangeEvent | Tab change event
C TeamExtensions | Extension used for PunTeams and Player class. Wraps access to the player's custom property
C TextButtonTransition | Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour
C TextToggleIsOnTransition | Use this on toggles texts to have some color transition on the text depending on the isOn State
C TurnExtensions |
C DefaultPool | The default implementation of a PrefabPool for PUN, which actually Instantiates and Destroys GameObjects but pools a resource
C InstantiateParameters |
C IOnPhotonViewControllerChange | This interface defines a callback for changes to the PhotonView's controller
C IOnPhotonViewOwnerChange | This interface defines a callback for changes to the PhotonView's owner
C IOnPhotonViewPreNetDestroy | This interface defines a callback which fires prior to the PhotonNetwork destroying the PhotonView and Gameobject
C IPhotonViewCallback | Empty Base class for all PhotonView callbacks
C IPunInstantiateMagicCallback |
C IPunObservable | Defines the OnPhotonSerializeView method to make it easy to implement correctly for observable scripts
C IPunOwnershipCallbacks | Global Callback interface for ownership changes. These callbacks will fire for changes to ANY PhotonView that changes. Consider using IOnPhotonViewControllerChange for callbacks from a specific PhotonView
C IPunPrefabPool | Defines an interface for object pooling, used in PhotonNetwork.Instantiate and PhotonNetwork.Destroy
C MonoBehaviourPun | This class adds the property photonView, while logging a warning when your game still uses the networkView
C MonoBehaviourPunCallbacks | This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use
C NestedComponentUtilities |
►C PhotonAnimatorView | This class helps you to synchronize Mecanim animations Simply add the component to your GameObject and make sure that the PhotonAnimatorView is added to the list of observed components
C SynchronizedLayer |
C SynchronizedParameter |
C PhotonHandler | Internal MonoBehaviour that allows Photon to run an Update loop
C PhotonMessageInfo | Container class for info about a particular message, RPC or update
C PhotonNetwork | The main class to use the PhotonNetwork plugin. This class is static
C PhotonRigidbody2DView |
C PhotonRigidbodyView |
C PhotonStream | This container is used in OnPhotonSerializeView() to either provide incoming data of a PhotonView or for you to provide it
C PhotonStreamQueue | The PhotonStreamQueue helps you poll object states at higher frequencies than what PhotonNetwork.SendRate dictates and then sends all those states at once when Serialize() is called. On the receiving end you can call Deserialize() and then the stream will roll out the received object states in the same order and timeStep they were recorded in
C PhotonTransformView |
C PhotonTransformViewClassic | This class helps you to synchronize position, rotation and scale of a GameObject. It also gives you many different options to make the synchronized values appear smooth, even when the data is only send a couple of times per second. Simply add the component to your GameObject and make sure that the PhotonTransformViewClassic is added to the list of observed components
C PhotonTransformViewPositionControl |
C PhotonTransformViewPositionModel |
C PhotonTransformViewRotationControl |
C PhotonTransformViewRotationModel |
C PhotonTransformViewScaleControl |
C PhotonTransformViewScaleModel |
C PhotonView | A PhotonView identifies an object across the network (viewID) and configures how the controlling client updates remote instances
C PunExtensions | Small number of extension methods that make it easier for PUN to work cross-Unity-versions
C PunRPC | Replacement for RPC attribute with different name. Used to flag methods as remote-callable
C SceneManagerHelper |
C ServerSettings | Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings
▼N Realtime |
C ActorProperties | Class for constants. These (byte) values define "well known" properties for an Actor / Player
C AppSettings | Settings for Photon application(s) and the server to connect to
C AuthenticationValues | Container for user authentication in Photon. Set AuthValues before you connect - all else is handled
C ConnectionCallbacksContainer | Container type for callbacks defined by IConnectionCallbacks. See LoadBalancingCallbackTargets
C ConnectionHandler |
C EnterRoomParams | Parameters for creating rooms
C ErrorCode | ErrorCode defines the default codes associated with Photon client/server communication
C ErrorInfo | Class wrapping the received EventCode.ErrorInfo event
C EventCode | Class for constants. These values are for events defined by Photon LoadBalancing
C Extensions | This static class defines some useful extension methods for several existing classes (e.g. Vector3, float and others)
C FindFriendsOptions | Options for OpFindFriends can be combined to filter which rooms of friends are returned
C FriendInfo | Used to store info about a friend's online state and in which room he/she is
C GamePropertyKey | Class for constants. These (byte) values are for "well known" room/game properties used in Photon LoadBalancing
C IConnectionCallbacks | Collection of "organizational" callbacks for the Realtime Api to cover: Connection and Regions
C IErrorInfoCallback | Interface for EventCode.ErrorInfo event callback for the Realtime Api
C IInRoomCallbacks | Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching
C ILobbyCallbacks | Collection of "organizational" callbacks for the Realtime Api to cover the Lobby
C IMatchmakingCallbacks | Collection of "organizational" callbacks for the Realtime Api to cover Matchmaking
C IOnEventCallback | Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent
C IWebRpcCallback | Interface for "WebRpc" callbacks for the Realtime Api. Currently includes only responses for Web RPCs
C LoadBalancingClient | This class implements the Photon LoadBalancing workflow by using a LoadBalancingPeer. It keeps a state and will automatically execute transitions between the Master and Game Servers
C LoadBalancingPeer | A LoadBalancingPeer provides the operations and enum definitions needed to use the LoadBalancing server application which is also used in Photon Cloud
C MatchMakingCallbacksContainer | Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets
C OperationCode | Class for constants. Contains operation codes
C OpJoinRandomRoomParams | Parameters for the matchmaking of JoinRandomRoom and JoinRandomOrCreateRoom
C ParameterCode | Class for constants. Codes for parameters of Operations and Events
C PhotonAppSettings | Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings
C PhotonPing | Abstract implementation of PhotonPing, ase for pinging servers to find the "Best Region"
C PhotonPortDefinition | Container for port definitions
C PingMono | Uses C# Socket class from System.Net.Sockets (as Unity usually does)
C Player | Summarizes a "player" within a room, identified (in that room) by ID (or "actorNumber")
C RaiseEventOptions | Aggregates several less-often used options for operation RaiseEvent. See field descriptions for usage details
C Region |
C RegionHandler | Provides methods to work with Photon's regions (Photon Cloud) and can be use to find the one with best ping
C RegionPinger |
C Room | This class represents a room a client joins/joined
C 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)
C RoomOptions | Wraps up common room properties needed when you create rooms. Read the individual entries for more details
C SupportLogger | Helper class to debug log basic information about Photon client and vital traffic statistics
C TypedLobby | Refers to a specific lobby on the server
C TypedLobbyInfo | Info for a lobby on the server. Used when LoadBalancingClient.EnableLobbyStatistics is true
C WebFlags | Optional flags to be used in Photon client SDKs with Op RaiseEvent and Op SetProperties. Introduced mainly for webhooks 1.2 to control behavior of forwarded HTTP requests
C WebRpcResponse | Reads an operation response of a WebRpc and provides convenient access to most common values


Photon Unity Networking 2: Photon Namespace Reference

Namespaces
Photon Namespace Reference


Photon Unity Networking 2: Photon.Chat Namespace Reference

  • Chat
Classes | Enumerations
Photon.Chat Namespace Reference

Classes

class | AuthenticationValues
Container for user authentication in Photon. Set AuthValues before you connect - all else is handled. More...
class | ChannelCreationOptions
class | ChannelWellKnownProperties
class | ChatAppSettings
Settings for Photon application(s) and the server to connect to. More...
class | ChatChannel
A channel of communication in Photon Chat, updated by ChatClient and provided as READ ONLY. More...
class | ChatClient
Central class of the Photon Chat API to connect, handle channels and messages. More...
class | ChatEventCode
Wraps up internally used constants in Photon Chat events. You don't have to use them directly usually. More...
class | ChatOperationCode
Wraps up codes for operations used internally in Photon Chat. You don't have to use them directly usually. More...
class | ChatParameterCode
Wraps up codes for parameters (in operations and events) used internally in Photon Chat. You don't have to use them directly usually. More...
class | ChatPeer
Provides basic operations of the Photon Chat server. This internal class is used by public ChatClient. More...
class | ChatUserStatus
Contains commonly used status values for SetOnlineStatus. You can define your own. More...
class | ErrorCode
ErrorCode defines the default codes associated with Photon client/server communication. More...
interface | IChatClientListener
Callback interface for Chat client side. Contains callback methods to notify your app about updates. Must be provided to new ChatClient in constructor More...
class | ParameterCode
Class for constants. Codes for parameters of Operations and Events. More...

Enumerations

enum | ChatDisconnectCause
Enumeration of causes for Disconnects (used in ChatClient.DisconnectedCause). More...
enum | CustomAuthenticationType : byte
Options for optional "Custom Authentication" services used with Photon. Used by OpAuthenticate after connecting to Photon. More...
enum | ChatState
Possible states for a Chat Client. More...

Enumeration Type Documentation

◆ ChatDisconnectCause

enum ChatDisconnectCause
strong

Enumeration of causes for Disconnects (used in ChatClient.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.
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.
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.
Exception | OnStatusChanged: Some internal exception caused the socket code to fail. Contact Exit Games.
InvalidAuthentication | OnOperationResponse: Authenticate in the Photon Cloud with invalid AppId. Update your subscription or contact Exit Games.
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 change region.
OperationNotAllowedInCurrentState | OnOperationResponse: Operation that's (currently) not available for this client (not authorized usually). Only tracked for op Authenticate.
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.
DisconnectByClientLogic | OnStatusChanged: The client disconnected from within the logic (the C# code).

◆ ChatState

enum ChatState
strong

Possible states for a Chat Client.

Enumerator
Uninitialized | Peer is created but not used yet.
ConnectingToNameServer | Connecting to name server.
ConnectedToNameServer | Connected to name server.
Authenticating | Authenticating on current server.
Authenticated | Finished authentication on current server.
DisconnectingFromNameServer | Disconnecting from name server. This is usually a transition from name server to frontend server.
ConnectingToFrontEnd | Connecting to frontend server.
ConnectedToFrontEnd | Connected to frontend server.
DisconnectingFromFrontEnd | Disconnecting from frontend server.
QueuedComingFromFrontEnd | Currently not used.
Disconnecting | The client disconnects (from any server).
Disconnected | The client is no longer connected (to any server).
ConnectWithFallbackProtocol | Client was unable to connect to Name Server and will attempt to connect with an alternative network protocol (TCP).

◆ CustomAuthenticationType

enum CustomAuthenticationType : byte
strong

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 auth values accordingly!
Facebook | Authenticates users by their Facebook Account. Set auth values accordingly!
Oculus | Authenticates users by their Oculus Account and token.
PlayStation4 | Authenticates users by their PSN Account and token on PS4.
Xbox | Authenticates users by their Xbox Account and XSTS token.
Viveport | Authenticates users by their HTC Viveport Account and user token. Set AuthGetParameters to "userToken=[userToken]"
NintendoSwitch | Authenticates users by their NSA ID.
PlayStation5 | Authenticates users by their PSN Account and token on PS5.
None | Disables custom authentication. Same as not providing any AuthenticationValues for connect (more precisely for: OpAuthenticate).


Photon Unity Networking 2: AuthenticationValues Class Reference

  • Chat
  • AuthenticationValues
Public Member Functions | Properties | List of all members
AuthenticationValues Class Reference

Container for user authentication in Photon. Set AuthValues before you connect - all else is handled. More...

Public Member Functions

AuthenticationValues ()
Creates empty auth values without any info. More...
AuthenticationValues (string userId)
Creates minimal info about the user. If this is authenticated or not, depends on the set AuthType. More...
virtual void | SetAuthPostData (string stringData)
Sets the data to be passed-on to the auth service via POST. More...
virtual void | SetAuthPostData (byte[] byteData)
Sets the data to be passed-on to the auth service via POST. More...
virtual void | SetAuthPostData (Dictionary< string, object > dictData)
Sets data to be passed-on to the auth service as Json (Content-Type: "application/json") via Post. More...
virtual void | AddAuthParameter (string key, string value)
Adds a key-value pair to the get-parameters used for Custom Auth (AuthGetParameters). More...
override string | ToString ()
Transform this object into string. More...
AuthenticationValues | CopyTo (AuthenticationValues copy)
Make a copy of the current object. More...

Properties

CustomAuthenticationType | AuthType [get, set]
The type of authentication provider that should be used. Defaults to None (no auth whatsoever). More...
string | AuthGetParameters [get, set]
This string must contain any (http get) parameters expected by the used authentication service. By default, username and token. More...
object | AuthPostData [get]
Data to be passed-on to the auth service via POST. Default: null (not sent). Either string or byte[] (see setters). More...
object | Token [get, set]
Internal Photon token. After initial authentication, Photon provides a token for this client, subsequently used as (cached) validation. More...
string | UserId [get, set]
The UserId should be a unique identifier per user. This is for finding friends, etc.. More...

Detailed Description

Container for user authentication in Photon. Set AuthValues before you connect - all else is handled.

On Photon, user authentication is optional but can be useful in many cases. If you want to FindFriends, a unique ID per user is very practical.

There are basically three options for user authentication: None at all, the client sets some UserId or you can use some account web-service to authenticate a user (and set the UserId server-side).

Custom Authentication lets you verify end-users by some kind of login or token. It sends those values to Photon which will verify them before granting access or disconnecting the client.

The AuthValues are sent in OpAuthenticate when you connect, so they must be set before you connect. If the AuthValues.UserId is null or empty when it's sent to the server, then the Photon Server assigns a UserId!

The Photon Cloud Dashboard will let you enable this feature and set important server values for it. https://dashboard.photonengine.com

Constructor & Destructor Documentation

◆ AuthenticationValues() [1/2]

AuthenticationValues ( )

Creates empty auth values without any info.

◆ AuthenticationValues() [2/2]

AuthenticationValues ( string userId )

Creates minimal info about the user. If this is authenticated or not, depends on the set AuthType.

Parameters
userId Some UserId to set in Photon.

Member Function Documentation

◆ AddAuthParameter()

virtual void AddAuthParameter | ( | string | key,
 |  | string | value
 | ) |  |
virtual

Adds a key-value pair to the get-parameters used for Custom Auth (AuthGetParameters).

This method does uri-encoding for you.

Parameters
key | Key for the value to set.
value | Some value relevant for Custom Authentication.

◆ CopyTo()

AuthenticationValues CopyTo ( AuthenticationValues copy )

Make a copy of the current object.

Parameters
copy The object to be copied into.
Returns
The copied object.

◆ SetAuthPostData() [1/3]

virtual void SetAuthPostData ( byte[] byteData )
virtual

Sets the data to be passed-on to the auth service via POST.

AuthPostData is just one value. Each SetAuthPostData replaces any previous value. It can be either a string, a byte[] or a dictionary.

Parameters
byteData Binary token / auth-data to pass on.

◆ SetAuthPostData() [2/3]

virtual void SetAuthPostData ( Dictionary< string, object > dictData )
virtual

Sets data to be passed-on to the auth service as Json (Content-Type: "application/json") via Post.

AuthPostData is just one value. Each SetAuthPostData replaces any previous value. It can be either a string, a byte[] or a dictionary.

Parameters
dictData A authentication-data dictionary will be converted to Json and passed to the Auth webservice via HTTP Post.

◆ SetAuthPostData() [3/3]

virtual void SetAuthPostData ( string stringData )
virtual

Sets the data to be passed-on to the auth service via POST.

AuthPostData is just one value. Each SetAuthPostData replaces any previous value. It can be either a string, a byte[] or a dictionary.

Parameters
stringData String data to be used in the body of the POST request. Null or empty string will set AuthPostData to null.

◆ ToString()

override string ToString ( )

Transform this object into string.

Returns
string representation of this object.

Property Documentation

◆ AuthGetParameters

string AuthGetParameters
getset

This string must contain any (http get) parameters expected by the used authentication service. By default, username and token.

Maps to operation parameter 216. Standard http get parameters are used here and passed on to the service that's defined in the server (Photon Cloud Dashboard).

◆ AuthPostData

object AuthPostData
get

Data to be passed-on to the auth service via POST. Default: null (not sent). Either string or byte[] (see setters).

Maps to operation parameter 214.

◆ AuthType

CustomAuthenticationType AuthType
getset

The type of authentication provider that should be used. Defaults to None (no auth whatsoever).

Several auth providers are available and CustomAuthenticationType.Custom can be used if you build your own service.

◆ Token

object Token
getset

Internal Photon token. After initial authentication, Photon provides a token for this client, subsequently used as (cached) validation.

Any token for custom authentication should be set via SetAuthPostData or AddAuthParameter.

◆ UserId

string UserId
getset

The UserId should be a unique identifier per user. This is for finding friends, etc..

See remarks of AuthValues for info about how this is set and used.


Photon Unity Networking 2: ChannelCreationOptions Class Reference

  • Chat
  • ChannelCreationOptions
Static Public Attributes | Properties | List of all members
ChannelCreationOptions Class Reference

Static Public Attributes

static ChannelCreationOptions Default = new ChannelCreationOptions()
Default values of channel creation options. More...

Properties

bool | PublishSubscribers [get, set]
Whether or not the channel to be created will allow client to keep a list of users. More...
int | MaxSubscribers [get, set]
Limit of the number of users subscribed to the channel to be created. More...

Member Data Documentation

◆ Default

ChannelCreationOptions Default = new ChannelCreationOptions()
static

Default values of channel creation options.

Property Documentation

◆ MaxSubscribers

int MaxSubscribers
getset

Limit of the number of users subscribed to the channel to be created.

◆ PublishSubscribers

bool PublishSubscribers
getset

Whether or not the channel to be created will allow client to keep a list of users.


Photon Unity Networking 2: ChannelWellKnownProperties Class Reference

  • Chat
  • ChannelWellKnownProperties
Static Public Attributes | List of all members
ChannelWellKnownProperties Class Reference

Static Public Attributes

const byte | MaxSubscribers = 255
const byte | PublishSubscribers = 254


Photon Unity Networking 2: ChatAppSettings Class Reference

  • Chat
  • ChatAppSettings
Public Attributes | Properties | List of all members
ChatAppSettings Class Reference

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

Public Attributes

string | AppIdChat
AppId for the Chat Api. More...
string | AppVersion
The AppVersion can be used to identify builds and will split the AppId distinct "Virtual AppIds" (important for the users to find each other). More...
string | FixedRegion
Can be set to any of the Photon Cloud's region names to directly connect to that region. More...
string | Server
The address (hostname or IP) of the server to connect to. More...
ushort | Port
If not null, this sets the port of the first Photon server to connect to (that will "forward" the client as needed). 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...
DebugLevel | NetworkLogging = DebugLevel.ERROR
Log level for the network lib. More...

Properties

bool | IsDefaultNameServer [get]
If true, the default nameserver address for the Photon Cloud should be used. More...
string | AppId [get, set]
Available to not immediately break compatibility. 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 Data Documentation

◆ AppIdChat

string AppIdChat

AppId for the Chat Api.

◆ AppVersion

string AppVersion

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

◆ 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.

◆ NetworkLogging

DebugLevel NetworkLogging = DebugLevel.ERROR

Log level for the network lib.

◆ Port

ushort 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.

◆ Server

string Server

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

Property Documentation

◆ AppId

string AppId
getset

Available to not immediately break compatibility.

◆ IsDefaultNameServer

bool IsDefaultNameServer
get

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


Photon Unity Networking 2: ChatChannel Class Reference

  • Chat
  • ChatChannel
Public Member Functions | Public Attributes | Properties | List of all members
ChatChannel Class Reference

A channel of communication in Photon Chat, updated by ChatClient and provided as READ ONLY. More...

Public Member Functions

ChatChannel (string name)
Used internally to create new channels. This does NOT create a channel on the server! Use ChatClient.Subscribe. More...
void | Add (string sender, object message, int msgId)
Used internally to add messages to this channel. More...
void | Add (string[] senders, object[] messages, int lastMsgId)
Used internally to add messages to this channel. More...
void | TruncateMessages ()
Reduces the number of locally cached messages in this channel to the MessageLimit (if set). More...
void | ClearMessages ()
Clear the local cache of messages currently stored. This frees memory but doesn't affect the server. More...
string | ToStringMessages ()
Provides a string-representation of all messages in this channel. More...

Public Attributes

readonly string | Name
Name of the channel (used to subscribe and unsubscribe). More...
readonly List< string > | Senders = new List<string>()
Senders of messages in chronological order. Senders and Messages refer to each other by index. Senders[x] is the sender of Messages[x]. More...
readonly List< object > | Messages = new List<object>()
Messages in chronological order. Senders and Messages refer to each other by index. Senders[x] is the sender of Messages[x]. More...
int | MessageLimit
If greater than 0, this channel will limit the number of messages, that it caches locally. More...
int | ChannelID
Unique channel ID. More...
readonly HashSet< string > | Subscribers = new HashSet<string>()
Subscribed users. More...

Properties

bool | IsPrivate [get, set]
Is this a private 1:1 channel? More...
int | MessageCount [get]
Count of messages this client still buffers/knows for this channel. More...
int | LastMsgId [get, protected set]
ID of the last message received. More...
bool | PublishSubscribers [get, protected set]
Whether or not this channel keeps track of the list of its subscribers. More...
int | MaxSubscribers [get, protected set]
Maximum number of channel subscribers. 0 means infinite. More...

Detailed Description

A channel of communication in Photon Chat, updated by ChatClient and provided as READ ONLY.

Contains messages and senders to use (read!) and display by your GUI. Access these by: ChatClient.PublicChannels ChatClient.PrivateChannels

Constructor & Destructor Documentation

◆ ChatChannel()

ChatChannel ( string name )

Used internally to create new channels. This does NOT create a channel on the server! Use ChatClient.Subscribe.

Member Function Documentation

◆ Add() [1/2]

void Add | ( | string | sender,
 |  | object | message,
 |  | int | msgId
 | ) |  |

Used internally to add messages to this channel.

◆ Add() [2/2]

void Add | ( | string[] | senders,
 |  | object[] | messages,
 |  | int | lastMsgId
 | ) |  |

Used internally to add messages to this channel.

◆ ClearMessages()

void ClearMessages ( )

Clear the local cache of messages currently stored. This frees memory but doesn't affect the server.

◆ ToStringMessages()

string ToStringMessages ( )

Provides a string-representation of all messages in this channel.

Returns
All known messages in format "Sender: Message", line by line.

◆ TruncateMessages()

void TruncateMessages ( )

Reduces the number of locally cached messages in this channel to the MessageLimit (if set).

Member Data Documentation

◆ ChannelID

int ChannelID

Unique channel ID.

◆ MessageLimit

int MessageLimit

If greater than 0, this channel will limit the number of messages, that it caches locally.

◆ Messages

readonly List<object> Messages = new List<object>()

Messages in chronological order. Senders and Messages refer to each other by index. Senders[x] is the sender of Messages[x].

◆ Name

readonly string Name

Name of the channel (used to subscribe and unsubscribe).

◆ Senders

readonly List<string> Senders = new List<string>()

Senders of messages in chronological order. Senders and Messages refer to each other by index. Senders[x] is the sender of Messages[x].

◆ Subscribers

readonly HashSet<string> Subscribers = new HashSet<string>()

Subscribed users.

Property Documentation

◆ IsPrivate

bool IsPrivate
getset

Is this a private 1:1 channel?

◆ LastMsgId

int LastMsgId
getprotected set

ID of the last message received.

◆ MaxSubscribers

int MaxSubscribers
getprotected set

Maximum number of channel subscribers. 0 means infinite.

◆ MessageCount

int MessageCount
get

Count of messages this client still buffers/knows for this channel.

◆ PublishSubscribers

bool PublishSubscribers
getprotected set

Whether or not this channel keeps track of the list of its subscribers.


Photon Unity Networking 2: ChatClient Class Reference

  • Chat
  • ChatClient
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
ChatClient Class Reference

Central class of the Photon Chat API to connect, handle channels and messages. More...

Inherits IPhotonPeerListener.

Public Member Functions

bool | CanChatInChannel (string channelName)
Checks if this client is ready to publish messages inside a public channel. More...
ChatClient (IChatClientListener listener, ConnectionProtocol protocol=ConnectionProtocol.Udp)
Chat client constructor. More...
bool | ConnectUsingSettings (ChatAppSettings appSettings)
bool | Connect (string appId, string appVersion, AuthenticationValues authValues)
Connects this client to the Photon Chat Cloud service, which will also authenticate the user (and set a UserId). More...
bool | ConnectAndSetStatus (string appId, string appVersion, AuthenticationValues authValues, int status=ChatUserStatus.Online, object message=null)
Connects this client to the Photon Chat Cloud service, which will also authenticate the user (and set a UserId). This also sets an online status once connected. By default it will set user status to ChatUserStatus.Online. See SetOnlineStatus(int,object) for more information. More...
void | Service ()
Must be called regularly to keep connection between client and server alive and to process incoming messages. More...
void | SendAcksOnly ()
Obsolete: Better use UseBackgroundWorkerForSending and Service(). More...
void | Disconnect (ChatDisconnectCause cause=ChatDisconnectCause.DisconnectByClientLogic)
Disconnects from the Chat Server by sending a "disconnect command", which prevents a timeout server-side. More...
void | StopThread ()
Locally shuts down the connection to the Chat Server. This resets states locally but the server will have to timeout this peer. More...
bool | Subscribe (string[] channels)
Sends operation to subscribe to a list of channels by name. More...
bool | Subscribe (string[] channels, int[] lastMsgIds)
Sends operation to subscribe to a list of channels by name and possibly retrieve messages we did not receive while unsubscribed. More...
bool | Subscribe (string[] channels, int messagesFromHistory)
Sends operation to subscribe client to channels, optionally fetching a number of messages from the cache. More...
bool | Unsubscribe (string[] channels)
Unsubscribes from a list of channels, which stops getting messages from those. More...
bool | PublishMessage (string channelName, object message, bool forwardAsWebhook=false)
Sends a message to a public channel which this client subscribed to. More...
bool | SendPrivateMessage (string target, object message, bool forwardAsWebhook=false)
Sends a private message to a single target user. Calls OnPrivateMessage on the receiving client. More...
bool | SendPrivateMessage (string target, object message, bool encrypt, bool forwardAsWebhook)
Sends a private message to a single target user. Calls OnPrivateMessage on the receiving client. More...
bool | SetOnlineStatus (int status)
Sets the user's status without changing your status-message. More...
bool | SetOnlineStatus (int status, object message)
Sets the user's status without changing your status-message. More...
bool | AddFriends (string[] friends)
Adds friends to a list on the Chat Server which will send you status updates for those. More...
bool | RemoveFriends (string[] friends)
Removes the provided entries from the list on the Chat Server and stops their status updates. More...
string | GetPrivateChannelNameByUser (string userName)
Get you the (locally used) channel name for the chat between this client and another user. More...
bool | TryGetChannel (string channelName, bool isPrivate, out ChatChannel channel)
Simplified access to either private or public channels by name. More...
bool | TryGetChannel (string channelName, out ChatChannel channel)
Simplified access to all channels by name. Checks public channels first, then private ones. More...
bool | TryGetPrivateChannelByUser (string userId, out ChatChannel channel)
Simplified access to private channels by target user. More...
bool | Subscribe (string channel, int lastMsgId=0, int messagesFromHistory=-1, ChannelCreationOptions creationOptions=null)
Subscribe to a single channel and optionally sets its well-know channel properties in case the channel is created. More...

Public Attributes

int | MessageLimit
If greater than 0, new channels will limit the number of messages they cache locally. More...
int | PrivateChatHistoryLength = -1
Limits the number of messages from private channel histories. More...
readonly Dictionary< string, ChatChannel > | PublicChannels
Public channels this client is subscribed to. More...
readonly Dictionary< string, ChatChannel > | PrivateChannels
Private channels in which this client has exchanged messages. More...
ChatPeer | chatPeer = null
The Chat Peer used by this client. More...

Static Public Attributes

const int DefaultMaxSubscribers = 100
Default maximum value possible for ChatChannel.MaxSubscribers when ChatChannel.PublishSubscribers is enabled More...

Properties

bool | EnableProtocolFallback [get, set]
Enables a fallback to another protocol in case a connect to the Name Server fails. More...
string | NameServerAddress [get]
The address of last connected Name Server. More...
string | FrontendAddress [get]
The address of the actual chat server assigned from NameServer. Public for read only. More...
string | ChatRegion [get, set]
Settable only before you connect! Defaults to "EU". More...
ChatState | State [get]
Current state of the ChatClient. Also use CanChat. More...
ChatDisconnectCause | DisconnectedCause [get]
Disconnection cause. Check this inside IChatClientListener.OnDisconnected. More...
bool | CanChat [get]
Checks if this client is ready to send messages. More...
string | AppVersion [get]
The version of your client. A new version also creates a new "virtual app" to separate players from older client versions. More...
string | AppId [get]
The AppID as assigned from the Photon Cloud. More...
AuthenticationValues | AuthValues [get, set]
Settable only before you connect! More...
string? | UserId [get]
The unique ID of a user/person, stored in AuthValues.UserId. Set it before you connect. More...
bool | UseBackgroundWorkerForSending [get, set]
Defines if a background thread will call SendOutgoingCommands, while your code calls Service to dispatch received messages. More...
ConnectionProtocol? | TransportProtocol [get, set]
Exposes the TransportProtocol of the used PhotonPeer. Settable while not connected. More...
Dictionary< ConnectionProtocol, Type > | SocketImplementationConfig [get]
Defines which IPhotonSocket class to use per ConnectionProtocol. More...
DebugLevel | DebugOut [get, set]
Sets the level (and amount) of debug output provided by the library. More...

Detailed Description

Central class of the Photon Chat API to connect, handle channels and messages.

This class must be instantiated with a IChatClientListener instance to get the callbacks. Integrate it into your game loop by calling Service regularly. If the target platform supports Threads/Tasks, set UseBackgroundWorkerForSending = true, to let the ChatClient keep the connection by sending from an independent thread.

Call Connect with an AppId that is setup as Photon Chat application. Note: Connect covers multiple messages between this client and the servers. A short workflow will connect you to a chat server.

Each ChatClient resembles a user in chat (set in Connect). Each user automatically subscribes a channel for incoming private messages and can message any other user privately. Before you publish messages in any non-private channel, that channel must be subscribed.

PublicChannels is a list of subscribed channels, containing messages and senders. PrivateChannels contains all incoming and sent private messages.

Constructor & Destructor Documentation

◆ ChatClient()

ChatClient | ( | IChatClientListener | listener,
 |  | ConnectionProtocol | protocol = ConnectionProtocol.Udp
 | ) |  |

Chat client constructor.

Parameters
listener | The chat listener implementation.
protocol | Connection protocol to be used by this client. Default is ConnectionProtocol.Udp.

Member Function Documentation

◆ AddFriends()

bool AddFriends ( string[] friends )

Adds friends to a list on the Chat Server which will send you status updates for those.

AddFriends and RemoveFriends enable clients to handle their friend list in the Photon Chat server. Having users on your friends list gives you access to their current online status (and whatever info your client sets in it).

Each user can set an online status consisting of an integer and an arbitrary (serializable) object. The object can be null, Hashtable, object[] or anything else Photon can serialize.

The status is published automatically to friends (anyone who set your user ID with AddFriends).

Photon flushes friends-list when a chat client disconnects, so it has to be set each time. If your community API gives you access to online status already, you could filter and set online friends in AddFriends.

Actual friend relations are not persistent and have to be stored outside of Photon.

Parameters
friends Array of friend userIds.
Returns
If the operation could be sent.

◆ CanChatInChannel()

bool CanChatInChannel ( string channelName )

Checks if this client is ready to publish messages inside a public channel.

Parameters
channelName The channel to do the check with.
Returns
Whether or not this client is ready to publish messages inside the public channel with the specified channelName.

◆ Connect()

bool Connect | ( | string | appId,
 |  | string | appVersion,
 |  | AuthenticationValues | authValues
 | ) |  |

Connects this client to the Photon Chat Cloud service, which will also authenticate the user (and set a UserId).

Parameters
appId | Get your Photon Chat AppId from the Dashboard.
appVersion | Any version string you make up. Used to separate users and variants of your clients, which might be incompatible.
authValues | Values for authentication. You can leave this null, if you set a UserId before. If you set authValues, they will override any UserId set before.
Returns

◆ ConnectAndSetStatus()

bool ConnectAndSetStatus | ( | string | appId,
 |  | string | appVersion,
 |  | AuthenticationValues | authValues,
 |  | int | status = ChatUserStatus.Online,
 |  | object | message = null
 | ) |  |

Connects this client to the Photon Chat Cloud service, which will also authenticate the user (and set a UserId). This also sets an online status once connected. By default it will set user status to ChatUserStatus.Online. See SetOnlineStatus(int,object) for more information.

Parameters
appId | Get your Photon Chat AppId from the Dashboard.
appVersion | Any version string you make up. Used to separate users and variants of your clients, which might be incompatible.
authValues | Values for authentication. You can leave this null, if you set a UserId before. If you set authValues, they will override any UserId set before.
status | User status to set when connected. Predefined states are in class ChatUserStatus. Other values can be used at will.
message | Optional status Also sets a status-message which your friends can get.
Returns
If the connection attempt could be sent at all.

◆ Disconnect()

void Disconnect ( ChatDisconnectCause cause = ChatDisconnectCause.DisconnectByClientLogic )

Disconnects from the Chat Server by sending a "disconnect command", which prevents a timeout server-side.

◆ GetPrivateChannelNameByUser()

string GetPrivateChannelNameByUser ( string userName )

Get you the (locally used) channel name for the chat between this client and another user.

Parameters
userName Remote user's name or UserId.
Returns
The (locally used) channel name for a private channel.

Do not subscribe to this channel. Private channels do not need to be explicitly subscribed to. Use this for debugging purposes mainly.

◆ PublishMessage()

bool PublishMessage | ( | string | channelName,
 |  | object | message,
 |  | bool | forwardAsWebhook = false
 | ) |  |

Sends a message to a public channel which this client subscribed to.

Before you publish to a channel, you have to subscribe it. Everyone in that channel will get the message.

Parameters
channelName | Name of the channel to publish to.
message | Your message (string or any serializable data).
forwardAsWebhook | Optionally, public messages can be forwarded as webhooks. Configure webhooks for your Chat app to use this.
Returns
False if the client is not yet ready to send messages.

◆ RemoveFriends()

bool RemoveFriends ( string[] friends )

Removes the provided entries from the list on the Chat Server and stops their status updates.

Photon flushes friends-list when a chat client disconnects. Unless you want to remove individual entries, you don't have to RemoveFriends.

AddFriends and RemoveFriends enable clients to handle their friend list in the Photon Chat server. Having users on your friends list gives you access to their current online status (and whatever info your client sets in it).

Each user can set an online status consisting of an integer and an arbitratry (serializable) object. The object can be null, Hashtable, object[] or anything else Photon can serialize.

The status is published automatically to friends (anyone who set your user ID with AddFriends).

Photon flushes friends-list when a chat client disconnects, so it has to be set each time. If your community API gives you access to online status already, you could filter and set online friends in AddFriends.

Actual friend relations are not persistent and have to be stored outside of Photon.

AddFriends and RemoveFriends enable clients to handle their friend list in the Photon Chat server. Having users on your friends list gives you access to their current online status (and whatever info your client sets in it).

Each user can set an online status consisting of an integer and an arbitratry (serializable) object. The object can be null, Hashtable, object[] or anything else Photon can serialize.

The status is published automatically to friends (anyone who set your user ID with AddFriends).

Actual friend relations are not persistent and have to be stored outside of Photon.

Parameters
friends Array of friend userIds.
Returns
If the operation could be sent.

◆ SendAcksOnly()

void SendAcksOnly ( )

Obsolete: Better use UseBackgroundWorkerForSending and Service().

◆ SendPrivateMessage() [1/2]

bool SendPrivateMessage | ( | string | target,
 |  | object | message,
 |  | bool | encrypt,
 |  | bool | forwardAsWebhook
 | ) |  |

Sends a private message to a single target user. Calls OnPrivateMessage on the receiving client.

Parameters
target | Username to send this message to.
message | The message you want to send. Can be a simple string or anything serializable.
encrypt | Optionally, private messages can be encrypted. Encryption is not end-to-end as the server decrypts the message.
forwardAsWebhook | Optionally, private messages can be forwarded as webhooks. Configure webhooks for your Chat app to use this.
Returns
True if this clients can send the message to the server.

◆ SendPrivateMessage() [2/2]

bool SendPrivateMessage | ( | string | target,
 |  | object | message,
 |  | bool | forwardAsWebhook = false
 | ) |  |

Sends a private message to a single target user. Calls OnPrivateMessage on the receiving client.

Parameters
target | Username to send this message to.
message | The message you want to send. Can be a simple string or anything serializable.
forwardAsWebhook | Optionally, private messages can be forwarded as webhooks. Configure webhooks for your Chat app to use this.
Returns
True if this clients can send the message to the server.

◆ Service()

void Service ( )

Must be called regularly to keep connection between client and server alive and to process incoming messages.

This method limits the effort it does automatically using the private variable msDeltaForServiceCalls. That value is lower for connect and multiplied by 4 when chat-server connection is ready.

◆ SetOnlineStatus() [1/2]

bool SetOnlineStatus ( int status )

Sets the user's status without changing your status-message.

The predefined status values can be found in class ChatUserStatus. State ChatUserStatus.Invisible will make you offline for everyone and send no message.

You can set custom values in the status integer. Aside from the pre-configured ones, all states will be considered visible and online. Else, no one would see the custom state.

This overload does not change the set message.

Parameters
status Predefined states are in class ChatUserStatus. Other values can be used at will.
Returns
True if the operation gets called on the server.

◆ SetOnlineStatus() [2/2]

bool SetOnlineStatus | ( | int | status,
 |  | object | message
 | ) |  |

Sets the user's status without changing your status-message.

The predefined status values can be found in class ChatUserStatus. State ChatUserStatus.Invisible will make you offline for everyone and send no message.

You can set custom values in the status integer. Aside from the pre-configured ones, all states will be considered visible and online. Else, no one would see the custom state.

The message object can be anything that Photon can serialize, including (but not limited to) Hashtable, object[] and string. This value is defined by your own conventions.

Parameters
status | Predefined states are in class ChatUserStatus. Other values can be used at will.
message | Also sets a status-message which your friends can get.
Returns
True if the operation gets called on the server.

◆ StopThread()

void StopThread ( )

Locally shuts down the connection to the Chat Server. This resets states locally but the server will have to timeout this peer.

◆ Subscribe() [1/4]

bool Subscribe | ( | string | channel,
 |  | int | lastMsgId = 0,
 |  | int | messagesFromHistory = -1,
 |  | ChannelCreationOptions | creationOptions = null
 | ) |  |

Subscribe to a single channel and optionally sets its well-know channel properties in case the channel is created.

Parameters
channel | name of the channel to subscribe to
lastMsgId | ID of the last received message from this channel when re subscribing to receive only missed messages, default is 0
messagesFromHistory | how many missed messages to receive from history, default is -1 (available history). 0 will get you no items. Positive values are capped by a server side limit.
creationOptions | options to be used in case the channel to subscribe to will be created.
Returns

◆ Subscribe() [2/4]

bool Subscribe ( string[] channels )

Sends operation to subscribe to a list of channels by name.

Parameters
channels List of channels to subscribe to. Avoid null or empty values.
Returns
If the operation could be sent at all (Example: Fails if not connected to Chat Server).

◆ Subscribe() [3/4]

bool Subscribe | ( | string[] | channels,
 |  | int | messagesFromHistory
 | ) |  |

Sends operation to subscribe client to channels, optionally fetching a number of messages from the cache.

Subscribes channels will forward new messages to this user. Use PublishMessage to do so. The messages cache is limited but can be useful to get into ongoing conversations, if that's needed.

Parameters
channels | List of channels to subscribe to. Avoid null or empty values.
messagesFromHistory | 0: no history. 1 and higher: number of messages in history. -1: all available history.
Returns
If the operation could be sent at all (Example: Fails if not connected to Chat Server).

◆ Subscribe() [4/4]

bool Subscribe | ( | string[] | channels,
 |  | int[] | lastMsgIds
 | ) |  |

Sends operation to subscribe to a list of channels by name and possibly retrieve messages we did not receive while unsubscribed.

Parameters
channels | List of channels to subscribe to. Avoid null or empty values.
lastMsgIds | ID of last message received per channel. Useful when re subscribing to receive only messages we missed.
Returns
If the operation could be sent at all (Example: Fails if not connected to Chat Server).

◆ TryGetChannel() [1/2]

bool TryGetChannel | ( | string | channelName,
 |  | bool | isPrivate,
 |  | out ChatChannel | channel
 | ) |  |

Simplified access to either private or public channels by name.

Parameters
channelName | Name of the channel to get. For private channels, the channel-name is composed of both user's names.
isPrivate | Define if you expect a private or public channel.
channel | Out parameter gives you the found channel, if any.
Returns
True if the channel was found.

Public channels exist only when subscribed to them. Private channels exist only when at least one message is exchanged with the target user privately.

◆ TryGetChannel() [2/2]

bool TryGetChannel | ( | string | channelName,
 |  | out ChatChannel | channel
 | ) |  |

Simplified access to all channels by name. Checks public channels first, then private ones.

Parameters
channelName | Name of the channel to get.
channel | Out parameter gives you the found channel, if any.
Returns
True if the channel was found.

Public channels exist only when subscribed to them. Private channels exist only when at least one message is exchanged with the target user privately.

◆ TryGetPrivateChannelByUser()

bool TryGetPrivateChannelByUser | ( | string | userId,
 |  | out ChatChannel | channel
 | ) |  |

Simplified access to private channels by target user.

Parameters
userId | UserId of the target user in the private channel.
channel | Out parameter gives you the found channel, if any.
Returns
True if the channel was found.

◆ Unsubscribe()

bool Unsubscribe ( string[] channels )

Unsubscribes from a list of channels, which stops getting messages from those.

The client will remove these channels from the PublicChannels dictionary once the server sent a response to this request.

The request will be sent to the server and IChatClientListener.OnUnsubscribed gets called when the server actually removed the channel subscriptions.

Unsubscribe will fail if you include null or empty channel names.

Parameters
channels Names of channels to unsubscribe.
Returns
False, if not connected to a chat server.

Member Data Documentation

◆ chatPeer

ChatPeer chatPeer = null

The Chat Peer used by this client.

◆ DefaultMaxSubscribers

const int DefaultMaxSubscribers = 100
static

Default maximum value possible for ChatChannel.MaxSubscribers when ChatChannel.PublishSubscribers is enabled

◆ MessageLimit

int MessageLimit

If greater than 0, new channels will limit the number of messages they cache locally.

This can be useful to limit the amount of memory used by chats. You can set a MessageLimit per channel but this value gets applied to new ones.

Note: Changing this value, does not affect ChatChannels that are already in use!

◆ PrivateChannels

readonly Dictionary<string, ChatChannel> PrivateChannels

Private channels in which this client has exchanged messages.

◆ PrivateChatHistoryLength

int PrivateChatHistoryLength = -1

Limits the number of messages from private channel histories.

This is applied to all private channels on reconnect, as there is no explicit re-joining private channels.
Default is -1, which gets available messages up to a maximum set by the server.
A value of 0 gets you zero messages.
The server's limit of messages may be lower. If so, the server's value will overrule this.

◆ PublicChannels

readonly Dictionary<string, ChatChannel> PublicChannels

Public channels this client is subscribed to.

Property Documentation

◆ AppId

string AppId
get

The AppID as assigned from the Photon Cloud.

◆ AppVersion

string AppVersion
get

The version of your client. A new version also creates a new "virtual app" to separate players from older client versions.

◆ AuthValues

AuthenticationValues AuthValues
getset

Settable only before you connect!

◆ CanChat

bool CanChat
get

Checks if this client is ready to send messages.

◆ ChatRegion

string ChatRegion
getset

Settable only before you connect! Defaults to "EU".

◆ DebugOut

DebugLevel DebugOut
getset

Sets the level (and amount) of debug output provided by the library.

This affects the callbacks to IChatClientListener.DebugReturn. Default Level: Error.

◆ DisconnectedCause

ChatDisconnectCause DisconnectedCause
get

Disconnection cause. Check this inside IChatClientListener.OnDisconnected.

◆ EnableProtocolFallback

bool EnableProtocolFallback
getset

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

When connecting to the Name Server fails for a first time, the client will select an alternative network protocol and re-try to connect.

The fallback will use the default Name Server port as defined by ProtocolToNameServerPort.

The fallback for TCP is UDP. All other protocols fallback to TCP.

◆ FrontendAddress

string FrontendAddress
get

The address of the actual chat server assigned from NameServer. Public for read only.

◆ NameServerAddress

string NameServerAddress
get

The address of last connected Name Server.

◆ SocketImplementationConfig

Dictionary<ConnectionProtocol, Type> SocketImplementationConfig
get

Defines which IPhotonSocket class to use per ConnectionProtocol.

Several platforms have special Socket implementations and slightly different APIs. To accomodate this, switching the socket implementation for a network protocol was made available. By default, UDP and TCP have socket implementations assigned.

You only need to set the SocketImplementationConfig once, after creating a PhotonPeer and before connecting. If you switch the TransportProtocol, the correct implementation is being used.

◆ State

ChatState State
get

Current state of the ChatClient. Also use CanChat.

◆ TransportProtocol

ConnectionProtocol? TransportProtocol
getset

Exposes the TransportProtocol of the used PhotonPeer. Settable while not connected.

◆ UseBackgroundWorkerForSending

bool UseBackgroundWorkerForSending
getset

Defines if a background thread will call SendOutgoingCommands, while your code calls Service to dispatch received messages.

The benefit of using a background thread to call SendOutgoingCommands is this:

Even if your game logic is being paused, the background thread will keep the connection to the server up. On a lower level, acknowledgements and pings will prevent a server-side timeout while (e.g.) Unity loads assets.

Your game logic still has to call Service regularly, or else incoming messages are not dispatched. As this typically triggers UI updates, it's easier to call Service from the main/UI thread.

◆ UserId

string? UserId
get

The unique ID of a user/person, stored in AuthValues.UserId. Set it before you connect.

This value wraps AuthValues.UserId. It's not a nickname and we assume users with the same userID are the same person.


Photon Unity Networking 2: ChatEventCode Class Reference

  • Chat
  • ChatEventCode
Static Public Attributes | List of all members
ChatEventCode Class Reference

Wraps up internally used constants in Photon Chat events. You don't have to use them directly usually. More...

Static Public Attributes

const byte | ChatMessages = 0
(0) Event code for messages published in public channels. More...
const byte | Users = 1
(1) Not Used. More...
const byte | PrivateMessage = 2
(2) Event code for messages published in private channels More...
const byte | FriendsList = 3
(3) Not Used. More...
const byte | StatusUpdate = 4
(4) Event code for status updates. More...
const byte | Subscribe = 5
(5) Event code for subscription acks. More...
const byte | Unsubscribe = 6
(6) Event code for unsubscribe acks. More...
const byte | PropertiesChanged = 7
(7) Event code for properties update. More...
const byte | UserSubscribed = 8
(8) Event code for new user subscription to a channel where ChatChannel.PublishSubscribers is enabled. More...
const byte | UserUnsubscribed = 9
(9) Event code for when user unsubscribes from a channel where ChatChannel.PublishSubscribers is enabled. More...
const byte | ErrorInfo = 10
(10) Event code for when the server sends an error to the client. More...

Detailed Description

Wraps up internally used constants in Photon Chat events. You don't have to use them directly usually.

Member Data Documentation

◆ ChatMessages

const byte ChatMessages = 0
static

(0) Event code for messages published in public channels.

◆ ErrorInfo

const byte ErrorInfo = 10
static

(10) Event code for when the server sends an error to the client.

This is currently only used by Chat WebHooks.

◆ FriendsList

const byte FriendsList = 3
static

(3) Not Used.

◆ PrivateMessage

const byte PrivateMessage = 2
static

(2) Event code for messages published in private channels

◆ PropertiesChanged

const byte PropertiesChanged = 7
static

(7) Event code for properties update.

◆ StatusUpdate

const byte StatusUpdate = 4
static

(4) Event code for status updates.

◆ Subscribe

const byte Subscribe = 5
static

(5) Event code for subscription acks.

◆ Unsubscribe

const byte Unsubscribe = 6
static

(6) Event code for unsubscribe acks.

◆ Users

const byte Users = 1
static

(1) Not Used.

◆ UserSubscribed

const byte UserSubscribed = 8
static

(8) Event code for new user subscription to a channel where ChatChannel.PublishSubscribers is enabled.

◆ UserUnsubscribed

const byte UserUnsubscribed = 9
static

(9) Event code for when user unsubscribes from a channel where ChatChannel.PublishSubscribers is enabled.


Photon Unity Networking 2: ChatOperationCode Class Reference

  • Chat
  • ChatOperationCode
Static Public Attributes | List of all members
ChatOperationCode Class Reference

Wraps up codes for operations used internally in Photon Chat. You don't have to use them directly usually. More...

Static Public Attributes

const byte | Authenticate = 230
(230) Operation Authenticate. More...
const byte | Subscribe = 0
(0) Operation to subscribe to chat channels. More...
const byte | Unsubscribe = 1
(1) Operation to unsubscribe from chat channels. More...
const byte | Publish = 2
(2) Operation to publish a message in a chat channel. More...
const byte | SendPrivate = 3
(3) Operation to send a private message to some other user. More...
const byte | ChannelHistory = 4
(4) Not used yet. More...
const byte | UpdateStatus = 5
(5) Set your (client's) status. More...
const byte | AddFriends = 6
(6) Add friends the list of friends that should update you of their status. More...
const byte | RemoveFriends = 7
(7) Remove friends from list of friends that should update you of their status. More...
const byte | SetProperties = 8
(8) Operation to set properties of public chat channel or users in public chat channels. More...

Detailed Description

Wraps up codes for operations used internally in Photon Chat. You don't have to use them directly usually.

Member Data Documentation

◆ AddFriends

const byte AddFriends = 6
static

(6) Add friends the list of friends that should update you of their status.

◆ Authenticate

const byte Authenticate = 230
static

(230) Operation Authenticate.

◆ ChannelHistory

const byte ChannelHistory = 4
static

(4) Not used yet.

◆ Publish

const byte Publish = 2
static

(2) Operation to publish a message in a chat channel.

◆ RemoveFriends

const byte RemoveFriends = 7
static

(7) Remove friends from list of friends that should update you of their status.

◆ SendPrivate

const byte SendPrivate = 3
static

(3) Operation to send a private message to some other user.

◆ SetProperties

const byte SetProperties = 8
static

(8) Operation to set properties of public chat channel or users in public chat channels.

◆ Subscribe

const byte Subscribe = 0
static

(0) Operation to subscribe to chat channels.

◆ Unsubscribe

const byte Unsubscribe = 1
static

(1) Operation to unsubscribe from chat channels.

◆ UpdateStatus

const byte UpdateStatus = 5
static

(5) Set your (client's) status.


Photon Unity Networking 2: ChatParameterCode Class Reference

  • Chat
  • ChatParameterCode
Static Public Attributes | List of all members
ChatParameterCode Class Reference

Wraps up codes for parameters (in operations and events) used internally in Photon Chat. You don't have to use them directly usually. More...

Static Public Attributes

const byte | Channels = 0
(0) Array of chat channels. More...
const byte | Channel = 1
(1) Name of a single chat channel. More...
const byte | Messages = 2
(2) Array of chat messages. More...
const byte | Message = 3
(3) A single chat message. More...
const byte | Senders = 4
(4) Array of names of the users who sent the array of chat messages. More...
const byte | Sender = 5
(5) Name of a the user who sent a chat message. More...
const byte | ChannelUserCount = 6
(6) Not used. More...
const byte | UserId = 225
(225) Name of user to send a (private) message to. More...
const byte | MsgId = 8
(8) Id of a message. More...
const byte | MsgIds = 9
(9) Not used. More...
const byte | Secret = 221
(221) Secret token to identify an authorized user. More...
const byte | SubscribeResults = 15
(15) Subscribe operation result parameter. A bool[] with result per channel. More...
const byte | Status = 10
(10) Status More...
const byte | Friends = 11
(11) Friends More...
const byte | SkipMessage = 12
(12) SkipMessage is used in SetOnlineStatus and if true, the message is not being broadcast. More...
const byte | HistoryLength = 14
(14) Number of message to fetch from history. 0: no history. 1 and higher: number of messages in history. -1: all history. More...
const byte | DebugMessage = 17
const byte | WebFlags = 21
(21) WebFlags object for changing behaviour of webhooks from client. More...
const byte | Properties = 22
(22) WellKnown or custom properties of channel or user. More...
const byte | ChannelSubscribers = 23
(23) Array of UserIds of users already subscribed to a channel. More...
const byte | DebugData = 24
(24) Optional data sent in ErrorInfo event from Chat WebHooks. More...
const byte | ExpectedValues = 25
(25) Code for values to be used for "Check And Swap" (CAS) when changing properties. More...
const byte | Broadcast = 26
(26) Code for broadcast parameter of ChatOperationCode.SetProperties method. More...
const byte | UserProperties = 28
WellKnown and custom user properties. More...
const byte | UniqueRoomId = 29
Generated unique reusable room id More...

Detailed Description

Wraps up codes for parameters (in operations and events) used internally in Photon Chat. You don't have to use them directly usually.

Member Data Documentation

◆ Broadcast

const byte Broadcast = 26
static

(26) Code for broadcast parameter of ChatOperationCode.SetProperties method.

◆ Channel

const byte Channel = 1
static

(1) Name of a single chat channel.

◆ Channels

const byte Channels = 0
static

(0) Array of chat channels.

◆ ChannelSubscribers

const byte ChannelSubscribers = 23
static

(23) Array of UserIds of users already subscribed to a channel.

Used in Subscribe event when PublishSubscribers is enabled. Does not include local user who just subscribed. Maximum length is (ChatChannel.MaxSubscribers - 1).

◆ ChannelUserCount

const byte ChannelUserCount = 6
static

(6) Not used.

◆ DebugData

const byte DebugData = 24
static

(24) Optional data sent in ErrorInfo event from Chat WebHooks.

◆ ExpectedValues

const byte ExpectedValues = 25
static

(25) Code for values to be used for "Check And Swap" (CAS) when changing properties.

◆ Friends

const byte Friends = 11
static

(11) Friends

◆ HistoryLength

const byte HistoryLength = 14
static

(14) Number of message to fetch from history. 0: no history. 1 and higher: number of messages in history. -1: all history.

◆ Message

const byte Message = 3
static

(3) A single chat message.

◆ Messages

const byte Messages = 2
static

(2) Array of chat messages.

◆ MsgId

const byte MsgId = 8
static

(8) Id of a message.

◆ MsgIds

const byte MsgIds = 9
static

(9) Not used.

◆ Properties

const byte Properties = 22
static

(22) WellKnown or custom properties of channel or user.

In event ChatEventCode.Subscribe it's always channel properties, in event ChatEventCode.UserSubscribed it's always user properties, in event ChatEventCode.PropertiesChanged it's channel properties unless UserId parameter value is not null

◆ Secret

const byte Secret = 221
static

(221) Secret token to identify an authorized user.

The code is used in LoadBalancing and copied over here.

◆ Sender

const byte Sender = 5
static

(5) Name of a the user who sent a chat message.

◆ Senders

const byte Senders = 4
static

(4) Array of names of the users who sent the array of chat messages.

◆ SkipMessage

const byte SkipMessage = 12
static

(12) SkipMessage is used in SetOnlineStatus and if true, the message is not being broadcast.

◆ Status

const byte Status = 10
static

(10) Status

◆ SubscribeResults

const byte SubscribeResults = 15
static

(15) Subscribe operation result parameter. A bool[] with result per channel.

◆ UniqueRoomId

const byte UniqueRoomId = 29
static

Generated unique reusable room id

◆ UserId

const byte UserId = 225
static

(225) Name of user to send a (private) message to.

The code is used in LoadBalancing and copied over here.

◆ UserProperties

const byte UserProperties = 28
static

WellKnown and custom user properties.

Used only in event ChatEventCode.Subscribe

◆ WebFlags

const byte WebFlags = 21
static

(21) WebFlags object for changing behaviour of webhooks from client.


Photon Unity Networking 2: ChatPeer Class Reference

  • Chat
  • ChatPeer
Public Member Functions | Public Attributes | Properties | List of all members
ChatPeer Class Reference

Provides basic operations of the Photon Chat server. This internal class is used by public ChatClient. More...

Inherits PhotonPeer.

Public Member Functions

ChatPeer (IPhotonPeerListener listener, ConnectionProtocol protocol)
Chat Peer constructor. More...
bool | Connect ()
Connects to NameServer. More...
bool | AuthenticateOnNameServer (string appId, string appVersion, string region, AuthenticationValues authValues)
Authenticates on NameServer. More...

Public Attributes

string | NameServerHost = "ns.photonengine.io"
Name Server Host Name for Photon Cloud. Without port and without any prefix. More...
ushort | NameServerPortOverride
If not zero, this is used for the name server port on connect. Independent of protocol (so this better matches). Set by ChatClient.ConnectUsingSettings. More...

Properties

string NameServerAddress [get]
Name Server Address for Photon Cloud (based on current protocol). You can use the default values and usually won't have to set this value. More...

Detailed Description

Provides basic operations of the Photon Chat server. This internal class is used by public ChatClient.

Constructor & Destructor Documentation

◆ ChatPeer()

ChatPeer | ( | IPhotonPeerListener | listener,
 |  | ConnectionProtocol | protocol
 | ) |  |

Chat Peer constructor.

Parameters
listener | Chat listener implementation.
protocol | Protocol to be used by the peer.

Member Function Documentation

◆ AuthenticateOnNameServer()

bool AuthenticateOnNameServer | ( | string | appId,
 |  | string | appVersion,
 |  | string | region,
 |  | AuthenticationValues | authValues
 | ) |  |

Authenticates on NameServer.

Returns
If the authentication operation request could be sent.

◆ Connect()

bool Connect ( )

Connects to NameServer.

Returns
If the connection attempt could be sent.

Member Data Documentation

◆ NameServerHost

string NameServerHost = "ns.photonengine.io"

Name Server Host Name for Photon Cloud. Without port and without any prefix.

◆ NameServerPortOverride

ushort NameServerPortOverride

If not zero, this is used for the name server port on connect. Independent of protocol (so this better matches). Set by ChatClient.ConnectUsingSettings.

This is reset when the protocol fallback is used.

Property Documentation

◆ NameServerAddress

string NameServerAddress
get

Name Server Address for Photon Cloud (based on current protocol). You can use the default values and usually won't have to set this value.


Photon Unity Networking 2: ChatUserStatus Class Reference

  • Chat
  • ChatUserStatus
Static Public Attributes | List of all members
ChatUserStatus Class Reference

Contains commonly used status values for SetOnlineStatus. You can define your own. More...

Static Public Attributes

const int | Offline = 0
(0) Offline. More...
const int | Invisible = 1
(1) Be invisible to everyone. Sends no message. More...
const int | Online = 2
(2) Online and available. More...
const int | Away = 3
(3) Online but not available. More...
const int | DND = 4
(4) Do not disturb. More...
const int | LFG = 5
(5) Looking For Game/Group. Could be used when you want to be invited or do matchmaking. More...
const int | Playing = 6
(6) Could be used when in a room, playing. More...

Detailed Description

Contains commonly used status values for SetOnlineStatus. You can define your own.

While "online" (value 2 and up), the status message will be sent to anyone who has you on his friend list.

Define custom online status values as you like with these rules: 0: Means "offline". It will be used when you are not connected. In this status, there is no status message. 1: Means "invisible" and is sent to friends as "offline". They see status 0, no message but you can chat. 2: And any higher value will be treated as "online". Status can be set.

Member Data Documentation

◆ Away

const int Away = 3
static

(3) Online but not available.

◆ DND

const int DND = 4
static

(4) Do not disturb.

◆ Invisible

const int Invisible = 1
static

(1) Be invisible to everyone. Sends no message.

◆ LFG

const int LFG = 5
static

(5) Looking For Game/Group. Could be used when you want to be invited or do matchmaking.

◆ Offline

const int Offline = 0
static

(0) Offline.

◆ Online

const int Online = 2
static

(2) Online and available.

◆ Playing

const int Playing = 6
static

(6) Could be used when in a room, playing.


Photon Unity Networking 2: ErrorCode Class Reference

  • Chat
  • ErrorCode
Static Public Attributes | List of all members
ErrorCode Class Reference

ErrorCode defines the default codes associated with Photon client/server communication. More...

Static Public Attributes

const int | Ok = 0
(0) is always "OK", anything else an error or specific situation. More...
const int | OperationNotAllowedInCurrentState = -3
(-3) Operation can't be executed yet (e.g. OpJoin can't be called before being authenticated, RaiseEvent cant be used before getting into a room). More...
const int | InvalidOperationCode = -2
(-2) The operation you called is not implemented on the server (application) you connect to. Make sure you run the fitting applications. More...
const int | InternalServerError = -1
(-1) Something went wrong in the server. Try to reproduce and contact Exit Games. More...
const int | InvalidAuthentication = 0x7FFF
(32767) Authentication failed. Possible cause: AppId is unknown to Photon (in cloud service). More...
const int | GameIdAlreadyExists = 0x7FFF - 1
(32766) GameId (name) already in use (can't create another). Change name. More...
const int | GameFull = 0x7FFF - 2
(32765) Game is full. This rarely happens when some player joined the room before your join completed. More...
const int | GameClosed = 0x7FFF - 3
(32764) Game is closed and can't be joined. Join another game. More...
const int | ServerFull = 0x7FFF - 5
(32762) Not in use currently. More...
const int | UserBlocked = 0x7FFF - 6
(32761) Not in use currently. More...
const int | NoRandomMatchFound = 0x7FFF - 7
(32760) Random matchmaking only succeeds if a room exists that is neither closed nor full. Repeat in a few seconds or create a new room. More...
const int | GameDoesNotExist = 0x7FFF - 9
(32758) Join can fail if the room (name) is not existing (anymore). This can happen when players leave while you join. More...
const int | MaxCcuReached = 0x7FFF - 10
(32757) Authorization on the Photon Cloud failed because the concurrent users (CCU) limit of the app's subscription is reached. More...
const int | InvalidRegion = 0x7FFF - 11
(32756) Authorization on the Photon Cloud failed because the app's subscription does not allow to use a particular region's server. More...
const int | CustomAuthenticationFailed = 0x7FFF - 12
(32755) Custom Authentication of the user failed due to setup reasons (see Cloud Dashboard) or the provided user data (like username or token). Check error message for details. More...
const int | AuthenticationTicketExpired = 0x7FF1
(32753) The Authentication ticket expired. Usually, this is refreshed behind the scenes. Connect (and authorize) again. More...

Detailed Description

ErrorCode defines the default codes associated with Photon client/server communication.

Member Data Documentation

◆ AuthenticationTicketExpired

const int AuthenticationTicketExpired = 0x7FF1
static

(32753) The Authentication ticket expired. Usually, this is refreshed behind the scenes. Connect (and authorize) again.

◆ CustomAuthenticationFailed

const int CustomAuthenticationFailed = 0x7FFF - 12
static

(32755) Custom Authentication of the user failed due to setup reasons (see Cloud Dashboard) or the provided user data (like username or token). Check error message for details.

◆ GameClosed

const int GameClosed = 0x7FFF - 3
static

(32764) Game is closed and can't be joined. Join another game.

◆ GameDoesNotExist

const int GameDoesNotExist = 0x7FFF - 9
static

(32758) Join can fail if the room (name) is not existing (anymore). This can happen when players leave while you join.

◆ GameFull

const int GameFull = 0x7FFF - 2
static

(32765) Game is full. This rarely happens when some player joined the room before your join completed.

◆ GameIdAlreadyExists

const int GameIdAlreadyExists = 0x7FFF - 1
static

(32766) GameId (name) already in use (can't create another). Change name.

◆ InternalServerError

const int InternalServerError = -1
static

(-1) Something went wrong in the server. Try to reproduce and contact Exit Games.

◆ InvalidAuthentication

const int InvalidAuthentication = 0x7FFF
static

(32767) Authentication failed. Possible cause: AppId is unknown to Photon (in cloud service).

◆ InvalidOperationCode

const int InvalidOperationCode = -2
static

(-2) The operation you called is not implemented on the server (application) you connect to. Make sure you run the fitting applications.

◆ InvalidRegion

const int InvalidRegion = 0x7FFF - 11
static

(32756) Authorization on the Photon Cloud failed because the app's subscription does not allow to use a particular region's server.

Some subscription plans for the Photon Cloud are region-bound. Servers of other regions can't be used then. Check your master server address and compare it with your Photon Cloud Dashboard's info. https://cloud.photonengine.com/dashboard

OpAuthorize is part of connection workflow but only on the Photon Cloud, this error can happen. Self-hosted Photon servers with a CCU limited license won't let a client connect at all.

◆ MaxCcuReached

const int MaxCcuReached = 0x7FFF - 10
static

(32757) Authorization on the Photon Cloud failed because the concurrent users (CCU) limit of the app's subscription is reached.

Unless you have a plan with "CCU Burst", clients might fail the authentication step during connect. Affected client are unable to call operations. Please note that players who end a game and return to the master server will disconnect and re-connect, which means that they just played and are rejected in the next minute / re-connect. This is a temporary measure. Once the CCU is below the limit, players will be able to connect an play again.

OpAuthorize is part of connection workflow but only on the Photon Cloud, this error can happen. Self-hosted Photon servers with a CCU limited license won't let a client connect at all.

◆ NoRandomMatchFound

const int NoRandomMatchFound = 0x7FFF - 7
static

(32760) Random matchmaking only succeeds if a room exists that is neither closed nor full. Repeat in a few seconds or create a new room.

◆ Ok

const int Ok = 0
static

(0) is always "OK", anything else an error or specific situation.

◆ OperationNotAllowedInCurrentState

const int OperationNotAllowedInCurrentState = -3
static

(-3) Operation can't be executed yet (e.g. OpJoin can't be called before being authenticated, RaiseEvent cant be used before getting into a room).

Before you call any operations on the Cloud servers, the automated client workflow must complete its authorization. In PUN, wait until State is: JoinedLobby or ConnectedToMaster

◆ ServerFull

const int ServerFull = 0x7FFF - 5
static

(32762) Not in use currently.

◆ UserBlocked

const int UserBlocked = 0x7FFF - 6
static

(32761) Not in use currently.


Photon Unity Networking 2: IChatClientListener Interface Reference

  • Chat
  • IChatClientListener
Public Member Functions | List of all members
IChatClientListener Interface Reference

Callback interface for Chat client side. Contains callback methods to notify your app about updates. Must be provided to new ChatClient in constructor More...

Public Member Functions

void | DebugReturn (DebugLevel level, string message)
All debug output of the library will be reported through this method. Print it or put it in a buffer to use it on-screen. More...
void | OnDisconnected ()
Disconnection happened. More...
void | OnConnected ()
Client is connected now. More...
void | OnChatStateChange (ChatState state)
The ChatClient's state changed. Usually, OnConnected and OnDisconnected are the callbacks to react to. More...
void | OnGetMessages (string channelName, string[] senders, object[] messages)
Notifies app that client got new messages from server Number of senders is equal to number of messages in 'messages'. Sender with number '0' corresponds to message with number '0', sender with number '1' corresponds to message with number '1' and so on More...
void | OnPrivateMessage (string sender, object message, string channelName)
Notifies client about private message More...
void | OnSubscribed (string[] channels, bool[] results)
Result of Subscribe operation. Returns subscription result for every requested channel name. More...
void | OnUnsubscribed (string[] channels)
Result of Unsubscribe operation. Returns for channel name if the channel is now unsubscribed. More...
void | OnStatusUpdate (string user, int status, bool gotMessage, object message)
New status of another user (you get updates for users set in your friends list). More...
void | OnUserSubscribed (string channel, string user)
A user has subscribed to a public chat channel More...
void | OnUserUnsubscribed (string channel, string user)
A user has unsubscribed from a public chat channel More...

Detailed Description

Callback interface for Chat client side. Contains callback methods to notify your app about updates. Must be provided to new ChatClient in constructor

Member Function Documentation

◆ DebugReturn()

void DebugReturn | ( | DebugLevel | level,
 |  | string | message
 | ) |  |

All debug output of the library will be reported through this method. Print it or put it in a buffer to use it on-screen.

Parameters
level | DebugLevel (severity) of the message.
message | Debug text. Print to System.Console or screen.

◆ OnChatStateChange()

void OnChatStateChange ( ChatState state )

The ChatClient's state changed. Usually, OnConnected and OnDisconnected are the callbacks to react to.

Parameters
state The new state.

◆ OnConnected()

void OnConnected ( )

Client is connected now.

Clients have to be connected before they can send their state, subscribe to channels and send any messages.

◆ OnDisconnected()

void OnDisconnected ( )

Disconnection happened.

◆ OnGetMessages()

void OnGetMessages | ( | string | channelName,
 |  | string[] | senders,
 |  | object[] | messages
 | ) |  |

Notifies app that client got new messages from server Number of senders is equal to number of messages in 'messages'. Sender with number '0' corresponds to message with number '0', sender with number '1' corresponds to message with number '1' and so on

Parameters
channelName | channel from where messages came
senders | list of users who sent messages
messages | list of messages it self

◆ OnPrivateMessage()

void OnPrivateMessage | ( | string | sender,
 |  | object | message,
 |  | string | channelName
 | ) |  |

Notifies client about private message

Parameters
sender | user who sent this message
message | message it self
channelName | channelName for private messages (messages you sent yourself get added to a channel per target username)

◆ OnStatusUpdate()

void OnStatusUpdate | ( | string | user,
 |  | int | status,
 |  | bool | gotMessage,
 |  | object | message
 | ) |  |

New status of another user (you get updates for users set in your friends list).

Parameters
user | Name of the user.
status | New status of that user.
gotMessage | True if the status contains a message you should cache locally. False: This status update does not include a message (keep any you have).
message | Message that user set.

◆ OnSubscribed()

void OnSubscribed | ( | string[] | channels,
 |  | bool[] | results
 | ) |  |

Result of Subscribe operation. Returns subscription result for every requested channel name.

If multiple channels sent in Subscribe operation, OnSubscribed may be called several times, each call with part of sent array or with single channel in "channels" parameter. Calls order and order of channels in "channels" parameter may differ from order of channels in "channels" parameter of Subscribe operation.

Parameters
channels | Array of channel names.
results | Per channel result if subscribed.

◆ OnUnsubscribed()

void OnUnsubscribed ( string[] channels )

Result of Unsubscribe operation. Returns for channel name if the channel is now unsubscribed.

If multiple channels sent in Unsubscribe operation, OnUnsubscribed may be called several times, each call with part of sent array or with single channel in "channels" parameter. Calls order and order of channels in "channels" parameter may differ from order of channels in "channels" parameter of Unsubscribe operation.

Parameters
channels Array of channel names that are no longer subscribed.

◆ OnUserSubscribed()

void OnUserSubscribed | ( | string | channel,
 |  | string | user
 | ) |  |

A user has subscribed to a public chat channel

Parameters
channel | Name of the chat channel
user | UserId of the user who subscribed

◆ OnUserUnsubscribed()

void OnUserUnsubscribed | ( | string | channel,
 |  | string | user
 | ) |  |

A user has unsubscribed from a public chat channel

Parameters
channel | Name of the chat channel
user | UserId of the user who unsubscribed


Photon Unity Networking 2: ParameterCode Class Reference

  • Chat
  • ParameterCode
Static Public Attributes | List of all members
ParameterCode Class Reference

Class for constants. Codes for parameters of Operations and Events. More...

Static Public Attributes

const byte | ApplicationId = 224
(224) Your application's ID: a name on your own Photon or a GUID on the Photon Cloud More...
const byte | Secret = 221
(221) Internally used to establish encryption More...
const byte | AppVersion = 220
(220) Version of your application More...
const byte | ClientAuthenticationType = 217
(217) This key's (byte) value defines the target custom authentication type/service the client connects with. Used in OpAuthenticate More...
const byte | ClientAuthenticationParams = 216
(216) This key's (string) value provides parameters sent to the custom authentication type/service the client connects with. Used in OpAuthenticate More...
const byte | ClientAuthenticationData = 214
(214) This key's (string or byte[]) value provides parameters sent to the custom authentication service setup in Photon Dashboard. Used in OpAuthenticate More...
const byte | Region = 210
(210) Used for region values in OpAuth and OpGetRegions. More...
const byte | Address = 230
(230) Address of a (game) server to use. More...
const byte | UserId = 225
(225) User's ID More...

Detailed Description

Class for constants. Codes for parameters of Operations and Events.

Member Data Documentation

◆ Address

const byte Address = 230
static

(230) Address of a (game) server to use.

◆ ApplicationId

const byte ApplicationId = 224
static

(224) Your application's ID: a name on your own Photon or a GUID on the Photon Cloud

◆ AppVersion

const byte AppVersion = 220
static

(220) Version of your application

◆ ClientAuthenticationData

const byte ClientAuthenticationData = 214
static

(214) This key's (string or byte[]) value provides parameters sent to the custom authentication service setup in Photon Dashboard. Used in OpAuthenticate

◆ ClientAuthenticationParams

const byte ClientAuthenticationParams = 216
static

(216) This key's (string) value provides parameters sent to the custom authentication type/service the client connects with. Used in OpAuthenticate

◆ ClientAuthenticationType

const byte ClientAuthenticationType = 217
static

(217) This key's (byte) value defines the target custom authentication type/service the client connects with. Used in OpAuthenticate

◆ Region

const byte Region = 210
static

(210) Used for region values in OpAuth and OpGetRegions.

◆ Secret

const byte Secret = 221
static

(221) Internally used to establish encryption

◆ UserId

const byte UserId = 225
static

(225) User's ID


Photon Unity Networking 2: Photon.Pun Namespace Reference

  • Pun
Namespaces | Classes | Typedefs | Enumerations
Photon.Pun Namespace Reference

Classes

class | CustomTypes
Internally used class, containing de/serialization method for PUN specific classes.
class | DefaultPool
The default implementation of a PrefabPool for PUN, which actually Instantiates and Destroys GameObjects but pools a resource. More...
struct | InstantiateParameters
interface | IOnPhotonViewControllerChange
This interface defines a callback for changes to the PhotonView's controller. More...
interface | IOnPhotonViewOwnerChange
This interface defines a callback for changes to the PhotonView's owner. More...
interface | IOnPhotonViewPreNetDestroy
This interface defines a callback which fires prior to the PhotonNetwork destroying the PhotonView and Gameobject. More...
interface | IPhotonViewCallback
Empty Base class for all PhotonView callbacks. More...
interface | IPunInstantiateMagicCallback
interface | IPunObservable
Defines the OnPhotonSerializeView method to make it easy to implement correctly for observable scripts. More...
interface | IPunOwnershipCallbacks
Global Callback interface for ownership changes. These callbacks will fire for changes to ANY PhotonView that changes. Consider using IOnPhotonViewControllerChange for callbacks from a specific PhotonView. More...
interface | IPunPrefabPool
Defines an interface for object pooling, used in PhotonNetwork.Instantiate and PhotonNetwork.Destroy. More...
class | MonoBehaviourPun
This class adds the property photonView, while logging a warning when your game still uses the networkView. More...
class | MonoBehaviourPunCallbacks
This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use. More...
class | NestedComponentUtilities
class | PhotonAnimatorView
This class helps you to synchronize Mecanim animations Simply add the component to your GameObject and make sure that the PhotonAnimatorView is added to the list of observed components More...
class | PhotonHandler
Internal MonoBehaviour that allows Photon to run an Update loop. More...
struct | PhotonMessageInfo
Container class for info about a particular message, RPC or update. More...
class | PhotonNetwork
The main class to use the PhotonNetwork plugin. This class is static. More...
class | PhotonRigidbody2DView
class | PhotonRigidbodyView
class | PhotonStream
This container is used in OnPhotonSerializeView() to either provide incoming data of a PhotonView or for you to provide it. More...
class | PhotonStreamQueue
The PhotonStreamQueue helps you poll object states at higher frequencies than what PhotonNetwork.SendRate dictates and then sends all those states at once when Serialize() is called. On the receiving end you can call Deserialize() and then the stream will roll out the received object states in the same order and timeStep they were recorded in. More...
class | PhotonTransformView
class | PhotonTransformViewClassic
This class helps you to synchronize position, rotation and scale of a GameObject. It also gives you many different options to make the synchronized values appear smooth, even when the data is only send a couple of times per second. Simply add the component to your GameObject and make sure that the PhotonTransformViewClassic is added to the list of observed components More...
class | PhotonTransformViewPositionControl
class | PhotonTransformViewPositionModel
class | PhotonTransformViewRotationControl
class | PhotonTransformViewRotationModel
class | PhotonTransformViewScaleControl
class | PhotonTransformViewScaleModel
class | PhotonView
A PhotonView identifies an object across the network (viewID) and configures how the controlling client updates remote instances. More...
class | PunEvent
Defines Photon event-codes as used by PUN.
class | PunExtensions
Small number of extension methods that make it easier for PUN to work cross-Unity-versions. More...
class | PunRPC
Replacement for RPC attribute with different name. Used to flag methods as remote-callable. More...
class | SceneManagerHelper
class | ServerSettings
Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings. More...

Typedefs

using | Debug = UnityEngine.Debug
using | Hashtable = ExitGames.Client.Photon.Hashtable
using | SupportClassPun = ExitGames.Client.Photon.SupportClass

Enumerations

enum | ConnectMethod
Which PhotonNetwork method was called to connect (which influences the regions we want pinged). More...
enum | PunLogLevel
Used to define the level of logging output created by the PUN classes. Either log errors, info (some more) or full. More...
enum | RpcTarget
Enum of "target" options for RPCs. These define which remote clients get your RPC call. More...
enum | ViewSynchronization
enum | OwnershipOption
Options to define how Ownership Transfer is handled per PhotonView. More...

Enumeration Type Documentation

◆ ConnectMethod

enum ConnectMethod
strong

Which PhotonNetwork method was called to connect (which influences the regions we want pinged).

PhotonNetwork.ConnectUsingSettings will call either ConnectToMaster, ConnectToRegion or ConnectToBest, depending on the settings.

◆ OwnershipOption

enum OwnershipOption
strong

Options to define how Ownership Transfer is handled per PhotonView.

This setting affects how RequestOwnership and TransferOwnership work at runtime.

Enumerator
Fixed

Ownership is fixed. Instantiated objects stick with their creator, room objects always belong to the Master Client.

Takeover

Ownership can be taken away from the current owner who can't object.

Request

Ownership can be requested with PhotonView.RequestOwnership but the current owner has to agree to give up ownership.

The current owner has to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request.


Photon Unity Networking 2: Photon.Pun.UtilityScripts Namespace Reference

  • Pun
  • UtilityScripts
Classes
Photon.Pun.UtilityScripts Namespace Reference

Classes

class | ButtonInsideScrollList
Button inside scroll list will stop scrolling ability of scrollRect container, so that when pressing down on a button and draggin up and down will not affect scrolling. this doesn't do anything if no scrollRect component found in Parent Hierarchy. More...
class | ByteComparer
class | CellTree
Represents the tree accessible from its root node. More...
class | CellTreeNode
Represents a single node of the tree. More...
class | ConnectAndJoinRandom
Simple component to call ConnectUsingSettings and to get into a PUN room easily. More...
class | CountdownTimer
This is a basic, network-synced CountdownTimer based on properties. More...
class | CullArea
Represents the cull area used for network culling. More...
class | CullingHandler
Handles the network culling. More...
class | EventSystemSpawner
Event system spawner. Will add an EventSystem GameObject with an EventSystem component and a StandaloneInputModule component. Use this in additive scene loading context where you would otherwise get a "Multiple EventSystem in scene... this is not supported" error from Unity. More...
class | GraphicToggleIsOnTransition
Use this on toggles texts to have some color transition on the text depending on the isOn State. More...
interface | IPunTurnManagerCallbacks
class | MoveByKeys
Very basic component to move a GameObject by WASD and Space. More...
class | OnClickDestroy
Destroys the networked GameObject either by PhotonNetwork.Destroy or by sending an RPC which calls Object.Destroy(). More...
class | OnClickInstantiate
Instantiates a networked GameObject on click. More...
class | OnClickRpc
This component will instantiate a network GameObject when in a room and the user click on that component's GameObject. Uses PhysicsRaycaster for positioning. More...
class | OnEscapeQuit
This component will quit the application when escape key is pressed More...
class | OnJoinedInstantiate
This component will instantiate a network GameObject when a room is joined More...
class | OnPointerOverTooltip
Set focus to a given photonView when pointed is over More...
class | OnStartDelete
This component will destroy the GameObject it is attached to (in Start()). More...
class | PhotonLagSimulationGui
This MonoBehaviour is a basic GUI for the Photon client's network-simulation feature. It can modify lag (fixed delay), jitter (random lag) and packet loss. More...
class | PhotonStatsGui
Basic GUI to show traffic and health statistics of the connection to Photon, toggled by shift+tab. More...
class | PhotonTeam
class | PhotonTeamExtensions
Extension methods for the Player class that make use of PhotonTeamsManager. More...
class | PhotonTeamsManager
Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension. More...
class | PlayerNumbering
Implements consistent numbering in a room/game with help of room properties. Access them by Player.GetPlayerNumber() extension. More...
class | PlayerNumberingExtensions
Extension used for PlayerRoomIndexing and Player class. More...
class | PointedAtGameObjectInfo
Display ViewId, OwnerActorNr, IsCeneView and IsMine when clicked. More...
class | PunPlayerScores
Scoring system for PhotonPlayer More...
class | PunTeams
Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension. More...
class | PunTurnManager
Pun turnBased Game manager. Provides an Interface (IPunTurnManagerCallbacks) for the typical turn flow and logic, between players Provides Extensions for Player, Room and RoomInfo to feature dedicated api for TurnBased Needs More...
class | ScoreExtensions
class | SmoothSyncMovement
Smoothed out movement for network gameobjects More...
class | StatesGui
Output detailed information about Pun Current states, using the old Unity UI framework. More...
class | TabViewManager
Tab view manager. Handles Tab views activation and deactivation, and provides a Unity Event Callback when a tab was selected. More...
class | TeamExtensions
Extension used for PunTeams and Player class. Wraps access to the player's custom property. More...
class | TextButtonTransition
Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour. More...
class | TextToggleIsOnTransition
Use this on toggles texts to have some color transition on the text depending on the isOn State. More...
class | TurnExtensions


Photon Unity Networking 2: ButtonInsideScrollList Class Reference

  • Pun
  • UtilityScripts
  • ButtonInsideScrollList
List of all members
ButtonInsideScrollList Class Reference

Button inside scroll list will stop scrolling ability of scrollRect container, so that when pressing down on a button and draggin up and down will not affect scrolling. this doesn't do anything if no scrollRect component found in Parent Hierarchy. More...

Inherits MonoBehaviour, IPointerDownHandler, and IPointerUpHandler.

Detailed Description

Button inside scroll list will stop scrolling ability of scrollRect container, so that when pressing down on a button and draggin up and down will not affect scrolling. this doesn't do anything if no scrollRect component found in Parent Hierarchy.


Photon Unity Networking 2: ByteComparer Class Reference

  • Pun
  • UtilityScripts
  • ByteComparer
Public Member Functions | List of all members
ByteComparer Class Reference

Inherits IComparer< byte >.

Public Member Functions

int Compare (byte x, byte y)


Photon Unity Networking 2: CellTree Class Reference

  • Pun
  • UtilityScripts
  • CellTree
Public Member Functions | Properties | List of all members
CellTree Class Reference

Represents the tree accessible from its root node. More...

Public Member Functions

CellTree ()
Default constructor. More...
CellTree (CellTreeNode root)
Constructor to define the root node. More...

Properties

CellTreeNode RootNode [get]
Represents the root node of the cell tree. More...

Detailed Description

Represents the tree accessible from its root node.

Constructor & Destructor Documentation

◆ CellTree() [1/2]

CellTree ( )

Default constructor.

◆ CellTree() [2/2]

CellTree ( CellTreeNode root )

Constructor to define the root node.

Parameters
root The root node of the tree.

Property Documentation

◆ RootNode

CellTreeNode RootNode
get

Represents the root node of the cell tree.


Photon Unity Networking 2: CellTreeNode Class Reference

  • Pun
  • UtilityScripts
  • CellTreeNode
Public Types | Public Member Functions | Public Attributes | List of all members
CellTreeNode Class Reference

Represents a single node of the tree. More...

Public Types

enum ENodeType : byte

Public Member Functions

CellTreeNode ()
Default constructor. More...
CellTreeNode (byte id, ENodeType nodeType, CellTreeNode parent)
Constructor to define the ID and the node type as well as setting a parent node. More...
void | AddChild (CellTreeNode child)
Adds the given child to the node. More...
void | Draw ()
Draws the cell in the editor. More...
void | GetActiveCells (List< byte > activeCells, bool yIsUpAxis, Vector3 position)
Gathers all cell IDs the player is currently inside or nearby. More...
bool | IsPointInsideCell (bool yIsUpAxis, Vector3 point)
Checks if the given point is inside the cell. More...
bool | IsPointNearCell (bool yIsUpAxis, Vector3 point)
Checks if the given point is near the cell. More...

Public Attributes

byte | Id
Represents the unique ID of the cell. More...
Vector3 | Center
Represents the center, top-left or bottom-right position of the cell or the size of the cell. More...
ENodeType | NodeType
Describes the current node type of the cell tree node. More...
CellTreeNode Parent
Reference to the parent node. More...
List< CellTreeNode > | Childs
A list containing all child nodes. More...

Detailed Description

Represents a single node of the tree.

Constructor & Destructor Documentation

◆ CellTreeNode() [1/2]

CellTreeNode ( )

Default constructor.

◆ CellTreeNode() [2/2]

CellTreeNode | ( | byte | id,
 |  | ENodeType | nodeType,
 |  | CellTreeNode | parent
 | ) |  |

Constructor to define the ID and the node type as well as setting a parent node.

Parameters
id | The ID of the cell is used as the interest group.
nodeType | The node type of the cell tree node.
parent | The parent node of the cell tree node.

Member Function Documentation

◆ AddChild()

void AddChild ( CellTreeNode child )

Adds the given child to the node.

Parameters
child The child which is added to the node.

◆ Draw()

void Draw ( )

Draws the cell in the editor.

◆ GetActiveCells()

void GetActiveCells | ( | List< byte > | activeCells,
 |  | bool | yIsUpAxis,
 |  | Vector3 | position
 | ) |  |

Gathers all cell IDs the player is currently inside or nearby.

Parameters
activeCells | The list to add all cell IDs to the player is currently inside or nearby.
yIsUpAxis | Describes if the y-axis is used as up-axis.
position | The current position of the player.

◆ IsPointInsideCell()

bool IsPointInsideCell | ( | bool | yIsUpAxis,
 |  | Vector3 | point
 | ) |  |

Checks if the given point is inside the cell.

Parameters
yIsUpAxis | Describes if the y-axis is used as up-axis.
point | The point to check.
Returns
True if the point is inside the cell, false if the point is not inside the cell.

◆ IsPointNearCell()

bool IsPointNearCell | ( | bool | yIsUpAxis,
 |  | Vector3 | point
 | ) |  |

Checks if the given point is near the cell.

Parameters
yIsUpAxis | Describes if the y-axis is used as up-axis.
point | The point to check.
Returns
True if the point is near the cell, false if the point is too far away.

Member Data Documentation

◆ Center

Vector3 Center

Represents the center, top-left or bottom-right position of the cell or the size of the cell.

◆ Childs

List<CellTreeNode> Childs

A list containing all child nodes.

◆ Id

byte Id

Represents the unique ID of the cell.

◆ NodeType

ENodeType NodeType

Describes the current node type of the cell tree node.

◆ Parent

CellTreeNode Parent

Reference to the parent node.


Photon Unity Networking 2: ConnectAndJoinRandom Class Reference

  • Pun
  • UtilityScripts
  • ConnectAndJoinRandom
Public Member Functions | Public Attributes | List of all members
ConnectAndJoinRandom Class Reference

Simple component to call ConnectUsingSettings and to get into a PUN room easily. More...

Inherits MonoBehaviourPunCallbacks.

Public Member Functions

void | Start ()
void | ConnectNow ()
override void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
override void | OnJoinedLobby ()
Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
override void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
override void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or intentional More...
override void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
- Public Member Functions inherited from MonoBehaviourPunCallbacks
virtual void | OnEnable ()
virtual void | OnDisable ()
virtual void | OnConnected ()
Called to signal that the raw connection got established but before the client can call operation on the server. More...
virtual void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
virtual void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...
virtual void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
virtual void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
virtual void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
virtual void | OnLeftLobby ()
Called after leaving a lobby. More...
virtual void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
virtual void | OnRoomListUpdate (List< RoomInfo > roomList)
Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
virtual void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
virtual void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
virtual void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
virtual void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
virtual void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
virtual void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
virtual void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...
virtual void | OnWebRpcResponse (OperationResponse response)
Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc. More...
virtual void | OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
Called when the Master Server sent an update for the Lobby Statistics. More...
virtual void | OnErrorInfo (ErrorInfo errorInfo)
Called when the client receives an event from the server indicating that an error happened there. More...

Public Attributes

bool | AutoConnect = true
Connect automatically? If false you can set this to true later on or call ConnectUsingSettings in your own scripts. More...
byte | Version = 1
Used as PhotonNetwork.GameVersion. More...
byte | MaxPlayers = 4
Max number of players allowed in room. Once full, a new room will be created by the next connection attemping to join. More...
int | playerTTL = -1

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

Simple component to call ConnectUsingSettings and to get into a PUN room easily.

A custom inspector provides a button to connect in PlayMode, should AutoConnect be false.

Member Function Documentation

◆ OnConnectedToMaster()

override void OnConnectedToMaster ( )
virtual

Called when the client is connected to the Master Server and ready for matchmaking and other tasks.

The list of available rooms won't become available unless you join a lobby via LoadBalancingClient.OpJoinLobby. You can join rooms and create them even without being in a lobby. The default lobby is used in that case.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnDisconnected()

override void OnDisconnected ( DisconnectCause cause )
virtual

Called after disconnecting from the Photon server. It could be a failure or intentional

The reason for this disconnect is provided as DisconnectCause.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnJoinedLobby()

override void OnJoinedLobby ( )
virtual

Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate.

While in the lobby, the roomlist is automatically updated in fixed intervals (which you can't modify in the public cloud). The room list gets available via OnRoomListUpdate.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnJoinedRoom()

override void OnJoinedRoom ( )
virtual

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnJoinRandomFailed()

override void OnJoinRandomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |
virtual

Called when a previous OpJoinRandom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Reimplemented from MonoBehaviourPunCallbacks.

Member Data Documentation

◆ AutoConnect

bool AutoConnect = true

Connect automatically? If false you can set this to true later on or call ConnectUsingSettings in your own scripts.

◆ MaxPlayers

byte MaxPlayers = 4

Max number of players allowed in room. Once full, a new room will be created by the next connection attemping to join.

◆ Version

byte Version = 1

Used as PhotonNetwork.GameVersion.


Photon Unity Networking 2: CountdownTimer Class Reference

  • Pun
  • UtilityScripts
  • CountdownTimer
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Events | List of all members
CountdownTimer Class Reference

This is a basic, network-synced CountdownTimer based on properties. More...

Inherits MonoBehaviourPunCallbacks.

Public Member Functions

delegate void | CountdownTimerHasExpired ()
OnCountdownTimerHasExpired delegate. More...
void | Start ()
override void | OnEnable ()
override void | OnDisable ()
void | Update ()
override void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
- Public Member Functions inherited from MonoBehaviourPunCallbacks
virtual void | OnConnected ()
Called to signal that the raw connection got established but before the client can call operation on the server. More...
virtual void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
virtual void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...
virtual void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
virtual void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
virtual void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
virtual void | OnJoinedLobby ()
Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
virtual void | OnLeftLobby ()
Called after leaving a lobby. More...
virtual void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or intentional More...
virtual void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
virtual void | OnRoomListUpdate (List< RoomInfo > roomList)
Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
virtual void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
virtual void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
virtual void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
virtual void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
virtual void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
virtual void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
virtual void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
virtual void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
virtual void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...
virtual void | OnWebRpcResponse (OperationResponse response)
Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc. More...
virtual void | OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
Called when the Master Server sent an update for the Lobby Statistics. More...
virtual void | OnErrorInfo (ErrorInfo errorInfo)
Called when the client receives an event from the server indicating that an error happened there. More...

Static Public Member Functions

static bool | TryGetStartTime (out int startTimestamp)
static void | SetStartTime ()

Public Attributes

float | Countdown = 5.0f
Text | Text

Static Public Attributes

const string CountdownStartTime = "StartTime"

Events

static CountdownTimerHasExpired OnCountdownTimerHasExpired
Called when the timer has expired. More...

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

This is a basic, network-synced CountdownTimer based on properties.

In order to start the timer, the MasterClient can call SetStartTime() to set the timestamp for the start. The property 'StartTime' then contains the server timestamp when the timer has been started.

In order to subscribe to the CountdownTimerHasExpired event you can call CountdownTimer.OnCountdownTimerHasExpired += OnCountdownTimerIsExpired; from Unity's OnEnable function for example. For unsubscribing simply call CountdownTimer.OnCountdownTimerHasExpired -= OnCountdownTimerIsExpired;.

You can do this from Unity's OnEnable and OnDisable functions.

Member Function Documentation

◆ CountdownTimerHasExpired()

delegate void CountdownTimerHasExpired ( )

OnCountdownTimerHasExpired delegate.

◆ OnRoomPropertiesUpdate()

override void OnRoomPropertiesUpdate ( Hashtable propertiesThatChanged )
virtual

Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties.

Since v1.25 this method has one parameter: Hashtable propertiesThatChanged.
Changing properties must be done by Room.SetCustomProperties, which causes this callback locally, too.

Parameters
propertiesThatChanged

Reimplemented from MonoBehaviourPunCallbacks.

Event Documentation

◆ OnCountdownTimerHasExpired

CountdownTimerHasExpired OnCountdownTimerHasExpired
static

Called when the timer has expired.


Photon Unity Networking 2: CullArea Class Reference

  • Pun
  • UtilityScripts
  • CullArea
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
CullArea Class Reference

Represents the cull area used for network culling. More...

Inherits MonoBehaviour.

Public Member Functions

void | OnDrawGizmos ()
Creates the cell hierarchy in editor and draws the cell view. More...
List< byte > | GetActiveCells (Vector3 position)
Gets a list of all cell IDs the player is currently inside or nearby. More...

Public Attributes

readonly byte | FIRST_GROUP_ID = 1
This represents the first ID which is assigned to the first created cell. If you already have some interest groups blocking this first ID, fell free to change it. However increasing the first group ID decreases the maximum amount of allowed cells. Allowed values are in range from 1 to 250. More...
readonly int[] | SUBDIVISION_FIRST_LEVEL_ORDER = new int[4] { 0, 1, 1, 1 }
This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy: More...
readonly int[] | SUBDIVISION_SECOND_LEVEL_ORDER = new int[8] { 0, 2, 1, 2, 0, 2, 1, 2 }
This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy: More...
readonly int[] | SUBDIVISION_THIRD_LEVEL_ORDER = new int[12] { 0, 3, 2, 3, 1, 3, 2, 3, 1, 3, 2, 3 }
This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy: More...
Vector2 | Center
Vector2 | Size = new Vector2(25.0f, 25.0f)
Vector2[] | Subdivisions = new Vector2[MAX_NUMBER_OF_SUBDIVISIONS]
int | NumberOfSubdivisions
bool | YIsUpAxis = false
bool | RecreateCellHierarchy = false

Static Public Attributes

const int MAX_NUMBER_OF_SUBDIVISIONS = 3

Properties

int | CellCount [get]
CellTree | CellTree [get]
Dictionary< int, GameObject > | Map [get]

Detailed Description

Represents the cull area used for network culling.

Member Function Documentation

◆ GetActiveCells()

List<byte> GetActiveCells ( Vector3 position )

Gets a list of all cell IDs the player is currently inside or nearby.

Parameters
position The current position of the player.
Returns
A list containing all cell IDs the player is currently inside or nearby.

◆ OnDrawGizmos()

void OnDrawGizmos ( )

Creates the cell hierarchy in editor and draws the cell view.

Member Data Documentation

◆ FIRST_GROUP_ID

readonly byte FIRST_GROUP_ID = 1

This represents the first ID which is assigned to the first created cell. If you already have some interest groups blocking this first ID, fell free to change it. However increasing the first group ID decreases the maximum amount of allowed cells. Allowed values are in range from 1 to 250.

◆ SUBDIVISION_FIRST_LEVEL_ORDER

readonly int [] SUBDIVISION_FIRST_LEVEL_ORDER = new int[4] { 0, 1, 1, 1 }

This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy:

  • 0: message is sent to all players
  • 1: message is sent to players who are interested in the matching cell of the first subdivision If there is only one subdivision we are sending one update to all players before sending three consequent updates only to players who are in the same cell or interested in updates of the current cell.

◆ SUBDIVISION_SECOND_LEVEL_ORDER

readonly int [] SUBDIVISION_SECOND_LEVEL_ORDER = new int[8] { 0, 2, 1, 2, 0, 2, 1, 2 }

This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy:

  • 0: message is sent to all players
  • 1: message is sent to players who are interested in the matching cell of the first subdivision
  • 2: message is sent to players who are interested in the matching cell of the second subdivision If there are two subdivisions we are sending every second update only to players who are in the same cell or interested in updates of the current cell.

◆ SUBDIVISION_THIRD_LEVEL_ORDER

readonly int [] SUBDIVISION_THIRD_LEVEL_ORDER = new int[12] { 0, 3, 2, 3, 1, 3, 2, 3, 1, 3, 2, 3 }

This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy:

  • 0: message is sent to all players
  • 1: message is sent to players who are interested in the matching cell of the first subdivision
  • 2: message is sent to players who are interested in the matching cell of the second subdivision
  • 3: message is sent to players who are interested in the matching cell of the third subdivision If there are two subdivisions we are sending every second update only to players who are in the same cell or interested in updates of the current cell.


Photon Unity Networking 2: CullingHandler Class Reference

  • Pun
  • UtilityScripts
  • CullingHandler
Public Member Functions | List of all members
CullingHandler Class Reference

Handles the network culling. More...

Inherits MonoBehaviour, and IPunObservable.

Public Member Functions

void OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
This time OnPhotonSerializeView is not used to send or receive any kind of data. It is used to change the currently active group of the PhotonView component, making it work together with PUN more directly. Keep in mind that this function is only executed, when there is at least one more player in the room. More...

Detailed Description

Handles the network culling.

Member Function Documentation

◆ OnPhotonSerializeView()

void OnPhotonSerializeView | ( | PhotonStream | stream,
 |  | PhotonMessageInfo | info
 | ) |  |

This time OnPhotonSerializeView is not used to send or receive any kind of data. It is used to change the currently active group of the PhotonView component, making it work together with PUN more directly. Keep in mind that this function is only executed, when there is at least one more player in the room.

Implements IPunObservable.


Photon Unity Networking 2: EventSystemSpawner Class Reference

  • Pun
  • UtilityScripts
  • EventSystemSpawner
List of all members
EventSystemSpawner Class Reference

Event system spawner. Will add an EventSystem GameObject with an EventSystem component and a StandaloneInputModule component. Use this in additive scene loading context where you would otherwise get a "Multiple EventSystem in scene... this is not supported" error from Unity. More...

Inherits MonoBehaviour.

Detailed Description

Event system spawner. Will add an EventSystem GameObject with an EventSystem component and a StandaloneInputModule component. Use this in additive scene loading context where you would otherwise get a "Multiple EventSystem in scene... this is not supported" error from Unity.


Photon Unity Networking 2: GraphicToggleIsOnTransition Class Reference

  • Pun
  • UtilityScripts
  • GraphicToggleIsOnTransition
Public Member Functions | Public Attributes | List of all members
GraphicToggleIsOnTransition Class Reference

Use this on toggles texts to have some color transition on the text depending on the isOn State. More...

Inherits MonoBehaviour, IPointerEnterHandler, and IPointerExitHandler.

Public Member Functions

void | OnPointerEnter (PointerEventData eventData)
void | OnPointerExit (PointerEventData eventData)
void | OnEnable ()
void | OnDisable ()
void | OnValueChanged (bool isOn)

Public Attributes

Toggle | toggle
Color | NormalOnColor = Color.white
Color | NormalOffColor = Color.black
Color | HoverOnColor = Color.black
Color | HoverOffColor = Color.black

Detailed Description

Use this on toggles texts to have some color transition on the text depending on the isOn State.


Photon Unity Networking 2: IPunTurnManagerCallbacks Interface Reference

  • Pun
  • UtilityScripts
  • IPunTurnManagerCallbacks
Public Member Functions | List of all members
IPunTurnManagerCallbacks Interface Reference

Public Member Functions

void | OnTurnBegins (int turn)
Called the turn begins event. More...
void | OnTurnCompleted (int turn)
Called when a turn is completed (finished by all players) More...
void | OnPlayerMove (Player player, int turn, object move)
Called when a player moved (but did not finish the turn) More...
void | OnPlayerFinished (Player player, int turn, object move)
When a player finishes a turn (includes the action/move of that player) More...
void | OnTurnTimeEnds (int turn)
Called when a turn completes due to a time constraint (timeout for a turn) More...

Member Function Documentation

◆ OnPlayerFinished()

void OnPlayerFinished | ( | Player | player,
 |  | int | turn,
 |  | object | move
 | ) |  |

When a player finishes a turn (includes the action/move of that player)

Parameters
player | Player reference
turn | Turn index
move | Move Object data

◆ OnPlayerMove()

void OnPlayerMove | ( | Player | player,
 |  | int | turn,
 |  | object | move
 | ) |  |

Called when a player moved (but did not finish the turn)

Parameters
player | Player reference
turn | Turn Index
move | Move Object data

◆ OnTurnBegins()

void OnTurnBegins ( int turn )

Called the turn begins event.

Parameters
turn Turn Index

◆ OnTurnCompleted()

void OnTurnCompleted ( int turn )

Called when a turn is completed (finished by all players)

Parameters
turn Turn Index

◆ OnTurnTimeEnds()

void OnTurnTimeEnds ( int turn )

Called when a turn completes due to a time constraint (timeout for a turn)

Parameters
turn Turn index


Photon Unity Networking 2: MoveByKeys Class Reference

  • Pun
  • UtilityScripts
  • MoveByKeys
Public Member Functions | Public Attributes | List of all members
MoveByKeys Class Reference

Very basic component to move a GameObject by WASD and Space. More...

Inherits MonoBehaviourPun.

Public Member Functions

void | Start ()
void | FixedUpdate ()

Public Attributes

float | Speed = 10f
float | JumpForce = 200f
float | JumpTimeout = 0.5f

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

Very basic component to move a GameObject by WASD and Space.

Requires a PhotonView. Disables itself on GameObjects that are not owned on Start.

Speed affects movement-speed. JumpForce defines how high the object "jumps". JumpTimeout defines after how many seconds you can jump again.


Photon Unity Networking 2: OnClickDestroy Class Reference

  • Pun
  • UtilityScripts
  • OnClickDestroy
Public Member Functions | Public Attributes | List of all members
OnClickDestroy Class Reference

Destroys the networked GameObject either by PhotonNetwork.Destroy or by sending an RPC which calls Object.Destroy(). More...

Inherits MonoBehaviourPun, and IPointerClickHandler.

Public Member Functions

IEnumerator DestroyRpc ()

Public Attributes

PointerEventData.InputButton | Button
KeyCode | ModifierKey
bool | DestroyByRpc

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

Destroys the networked GameObject either by PhotonNetwork.Destroy or by sending an RPC which calls Object.Destroy().

Using an RPC to Destroy a GameObject is typically a bad idea. It allows any player to Destroy a GameObject and may cause errors.

A client has to clean up the server's event-cache, which contains events for Instantiate and buffered RPCs related to the GO.

A buffered RPC gets cleaned up when the sending player leaves the room, so players joining later won't get those buffered RPCs. This in turn, may mean they don't destroy the GO due to coming later.

Vice versa, a GameObject Instantiate might get cleaned up when the creating player leaves a room. This way, the GameObject that a RPC targets might become lost.

It makes sense to test those cases. Many are not breaking errors and you just have to be aware of them.

Gets OnClick() calls by Unity's IPointerClickHandler. Needs a PhysicsRaycaster on the camera. See: https://docs.unity3d.com/ScriptReference/EventSystems.IPointerClickHandler.html


Photon Unity Networking 2: OnClickInstantiate Class Reference

  • Pun
  • UtilityScripts
  • OnClickInstantiate
Public Types | Public Attributes | List of all members
OnClickInstantiate Class Reference

Instantiates a networked GameObject on click. More...

Inherits MonoBehaviour, and IPointerClickHandler.

Public Types

enum InstantiateOption

Public Attributes

PointerEventData.InputButton | Button
KeyCode | ModifierKey
GameObject | Prefab

Detailed Description

Instantiates a networked GameObject on click.

Gets OnClick() calls by Unity's IPointerClickHandler. Needs a PhysicsRaycaster on the camera. See: https://docs.unity3d.com/ScriptReference/EventSystems.IPointerClickHandler.html


Photon Unity Networking 2: OnClickRpc Class Reference

  • Pun
  • UtilityScripts
  • OnClickRpc
Public Member Functions | Public Attributes | List of all members
OnClickRpc Class Reference

This component will instantiate a network GameObject when in a room and the user click on that component's GameObject. Uses PhysicsRaycaster for positioning. More...

Inherits MonoBehaviourPun, and IPointerClickHandler.

Public Member Functions

void | ClickRpc ()
IEnumerator | ClickFlash ()

Public Attributes

PointerEventData.InputButton | Button
KeyCode | ModifierKey
RpcTarget | Target

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

This component will instantiate a network GameObject when in a room and the user click on that component's GameObject. Uses PhysicsRaycaster for positioning.


Photon Unity Networking 2: OnEscapeQuit Class Reference

  • Pun
  • UtilityScripts
  • OnEscapeQuit
Public Member Functions | List of all members
OnEscapeQuit Class Reference

This component will quit the application when escape key is pressed More...

Inherits MonoBehaviour.

Public Member Functions

void Update ()

Detailed Description

This component will quit the application when escape key is pressed


Photon Unity Networking 2: OnJoinedInstantiate Class Reference

  • Pun
  • UtilityScripts
  • OnJoinedInstantiate
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
OnJoinedInstantiate Class Reference

This component will instantiate a network GameObject when a room is joined More...

Inherits MonoBehaviour, and IMatchmakingCallbacks.

Public Types

enum SpawnSequence

Public Member Functions

virtual void | OnEnable ()
virtual void | OnDisable ()
virtual void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
virtual void | SpawnObjects ()
virtual void | DespawnObjects (bool localOnly)
Destroy all objects that have been spawned by this component for this client. More...
virtual void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
virtual void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
virtual void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
virtual void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
virtual void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
virtual void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
virtual void | GetSpawnPoint (out Vector3 spawnPos, out Quaternion spawnRot)
Gets the next SpawnPoint from the list using the SpawnSequence, and applies RandomOffset (if used) to the transform matrix. Override this method with any custom code for coming up with a spawn location. This method is used by AutoSpawn. More...

Public Attributes

SpawnSequence | Sequence = SpawnSequence.Connection
List< Transform > | SpawnPoints = new List<Transform>(1) { null }
bool | UseRandomOffset = true
float | RandomOffset = 2.0f
bool | ClampY = true
List< GameObject > | PrefabsToInstantiate = new List<GameObject>(1) { null }
bool | AutoSpawnObjects = true
Stack< GameObject > | SpawnedObjects = new Stack<GameObject>()

Protected Member Functions

virtual Transform | GetSpawnPoint ()
Get the transform of the next SpawnPoint from the list, selected using the SpawnSequence setting. RandomOffset is not applied, only the transform of the SpawnPoint is returned. Override this method to change how Spawn Point transform is selected. Return the transform you want to use as a spawn point. More...
virtual Vector3 | GetRandomOffset ()
When UseRandomeOffset is enabled, this method is called to produce a Vector3 offset. The default implementation clamps the Y value to zero. You may override this with your own implementation. More...

Protected Attributes

int | spawnedAsActorId
int | lastUsedSpawnPointIndex = -1

Detailed Description

This component will instantiate a network GameObject when a room is joined

Member Function Documentation

◆ DespawnObjects()

virtual void DespawnObjects ( bool localOnly )
virtual

Destroy all objects that have been spawned by this component for this client.

Parameters
localOnly Use Object.Destroy rather than PhotonNetwork.Destroy.

◆ GetRandomOffset()

virtual Vector3 GetRandomOffset ( )
protectedvirtual

When UseRandomeOffset is enabled, this method is called to produce a Vector3 offset. The default implementation clamps the Y value to zero. You may override this with your own implementation.

◆ GetSpawnPoint() [1/2]

virtual Transform GetSpawnPoint ( )
protectedvirtual

Get the transform of the next SpawnPoint from the list, selected using the SpawnSequence setting. RandomOffset is not applied, only the transform of the SpawnPoint is returned. Override this method to change how Spawn Point transform is selected. Return the transform you want to use as a spawn point.

Returns

◆ GetSpawnPoint() [2/2]

virtual void GetSpawnPoint | ( | out Vector3 | spawnPos,
 |  | out Quaternion | spawnRot
 | ) |  |
virtual

Gets the next SpawnPoint from the list using the SpawnSequence, and applies RandomOffset (if used) to the transform matrix. Override this method with any custom code for coming up with a spawn location. This method is used by AutoSpawn.

◆ OnCreatedRoom()

virtual void OnCreatedRoom ( )
virtual

Called when this client created a room and entered it. OnJoinedRoom() will be called as well.

This callback is only called on the client which created a room (see OpCreateRoom).

As any client might close (or drop connection) anytime, there is a chance that the creator of a room does not execute OnCreatedRoom.

If you need specific room properties or a "start signal", implement OnMasterClientSwitched() and make each new MasterClient check the room's state.

Implements IMatchmakingCallbacks.

◆ OnCreateRoomFailed()

virtual void OnCreateRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |
virtual

Called when the server couldn't create a room (OpCreateRoom failed).

Creating a room may fail for various reasons. Most often, the room already exists (roomname in use) or the RoomOptions clash and it's impossible to create the room.

When creating a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnFriendListUpdate()

virtual void OnFriendListUpdate ( List< FriendInfo > friendList )
virtual

Called when the server sent the response to a FindFriends request.

After calling OpFindFriends, the Master Server will cache the friend list and send updates to the friend list. The friends includes the name, userId, online state and the room (if any) for each requested user/friend.

Use the friendList to update your UI and store it, if the UI should highlight changes.

Implements IMatchmakingCallbacks.

◆ OnJoinedRoom()

virtual void OnJoinedRoom ( )
virtual

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Implements IMatchmakingCallbacks.

◆ OnJoinRandomFailed()

virtual void OnJoinRandomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |
virtual

Called when a previous OpJoinRandom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

This operation is only ever sent to the Master Server. Once a room is found by the Master Server, the client will head off to the designated Game Server and use the operation Join on the Game Server.

When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnJoinRoomFailed()

virtual void OnJoinRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |
virtual

Called when a previous OpJoinRoom call failed on the server.

Joining a room may fail for various reasons. Most often, the room is full or does not exist anymore (due to someone else being faster or closing the room).

When joining a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnLeftRoom()

virtual void OnLeftRoom ( )
virtual

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Implements IMatchmakingCallbacks.


Photon Unity Networking 2: OnPointerOverTooltip Class Reference

  • Pun
  • UtilityScripts
  • OnPointerOverTooltip
List of all members
OnPointerOverTooltip Class Reference

Set focus to a given photonView when pointed is over More...

Inherits MonoBehaviour, IPointerEnterHandler, and IPointerExitHandler.

Detailed Description

Set focus to a given photonView when pointed is over


Photon Unity Networking 2: OnStartDelete Class Reference

  • Pun
  • UtilityScripts
  • OnStartDelete
List of all members
OnStartDelete Class Reference

This component will destroy the GameObject it is attached to (in Start()). More...

Inherits MonoBehaviour.

Detailed Description

This component will destroy the GameObject it is attached to (in Start()).


Photon Unity Networking 2: PhotonTeam Class Reference

  • Pun
  • UtilityScripts
  • PhotonTeam
Public Member Functions | Public Attributes | List of all members
PhotonTeam Class Reference

Public Member Functions

override string ToString ()

Public Attributes

string | Name
byte | Code


Photon Unity Networking 2: PhotonTeamExtensions Class Reference

  • Pun
  • UtilityScripts
  • PhotonTeamExtensions
Static Public Member Functions | List of all members
PhotonTeamExtensions Class Reference

Extension methods for the Player class that make use of PhotonTeamsManager. More...

Static Public Member Functions

static PhotonTeam | GetPhotonTeam (this Player player)
Gets the team the player is currently joined to. Null if none. More...
static bool | JoinTeam (this Player player, PhotonTeam team)
Join a team. More...
static bool | JoinTeam (this Player player, byte teamCode)
Join a team using team code. More...
static bool | JoinTeam (this Player player, string teamName)
Join a team using team name. More...
static bool | SwitchTeam (this Player player, PhotonTeam team)
Switch that player's team to the one you assign. More...
static bool | SwitchTeam (this Player player, byte teamCode)
Switch the player's team using a team code. More...
static bool | SwitchTeam (this Player player, string teamName)
Switch the player's team using a team name. More...
static bool | LeaveCurrentTeam (this Player player)
Leave the current team if any. More...
static bool | TryGetTeamMates (this Player player, out Player[] teamMates)
Try to get the team mates. More...

Detailed Description

Extension methods for the Player class that make use of PhotonTeamsManager.

Member Function Documentation

◆ GetPhotonTeam()

static PhotonTeam GetPhotonTeam ( this Player player )
static

Gets the team the player is currently joined to. Null if none.

Returns
The team the player is currently joined to. Null if none.

◆ JoinTeam() [1/3]

static bool JoinTeam | ( | this Player | player,
 |  | byte | teamCode
 | ) |  |
static

Join a team using team code.

Parameters
player | The player who will join the team.
teamCode | The code fo the team to be joined.
Returns

◆ JoinTeam() [2/3]

static bool JoinTeam | ( | this Player | player,
 |  | PhotonTeam | team
 | ) |  |
static

Join a team.

Parameters
player | The player who will join a team.
team | The team to be joined.
Returns

◆ JoinTeam() [3/3]

static bool JoinTeam | ( | this Player | player,
 |  | string | teamName
 | ) |  |
static

Join a team using team name.

Parameters
player | The player who will join the team.
teamName | The name of the team to be joined.
Returns

◆ LeaveCurrentTeam()

static bool LeaveCurrentTeam ( this Player player )
static

Leave the current team if any.

Parameters
player
Returns
If the leaving team request is queued to be sent to the server or done in case offline or not joined to a room yet.

◆ SwitchTeam() [1/3]

static bool SwitchTeam | ( | this Player | player,
 |  | byte | teamCode
 | ) |  |
static

Switch the player's team using a team code.

Internally checks if this player is in that team already or not.

Parameters
player | The player that will switch teams.
teamCode | The code of the team to switch to.
Returns
If the team switch request is queued to be sent to the server or done in case offline or not joined to a room yet.

◆ SwitchTeam() [2/3]

static bool SwitchTeam | ( | this Player | player,
 |  | PhotonTeam | team
 | ) |  |
static

Switch that player's team to the one you assign.

Internally checks if this player is in that team already or not. Only team switches are actually sent.

Parameters
player
team

◆ SwitchTeam() [3/3]

static bool SwitchTeam | ( | this Player | player,
 |  | string | teamName
 | ) |  |
static

Switch the player's team using a team name.

Internally checks if this player is in that team already or not.

Parameters
player | The player that will switch teams.
teamName | The name of the team to switch to.
Returns
If the team switch request is queued to be sent to the server or done in case offline or not joined to a room yet.

◆ TryGetTeamMates()

static bool TryGetTeamMates | ( | this Player | player,
 |  | out Player[] | teamMates
 | ) |  |
static

Try to get the team mates.

Parameters
player | The player to get the team mates of.
teamMates | The team mates array to fill.
Returns
If successful or not.


Photon Unity Networking 2: PhotonTeamsManager Class Reference

  • Pun
  • UtilityScripts
  • PhotonTeamsManager
Public Member Functions | Static Public Attributes | Properties | Events | List of all members
PhotonTeamsManager Class Reference

Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension. More...

Inherits MonoBehaviour, IMatchmakingCallbacks, and IInRoomCallbacks.

Public Member Functions

bool | TryGetTeamByCode (byte code, out PhotonTeam team)
Find a PhotonTeam using a team code. More...
bool | TryGetTeamByName (string teamName, out PhotonTeam team)
Find a PhotonTeam using a team name. More...
PhotonTeam[] GetAvailableTeams ()
Gets all teams available. More...
bool | TryGetTeamMembers (byte code, out Player[] members)
Gets all players joined to a team using a team code. More...
bool | TryGetTeamMembers (string teamName, out Player[] members)
Gets all players joined to a team using a team name. More...
bool | TryGetTeamMembers (PhotonTeam team, out Player[] members)
Gets all players joined to a team. More...
bool | TryGetTeamMatesOfPlayer (Player player, out Player[] teamMates)
Gets all team mates of a player. More...
int | GetTeamMembersCount (byte code)
Gets the number of players in a team by team code. More...
int | GetTeamMembersCount (string name)
Gets the number of players in a team by team name. More...
int | GetTeamMembersCount (PhotonTeam team)
Gets the number of players in a team. More...

Static Public Attributes

const string TeamPlayerProp = "_pt"
Defines the player custom property name to use for team affinity of "this" player. More...

Properties

static PhotonTeamsManager Instance [get]

Events

static Action< Player, PhotonTeam > | PlayerJoinedTeam
static Action< Player, PhotonTeam > | PlayerLeftTeam

Detailed Description

Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension.

Teams are defined by enum Team. Change this to get more / different teams. There are no rules when / if you can join a team. You could add this in JoinTeam or something.

Member Function Documentation

◆ GetAvailableTeams()

PhotonTeam [] GetAvailableTeams ( )

Gets all teams available.

Returns
Returns all teams available.

◆ GetTeamMembersCount() [1/3]

int GetTeamMembersCount ( byte code )

Gets the number of players in a team by team code.

Parameters
code Unique code of the team
Returns
Number of players joined to the team.

◆ GetTeamMembersCount() [2/3]

int GetTeamMembersCount ( PhotonTeam team )

Gets the number of players in a team.

Parameters
team The team you want to know the size of
Returns
Number of players joined to the team.

◆ GetTeamMembersCount() [3/3]

int GetTeamMembersCount ( string name )

Gets the number of players in a team by team name.

Parameters
name Unique name of the team
Returns
Number of players joined to the team.

◆ TryGetTeamByCode()

bool TryGetTeamByCode | ( | byte | code,
 |  | out PhotonTeam | team
 | ) |  |

Find a PhotonTeam using a team code.

Parameters
code | The team code.
team | The team to be assigned if found.
Returns
If successful or not.

◆ TryGetTeamByName()

bool TryGetTeamByName | ( | string | teamName,
 |  | out PhotonTeam | team
 | ) |  |

Find a PhotonTeam using a team name.

Parameters
teamName | The team name.
team | The team to be assigned if found.
Returns
If successful or not.

◆ TryGetTeamMatesOfPlayer()

bool TryGetTeamMatesOfPlayer | ( | Player | player,
 |  | out Player[] | teamMates
 | ) |  |

Gets all team mates of a player.

Parameters
player | The player whose team mates will be searched.
teamMates | The array of players to be filled.
Returns
If successful or not.

◆ TryGetTeamMembers() [1/3]

bool TryGetTeamMembers | ( | byte | code,
 |  | out Player[] | members
 | ) |  |

Gets all players joined to a team using a team code.

Parameters
code | The code of the team.
members | The array of players to be filled.
Returns
If successful or not.

◆ TryGetTeamMembers() [2/3]

bool TryGetTeamMembers | ( | PhotonTeam | team,
 |  | out Player[] | members
 | ) |  |

Gets all players joined to a team.

Parameters
team | The team which will be used to find players.
members | The array of players to be filled.
Returns
If successful or not.

◆ TryGetTeamMembers() [3/3]

bool TryGetTeamMembers | ( | string | teamName,
 |  | out Player[] | members
 | ) |  |

Gets all players joined to a team using a team name.

Parameters
teamName | The name of the team.
members | The array of players to be filled.
Returns
If successful or not.

Member Data Documentation

◆ TeamPlayerProp

const string TeamPlayerProp = "_pt"
static

Defines the player custom property name to use for team affinity of "this" player.


Photon Unity Networking 2: PlayerNumbering Class Reference

  • Pun
  • UtilityScripts
  • PlayerNumbering
Public Member Functions | Public Attributes | Static Public Attributes | Events | List of all members
PlayerNumbering Class Reference

Implements consistent numbering in a room/game with help of room properties. Access them by Player.GetPlayerNumber() extension. More...

Inherits MonoBehaviourPunCallbacks.

Public Member Functions

delegate void | PlayerNumberingChanged ()
OnPlayerNumberingChanged delegate. Use More...
void | Awake ()
override void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
override void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
override void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
override void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
override void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
void | RefreshData ()
Internal call Refresh the cached data and call the OnPlayerNumberingChanged delegate. More...
- Public Member Functions inherited from MonoBehaviourPunCallbacks
virtual void | OnEnable ()
virtual void | OnDisable ()
virtual void | OnConnected ()
Called to signal that the raw connection got established but before the client can call operation on the server. More...
virtual void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...
virtual void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
virtual void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
virtual void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
virtual void | OnJoinedLobby ()
Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
virtual void | OnLeftLobby ()
Called after leaving a lobby. More...
virtual void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or intentional More...
virtual void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
virtual void | OnRoomListUpdate (List< RoomInfo > roomList)
Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
virtual void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
virtual void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
virtual void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
virtual void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
virtual void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
virtual void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...
virtual void | OnWebRpcResponse (OperationResponse response)
Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc. More...
virtual void | OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
Called when the Master Server sent an update for the Lobby Statistics. More...
virtual void | OnErrorInfo (ErrorInfo errorInfo)
Called when the client receives an event from the server indicating that an error happened there. More...

Public Attributes

bool dontDestroyOnLoad = false
dont destroy on load flag for this Component's GameObject to survive Level Loading. More...

Static Public Attributes

static PlayerNumbering | instance
The instance. EntryPoint to query about Room Indexing. More...
static Player[] | SortedPlayers
const string | RoomPlayerIndexedProp = "pNr"
Defines the room custom property name to use for room player indexing tracking. More...

Events

static PlayerNumberingChanged OnPlayerNumberingChanged
Called everytime the room Indexing was updated. Use this for discrete updates. Always better than brute force calls every frame. More...

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

Implements consistent numbering in a room/game with help of room properties. Access them by Player.GetPlayerNumber() extension.

indexing ranges from 0 to the maximum number of Players. indexing remains for the player while in room. If a Player is numbered 2 and player numbered 1 leaves, numbered 1 become vacant and will assigned to the future player joining (the first available vacant number is assigned when joining)

Member Function Documentation

◆ OnJoinedRoom()

override void OnJoinedRoom ( )
virtual

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnLeftRoom()

override void OnLeftRoom ( )
virtual

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnPlayerEnteredRoom()

override void OnPlayerEnteredRoom ( Player newPlayer )
virtual

Called when a remote player entered the room. This Player is already added to the playerlist.

If your game starts with a certain number of players, this callback can be useful to check the Room.playerCount and find out if you can start.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnPlayerLeftRoom()

override void OnPlayerLeftRoom ( Player otherPlayer )
virtual

Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive.

If another player leaves the room or if the server detects a lost connection, this callback will be used to notify your game logic.

Depending on the room's setup, players may become inactive, which means they may return and retake their spot in the room. In such cases, the Player stays in the Room.Players dictionary.

If the player is not just inactive, it gets removed from the Room.Players dictionary, before the callback is called.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnPlayerPropertiesUpdate()

override void OnPlayerPropertiesUpdate | ( | Player | targetPlayer,
 |  | Hashtable | changedProps
 | ) |  |
virtual

Called when custom player-properties are changed. Player and the changed properties are passed as object[].

Changing properties must be done by Player.SetCustomProperties, which causes this callback locally, too.

Parameters
targetPlayer | Contains Player that changed.
changedProps | Contains the properties that changed.

Reimplemented from MonoBehaviourPunCallbacks.

◆ PlayerNumberingChanged()

delegate void PlayerNumberingChanged ( )

OnPlayerNumberingChanged delegate. Use

◆ RefreshData()

void RefreshData ( )

Internal call Refresh the cached data and call the OnPlayerNumberingChanged delegate.

Member Data Documentation

◆ dontDestroyOnLoad

bool dontDestroyOnLoad = false

dont destroy on load flag for this Component's GameObject to survive Level Loading.

◆ instance

PlayerNumbering instance
static

The instance. EntryPoint to query about Room Indexing.

◆ RoomPlayerIndexedProp

const string RoomPlayerIndexedProp = "pNr"
static

Defines the room custom property name to use for room player indexing tracking.

Event Documentation

◆ OnPlayerNumberingChanged

PlayerNumberingChanged OnPlayerNumberingChanged
static

Called everytime the room Indexing was updated. Use this for discrete updates. Always better than brute force calls every frame.


Photon Unity Networking 2: PlayerNumberingExtensions Class Reference

  • Pun
  • UtilityScripts
  • PlayerNumberingExtensions
Static Public Member Functions | List of all members
PlayerNumberingExtensions Class Reference

Extension used for PlayerRoomIndexing and Player class. More...

Static Public Member Functions

static int | GetPlayerNumber (this Player player)
Extension for Player class to wrap up access to the player's custom property. Make sure you use the delegate 'OnPlayerNumberingChanged' to knoiw when you can query the PlayerNumber. Numbering can changes over time or not be yet assigned during the initial phase ( when player creates a room for example) More...
static void | SetPlayerNumber (this Player player, int playerNumber)
Sets the player number. It's not recommanded to manually interfere with the playerNumbering, but possible. More...

Detailed Description

Extension used for PlayerRoomIndexing and Player class.

Member Function Documentation

◆ GetPlayerNumber()

static int GetPlayerNumber ( this Player player )
static

Extension for Player class to wrap up access to the player's custom property. Make sure you use the delegate 'OnPlayerNumberingChanged' to knoiw when you can query the PlayerNumber. Numbering can changes over time or not be yet assigned during the initial phase ( when player creates a room for example)

Returns
persistent index in room. -1 for no indexing

◆ SetPlayerNumber()

static void SetPlayerNumber | ( | this Player | player,
 |  | int | playerNumber
 | ) |  |
static

Sets the player number. It's not recommanded to manually interfere with the playerNumbering, but possible.

Parameters
player | Player.
playerNumber | Player number.


Photon Unity Networking 2: PointedAtGameObjectInfo Class Reference

  • Pun
  • UtilityScripts
  • PointedAtGameObjectInfo
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
PointedAtGameObjectInfo Class Reference

Display ViewId, OwnerActorNr, IsCeneView and IsMine when clicked. More...

Inherits MonoBehaviour.

Public Member Functions

void | SetFocus (PhotonView pv)
void | RemoveFocus (PhotonView pv)

Public Attributes

Text text

Static Public Attributes

static PointedAtGameObjectInfo Instance

Detailed Description

Display ViewId, OwnerActorNr, IsCeneView and IsMine when clicked.


Photon Unity Networking 2: PunPlayerScores Class Reference

  • Pun
  • UtilityScripts
  • PunPlayerScores
Static Public Attributes | List of all members
PunPlayerScores Class Reference

Scoring system for PhotonPlayer More...

Inherits MonoBehaviour.

Static Public Attributes

const string PlayerScoreProp = "score"

Detailed Description

Scoring system for PhotonPlayer


Photon Unity Networking 2: PunTeams Class Reference

  • Pun
  • UtilityScripts
  • PunTeams
Public Types | Public Member Functions | Static Public Attributes | List of all members
PunTeams Class Reference

Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension. More...

Inherits MonoBehaviourPunCallbacks.

Public Types

enum Team : byte
Enum defining the teams available. First team should be neutral (it's the default value any field of this enum gets). More...

Public Member Functions

void | Start ()
override void | OnDisable ()
override void | OnJoinedRoom ()
Needed to update the team lists when joining a room. More...
override void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
override void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Refreshes the team lists. It could be a non-team related property change, too. More...
override void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
override void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
void | UpdateTeams ()
- Public Member Functions inherited from MonoBehaviourPunCallbacks
virtual void | OnEnable ()
virtual void | OnConnected ()
Called to signal that the raw connection got established but before the client can call operation on the server. More...
virtual void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...
virtual void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
virtual void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
virtual void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
virtual void | OnJoinedLobby ()
Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
virtual void | OnLeftLobby ()
Called after leaving a lobby. More...
virtual void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or intentional More...
virtual void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
virtual void | OnRoomListUpdate (List< RoomInfo > roomList)
Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
virtual void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
virtual void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
virtual void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
virtual void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
virtual void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
virtual void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...
virtual void | OnWebRpcResponse (OperationResponse response)
Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc. More...
virtual void | OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
Called when the Master Server sent an update for the Lobby Statistics. More...
virtual void | OnErrorInfo (ErrorInfo errorInfo)
Called when the client receives an event from the server indicating that an error happened there. More...

Static Public Attributes

static Dictionary< Team, List< Player > > | PlayersPerTeam
The main list of teams with their player-lists. Automatically kept up to date. More...
const string | TeamPlayerProp = "team"
Defines the player custom property name to use for team affinity of "this" player. More...

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension.

Teams are defined by enum Team. Change this to get more / different teams. There are no rules when / if you can join a team. You could add this in JoinTeam or something.

Member Enumeration Documentation

◆ Team

enum Team : byte
strong

Enum defining the teams available. First team should be neutral (it's the default value any field of this enum gets).

Member Function Documentation

◆ OnJoinedRoom()

override void OnJoinedRoom ( )
virtual

Needed to update the team lists when joining a room.

Called by PUN. See enum MonoBehaviourPunCallbacks for an explanation.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnLeftRoom()

override void OnLeftRoom ( )
virtual

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnPlayerEnteredRoom()

override void OnPlayerEnteredRoom ( Player newPlayer )
virtual

Called when a remote player entered the room. This Player is already added to the playerlist.

If your game starts with a certain number of players, this callback can be useful to check the Room.playerCount and find out if you can start.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnPlayerLeftRoom()

override void OnPlayerLeftRoom ( Player otherPlayer )
virtual

Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive.

If another player leaves the room or if the server detects a lost connection, this callback will be used to notify your game logic.

Depending on the room's setup, players may become inactive, which means they may return and retake their spot in the room. In such cases, the Player stays in the Room.Players dictionary.

If the player is not just inactive, it gets removed from the Room.Players dictionary, before the callback is called.

Reimplemented from MonoBehaviourPunCallbacks.

◆ OnPlayerPropertiesUpdate()

override void OnPlayerPropertiesUpdate | ( | Player | targetPlayer,
 |  | Hashtable | changedProps
 | ) |  |
virtual

Refreshes the team lists. It could be a non-team related property change, too.

Called by PUN. See enum MonoBehaviourPunCallbacks for an explanation.

Reimplemented from MonoBehaviourPunCallbacks.

Member Data Documentation

◆ PlayersPerTeam

Dictionary<Team, List<Player> > PlayersPerTeam
static

The main list of teams with their player-lists. Automatically kept up to date.

Note that this is static. Can be accessed by PunTeam.PlayersPerTeam. You should not modify this.

◆ TeamPlayerProp

const string TeamPlayerProp = "team"
static

Defines the player custom property name to use for team affinity of "this" player.


Photon Unity Networking 2: PunTurnManager Class Reference

  • Pun
  • UtilityScripts
  • PunTurnManager
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
PunTurnManager Class Reference

Pun turnBased Game manager. Provides an Interface (IPunTurnManagerCallbacks) for the typical turn flow and logic, between players Provides Extensions for Player, Room and RoomInfo to feature dedicated api for TurnBased Needs More...

Inherits MonoBehaviourPunCallbacks, and IOnEventCallback.

Public Member Functions

void | BeginTurn ()
Tells the TurnManager to begins a new turn. More...
void | SendMove (object move, bool finished)
Call to send an action. Optionally finish the turn, too. The move object can be anything. Try to optimize though and only send the strict minimum set of information to define the turn move. More...
bool | GetPlayerFinishedTurn (Player player)
Gets if the player finished the current turn. More...
void | OnEvent (EventData photonEvent)
Called by PhotonNetwork.OnEventCall registration More...
override void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called by PhotonNetwork More...
- Public Member Functions inherited from MonoBehaviourPunCallbacks
virtual void | OnEnable ()
virtual void | OnDisable ()
virtual void | OnConnected ()
Called to signal that the raw connection got established but before the client can call operation on the server. More...
virtual void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
virtual void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...
virtual void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
virtual void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
virtual void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
virtual void | OnJoinedLobby ()
Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
virtual void | OnLeftLobby ()
Called after leaving a lobby. More...
virtual void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or intentional More...
virtual void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
virtual void | OnRoomListUpdate (List< RoomInfo > roomList)
Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
virtual void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
virtual void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
virtual void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
virtual void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
virtual void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
virtual void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
virtual void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
virtual void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
virtual void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...
virtual void | OnWebRpcResponse (OperationResponse response)
Called when the response to a WebRPC is available. See LoadBalancingClient.OpWebRpc. More...
virtual void | OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
Called when the Master Server sent an update for the Lobby Statistics. More...
virtual void | OnErrorInfo (ErrorInfo errorInfo)
Called when the client receives an event from the server indicating that an error happened there. More...

Public Attributes

float TurnDuration = 20f
The duration of the turn in seconds. More...
IPunTurnManagerCallbacks TurnManagerListener
The turn manager listener. Set this to your own script instance to catch Callbacks More...

Static Public Attributes

const byte | TurnManagerEventOffset = 0
The turn manager event offset event message byte. Used internaly for defining data in Room Custom Properties More...
const byte | EvMove = 1 + TurnManagerEventOffset
The Move event message byte. Used internaly for saving data in Room Custom Properties More...
const byte | EvFinalMove = 2 + TurnManagerEventOffset
The Final Move event message byte. Used internaly for saving data in Room Custom Properties More...

Properties

int | Turn [get]
Wraps accessing the "turn" custom properties of a room. More...
float | ElapsedTimeInTurn [get]
Gets the elapsed time in the current turn in seconds More...
float | RemainingSecondsInTurn [get]
Gets the remaining seconds for the current turn. Ranges from 0 to TurnDuration More...
bool | IsCompletedByAll [get]
Gets a value indicating whether the turn is completed by all. More...
bool | IsFinishedByMe [get]
Gets a value indicating whether the current turn is finished by me. More...
bool | IsOver [get]
Gets a value indicating whether the current turn is over. That is the ElapsedTimeinTurn is greater or equal to the TurnDuration More...
- Properties inherited from MonoBehaviourPun
PhotonView | photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

Pun turnBased Game manager. Provides an Interface (IPunTurnManagerCallbacks) for the typical turn flow and logic, between players Provides Extensions for Player, Room and RoomInfo to feature dedicated api for TurnBased Needs

Member Function Documentation

◆ BeginTurn()

void BeginTurn ( )

Tells the TurnManager to begins a new turn.

◆ GetPlayerFinishedTurn()

bool GetPlayerFinishedTurn ( Player player )

Gets if the player finished the current turn.

Returns
true, if player finished the current turn, false otherwise.
Parameters
player The Player to check for

◆ OnEvent()

void OnEvent ( EventData photonEvent )

Called by PhotonNetwork.OnEventCall registration

Parameters
photonEvent Photon event.

Implements IOnEventCallback.

◆ OnRoomPropertiesUpdate()

override void OnRoomPropertiesUpdate ( Hashtable propertiesThatChanged )
virtual

Called by PhotonNetwork

Parameters
propertiesThatChanged Properties that changed.

Reimplemented from MonoBehaviourPunCallbacks.

◆ SendMove()

void SendMove | ( | object | move,
 |  | bool | finished
 | ) |  |

Call to send an action. Optionally finish the turn, too. The move object can be anything. Try to optimize though and only send the strict minimum set of information to define the turn move.

Parameters
move
finished

Member Data Documentation

◆ EvFinalMove

const byte EvFinalMove = 2 + TurnManagerEventOffset
static

The Final Move event message byte. Used internaly for saving data in Room Custom Properties

◆ EvMove

const byte EvMove = 1 + TurnManagerEventOffset
static

The Move event message byte. Used internaly for saving data in Room Custom Properties

◆ TurnDuration

float TurnDuration = 20f

The duration of the turn in seconds.

◆ TurnManagerEventOffset

const byte TurnManagerEventOffset = 0
static

The turn manager event offset event message byte. Used internaly for defining data in Room Custom Properties

◆ TurnManagerListener

IPunTurnManagerCallbacks TurnManagerListener

The turn manager listener. Set this to your own script instance to catch Callbacks

Property Documentation

◆ ElapsedTimeInTurn

float ElapsedTimeInTurn
get

Gets the elapsed time in the current turn in seconds

The elapsed time in the turn.

◆ IsCompletedByAll

bool IsCompletedByAll
get

Gets a value indicating whether the turn is completed by all.

true if this turn is completed by all; otherwise, false.

◆ IsFinishedByMe

bool IsFinishedByMe
get

Gets a value indicating whether the current turn is finished by me.

true if the current turn is finished by me; otherwise, false.

◆ IsOver

bool IsOver
get

Gets a value indicating whether the current turn is over. That is the ElapsedTimeinTurn is greater or equal to the TurnDuration

true if the current turn is over; otherwise, false.

◆ RemainingSecondsInTurn

float RemainingSecondsInTurn
get

Gets the remaining seconds for the current turn. Ranges from 0 to TurnDuration

The remaining seconds fo the current turn

◆ Turn

int Turn
get

Wraps accessing the "turn" custom properties of a room.

The turn index


Photon Unity Networking 2: ScoreExtensions Class Reference

  • Pun
  • UtilityScripts
  • ScoreExtensions
Static Public Member Functions | List of all members
ScoreExtensions Class Reference

Static Public Member Functions

static void | SetScore (this Player player, int newScore)
static void | AddScore (this Player player, int scoreToAddToCurrent)
static int | GetScore (this Player player)


Photon Unity Networking 2: SmoothSyncMovement Class Reference

  • Pun
  • UtilityScripts
  • SmoothSyncMovement
Public Member Functions | Public Attributes | List of all members
SmoothSyncMovement Class Reference

Smoothed out movement for network gameobjects More...

Inherits MonoBehaviourPun, and IPunObservable.

Public Member Functions

void | Awake ()
void | OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More...
void | Update ()

Public Attributes

float SmoothingDelay = 5

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

Smoothed out movement for network gameobjects

Member Function Documentation

◆ OnPhotonSerializeView()

void OnPhotonSerializeView | ( | PhotonStream | stream,
 |  | PhotonMessageInfo | info
 | ) |  |

Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.

This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.

Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.

Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.

To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.

If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).

Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".

Implements IPunObservable.


Photon Unity Networking 2: StatesGui Class Reference

  • Pun
  • UtilityScripts
  • StatesGui
Public Attributes | List of all members
StatesGui Class Reference

Output detailed information about Pun Current states, using the old Unity UI framework. More...

Inherits MonoBehaviour.

Public Attributes

Rect | GuiOffset = new Rect(250, 0, 300, 300)
bool | DontDestroy = true
bool | ServerTimestamp
bool | DetailedConnection
bool | Server
bool | AppVersion
bool | UserId
bool | Room
bool | RoomProps
bool | EventsIn
bool | LocalPlayer
bool | PlayerProps
bool | Others
bool | Buttons
bool | ExpectedUsers

Detailed Description

Output detailed information about Pun Current states, using the old Unity UI framework.


Photon Unity Networking 2: TabViewManager Class Reference

  • Pun
  • UtilityScripts
  • TabViewManager
Classes | Public Member Functions | Public Attributes | Protected Attributes | List of all members
TabViewManager Class Reference

Tab view manager. Handles Tab views activation and deactivation, and provides a Unity Event Callback when a tab was selected. More...

Inherits MonoBehaviour.

Classes

class | Tab
class | TabChangeEvent
Tab change event. More...

Public Member Functions

void SelectTab (string id)
Selects a given tab. More...

Public Attributes

ToggleGroup ToggleGroup
The toggle group component target. More...
Tab[] Tabs
all the tabs for this group More...
TabChangeEvent OnTabChanged
The on tab changed Event. More...

Protected Attributes

Tab CurrentTab

Detailed Description

Tab view manager. Handles Tab views activation and deactivation, and provides a Unity Event Callback when a tab was selected.

Member Function Documentation

◆ SelectTab()

void SelectTab ( string id )

Selects a given tab.

Parameters
id Tab Id

Member Data Documentation

◆ OnTabChanged

TabChangeEvent OnTabChanged

The on tab changed Event.

◆ Tabs

Tab [] Tabs

all the tabs for this group

◆ ToggleGroup

ToggleGroup ToggleGroup

The toggle group component target.


Photon Unity Networking 2: TabViewManager.Tab Class Reference

  • Pun
  • UtilityScripts
  • TabViewManager
  • Tab
Public Attributes | List of all members
TabViewManager.Tab Class Reference

Public Attributes

string | ID = ""
Toggle | Toggle
RectTransform | View


Photon Unity Networking 2: TabViewManager.TabChangeEvent Class Reference

  • Pun
  • UtilityScripts
  • TabViewManager
  • TabChangeEvent
TabViewManager.TabChangeEvent Class Reference

Tab change event. More...

Inherits UnityEvent< string >.

Detailed Description

Tab change event.


Photon Unity Networking 2: TeamExtensions Class Reference

  • Pun
  • UtilityScripts
  • TeamExtensions
Static Public Member Functions | List of all members
TeamExtensions Class Reference

Extension used for PunTeams and Player class. Wraps access to the player's custom property. More...

Static Public Member Functions

static PunTeams.Team | GetTeam (this Player player)
Extension for Player class to wrap up access to the player's custom property. More...
static void | SetTeam (this Player player, PunTeams.Team team)
Switch that player's team to the one you assign. More...

Detailed Description

Extension used for PunTeams and Player class. Wraps access to the player's custom property.

Member Function Documentation

◆ GetTeam()

static PunTeams.Team GetTeam ( this Player player )
static

Extension for Player class to wrap up access to the player's custom property.

Returns
PunTeam.Team.none if no team was found (yet).

◆ SetTeam()

static void SetTeam | ( | this Player | player,
 |  | PunTeams.Team | team
 | ) |  |
static

Switch that player's team to the one you assign.

Internally checks if this player is in that team already or not. Only team switches are actually sent.

Parameters
player
team


Photon Unity Networking 2: TextButtonTransition Class Reference

  • Pun
  • UtilityScripts
  • TextButtonTransition
Public Member Functions | Public Attributes | List of all members
TextButtonTransition Class Reference

Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour. More...

Inherits MonoBehaviour, IPointerEnterHandler, and IPointerExitHandler.

Public Member Functions

void | Awake ()
void | OnEnable ()
void | OnDisable ()
void | OnPointerEnter (PointerEventData eventData)
void | OnPointerExit (PointerEventData eventData)

Public Attributes

Selectable | Selectable
The selectable Component. More...
Color | NormalColor = Color.white
The color of the normal of the transition state. More...
Color | HoverColor = Color.black
The color of the hover of the transition state. More...

Detailed Description

Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour.

Member Data Documentation

◆ HoverColor

Color HoverColor = Color.black

The color of the hover of the transition state.

◆ NormalColor

Color NormalColor = Color.white

The color of the normal of the transition state.

◆ Selectable

Selectable Selectable

The selectable Component.


Photon Unity Networking 2: TextToggleIsOnTransition Class Reference

  • Pun
  • UtilityScripts
  • TextToggleIsOnTransition
Public Member Functions | Public Attributes | List of all members
TextToggleIsOnTransition Class Reference

Use this on toggles texts to have some color transition on the text depending on the isOn State. More...

Inherits MonoBehaviour, IPointerEnterHandler, and IPointerExitHandler.

Public Member Functions

void | OnEnable ()
void | OnDisable ()
void | OnValueChanged (bool isOn)
void | OnPointerEnter (PointerEventData eventData)
void | OnPointerExit (PointerEventData eventData)

Public Attributes

Toggle | toggle
The toggle Component. More...
Color | NormalOnColor = Color.white
The color of the normal on transition state. More...
Color | NormalOffColor = Color.black
The color of the normal off transition state. More...
Color | HoverOnColor = Color.black
The color of the hover on transition state. More...
Color | HoverOffColor = Color.black
The color of the hover off transition state. More...

Detailed Description

Use this on toggles texts to have some color transition on the text depending on the isOn State.

Member Data Documentation

◆ HoverOffColor

Color HoverOffColor = Color.black

The color of the hover off transition state.

◆ HoverOnColor

Color HoverOnColor = Color.black

The color of the hover on transition state.

◆ NormalOffColor

Color NormalOffColor = Color.black

The color of the normal off transition state.

◆ NormalOnColor

Color NormalOnColor = Color.white

The color of the normal on transition state.

◆ toggle

Toggle toggle

The toggle Component.


Photon Unity Networking 2: TurnExtensions Class Reference

  • Pun
  • UtilityScripts
  • TurnExtensions
Static Public Member Functions | Static Public Attributes | List of all members
TurnExtensions Class Reference

Static Public Member Functions

static void | SetTurn (this Room room, int turn, bool setStartTime=false)
Sets the turn. More...
static int | GetTurn (this RoomInfo room)
Gets the current turn from a RoomInfo More...
static int | GetTurnStart (this RoomInfo room)
Returns the start time when the turn began. This can be used to calculate how long it's going on. More...
static int | GetFinishedTurn (this Player player)
gets the player's finished turn (from the ROOM properties) More...
static void | SetFinishedTurn (this Player player, int turn)
Sets the player's finished turn (in the ROOM properties) More...

Static Public Attributes

static readonly string | TurnPropKey = "Turn"
currently ongoing turn number More...
static readonly string | TurnStartPropKey = "TStart"
start (server) time for currently ongoing turn (used to calculate end) More...
static readonly string | FinishedTurnPropKey = "FToA"
Finished Turn of Actor (followed by number) More...

Member Function Documentation

◆ GetFinishedTurn()

static int GetFinishedTurn ( this Player player )
static

gets the player's finished turn (from the ROOM properties)

Returns
The finished turn index
Parameters
player Player reference

◆ GetTurn()

static int GetTurn ( this RoomInfo room )
static

Gets the current turn from a RoomInfo

Returns
The turn index
Parameters
room RoomInfo reference

◆ GetTurnStart()

static int GetTurnStart ( this RoomInfo room )
static

Returns the start time when the turn began. This can be used to calculate how long it's going on.

Returns
The turn start.
Parameters
room Room.

◆ SetFinishedTurn()

static void SetFinishedTurn | ( | this Player | player,
 |  | int | turn
 | ) |  |
static

Sets the player's finished turn (in the ROOM properties)

Parameters
player | Player Reference
turn | Turn Index

◆ SetTurn()

static void SetTurn | ( | this Room | room,
 |  | int | turn,
 |  | bool | setStartTime = false
 | ) |  |
static

Sets the turn.

Parameters
room | Room reference
turn | Turn index
setStartTime | If set to true set start time.

Member Data Documentation

◆ FinishedTurnPropKey

readonly string FinishedTurnPropKey = "FToA"
static

Finished Turn of Actor (followed by number)

◆ TurnPropKey

readonly string TurnPropKey = "Turn"
static

currently ongoing turn number

◆ TurnStartPropKey

readonly string TurnStartPropKey = "TStart"
static

start (server) time for currently ongoing turn (used to calculate end)


Photon Unity Networking 2: DefaultPool Class Reference

  • Pun
  • DefaultPool
Public Member Functions | Public Attributes | List of all members
DefaultPool Class Reference

The default implementation of a PrefabPool for PUN, which actually Instantiates and Destroys GameObjects but pools a resource. More...

Inherits IPunPrefabPool.

Public Member Functions

GameObject | Instantiate (string prefabId, Vector3 position, Quaternion rotation)
Returns an inactive instance of a networked GameObject, to be used by PUN. More...
void | Destroy (GameObject gameObject)
Simply destroys a GameObject. More...

Public Attributes

readonly Dictionary< string, GameObject > ResourceCache = new Dictionary<string, GameObject>()
Contains a GameObject per prefabId, to speed up instantiation. More...

Detailed Description

The default implementation of a PrefabPool for PUN, which actually Instantiates and Destroys GameObjects but pools a resource.

This pool is not actually storing GameObjects for later reuse. Instead, it's destroying used GameObjects. However, prefabs will be loaded from a Resources folder and cached, which speeds up Instantiation a bit.

The ResourceCache is public, so it can be filled without relying on the Resources folders.

Member Function Documentation

◆ Destroy()

void Destroy ( GameObject gameObject )

Simply destroys a GameObject.

Parameters
gameObject The GameObject to get rid of.

Implements IPunPrefabPool.

◆ Instantiate()

GameObject Instantiate | ( | string | prefabId,
 |  | Vector3 | position,
 |  | Quaternion | rotation
 | ) |  |

Returns an inactive instance of a networked GameObject, to be used by PUN.

Parameters
prefabId | String identifier for the networked object.
position | Location of the new object.
rotation | Rotation of the new object.
Returns

Implements IPunPrefabPool.

Member Data Documentation

◆ ResourceCache

readonly Dictionary<string, GameObject> ResourceCache = new Dictionary<string, GameObject>()

Contains a GameObject per prefabId, to speed up instantiation.


Photon Unity Networking 2: InstantiateParameters Struct Reference

  • Pun
  • InstantiateParameters
Public Member Functions | Public Attributes | List of all members
InstantiateParameters Struct Reference

Public Member Functions

InstantiateParameters (string prefabName, Vector3 position, Quaternion rotation, byte @group, object[] data, byte objLevelPrefix, int[] viewIDs, Player creator, int timestamp)

Public Attributes

int[] | viewIDs
byte | objLevelPrefix
object[] | data
byte | group
Quaternion | rotation
Vector3 | position
string | prefabName
Player | creator
int | timestamp


Photon Unity Networking 2: IOnPhotonViewControllerChange Interface Reference

  • Pun
  • IOnPhotonViewControllerChange
Public Member Functions | List of all members
IOnPhotonViewControllerChange Interface Reference

This interface defines a callback for changes to the PhotonView's controller. More...

Inherits IPhotonViewCallback.

Public Member Functions

void OnControllerChange (Player newController, Player previousController)
This method will be called when the PhotonView's controller changes. More...

Detailed Description

This interface defines a callback for changes to the PhotonView's controller.

Member Function Documentation

◆ OnControllerChange()

void OnControllerChange | ( | Player | newController,
 |  | Player | previousController
 | ) |  |

This method will be called when the PhotonView's controller changes.

Parameters
newOwner
previousOwner


Photon Unity Networking 2: IOnPhotonViewOwnerChange Interface Reference

  • Pun
  • IOnPhotonViewOwnerChange
Public Member Functions | List of all members
IOnPhotonViewOwnerChange Interface Reference

This interface defines a callback for changes to the PhotonView's owner. More...

Inherits IPhotonViewCallback.

Public Member Functions

void OnOwnerChange (Player newOwner, Player previousOwner)
This method will be called when the PhotonView's owner changes. More...

Detailed Description

This interface defines a callback for changes to the PhotonView's owner.

Member Function Documentation

◆ OnOwnerChange()

void OnOwnerChange | ( | Player | newOwner,
 |  | Player | previousOwner
 | ) |  |

This method will be called when the PhotonView's owner changes.

Parameters
newOwner
previousOwner


Photon Unity Networking 2: IOnPhotonViewPreNetDestroy Interface Reference

  • Pun
  • IOnPhotonViewPreNetDestroy
Public Member Functions | List of all members
IOnPhotonViewPreNetDestroy Interface Reference

This interface defines a callback which fires prior to the PhotonNetwork destroying the PhotonView and Gameobject. More...

Inherits IPhotonViewCallback.

Public Member Functions

void OnPreNetDestroy (PhotonView rootView)
This method is called before Destroy() is initiated for a networked object. More...

Detailed Description

This interface defines a callback which fires prior to the PhotonNetwork destroying the PhotonView and Gameobject.

Member Function Documentation

◆ OnPreNetDestroy()

void OnPreNetDestroy ( PhotonView rootView )

This method is called before Destroy() is initiated for a networked object.

Parameters
rootView


Photon Unity Networking 2: IPhotonViewCallback Interface Reference

  • Pun
  • IPhotonViewCallback
IPhotonViewCallback Interface Reference

Empty Base class for all PhotonView callbacks. More...

Inherited by IOnPhotonViewControllerChange, IOnPhotonViewOwnerChange, and IOnPhotonViewPreNetDestroy.

Detailed Description

Empty Base class for all PhotonView callbacks.


Photon Unity Networking 2: IPunOwnershipCallbacks Interface Reference

  • Pun
  • IPunOwnershipCallbacks
Public Member Functions | List of all members
IPunOwnershipCallbacks Interface Reference

Global Callback interface for ownership changes. These callbacks will fire for changes to ANY PhotonView that changes. Consider using IOnPhotonViewControllerChange for callbacks from a specific PhotonView. More...

Public Member Functions

void | OnOwnershipRequest (PhotonView targetView, Player requestingPlayer)
Called when another player requests ownership of a PhotonView. Called on all clients, so check if (targetView.IsMine) or (targetView.Owner == PhotonNetwork.LocalPlayer) to determine if a targetView.TransferOwnership(requestingPlayer) response should be given. More...
void | OnOwnershipTransfered (PhotonView targetView, Player previousOwner)
Called when ownership of a PhotonView is transfered to another player. More...
void | OnOwnershipTransferFailed (PhotonView targetView, Player senderOfFailedRequest)
Called when an Ownership Request fails for objects with "takeover" setting. More...

Detailed Description

Global Callback interface for ownership changes. These callbacks will fire for changes to ANY PhotonView that changes. Consider using IOnPhotonViewControllerChange for callbacks from a specific PhotonView.

Member Function Documentation

◆ OnOwnershipRequest()

void OnOwnershipRequest | ( | PhotonView | targetView,
 |  | Player | requestingPlayer
 | ) |  |

Called when another player requests ownership of a PhotonView. Called on all clients, so check if (targetView.IsMine) or (targetView.Owner == PhotonNetwork.LocalPlayer) to determine if a targetView.TransferOwnership(requestingPlayer) response should be given.

The parameter viewAndPlayer contains:

PhotonView view = viewAndPlayer[0] as PhotonView;

Player requestingPlayer = viewAndPlayer[1] as Player;

Parameters
targetView | PhotonView for which ownership gets requested.
requestingPlayer | Player who requests ownership.

◆ OnOwnershipTransfered()

void OnOwnershipTransfered | ( | PhotonView | targetView,
 |  | Player | previousOwner
 | ) |  |

Called when ownership of a PhotonView is transfered to another player.

The parameter viewAndPlayers contains:

PhotonView view = viewAndPlayers[0] as PhotonView;

Player newOwner = viewAndPlayers[1] as Player;

Player oldOwner = viewAndPlayers[2] as Player;

void OnOwnershipTransfered(object[] viewAndPlayers) {} //

Parameters
targetView | PhotonView for which ownership changed.
previousOwner | Player who was the previous owner (or null, if none).

◆ OnOwnershipTransferFailed()

void OnOwnershipTransferFailed | ( | PhotonView | targetView,
 |  | Player | senderOfFailedRequest
 | ) |  |

Called when an Ownership Request fails for objects with "takeover" setting.

Each request asks to take ownership from a specific controlling player. This can fail if anyone else took over ownership briefly before the request arrived.

Parameters
targetView
senderOfFailedRequest


Photon Unity Networking 2: IPunPrefabPool Interface Reference

  • Pun
  • IPunPrefabPool
Public Member Functions | List of all members
IPunPrefabPool Interface Reference

Defines an interface for object pooling, used in PhotonNetwork.Instantiate and PhotonNetwork.Destroy. More...

Inherited by DefaultPool.

Public Member Functions

GameObject | Instantiate (string prefabId, Vector3 position, Quaternion rotation)
Called to get an instance of a prefab. Must return valid, disabled GameObject with PhotonView. More...
void | Destroy (GameObject gameObject)
Called to destroy (or just return) the instance of a prefab. It's disabled and the pool may reset and cache it for later use in Instantiate. More...

Detailed Description

Defines an interface for object pooling, used in PhotonNetwork.Instantiate and PhotonNetwork.Destroy.

To apply your custom IPunPrefabPool, set PhotonNetwork.PrefabPool.

The pool has to return a valid, disabled GameObject when PUN calls Instantiate. Also, the position and rotation must be applied.

Note that Awake and Start are only called once by Unity, so scripts on re-used GameObjects should make use of OnEnable and or OnDisable. When OnEnable gets called, the PhotonView is already updated to the new values.

To be able to enable a GameObject, Instantiate must return an inactive object.

Before PUN "destroys" GameObjects, it will disable them.

If a component implements IPunInstantiateMagicCallback, PUN will call OnPhotonInstantiate when the networked object gets instantiated. If no components implement this on a prefab, PUN will optimize the instantiation and no longer looks up IPunInstantiateMagicCallback via GetComponents.

Member Function Documentation

◆ Destroy()

void Destroy ( GameObject gameObject )

Called to destroy (or just return) the instance of a prefab. It's disabled and the pool may reset and cache it for later use in Instantiate.

A pool needs some way to find out which type of GameObject got returned via Destroy(). It could be a tag, name, a component or anything similar.

Parameters
gameObject The instance to destroy.

Implemented in DefaultPool.

◆ Instantiate()

GameObject Instantiate | ( | string | prefabId,
 |  | Vector3 | position,
 |  | Quaternion | rotation
 | ) |  |

Called to get an instance of a prefab. Must return valid, disabled GameObject with PhotonView.

Parameters
prefabId | The id of this prefab.
position | The position for the instance.
rotation | The rotation for the instance.
Returns
A disabled instance to use by PUN or null if the prefabId is unknown.

Implemented in DefaultPool.


Photon Unity Networking 2: MonoBehaviourPun Class Reference

  • Pun
  • MonoBehaviourPun
Properties | List of all members
MonoBehaviourPun Class Reference

This class adds the property photonView, while logging a warning when your game still uses the networkView. More...

Inherits MonoBehaviour.

Inherited by MonoBehaviourPunCallbacks, PhotonAnimatorView, PhotonRigidbody2DView, PhotonRigidbodyView, PhotonTransformView, PhotonTransformViewClassic, MoveByKeys, OnClickDestroy, OnClickRpc, and SmoothSyncMovement.

Properties

PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

This class adds the property photonView, while logging a warning when your game still uses the networkView.

Property Documentation

◆ photonView

PhotonView photonView
get

A cached reference to a PhotonView on this GameObject.

If you intend to work with a PhotonView in a script, it's usually easier to write this.photonView.

If you intend to remove the PhotonView component from the GameObject but keep this Photon.MonoBehaviour, avoid this reference or modify this code to use PhotonView.Get(obj) instead.


Photon Unity Networking 2: NestedComponentUtilities Class Reference

  • Pun
  • NestedComponentUtilities
Static Public Member Functions | Static Public Attributes | List of all members
NestedComponentUtilities Class Reference

Static Public Member Functions

static T | EnsureRootComponentExists< T, NestedT > (this Transform transform)
static T | GetParentComponent< T > (this Transform t)
Find T on supplied transform or any parent. Unlike GetComponentInParent, GameObjects do not need to be active to be found. More...
static void | GetNestedComponentsInParents< T > (this Transform t, List< T > list)
Returns all T found between the child transform and its root. Order in List from child to parent, with the root/parent most being last. More...
static T | GetNestedComponentInChildren< T, NestedT > (this Transform t, bool includeInactive)
static T | GetNestedComponentInParent< T, NestedT > (this Transform t)
Same as GetComponentInParent, but will always include inactive objects in search. More...
static T | GetNestedComponentInParents< T, NestedT > (this Transform t)
UNTESTED More...
static void | GetNestedComponentsInParents< T, NestedT > (this Transform t, List< T > list)
Finds components of type T on supplied transform, and every parent above that node, inclusively stopping on node StopSearchOnT component. More...
static List< T > | GetNestedComponentsInChildren< T, NestedT > (this Transform t, List< T > list, bool includeInactive=true)
Same as GetComponentsInChildren, but will not recurse into children with component of the DontRecurseOnT type. This allows nesting of PhotonViews/NetObjects to be respected. More...
static List< T > | GetNestedComponentsInChildren< T > (this Transform t, List< T > list, bool includeInactive=true, params System.Type[] stopOn)
Same as GetComponentsInChildren, but will not recurse into children with component of the DontRecurseOnT type. This allows nesting of PhotonViews/NetObjects to be respected. More...
static void | GetNestedComponentsInChildren< T, SearchT, NestedT > (this Transform t, bool includeInactive, List< T > list)
Same as GetComponentsInChildren, but will not recurse into children with component of the NestedT type. This allows nesting of PhotonViews/NetObjects to be respected. More...

Static Public Attributes

static Dictionary< System.Type, ICollection > searchLists = new Dictionary<System.Type, ICollection>()

Member Function Documentation

◆ GetNestedComponentInParent< T, NestedT >()

static T GetNestedComponentInParent< T, NestedT > ( this Transform t )
static

Same as GetComponentInParent, but will always include inactive objects in search.

Template Parameters
T
DontRecurseOnT
Parameters
t
Returns
Type Constraints
T : class
NestedT : class

◆ GetNestedComponentInParents< T, NestedT >()

static T GetNestedComponentInParents< T, NestedT > ( this Transform t )
static

UNTESTED

Template Parameters
T
StopSearchOnT
Parameters
t
Returns
Type Constraints
T : class
NestedT : class

◆ GetNestedComponentsInChildren< T >()

static List<T> GetNestedComponentsInChildren< T > | ( | this Transform | t,
 |  | List< T > | list,
 |  | bool | includeInactive = true,
 |  | params System.Type[] | stopOn
 | ) |  |
static

Same as GetComponentsInChildren, but will not recurse into children with component of the DontRecurseOnT type. This allows nesting of PhotonViews/NetObjects to be respected.

Template Parameters
T
Parameters
t
list Pass null and a reused list will be used. Consume immediately.
Type Constraints
T : class

◆ GetNestedComponentsInChildren< T, NestedT >()

static List<T> GetNestedComponentsInChildren< T, NestedT > | ( | this Transform | t,
 |  | List< T > | list,
 |  | bool | includeInactive = true
 | ) |  |
static

Same as GetComponentsInChildren, but will not recurse into children with component of the DontRecurseOnT type. This allows nesting of PhotonViews/NetObjects to be respected.

Template Parameters
T
Parameters
t
list Pass null and a reused list will be used. Consume immediately.
Type Constraints
T : class
NestedT : class

◆ GetNestedComponentsInChildren< T, SearchT, NestedT >()

static void GetNestedComponentsInChildren< T, SearchT, NestedT > | ( | this Transform | t,
 |  | bool | includeInactive,
 |  | List< T > | list
 | ) |  |
static

Same as GetComponentsInChildren, but will not recurse into children with component of the NestedT type. This allows nesting of PhotonViews/NetObjects to be respected.

Template Parameters
T | Cast found components to this type. Typically Component, but any other class/interface will work as long as they are assignable from SearchT.
SearchT | Find components of this class or interface type.
DontRecurseOnT
Parameters
t
includeInactive
list
Returns
Type Constraints
T : class
SearchT : class

◆ GetNestedComponentsInParents< T >()

static void GetNestedComponentsInParents< T > | ( | this Transform | t,
 |  | List< T > | list
 | ) |  |
static

Returns all T found between the child transform and its root. Order in List from child to parent, with the root/parent most being last.

Parameters
t
Returns
Type Constraints
T : Component

◆ GetNestedComponentsInParents< T, NestedT >()

static void GetNestedComponentsInParents< T, NestedT > | ( | this Transform | t,
 |  | List< T > | list
 | ) |  |
static

Finds components of type T on supplied transform, and every parent above that node, inclusively stopping on node StopSearchOnT component.

Template Parameters
T
StopSearchOnT
Parameters
t
list
Returns
Type Constraints
T : class
NestedT : class

◆ GetParentComponent< T >()

static T GetParentComponent< T > ( this Transform t )
static

Find T on supplied transform or any parent. Unlike GetComponentInParent, GameObjects do not need to be active to be found.

Type Constraints
T : Component


Photon Unity Networking 2: PhotonAnimatorView Class Reference

  • Pun
  • PhotonAnimatorView
Classes | Public Types | Public Member Functions | List of all members
PhotonAnimatorView Class Reference

This class helps you to synchronize Mecanim animations Simply add the component to your GameObject and make sure that the PhotonAnimatorView is added to the list of observed components More...

Inherits MonoBehaviourPun, and IPunObservable.

Classes

class | SynchronizedLayer
class | SynchronizedParameter

Public Types

enum | ParameterType
enum | SynchronizeType

Public Member Functions

void | CacheDiscreteTriggers ()
Caches the discrete triggers values for keeping track of raised triggers, and will be reseted after the sync routine got performed More...
bool | DoesLayerSynchronizeTypeExist (int layerIndex)
Check if a specific layer is configured to be synchronize More...
bool | DoesParameterSynchronizeTypeExist (string name)
Check if the specified parameter is configured to be synchronized More...
List< SynchronizedLayer > | GetSynchronizedLayers ()
Get a list of all synchronized layers More...
List< SynchronizedParameter > | GetSynchronizedParameters ()
Get a list of all synchronized parameters More...
SynchronizeType | GetLayerSynchronizeType (int layerIndex)
Gets the type how the layer is synchronized More...
SynchronizeType | GetParameterSynchronizeType (string name)
Gets the type how the parameter is synchronized More...
void | SetLayerSynchronized (int layerIndex, SynchronizeType synchronizeType)
Sets the how a layer should be synchronized More...
void | SetParameterSynchronized (string name, ParameterType type, SynchronizeType synchronizeType)
Sets the how a parameter should be synchronized More...
void | OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More...

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

This class helps you to synchronize Mecanim animations Simply add the component to your GameObject and make sure that the PhotonAnimatorView is added to the list of observed components

When Using Trigger Parameters, make sure the component that sets the trigger is higher in the stack of Components on the GameObject than 'PhotonAnimatorView' Triggers are raised true during one frame only.

Member Function Documentation

◆ CacheDiscreteTriggers()

void CacheDiscreteTriggers ( )

Caches the discrete triggers values for keeping track of raised triggers, and will be reseted after the sync routine got performed

◆ DoesLayerSynchronizeTypeExist()

bool DoesLayerSynchronizeTypeExist ( int layerIndex )

Check if a specific layer is configured to be synchronize

Parameters
layerIndex Index of the layer.
Returns
True if the layer is synchronized

◆ DoesParameterSynchronizeTypeExist()

bool DoesParameterSynchronizeTypeExist ( string name )

Check if the specified parameter is configured to be synchronized

Parameters
name The name of the parameter.
Returns
True if the parameter is synchronized

◆ GetLayerSynchronizeType()

SynchronizeType GetLayerSynchronizeType ( int layerIndex )

Gets the type how the layer is synchronized

Parameters
layerIndex Index of the layer.
Returns
Disabled/Discrete/Continuous

◆ GetParameterSynchronizeType()

SynchronizeType GetParameterSynchronizeType ( string name )

Gets the type how the parameter is synchronized

Parameters
name The name of the parameter.
Returns
Disabled/Discrete/Continuous

◆ GetSynchronizedLayers()

List<SynchronizedLayer> GetSynchronizedLayers ( )

Get a list of all synchronized layers

Returns
List of SynchronizedLayer objects

◆ GetSynchronizedParameters()

List<SynchronizedParameter> GetSynchronizedParameters ( )

Get a list of all synchronized parameters

Returns
List of SynchronizedParameter objects

◆ OnPhotonSerializeView()

void OnPhotonSerializeView | ( | PhotonStream | stream,
 |  | PhotonMessageInfo | info
 | ) |  |

Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.

This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.

Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.

Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.

To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.

If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).

Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".

Implements IPunObservable.

◆ SetLayerSynchronized()

void SetLayerSynchronized | ( | int | layerIndex,
 |  | SynchronizeType | synchronizeType
 | ) |  |

Sets the how a layer should be synchronized

Parameters
layerIndex | Index of the layer.
synchronizeType | Disabled/Discrete/Continuous

◆ SetParameterSynchronized()

void SetParameterSynchronized | ( | string | name,
 |  | ParameterType | type,
 |  | SynchronizeType | synchronizeType
 | ) |  |

Sets the how a parameter should be synchronized

Parameters
name | The name of the parameter.
type | The type of the parameter.
synchronizeType | Disabled/Discrete/Continuous


Photon Unity Networking 2: PhotonAnimatorView.SynchronizedLayer Class Reference

  • Pun
  • PhotonAnimatorView
  • SynchronizedLayer
Public Attributes | List of all members
PhotonAnimatorView.SynchronizedLayer Class Reference

Public Attributes

SynchronizeType | SynchronizeType
int | LayerIndex


Photon Unity Networking 2: PhotonAnimatorView.SynchronizedParameter Class Reference

  • Pun
  • PhotonAnimatorView
  • SynchronizedParameter
Public Attributes | List of all members
PhotonAnimatorView.SynchronizedParameter Class Reference

Public Attributes

ParameterType | Type
SynchronizeType | SynchronizeType
string | Name


Photon Unity Networking 2: PhotonHandler Class Reference

  • Pun
  • PhotonHandler
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PhotonHandler Class Reference

Internal MonoBehaviour that allows Photon to run an Update loop. More...

Inherits ConnectionHandler, IInRoomCallbacks, and IMatchmakingCallbacks.

Public Member Functions

void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...
void | OnFriendListUpdate (System.Collections.Generic.List< FriendInfo > friendList)
void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
- Public Member Functions inherited from ConnectionHandler
void | StartFallbackSendAckThread ()
void | StopFallbackSendAckThread ()
bool | RealtimeFallbackThread ()
A thread which runs independent from the Update() calls. Keeps connections online while loading or in background. See KeepAliveInBackground. More...
- Public Member Functions inherited from IMatchmakingCallbacks
void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...

Static Public Attributes

static int | MaxDatagrams = 3
Limits the number of datagrams that are created in each LateUpdate. More...
static bool | SendAsap
Signals that outgoing messages should be sent in the next LateUpdate call. More...
- Static Public Attributes inherited from ConnectionHandler
static bool | AppQuits
Indicates that the app is closing. Set in OnApplicationQuit(). More...

Protected Member Functions

override void | Awake ()
virtual void | OnEnable ()
void | Start ()
override void | OnDisable ()
void | FixedUpdate ()
Called in intervals by UnityEngine. Affected by Time.timeScale. More...
void | LateUpdate ()
Called in intervals by UnityEngine, after running the normal game code and physics. More...
void | Dispatch ()
Dispatches incoming network messages for PUN. Called in FixedUpdate or LateUpdate. More...

Protected Attributes

List< int > reusableIntList = new List<int>()

Additional Inherited Members

- Public Attributes inherited from ConnectionHandler
bool | DisconnectAfterKeepAlive = false
Option to let the fallback thread call Disconnect after the KeepAliveInBackground time. Default: false. More...
int | KeepAliveInBackground = 60000
Defines for how long the Fallback Thread should keep the connection, before it may time out as usual. More...
bool | ApplyDontDestroyOnLoad = true
Keeps the ConnectionHandler, even if a new scene gets loaded. More...
- Properties inherited from ConnectionHandler
LoadBalancingClient | Client [get, set]
Photon client to log information and statistics from. More...
int | CountSendAcksOnly [get]
Counts how often the Fallback Thread called SendAcksOnly, which is purely of interest to monitor if the game logic called SendOutgoingCommands as intended. More...
bool | FallbackThreadRunning [get]
True if a fallback thread is running. Will call the client's SendAcksOnly() method to keep the connection up. More...

Detailed Description

Internal MonoBehaviour that allows Photon to run an Update loop.

Member Function Documentation

◆ Dispatch()

void Dispatch ( )
protected

Dispatches incoming network messages for PUN. Called in FixedUpdate or LateUpdate.

It may make sense to dispatch incoming messages, even if the timeScale is near 0. That can be configured with PhotonNetwork.MinimalTimeScaleToDispatchInFixedUpdate.

Without dispatching messages, PUN won't change state and does not handle updates.

◆ FixedUpdate()

void FixedUpdate ( )
protected

Called in intervals by UnityEngine. Affected by Time.timeScale.

◆ LateUpdate()

void LateUpdate ( )
protected

Called in intervals by UnityEngine, after running the normal game code and physics.

◆ OnCreatedRoom()

void OnCreatedRoom ( )

Called when this client created a room and entered it. OnJoinedRoom() will be called as well.

This callback is only called on the client which created a room (see OpCreateRoom).

As any client might close (or drop connection) anytime, there is a chance that the creator of a room does not execute OnCreatedRoom.

If you need specific room properties or a "start signal", implement OnMasterClientSwitched() and make each new MasterClient check the room's state.

Implements IMatchmakingCallbacks.

◆ OnCreateRoomFailed()

void OnCreateRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when the server couldn't create a room (OpCreateRoom failed).

Creating a room may fail for various reasons. Most often, the room already exists (roomname in use) or the RoomOptions clash and it's impossible to create the room.

When creating a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnJoinedRoom()

void OnJoinedRoom ( )

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Implements IMatchmakingCallbacks.

◆ OnJoinRandomFailed()

void OnJoinRandomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when a previous OpJoinRandom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

This operation is only ever sent to the Master Server. Once a room is found by the Master Server, the client will head off to the designated Game Server and use the operation Join on the Game Server.

When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnJoinRoomFailed()

void OnJoinRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when a previous OpJoinRoom call failed on the server.

Joining a room may fail for various reasons. Most often, the room is full or does not exist anymore (due to someone else being faster or closing the room).

When joining a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnLeftRoom()

void OnLeftRoom ( )

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Implements IMatchmakingCallbacks.

◆ OnMasterClientSwitched()

void OnMasterClientSwitched ( Player newMasterClient )

Called after switching to a new MasterClient when the current one leaves.

This is not called when this client enters a room. The former MasterClient is still in the player list when this method get called.

Implements IInRoomCallbacks.

◆ OnPlayerEnteredRoom()

void OnPlayerEnteredRoom ( Player newPlayer )

Called when a remote player entered the room. This Player is already added to the playerlist.

If your game starts with a certain number of players, this callback can be useful to check the Room.playerCount and find out if you can start.

Implements IInRoomCallbacks.

◆ OnPlayerLeftRoom()

void OnPlayerLeftRoom ( Player otherPlayer )

Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive.

If another player leaves the room or if the server detects a lost connection, this callback will be used to notify your game logic.

Depending on the room's setup, players may become inactive, which means they may return and retake their spot in the room. In such cases, the Player stays in the Room.Players dictionary.

If the player is not just inactive, it gets removed from the Room.Players dictionary, before the callback is called.

Implements IInRoomCallbacks.

◆ OnPlayerPropertiesUpdate()

void OnPlayerPropertiesUpdate | ( | Player | targetPlayer,
 |  | Hashtable | changedProps
 | ) |  |

Called when custom player-properties are changed. Player and the changed properties are passed as object[].

Changing properties must be done by Player.SetCustomProperties, which causes this callback locally, too.

Parameters
targetPlayer | Contains Player that changed.
changedProps | Contains the properties that changed.

Implements IInRoomCallbacks.

◆ OnRoomPropertiesUpdate()

void OnRoomPropertiesUpdate ( Hashtable propertiesThatChanged )

Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties.

Since v1.25 this method has one parameter: Hashtable propertiesThatChanged.
Changing properties must be done by Room.SetCustomProperties, which causes this callback locally, too.

Parameters
propertiesThatChanged

Implements IInRoomCallbacks.

Member Data Documentation

◆ MaxDatagrams

int MaxDatagrams = 3
static

Limits the number of datagrams that are created in each LateUpdate.

Helps spreading out sending of messages minimally.

◆ SendAsap

bool SendAsap
static

Signals that outgoing messages should be sent in the next LateUpdate call.

Up to MaxDatagrams are created to send queued messages.


Photon Unity Networking 2: PhotonRigidbody2DView Class Reference

  • Pun
  • PhotonRigidbody2DView
Public Member Functions | Public Attributes | List of all members
PhotonRigidbody2DView Class Reference

Inherits MonoBehaviourPun, and IPunObservable.

Public Member Functions

void | Awake ()
void | FixedUpdate ()
void | OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More...

Public Attributes

bool | m_SynchronizeVelocity = true
bool | m_SynchronizeAngularVelocity = false
bool | m_TeleportEnabled = false
float | m_TeleportIfDistanceGreaterThan = 3.0f

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Member Function Documentation

◆ OnPhotonSerializeView()

void OnPhotonSerializeView | ( | PhotonStream | stream,
 |  | PhotonMessageInfo | info
 | ) |  |

Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.

This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.

Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.

Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.

To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.

If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).

Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".

Implements IPunObservable.


Photon Unity Networking 2: PhotonRigidbodyView Class Reference

  • Pun
  • PhotonRigidbodyView
Public Member Functions | Public Attributes | List of all members
PhotonRigidbodyView Class Reference

Inherits MonoBehaviourPun, and IPunObservable.

Public Member Functions

void | Awake ()
void | FixedUpdate ()
void | OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More...

Public Attributes

bool | m_SynchronizeVelocity = true
bool | m_SynchronizeAngularVelocity = false
bool | m_TeleportEnabled = false
float | m_TeleportIfDistanceGreaterThan = 3.0f

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Member Function Documentation

◆ OnPhotonSerializeView()

void OnPhotonSerializeView | ( | PhotonStream | stream,
 |  | PhotonMessageInfo | info
 | ) |  |

Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.

This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.

Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.

Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.

To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.

If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).

Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".

Implements IPunObservable.


Photon Unity Networking 2: PhotonStreamQueue Class Reference

  • Pun
  • PhotonStreamQueue
Public Member Functions | List of all members
PhotonStreamQueue Class Reference

The PhotonStreamQueue helps you poll object states at higher frequencies than what PhotonNetwork.SendRate dictates and then sends all those states at once when Serialize() is called. On the receiving end you can call Deserialize() and then the stream will roll out the received object states in the same order and timeStep they were recorded in. More...

Public Member Functions

PhotonStreamQueue (int sampleRate)
Initializes a new instance of the PhotonStreamQueue class. More...
void | Reset ()
Resets the PhotonStreamQueue. You need to do this whenever the amount of objects you are observing changes More...
void | SendNext (object obj)
Adds the next object to the queue. This works just like PhotonStream.SendNext More...
bool | HasQueuedObjects ()
Determines whether the queue has stored any objects More...
object | ReceiveNext ()
Receives the next object from the queue. This works just like PhotonStream.ReceiveNext More...
void | Serialize (PhotonStream stream)
Serializes the specified stream. Call this in your OnPhotonSerializeView method to send the whole recorded stream. More...
void | Deserialize (PhotonStream stream)
Deserializes the specified stream. Call this in your OnPhotonSerializeView method to receive the whole recorded stream. More...

Detailed Description

The PhotonStreamQueue helps you poll object states at higher frequencies than what PhotonNetwork.SendRate dictates and then sends all those states at once when Serialize() is called. On the receiving end you can call Deserialize() and then the stream will roll out the received object states in the same order and timeStep they were recorded in.

Constructor & Destructor Documentation

◆ PhotonStreamQueue()

PhotonStreamQueue ( int sampleRate )

Initializes a new instance of the PhotonStreamQueue class.

Parameters
sampleRate How many times per second should the object states be sampled

Member Function Documentation

◆ Deserialize()

void Deserialize ( PhotonStream stream )

Deserializes the specified stream. Call this in your OnPhotonSerializeView method to receive the whole recorded stream.

Parameters
stream The PhotonStream you receive as a parameter in OnPhotonSerializeView

◆ HasQueuedObjects()

bool HasQueuedObjects ( )

Determines whether the queue has stored any objects

◆ ReceiveNext()

object ReceiveNext ( )

Receives the next object from the queue. This works just like PhotonStream.ReceiveNext

Returns

◆ Reset()

void Reset ( )

Resets the PhotonStreamQueue. You need to do this whenever the amount of objects you are observing changes

◆ SendNext()

void SendNext ( object obj )

Adds the next object to the queue. This works just like PhotonStream.SendNext

Parameters
obj The object you want to add to the queue

◆ Serialize()

void Serialize ( PhotonStream stream )

Serializes the specified stream. Call this in your OnPhotonSerializeView method to send the whole recorded stream.

Parameters
stream The PhotonStream you receive as a parameter in OnPhotonSerializeView


Photon Unity Networking 2: PhotonTransformView Class Reference

  • Pun
  • PhotonTransformView
Public Member Functions | Public Attributes | List of all members
PhotonTransformView Class Reference

Inherits MonoBehaviourPun, and IPunObservable.

Public Member Functions

void | Awake ()
void | Update ()
void | OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More...

Public Attributes

bool | m_SynchronizePosition = true
bool | m_SynchronizeRotation = true
bool | m_SynchronizeScale = false
bool | m_UseLocal

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Member Function Documentation

◆ OnPhotonSerializeView()

void OnPhotonSerializeView | ( | PhotonStream | stream,
 |  | PhotonMessageInfo | info
 | ) |  |

Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.

This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.

Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.

Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.

To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.

If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).

Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".

Implements IPunObservable.


Photon Unity Networking 2: PhotonTransformViewClassic Class Reference

  • Pun
  • PhotonTransformViewClassic
Public Member Functions | Public Attributes | List of all members
PhotonTransformViewClassic Class Reference

This class helps you to synchronize position, rotation and scale of a GameObject. It also gives you many different options to make the synchronized values appear smooth, even when the data is only send a couple of times per second. Simply add the component to your GameObject and make sure that the PhotonTransformViewClassic is added to the list of observed components More...

Inherits MonoBehaviourPun, and IPunObservable.

Public Member Functions

void | SetSynchronizedValues (Vector3 speed, float turnSpeed)
These values are synchronized to the remote objects if the interpolation mode or the extrapolation mode SynchronizeValues is used. Your movement script should pass on the current speed (in units/second) and turning speed (in angles/second) so the remote object can use them to predict the objects movement. More...
void | OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info)
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More...

Public Attributes

PhotonTransformViewPositionModel | m_PositionModel = new PhotonTransformViewPositionModel()
PhotonTransformViewRotationModel | m_RotationModel = new PhotonTransformViewRotationModel()
PhotonTransformViewScaleModel | m_ScaleModel = new PhotonTransformViewScaleModel()

Additional Inherited Members

- Properties inherited from MonoBehaviourPun
PhotonView photonView [get]
A cached reference to a PhotonView on this GameObject. More...

Detailed Description

This class helps you to synchronize position, rotation and scale of a GameObject. It also gives you many different options to make the synchronized values appear smooth, even when the data is only send a couple of times per second. Simply add the component to your GameObject and make sure that the PhotonTransformViewClassic is added to the list of observed components

Member Function Documentation

◆ OnPhotonSerializeView()

void OnPhotonSerializeView | ( | PhotonStream | stream,
 |  | PhotonMessageInfo | info
 | ) |  |

Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.

This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.

Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.

Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.

To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.

If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).

Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".

Implements IPunObservable.

◆ SetSynchronizedValues()

void SetSynchronizedValues | ( | Vector3 | speed,
 |  | float | turnSpeed
 | ) |  |

These values are synchronized to the remote objects if the interpolation mode or the extrapolation mode SynchronizeValues is used. Your movement script should pass on the current speed (in units/second) and turning speed (in angles/second) so the remote object can use them to predict the objects movement.

Parameters
speed | The current movement vector of the object in units/second.
turnSpeed | The current turn speed of the object in angles/second.


Photon Unity Networking 2: PhotonTransformViewPositionControl Class Reference

  • Pun
  • PhotonTransformViewPositionControl
Public Member Functions | List of all members
PhotonTransformViewPositionControl Class Reference

Public Member Functions

PhotonTransformViewPositionControl (PhotonTransformViewPositionModel model)
void | SetSynchronizedValues (Vector3 speed, float turnSpeed)
These values are synchronized to the remote objects if the interpolation mode or the extrapolation mode SynchronizeValues is used. Your movement script should pass on the current speed (in units/second) and turning speed (in angles/second) so the remote object can use them to predict the objects movement. More...
Vector3 | UpdatePosition (Vector3 currentPosition)
Calculates the new position based on the values setup in the inspector More...
Vector3 | GetNetworkPosition ()
Gets the last position that was received through the network More...
Vector3 | GetExtrapolatedPositionOffset ()
Calculates an estimated position based on the last synchronized position, the time when the last position was received and the movement speed of the object More...
void | OnPhotonSerializeView (Vector3 currentPosition, PhotonStream stream, PhotonMessageInfo info)

Member Function Documentation

◆ GetExtrapolatedPositionOffset()

Vector3 GetExtrapolatedPositionOffset ( )

Calculates an estimated position based on the last synchronized position, the time when the last position was received and the movement speed of the object

Returns
Estimated position of the remote object

◆ GetNetworkPosition()

Vector3 GetNetworkPosition ( )

Gets the last position that was received through the network

Returns

◆ SetSynchronizedValues()

void SetSynchronizedValues | ( | Vector3 | speed,
 |  | float | turnSpeed
 | ) |  |

These values are synchronized to the remote objects if the interpolation mode or the extrapolation mode SynchronizeValues is used. Your movement script should pass on the current speed (in units/second) and turning speed (in angles/second) so the remote object can use them to predict the objects movement.

Parameters
speed | The current movement vector of the object in units/second.
turnSpeed | The current turn speed of the object in angles/second.

◆ UpdatePosition()

Vector3 UpdatePosition ( Vector3 currentPosition )

Calculates the new position based on the values setup in the inspector

Parameters
currentPosition The current position.
Returns
The new position.


Photon Unity Networking 2: PhotonTransformViewPositionModel Class Reference

  • Pun
  • PhotonTransformViewPositionModel
Public Types | Public Attributes | List of all members
PhotonTransformViewPositionModel Class Reference

Public Types

enum | InterpolateOptions
enum | ExtrapolateOptions

Public Attributes

bool | SynchronizeEnabled
bool | TeleportEnabled = true
float | TeleportIfDistanceGreaterThan = 3f
InterpolateOptions | InterpolateOption = InterpolateOptions.EstimatedSpeed
float | InterpolateMoveTowardsSpeed = 1f
float | InterpolateLerpSpeed = 1f
ExtrapolateOptions | ExtrapolateOption = ExtrapolateOptions.Disabled
float | ExtrapolateSpeed = 1f
bool | ExtrapolateIncludingRoundTripTime = true
int | ExtrapolateNumberOfStoredPositions = 1


Photon Unity Networking 2: PhotonTransformViewRotationControl Class Reference

  • Pun
  • PhotonTransformViewRotationControl
Public Member Functions | List of all members
PhotonTransformViewRotationControl Class Reference

Public Member Functions

PhotonTransformViewRotationControl (PhotonTransformViewRotationModel model)
Quaternion | GetNetworkRotation ()
Gets the last rotation that was received through the network More...
Quaternion | GetRotation (Quaternion currentRotation)
void | OnPhotonSerializeView (Quaternion currentRotation, PhotonStream stream, PhotonMessageInfo info)

Member Function Documentation

◆ GetNetworkRotation()

Quaternion GetNetworkRotation ( )

Gets the last rotation that was received through the network

Returns


Photon Unity Networking 2: PhotonTransformViewRotationModel Class Reference

  • Pun
  • PhotonTransformViewRotationModel
Public Types | Public Attributes | List of all members
PhotonTransformViewRotationModel Class Reference

Public Types

enum InterpolateOptions

Public Attributes

bool | SynchronizeEnabled
InterpolateOptions | InterpolateOption = InterpolateOptions.RotateTowards
float | InterpolateRotateTowardsSpeed = 180
float | InterpolateLerpSpeed = 5


Photon Unity Networking 2: PhotonTransformViewScaleControl Class Reference

  • Pun
  • PhotonTransformViewScaleControl
Public Member Functions | List of all members
PhotonTransformViewScaleControl Class Reference

Public Member Functions

PhotonTransformViewScaleControl (PhotonTransformViewScaleModel model)
Vector3 | GetNetworkScale ()
Gets the last scale that was received through the network More...
Vector3 | GetScale (Vector3 currentScale)
void | OnPhotonSerializeView (Vector3 currentScale, PhotonStream stream, PhotonMessageInfo info)

Member Function Documentation

◆ GetNetworkScale()

Vector3 GetNetworkScale ( )

Gets the last scale that was received through the network

Returns


Photon Unity Networking 2: PhotonTransformViewScaleModel Class Reference

  • Pun
  • PhotonTransformViewScaleModel
Public Types | Public Attributes | List of all members
PhotonTransformViewScaleModel Class Reference

Public Types

enum InterpolateOptions

Public Attributes

bool | SynchronizeEnabled
InterpolateOptions | InterpolateOption = InterpolateOptions.Disabled
float | InterpolateMoveTowardsSpeed = 1f
float | InterpolateLerpSpeed


Photon Unity Networking 2: PunExtensions Class Reference

  • Pun
  • PunExtensions
Static Public Member Functions | Static Public Attributes | List of all members
PunExtensions Class Reference

Small number of extension methods that make it easier for PUN to work cross-Unity-versions. More...

Static Public Member Functions

static ParameterInfo[] | GetCachedParemeters (this MethodInfo mo)
static PhotonView[] | GetPhotonViewsInChildren (this UnityEngine.GameObject go)
static PhotonView | GetPhotonView (this UnityEngine.GameObject go)
static bool | AlmostEquals (this Vector3 target, Vector3 second, float sqrMagnitudePrecision)
compares the squared magnitude of target - second to given float value More...
static bool | AlmostEquals (this Vector2 target, Vector2 second, float sqrMagnitudePrecision)
compares the squared magnitude of target - second to given float value More...
static bool | AlmostEquals (this Quaternion target, Quaternion second, float maxAngle)
compares the angle between target and second to given float value More...
static bool | AlmostEquals (this float target, float second, float floatDiff)
compares two floats and returns true of their difference is less than floatDiff More...
static bool | CheckIsAssignableFrom (this Type to, Type from)
static bool | CheckIsInterface (this Type to)

Static Public Attributes

static Dictionary< MethodInfo, ParameterInfo[]> ParametersOfMethods = new Dictionary<MethodInfo, ParameterInfo[]>()

Detailed Description

Small number of extension methods that make it easier for PUN to work cross-Unity-versions.

Member Function Documentation

◆ AlmostEquals() [1/4]

static bool AlmostEquals | ( | this float | target,
 |  | float | second,
 |  | float | floatDiff
 | ) |  |
static

compares two floats and returns true of their difference is less than floatDiff

◆ AlmostEquals() [2/4]

static bool AlmostEquals | ( | this Quaternion | target,
 |  | Quaternion | second,
 |  | float | maxAngle
 | ) |  |
static

compares the angle between target and second to given float value

◆ AlmostEquals() [3/4]

static bool AlmostEquals | ( | this Vector2 | target,
 |  | Vector2 | second,
 |  | float | sqrMagnitudePrecision
 | ) |  |
static

compares the squared magnitude of target - second to given float value

◆ AlmostEquals() [4/4]

static bool AlmostEquals | ( | this Vector3 | target,
 |  | Vector3 | second,
 |  | float | sqrMagnitudePrecision
 | ) |  |
static

compares the squared magnitude of target - second to given float value


Photon Unity Networking 2: PunRPC Class Reference

  • Pun
  • PunRPC
PunRPC Class Reference

Replacement for RPC attribute with different name. Used to flag methods as remote-callable. More...

Inherits Attribute.

Detailed Description

Replacement for RPC attribute with different name. Used to flag methods as remote-callable.


Photon Unity Networking 2: SceneManagerHelper Class Reference

  • Pun
  • SceneManagerHelper
Properties | List of all members
SceneManagerHelper Class Reference

Properties

static string | ActiveSceneName [get]
static int | ActiveSceneBuildIndex [get]


Photon Unity Networking 2: ServerSettings Class Reference

  • Pun
  • ServerSettings
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
ServerSettings Class Reference

Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings. More...

Inherits ScriptableObject.

Public Member Functions

void | UseCloud (string cloudAppid, string code="")
Sets appid and region code in the AppSettings. Used in Editor. More...
override string | ToString ()
String summary of the AppSettings. More...

Static Public Member Functions

static bool | IsAppId (string val)
Checks if a string is a Guid by attempting to create one. More...
static void | ResetBestRegionCodeInPreferences ()
Sets the "best region summary" in the preferences to null. On next start, the client will ping all available. More...

Public Attributes

AppSettings | AppSettings
string | DevRegion
Region that will be used by the Editor and Development Builds. This ensures all users will be in the same region for testing. More...
PunLogLevel | PunLogging = PunLogLevel.ErrorsOnly
bool | EnableSupportLogger
bool | RunInBackground = true
bool | StartInOfflineMode
List< string > | RpcList = new List<string>()

Properties

static string BestRegionSummaryInPreferences [get]
Gets the "best region summary" from the preferences. More...

Detailed Description

Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings.

Includes the AppSettings class from the Realtime APIs plus some other, PUN-relevant, settings.

Member Function Documentation

◆ IsAppId()

static bool IsAppId ( string val )
static

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

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

◆ ResetBestRegionCodeInPreferences()

static void ResetBestRegionCodeInPreferences ( )
static

Sets the "best region summary" in the preferences to null. On next start, the client will ping all available.

◆ ToString()

override string ToString ( )

String summary of the AppSettings.

◆ UseCloud()

void UseCloud | ( | string | cloudAppid,
 |  | string | code = ""
 | ) |  |

Sets appid and region code in the AppSettings. Used in Editor.

Member Data Documentation

◆ DevRegion

string DevRegion

Region that will be used by the Editor and Development Builds. This ensures all users will be in the same region for testing.

Property Documentation

◆ BestRegionSummaryInPreferences

string BestRegionSummaryInPreferences
staticget

Gets the "best region summary" from the preferences.

The best region code in preferences.


Photon Unity Networking 2: Photon.Realtime Namespace Reference

  • Realtime
Classes | Typedefs | 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 | 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 LoadBalancingCallbackTargets. More...
class | ConnectionHandler
class | EnterRoomParams
Parameters for creating rooms. 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 | ErrorInfoCallbacksContainer
Container type for callbacks defined by IErrorInfoCallback. See LoadBalancingClient.ErrorInfoCallbackTargets.
class | EventCode
Class for constants. These values are for events defined by Photon LoadBalancing. More...
class | Extensions
This static class defines some useful extension methods for several existing classes (e.g. Vector3, float and others). More...
class | FindFriendsOptions
Options for OpFindFriends can be combined to filter which rooms of friends are returned. More...
class | FriendInfo
Used to store 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 LoadBalancing. 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...
class | InRoomCallbacksContainer
Container type for callbacks defined by IInRoomCallbacks. See InRoomCallbackTargets.
interface | IOnEventCallback
Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent. More...
interface | IWebRpcCallback
Interface for "WebRpc" callbacks for the Realtime Api. Currently includes only responses for Web RPCs. More...
class | LoadBalancingClient
This class implements the Photon LoadBalancing workflow by using a LoadBalancingPeer. It keeps a state and will automatically execute transitions between the Master and Game Servers. More...
class | LoadBalancingPeer
A LoadBalancingPeer provides the operations and enum definitions needed to use the LoadBalancing server application which is also used in Photon Cloud. More...
class | LobbyCallbacksContainer
Container type for callbacks defined by ILobbyCallbacks. See LobbyCallbackTargets.
class | MatchMakingCallbacksContainer
Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets. More...
class | OperationCode
Class for constants. Contains operation codes. More...
class | OpJoinRandomRoomParams
Parameters for the matchmaking of JoinRandomRoom and JoinRandomOrCreateRoom. More...
class | ParameterCode
Class for constants. Codes for parameters of Operations and Events. More...
class | PhotonAppSettings
Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings. More...
class | PhotonPing
Abstract implementation of PhotonPing, ase for pinging servers to find the "Best Region". More...
struct | PhotonPortDefinition
Container for port definitions. 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 | RaiseEventOptions
Aggregates several less-often used options for operation RaiseEvent. See field descriptions for usage details. More...
class | Region
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
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...
class | SupportLogger
Helper class to debug log basic information about Photon client and vital traffic statistics. More...
class | TypedLobby
Refers to a specific lobby on the server. More...
class | TypedLobbyInfo
Info for a lobby on the server. Used when LoadBalancingClient.EnableLobbyStatistics is true. More...
class | WebFlags
Optional flags to be used in Photon client SDKs with Op RaiseEvent and Op SetProperties. Introduced mainly for webhooks 1.2 to control behavior of forwarded HTTP requests. More...
class | WebRpcCallbacksContainer
Container type for callbacks defined by IWebRpcCallback. See WebRpcCallbackTargets.
class | WebRpcResponse
Reads an operation response of a WebRpc and provides convenient access to most common values. More...

Typedefs

using | SupportClass = ExitGames.Client.Photon.SupportClass
using | Stopwatch = System.Diagnostics.Stopwatch

Enumerations

enum | ClientState
State values for a client, which handles switching Photon server types, some operations, etc. More...
enum | DisconnectCause
Enumeration of causes for Disconnects (used in LoadBalancingClient.DisconnectedCause). More...
enum | ServerConnection
Available server (types) for internally used field: server. More...
enum | ClientAppType
Defines which sort of app the LoadBalancingClient is used for: Realtime or Voice. More...
enum | EncryptionMode
Defines how the communication gets encrypted. 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 | MatchmakingMode : byte
Options for matchmaking rules for OpJoinRandom. 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 | 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 | PropertyTypeFlag : byte
Flags for "types of properties", being used as filter in OpGetProperties. More...
enum | LobbyType : byte
Types of lobbies define their behaviour and capabilities. Check each value for details. More...
enum | AuthModeOption
Options for authentication modes. From "classic" auth on each server to AuthOnce (on NameServer). More...
enum | CustomAuthenticationType : byte
Options for optional "Custom Authentication" services used with Photon. Used by OpAuthenticate after connecting to Photon. More...

Enumeration Type Documentation

◆ AuthModeOption

enum AuthModeOption
strong

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

◆ ClientAppType

enum ClientAppType
strong

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

Enumerator
Realtime | Realtime apps are for gaming / interaction. Also used by PUN 2.
Voice | Voice apps stream audio.
Fusion | Fusion clients are for matchmaking and relay in Photon Fusion.

◆ CustomAuthenticationType

enum CustomAuthenticationType : byte
strong

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 auth values accordingly!
Facebook | Authenticates users by their Facebook Account. Set auth values accordingly!
Oculus | Authenticates users by their Oculus Account and token.
PlayStation4 | Authenticates users by their PSN Account and token on PS4.
Xbox | Authenticates users by their Xbox Account and XSTS token.
Viveport | Authenticates users by their HTC Viveport Account and user token. Set AuthGetParameters to "userToken=[userToken]"
NintendoSwitch | Authenticates users by their NSA ID.
PlayStation5 | Authenticates users by their PSN Account and token on PS5.
None | Disables custom authentication. Same as not providing any AuthenticationValues for connect (more precisely for: OpAuthenticate).

◆ DisconnectCause

enum DisconnectCause
strong

Enumeration of causes for Disconnects (used in LoadBalancingClient.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 catched 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.

◆ EncryptionMode

enum EncryptionMode
strong

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).
DatagramEncryption | With this encryption mode for UDP, the connection gets setup and all further datagrams get encrypted almost entirely. On-demand message encryption (like in PayloadEncryption) is unavailable.
DatagramEncryptionRandomSequence | With this encryption mode for UDP, the connection gets setup with random sequence numbers and all further datagrams get encrypted almost entirely. On-demand message encryption (like in PayloadEncryption) is unavailable.
DatagramEncryptionGCM | Datagram Encryption with GCM.

◆ EventCaching

enum 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).
MergeCache | Will merge this event's keys with those already cached.
ReplaceCache | Replaces the event cache for this eventCode with this event's content.
RemoveCache | Removes this event (by eventCode) from the cache.
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 RaiseEventOptions.CacheSliceIndex for this.
SlicePurgeIndex | Purge cache slice with index. Exactly one slice is removed from cache. You must set RaiseEventOptions.CacheSliceIndex for this.
SlicePurgeUpToIndex | Purge cache slices with specified index and anything lower than that. You must set RaiseEventOptions.CacheSliceIndex for this.

◆ JoinMode

enum 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.

◆ LobbyType

enum 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).
SqlLobby | 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.
AsyncRandomLobby | 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.

◆ MatchmakingMode

enum 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.

◆ PropertyTypeFlag

enum PropertyTypeFlag : byte
strong

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'

◆ ReceiverGroup

enum 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.

◆ ServerConnection

enum ServerConnection
strong

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).


Photon Unity Networking 2: ActorProperties Class Reference

  • Realtime
  • ActorProperties
Static Public Attributes | List of all members
ActorProperties Class Reference

Class for constants. These (byte) values define "well known" properties for an Actor / Player. More...

Static Public Attributes

const byte | PlayerName = 255
(255) Name of a player/actor. More...
const byte | IsInactive = 254
(254) Tells you if the player is currently in this game (getting events live). More...
const byte | UserId = 253
(253) UserId of the player. Sent when room gets created with RoomOptions.PublishUserId = true. More...

Detailed Description

Class for constants. These (byte) values define "well known" properties for an Actor / Player.

These constants are used internally. "Custom properties" have to use a string-type as key. They can be assigned at will.

Member Data Documentation

◆ IsInactive

const byte IsInactive = 254
static

(254) Tells you if the player is currently in this game (getting events live).

A server-set value for async games, where players can leave the game and return later.

◆ PlayerName

const byte PlayerName = 255
static

(255) Name of a player/actor.

◆ UserId

const byte UserId = 253
static

(253) UserId of the player. Sent when room gets created with RoomOptions.PublishUserId = true.


Photon Unity Networking 2: AppSettings Class Reference

  • Realtime
  • AppSettings
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
val The 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).


Photon Unity Networking 2: AuthenticationValues Class Reference

  • Realtime
  • AuthenticationValues
Public Member Functions | Properties | List of all members
AuthenticationValues Class Reference

Container for user authentication in Photon. Set AuthValues before you connect - all else is handled. More...

Public Member Functions

AuthenticationValues ()
Creates empty auth values without any info. More...
AuthenticationValues (string userId)
Creates minimal info about the user. If this is authenticated or not, depends on the set AuthType. More...
virtual void | SetAuthPostData (string stringData)
Sets the data to be passed-on to the auth service via POST. More...
virtual void | SetAuthPostData (byte[] byteData)
Sets the data to be passed-on to the auth service via POST. More...
virtual void | SetAuthPostData (Dictionary< string, object > dictData)
Sets data to be passed-on to the auth service as Json (Content-Type: "application/json") via Post. More...
virtual void | AddAuthParameter (string key, string value)
Adds a key-value pair to the get-parameters used for Custom Auth (AuthGetParameters). More...
override string | ToString ()
Transform this object into string. More...
AuthenticationValues | CopyTo (AuthenticationValues copy)
Make a copy of the current object. More...

Properties

CustomAuthenticationType | AuthType [get, set]
The type of authentication provider that should be used. Defaults to None (no auth whatsoever). More...
string | AuthGetParameters [get, set]
This string must contain any (http get) parameters expected by the used authentication service. By default, username and token. More...
object | AuthPostData [get]
Data to be passed-on to the auth service via POST. Default: null (not sent). Either string or byte[] (see setters). More...
object | Token [get, set]
Internal Photon token. After initial authentication, Photon provides a token for this client, subsequently used as (cached) validation. More...
string | UserId [get, set]
The UserId should be a unique identifier per user. This is for finding friends, etc.. More...

Detailed Description

Container for user authentication in Photon. Set AuthValues before you connect - all else is handled.

On Photon, user authentication is optional but can be useful in many cases. If you want to FindFriends, a unique ID per user is very practical.

There are basically three options for user authentication: None at all, the client sets some UserId or you can use some account web-service to authenticate a user (and set the UserId server-side).

Custom Authentication lets you verify end-users by some kind of login or token. It sends those values to Photon which will verify them before granting access or disconnecting the client.

The AuthValues are sent in OpAuthenticate when you connect, so they must be set before you connect. If the AuthValues.UserId is null or empty when it's sent to the server, then the Photon Server assigns a UserId!

The Photon Cloud Dashboard will let you enable this feature and set important server values for it. https://dashboard.photonengine.com

Constructor & Destructor Documentation

◆ AuthenticationValues() [1/2]

AuthenticationValues ( )

Creates empty auth values without any info.

◆ AuthenticationValues() [2/2]

AuthenticationValues ( string userId )

Creates minimal info about the user. If this is authenticated or not, depends on the set AuthType.

Parameters
userId Some UserId to set in Photon.

Member Function Documentation

◆ AddAuthParameter()

virtual void AddAuthParameter | ( | string | key,
 |  | string | value
 | ) |  |
virtual

Adds a key-value pair to the get-parameters used for Custom Auth (AuthGetParameters).

This method does uri-encoding for you.

Parameters
key | Key for the value to set.
value | Some value relevant for Custom Authentication.

◆ CopyTo()

AuthenticationValues CopyTo ( AuthenticationValues copy )

Make a copy of the current object.

Parameters
copy The object to be copied into.
Returns
The copied object.

◆ SetAuthPostData() [1/3]

virtual void SetAuthPostData ( byte[] byteData )
virtual

Sets the data to be passed-on to the auth service via POST.

AuthPostData is just one value. Each SetAuthPostData replaces any previous value. It can be either a string, a byte[] or a dictionary.

Parameters
byteData Binary token / auth-data to pass on.

◆ SetAuthPostData() [2/3]

virtual void SetAuthPostData ( Dictionary< string, object > dictData )
virtual

Sets data to be passed-on to the auth service as Json (Content-Type: "application/json") via Post.

AuthPostData is just one value. Each SetAuthPostData replaces any previous value. It can be either a string, a byte[] or a dictionary.

Parameters
dictData A authentication-data dictionary will be converted to Json and passed to the Auth webservice via HTTP Post.

◆ SetAuthPostData() [3/3]

virtual void SetAuthPostData ( string stringData )
virtual

Sets the data to be passed-on to the auth service via POST.

AuthPostData is just one value. Each SetAuthPostData replaces any previous value. It can be either a string, a byte[] or a dictionary.

Parameters
stringData String data to be used in the body of the POST request. Null or empty string will set AuthPostData to null.

◆ ToString()

override string ToString ( )

Transform this object into string.

Returns
String info about this object's values.

Property Documentation

◆ AuthGetParameters

string AuthGetParameters
getset

This string must contain any (http get) parameters expected by the used authentication service. By default, username and token.

Maps to operation parameter 216. Standard http get parameters are used here and passed on to the service that's defined in the server (Photon Cloud Dashboard).

◆ AuthPostData

object AuthPostData
get

Data to be passed-on to the auth service via POST. Default: null (not sent). Either string or byte[] (see setters).

Maps to operation parameter 214.

◆ AuthType

CustomAuthenticationType AuthType
getset

The type of authentication provider that should be used. Defaults to None (no auth whatsoever).

Several auth providers are available and CustomAuthenticationType.Custom can be used if you build your own service.

◆ Token

object Token
getset

Internal Photon token. After initial authentication, Photon provides a token for this client, subsequently used as (cached) validation.

Any token for custom authentication should be set via SetAuthPostData or AddAuthParameter.

◆ UserId

string UserId
getset

The UserId should be a unique identifier per user. This is for finding friends, etc..

See remarks of AuthValues for info about how this is set and used.


Photon Unity Networking 2: ConnectionCallbacksContainer Class Reference

  • Realtime
  • ConnectionCallbacksContainer
Public Member Functions | List of all members
ConnectionCallbacksContainer Class Reference

Container type for callbacks defined by IConnectionCallbacks. See LoadBalancingCallbackTargets. More...

Inherits List< IConnectionCallbacks >, and IConnectionCallbacks.

Public Member Functions

ConnectionCallbacksContainer (LoadBalancingClient client)
void | OnConnected ()
Called to signal that the "low level connection" got established but before the client can call operation on the server. More...
void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or an explicit disconnect call More...
void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...

Detailed Description

Container type for callbacks defined by IConnectionCallbacks. See LoadBalancingCallbackTargets.

While the interfaces of callbacks wrap up the methods that will be called, the container classes implement a simple way to call a method on all registered objects.

Member Function Documentation

◆ OnConnected()

void OnConnected ( )

Called to signal that the "low level connection" got established but before the client can call operation on the server.

After the (low level transport) connection is established, the client will automatically send the Authentication operation, which needs to get a response before the client can call other operations.

Your logic should wait for either: OnRegionListReceived or OnConnectedToMaster.

This callback is useful to detect if the server can be reached at all (technically). Most often, it's enough to implement OnDisconnected(DisconnectCause cause) and check for the cause.

This is not called for transitions from the masterserver to game servers.

Implements IConnectionCallbacks.

◆ OnConnectedToMaster()

void OnConnectedToMaster ( )

Called when the client is connected to the Master Server and ready for matchmaking and other tasks.

The list of available rooms won't become available unless you join a lobby via LoadBalancingClient.OpJoinLobby. You can join rooms and create them even without being in a lobby. The default lobby is used in that case.

Implements IConnectionCallbacks.

◆ OnCustomAuthenticationFailed()

void OnCustomAuthenticationFailed ( string debugMessage )

Called when the custom authentication failed. Followed by disconnect!

Custom Authentication can fail due to user-input, bad tokens/secrets. If authentication is successful, this method is not called. Implement OnJoinedLobby() or OnConnectedToMaster() (as usual).

During development of a game, it might also fail due to wrong configuration on the server side. In those cases, logging the debugMessage is very important.

Unless you setup a custom authentication service for your app (in the Dashboard), this won't be called!

Parameters
debugMessage Contains a debug message why authentication failed. This has to be fixed during development.

Implements IConnectionCallbacks.

◆ OnCustomAuthenticationResponse()

void OnCustomAuthenticationResponse ( Dictionary< string, object > data )

Called when your Custom Authentication service responds with additional data.

Custom Authentication services can include some custom data in their response. When present, that data is made available in this callback as Dictionary. While the keys of your data have to be strings, the values can be either string or a number (in Json). You need to make extra sure, that the value type is the one you expect. Numbers become (currently) int64.

Example: void OnCustomAuthenticationResponse(Dictionary<string, object> data) { ... }

https://doc.photonengine.com/en-us/realtime/current/reference/custom-authentication

Implements IConnectionCallbacks.

◆ OnDisconnected()

void OnDisconnected ( DisconnectCause cause )

Called after disconnecting from the Photon server. It could be a failure or an explicit disconnect call

The reason for this disconnect is provided as DisconnectCause.

Implements IConnectionCallbacks.

◆ OnRegionListReceived()

void OnRegionListReceived ( RegionHandler regionHandler )

Called when the Name Server provided a list of regions for your title.

Check the RegionHandler class description, to make use of the provided values.

Parameters
regionHandler The currently used RegionHandler.

Implements IConnectionCallbacks.


Photon Unity Networking 2: ConnectionHandler Class Reference

  • Realtime
  • ConnectionHandler
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
ConnectionHandler Class Reference

Inherited by PhotonHandler.

Public Member Functions

void | StartFallbackSendAckThread ()
void | StopFallbackSendAckThread ()
bool | RealtimeFallbackThread ()
A thread which runs independent from the Update() calls. Keeps connections online while loading or in background. See KeepAliveInBackground. More...

Public Attributes

bool | DisconnectAfterKeepAlive = false
Option to let the fallback thread call Disconnect after the KeepAliveInBackground time. Default: false. More...
int | KeepAliveInBackground = 60000
Defines for how long the Fallback Thread should keep the connection, before it may time out as usual. More...
bool | ApplyDontDestroyOnLoad = true
Keeps the ConnectionHandler, even if a new scene gets loaded. More...

Static Public Attributes

static bool AppQuits
Indicates that the app is closing. Set in OnApplicationQuit(). More...

Properties

LoadBalancingClient | Client [get, set]
Photon client to log information and statistics from. More...
int | CountSendAcksOnly [get]
Counts how often the Fallback Thread called SendAcksOnly, which is purely of interest to monitor if the game logic called SendOutgoingCommands as intended. More...
bool | FallbackThreadRunning [get]
True if a fallback thread is running. Will call the client's SendAcksOnly() method to keep the connection up. More...

Member Function Documentation

◆ RealtimeFallbackThread()

bool RealtimeFallbackThread ( )

A thread which runs independent from the Update() calls. Keeps connections online while loading or in background. See KeepAliveInBackground.

Member Data Documentation

◆ ApplyDontDestroyOnLoad

bool ApplyDontDestroyOnLoad = true

Keeps the ConnectionHandler, even if a new scene gets loaded.

◆ AppQuits

bool AppQuits
static

Indicates that the app is closing. Set in OnApplicationQuit().

◆ DisconnectAfterKeepAlive

bool DisconnectAfterKeepAlive = false

Option to let the fallback thread call Disconnect after the KeepAliveInBackground time. Default: false.

If set to true, the thread will disconnect the client regularly, should the client not call SendOutgoingCommands / Service. This may happen due to an app being in background (and not getting a lot of CPU time) or when loading assets.

If false, a regular timeout time will have to pass (on top) to time out the client.

◆ KeepAliveInBackground

int KeepAliveInBackground = 60000

Defines for how long the Fallback Thread should keep the connection, before it may time out as usual.

We want to the Client to keep it's connection when an app is in the background (and doesn't call Update / Service Clients should not keep their connection indefinitely in the background, so after some milliseconds, the Fallback Thread should stop keeping it up.

Property Documentation

◆ Client

LoadBalancingClient Client
getset

Photon client to log information and statistics from.

◆ CountSendAcksOnly

int CountSendAcksOnly
get

Counts how often the Fallback Thread called SendAcksOnly, which is purely of interest to monitor if the game logic called SendOutgoingCommands as intended.

◆ FallbackThreadRunning

bool FallbackThreadRunning
get

True if a fallback thread is running. Will call the client's SendAcksOnly() method to keep the connection up.


Photon Unity Networking 2: EnterRoomParams Class Reference

  • Realtime
  • EnterRoomParams
Public Attributes | List of all members
EnterRoomParams Class Reference

Parameters for creating rooms. More...

Public Attributes

string | RoomName
The name of the room to create. If null, the server generates a unique name. If not null, it must be unique and new or will cause an error. More...
RoomOptions RoomOptions
The RoomOptions define the optional behaviour of rooms. More...
TypedLobby Lobby
A lobby to attach the new room to. If set, this overrides a joined lobby (if any). More...
Hashtable | PlayerProperties
The custom player properties that describe this client / user. Keys must be strings. More...
string[] | ExpectedUsers
A list of users who are expected to join the room along with this client. Reserves slots for rooms with MaxPlayers value. More...

Detailed Description

Parameters for creating rooms.

Member Data Documentation

◆ ExpectedUsers

string [] ExpectedUsers

A list of users who are expected to join the room along with this client. Reserves slots for rooms with MaxPlayers value.

◆ Lobby

TypedLobby Lobby

A lobby to attach the new room to. If set, this overrides a joined lobby (if any).

◆ PlayerProperties

Hashtable PlayerProperties

The custom player properties that describe this client / user. Keys must be strings.

◆ RoomName

string RoomName

The name of the room to create. If null, the server generates a unique name. If not null, it must be unique and new or will cause an error.

◆ RoomOptions

RoomOptions RoomOptions

The RoomOptions define the optional behaviour of rooms.


Photon Unity Networking 2: ErrorCode Class Reference

  • Realtime
  • ErrorCode
Static Public Attributes | List of all members
ErrorCode Class Reference

ErrorCode defines the default codes associated with Photon client/server communication. More...

Static Public Attributes

const int | Ok = 0
(0) is always "OK", anything else an error or specific situation. More...
const int | OperationNotAllowedInCurrentState = -3
(-3) Operation can't be executed yet (e.g. OpJoin can't be called before being authenticated, RaiseEvent cant be used before getting into a room). More...
const int | InvalidOperationCode = -2
(-2) The operation you called is not implemented on the server (application) you connect to. Make sure you run the fitting applications. More...
const int | InvalidOperation = -2
(-2) The operation you called could not be executed on the server. More...
const int | InternalServerError = -1
(-1) Something went wrong in the server. Try to reproduce and contact Exit Games. More...
const int | InvalidAuthentication = 0x7FFF
(32767) Authentication failed. Possible cause: AppId is unknown to Photon (in cloud service). More...
const int | GameIdAlreadyExists = 0x7FFF - 1
(32766) GameId (name) already in use (can't create another). Change name. More...
const int | GameFull = 0x7FFF - 2
(32765) Game is full. This rarely happens when some player joined the room before your join completed. More...
const int | GameClosed = 0x7FFF - 3
(32764) Game is closed and can't be joined. Join another game. More...
const int | AlreadyMatched = 0x7FFF - 4
const int | ServerFull = 0x7FFF - 5
(32762) All servers are busy. This is a temporary issue and the game logic should try again after a brief wait time. More...
const int | UserBlocked = 0x7FFF - 6
(32761) Not in use currently. More...
const int | NoRandomMatchFound = 0x7FFF - 7
(32760) Random matchmaking only succeeds if a room exists thats neither closed nor full. Repeat in a few seconds or create a new room. More...
const int | GameDoesNotExist = 0x7FFF - 9
(32758) Join can fail if the room (name) is not existing (anymore). This can happen when players leave while you join. More...
const int | MaxCcuReached = 0x7FFF - 10
(32757) Authorization on the Photon Cloud failed becaus the concurrent users (CCU) limit of the app's subscription is reached. More...
const int | InvalidRegion = 0x7FFF - 11
(32756) Authorization on the Photon Cloud failed because the app's subscription does not allow to use a particular region's server. More...
const int | CustomAuthenticationFailed = 0x7FFF - 12
(32755) Custom Authentication of the user failed due to setup reasons (see Cloud Dashboard) or the provided user data (like username or token). Check error message for details. More...
const int | AuthenticationTicketExpired = 0x7FF1
(32753) The Authentication ticket expired. Usually, this is refreshed behind the scenes. Connect (and authorize) again. More...
const int | PluginReportedError = 0x7FFF - 15
(32752) A server-side plugin (or webhook) failed to execute and reported an error. Check the OperationResponse.DebugMessage. More...
const int | PluginMismatch = 0x7FFF - 16
(32751) CreateGame/JoinGame/Join operation fails if expected plugin does not correspond to loaded one. More...
const int | JoinFailedPeerAlreadyJoined = 32750
(32750) for join requests. Indicates the current peer already called join and is joined to the room. More...
const int | JoinFailedFoundInactiveJoiner = 32749
(32749) for join requests. Indicates the list of InactiveActors already contains an actor with the requested ActorNr or UserId. More...
const int | JoinFailedWithRejoinerNotFound = 32748
(32748) for join requests. Indicates the list of Actors (active and inactive) did not contain an actor with the requested ActorNr or UserId. More...
const int | JoinFailedFoundExcludedUserId = 32747
(32747) for join requests. Note: for future use - Indicates the requested UserId was found in the ExcludedList. More...
const int | JoinFailedFoundActiveJoiner = 32746
(32746) for join requests. Indicates the list of ActiveActors already contains an actor with the requested ActorNr or UserId. More...
const int | HttpLimitReached = 32745
(32745) for SetProerties and Raisevent (if flag HttpForward is true) requests. Indicates the maximum allowd http requests per minute was reached. More...
const int | ExternalHttpCallFailed = 32744
(32744) for WebRpc requests. Indicates the the call to the external service failed. More...
const int | OperationLimitReached = 32743
(32743) for operations with defined limits (as in calls per second, content count or size). More...
const int | SlotError = 32742
(32742) Server error during matchmaking with slot reservation. E.g. the reserved slots can not exceed MaxPlayers. More...
const int | InvalidEncryptionParameters = 32741
(32741) Server will react with this error if invalid encryption parameters provided by token More...

Detailed Description

ErrorCode defines the default codes associated with Photon client/server communication.

Member Data Documentation

◆ AuthenticationTicketExpired

const int AuthenticationTicketExpired = 0x7FF1
static

(32753) The Authentication ticket expired. Usually, this is refreshed behind the scenes. Connect (and authorize) again.

◆ CustomAuthenticationFailed

const int CustomAuthenticationFailed = 0x7FFF - 12
static

(32755) Custom Authentication of the user failed due to setup reasons (see Cloud Dashboard) or the provided user data (like username or token). Check error message for details.

◆ ExternalHttpCallFailed

const int ExternalHttpCallFailed = 32744
static

(32744) for WebRpc requests. Indicates the the call to the external service failed.

◆ GameClosed

const int GameClosed = 0x7FFF - 3
static

(32764) Game is closed and can't be joined. Join another game.

◆ GameDoesNotExist

const int GameDoesNotExist = 0x7FFF - 9
static

(32758) Join can fail if the room (name) is not existing (anymore). This can happen when players leave while you join.

◆ GameFull

const int GameFull = 0x7FFF - 2
static

(32765) Game is full. This rarely happens when some player joined the room before your join completed.

◆ GameIdAlreadyExists

const int GameIdAlreadyExists = 0x7FFF - 1
static

(32766) GameId (name) already in use (can't create another). Change name.

◆ HttpLimitReached

const int HttpLimitReached = 32745
static

(32745) for SetProerties and Raisevent (if flag HttpForward is true) requests. Indicates the maximum allowd http requests per minute was reached.

◆ InternalServerError

const int InternalServerError = -1
static

(-1) Something went wrong in the server. Try to reproduce and contact Exit Games.

◆ InvalidAuthentication

const int InvalidAuthentication = 0x7FFF
static

(32767) Authentication failed. Possible cause: AppId is unknown to Photon (in cloud service).

◆ InvalidEncryptionParameters

const int InvalidEncryptionParameters = 32741
static

(32741) Server will react with this error if invalid encryption parameters provided by token

◆ InvalidOperation

const int InvalidOperation = -2
static

(-2) The operation you called could not be executed on the server.

Make sure you are connected to the server you expect.

This code is used in several cases: The arguments/parameters of the operation might be out of range, missing entirely or conflicting. The operation you called is not implemented on the server (application). Server-side plugins affect the available operations.

◆ InvalidOperationCode

const int InvalidOperationCode = -2
static

(-2) The operation you called is not implemented on the server (application) you connect to. Make sure you run the fitting applications.

◆ InvalidRegion

const int InvalidRegion = 0x7FFF - 11
static

(32756) Authorization on the Photon Cloud failed because the app's subscription does not allow to use a particular region's server.

Some subscription plans for the Photon Cloud are region-bound. Servers of other regions can't be used then. Check your master server address and compare it with your Photon Cloud Dashboard's info. https://dashboard.photonengine.com

OpAuthorize is part of connection workflow but only on the Photon Cloud, this error can happen. Self-hosted Photon servers with a CCU limited license won't let a client connect at all.

◆ JoinFailedFoundActiveJoiner

const int JoinFailedFoundActiveJoiner = 32746
static

(32746) for join requests. Indicates the list of ActiveActors already contains an actor with the requested ActorNr or UserId.

◆ JoinFailedFoundExcludedUserId

const int JoinFailedFoundExcludedUserId = 32747
static

(32747) for join requests. Note: for future use - Indicates the requested UserId was found in the ExcludedList.

◆ JoinFailedFoundInactiveJoiner

const int JoinFailedFoundInactiveJoiner = 32749
static

(32749) for join requests. Indicates the list of InactiveActors already contains an actor with the requested ActorNr or UserId.

◆ JoinFailedPeerAlreadyJoined

const int JoinFailedPeerAlreadyJoined = 32750
static

(32750) for join requests. Indicates the current peer already called join and is joined to the room.

◆ JoinFailedWithRejoinerNotFound

const int JoinFailedWithRejoinerNotFound = 32748
static

(32748) for join requests. Indicates the list of Actors (active and inactive) did not contain an actor with the requested ActorNr or UserId.

◆ MaxCcuReached

const int MaxCcuReached = 0x7FFF - 10
static

(32757) Authorization on the Photon Cloud failed becaus the concurrent users (CCU) limit of the app's subscription is reached.

Unless you have a plan with "CCU Burst", clients might fail the authentication step during connect. Affected client are unable to call operations. Please note that players who end a game and return to the master server will disconnect and re-connect, which means that they just played and are rejected in the next minute / re-connect. This is a temporary measure. Once the CCU is below the limit, players will be able to connect an play again.

OpAuthorize is part of connection workflow but only on the Photon Cloud, this error can happen. Self-hosted Photon servers with a CCU limited license won't let a client connect at all.

◆ NoRandomMatchFound

const int NoRandomMatchFound = 0x7FFF - 7
static

(32760) Random matchmaking only succeeds if a room exists thats neither closed nor full. Repeat in a few seconds or create a new room.

◆ Ok

const int Ok = 0
static

(0) is always "OK", anything else an error or specific situation.

◆ OperationLimitReached

const int OperationLimitReached = 32743
static

(32743) for operations with defined limits (as in calls per second, content count or size).

◆ OperationNotAllowedInCurrentState

const int OperationNotAllowedInCurrentState = -3
static

(-3) Operation can't be executed yet (e.g. OpJoin can't be called before being authenticated, RaiseEvent cant be used before getting into a room).

Before you call any operations on the Cloud servers, the automated client workflow must complete its authorization. Wait until State is: JoinedLobby or ConnectedToMasterServer

◆ PluginMismatch

const int PluginMismatch = 0x7FFF - 16
static

(32751) CreateGame/JoinGame/Join operation fails if expected plugin does not correspond to loaded one.

◆ PluginReportedError

const int PluginReportedError = 0x7FFF - 15
static

(32752) A server-side plugin (or webhook) failed to execute and reported an error. Check the OperationResponse.DebugMessage.

◆ ServerFull

const int ServerFull = 0x7FFF - 5
static

(32762) All servers are busy. This is a temporary issue and the game logic should try again after a brief wait time.

This error may happen for all operations that create rooms. The operation response will contain this error code.

This error is very unlikely to happen as we monitor load on all servers and add them on demand. However, it's good to be prepared for a shortage of machines or surge in CCUs.

◆ SlotError

const int SlotError = 32742
static

(32742) Server error during matchmaking with slot reservation. E.g. the reserved slots can not exceed MaxPlayers.

◆ UserBlocked

const int UserBlocked = 0x7FFF - 6
static

(32761) Not in use currently.


Photon Unity Networking 2: ErrorInfo Class Reference

  • Realtime
  • ErrorInfo
Public Member Functions | Public Attributes | List of all members
ErrorInfo Class Reference

Class wrapping the received EventCode.ErrorInfo event. More...

Public Member Functions

ErrorInfo (EventData eventData)
override string ToString ()

Public Attributes

readonly string Info
String containing information about the error. More...

Detailed Description

Class wrapping the received EventCode.ErrorInfo event.

This is passed inside IErrorInfoCallback.OnErrorInfo callback. If you implement IOnEventCallback.OnEvent or LoadBalancingClient.EventReceived you will also get EventCode.ErrorInfo but not parsed.

In most cases this could be either:

  1. an error from webhooks plugin (if HasErrorInfo is enabled), read more here: https://doc.photonengine.com/en-us/realtime/current/gameplay/web-extensions/webhooks#options
  2. an error sent from a custom server plugin via PluginHost.BroadcastErrorInfoEvent, see example here: https://doc.photonengine.com/en-us/server/current/plugins/manual#handling_http_response
  3. an error sent from the server, for example, when the limit of cached events has been exceeded in the room (all clients will be disconnected and the room will be closed in this case) read more here: https://doc.photonengine.com/en-us/realtime/current/gameplay/cached-events#special_considerations

Member Data Documentation

◆ Info

readonly string Info

String containing information about the error.


Photon Unity Networking 2: EventCode Class Reference

  • Realtime
  • EventCode
Static Public Attributes | List of all members
EventCode Class Reference

Class for constants. These values are for events defined by Photon LoadBalancing. More...

Static Public Attributes

const byte | GameList = 230
(230) Initial list of RoomInfos (in lobby on Master) More...
const byte | GameListUpdate = 229
(229) Update of RoomInfos to be merged into "initial" list (in lobby on Master) More...
const byte | QueueState = 228
(228) Currently not used. State of queueing in case of server-full More...
const byte | Match = 227
(227) Currently not used. Event for matchmaking More...
const byte | AppStats = 226
(226) Event with stats about this application (players, rooms, etc) More...
const byte | LobbyStats = 224
(224) This event provides a list of lobbies with their player and game counts. More...
const byte | AzureNodeInfo = 210
(210) Internally used in case of hosting by Azure More...
const byte | Join = (byte)255
(255) Event Join: someone joined the game. The new actorNumber is provided as well as the properties of that actor (if set in OpJoin). More...
const byte | Leave = (byte)254
(254) Event Leave: The player who left the game can be identified by the actorNumber. More...
const byte | PropertiesChanged = (byte)253
(253) When you call OpSetProperties with the broadcast option "on", this event is fired. It contains the properties being set. More...
const byte | SetProperties = (byte)253
(253) When you call OpSetProperties with the broadcast option "on", this event is fired. It contains the properties being set. More...
const byte | ErrorInfo = 251
(251) Sent by Photon Cloud when a plugin-call or webhook-call failed or events cache limit exceeded. Usually, the execution on the server continues, despite the issue. Contains: ParameterCode.Info. More...
const byte | CacheSliceChanged = 250
(250) Sent by Photon whent he event cache slice was changed. Done by OpRaiseEvent. More...
const byte | AuthEvent = 223
(223) Sent by Photon to update a token before it times out. More...

Detailed Description

Class for constants. These values are for events defined by Photon LoadBalancing.

They start at 255 and go DOWN. Your own in-game events can start at 0. These constants are used internally.

Member Data Documentation

◆ AppStats

const byte AppStats = 226
static

(226) Event with stats about this application (players, rooms, etc)

◆ AuthEvent

const byte AuthEvent = 223
static

(223) Sent by Photon to update a token before it times out.

◆ AzureNodeInfo

const byte AzureNodeInfo = 210
static

(210) Internally used in case of hosting by Azure

◆ CacheSliceChanged

const byte CacheSliceChanged = 250
static

(250) Sent by Photon whent he event cache slice was changed. Done by OpRaiseEvent.

◆ ErrorInfo

const byte ErrorInfo = 251
static

(251) Sent by Photon Cloud when a plugin-call or webhook-call failed or events cache limit exceeded. Usually, the execution on the server continues, despite the issue. Contains: ParameterCode.Info.

(252) When player left game unexpected and the room has a playerTtl != 0, this event is fired to let everyone know about the timeout. Obsolete. Replaced by Leave. public const byte Disconnect = LiteEventCode.Disconnect;

See also
https://doc.photonengine.com/en-us/realtime/current/reference/webhooks::options

◆ GameList

const byte GameList = 230
static

(230) Initial list of RoomInfos (in lobby on Master)

◆ GameListUpdate

const byte GameListUpdate = 229
static

(229) Update of RoomInfos to be merged into "initial" list (in lobby on Master)

◆ Join

const byte Join = (byte)255
static

(255) Event Join: someone joined the game. The new actorNumber is provided as well as the properties of that actor (if set in OpJoin).

◆ Leave

const byte Leave = (byte)254
static

(254) Event Leave: The player who left the game can be identified by the actorNumber.

◆ LobbyStats

const byte LobbyStats = 224
static

(224) This event provides a list of lobbies with their player and game counts.

◆ Match

const byte Match = 227
static

(227) Currently not used. Event for matchmaking

◆ PropertiesChanged

const byte PropertiesChanged = (byte)253
static

(253) When you call OpSetProperties with the broadcast option "on", this event is fired. It contains the properties being set.

◆ QueueState

const byte QueueState = 228
static

(228) Currently not used. State of queueing in case of server-full

◆ SetProperties

const byte SetProperties = (byte)253
static

(253) When you call OpSetProperties with the broadcast option "on", this event is fired. It contains the properties being set.


Photon Unity Networking 2: Extensions Class Reference

  • Realtime
  • Extensions
Static Public Member Functions | List of all members
Extensions Class Reference

This static class defines some useful extension methods for several existing classes (e.g. Vector3, float and others). More...

Static Public Member Functions

static void | Merge (this IDictionary target, IDictionary addHash)
Merges all keys from addHash into the target. Adds new keys and updates the values of existing keys in target. More...
static void | MergeStringKeys (this IDictionary target, IDictionary addHash)
Merges keys of type string to target Hashtable. More...
static string | ToStringFull (this IDictionary origin)
Helper method for debugging of IDictionary content, including type-information. Using this is not performant. More...
static string | ToStringFull< T > (this List< T > data)
Helper method for debugging of List<T> content. Using this is not performant. More...
static string | ToStringFull (this object[] data)
Helper method for debugging of object[] content. Using this is not performant. More...
static Hashtable | StripToStringKeys (this IDictionary original)
This method copies all string-typed keys of the original into a new Hashtable. More...
static Hashtable | StripToStringKeys (this Hashtable original)
This method copies all string-typed keys of the original into a new Hashtable. More...
static void | StripKeysWithNullValues (this IDictionary original)
Removes all keys with null values. More...
static void | StripKeysWithNullValues (this Hashtable original)
Removes all keys with null values. More...
static bool | Contains (this int[] target, int nr)
Checks if a particular integer value is in an int-array. More...

Detailed Description

This static class defines some useful extension methods for several existing classes (e.g. Vector3, float and others).

Member Function Documentation

◆ Contains()

static bool Contains | ( | this int[] | target,
 |  | int | nr
 | ) |  |
static

Checks if a particular integer value is in an int-array.

This might be useful to look up if a particular actorNumber is in the list of players of a room.

Parameters
target | The array of ints to check.
nr | The number to lookup in target.
Returns
True if nr was found in target.

◆ Merge()

static void Merge | ( | this IDictionary | target,
 |  | IDictionary | addHash
 | ) |  |
static

Merges all keys from addHash into the target. Adds new keys and updates the values of existing keys in target.

Parameters
target | The IDictionary to update.
addHash | The IDictionary containing data to merge into target.

◆ MergeStringKeys()

static void MergeStringKeys | ( | this IDictionary | target,
 |  | IDictionary | addHash
 | ) |  |
static

Merges keys of type string to target Hashtable.

Does not remove keys from target (so non-string keys CAN be in target if they were before).

Parameters
target | The target IDictionary passed in plus all string-typed keys from the addHash.
addHash | A IDictionary that should be merged partly into target to update it.

◆ StripKeysWithNullValues() [1/2]

static void StripKeysWithNullValues ( this Hashtable original )
static

Removes all keys with null values.

Photon properties are removed by setting their value to null. Changes the original IDictionary! Uses lock(keysWithNullValue), which should be no problem in expected use cases.

Parameters
original The IDictionary to strip of keys with null value.

◆ StripKeysWithNullValues() [2/2]

static void StripKeysWithNullValues ( this IDictionary original )
static

Removes all keys with null values.

Photon properties are removed by setting their value to null. Changes the original IDictionary! Uses lock(keysWithNullValue), which should be no problem in expected use cases.

Parameters
original The IDictionary to strip of keys with null value.

◆ StripToStringKeys() [1/2]

static Hashtable StripToStringKeys ( this Hashtable original )
static

This method copies all string-typed keys of the original into a new Hashtable.

Does not recurse (!) into hashes that might be values in the root-hash. This does not modify the original.

Parameters
original The original IDictonary to get string-typed keys from.
Returns
New Hashtable containing only string-typed keys of the original.

◆ StripToStringKeys() [2/2]

static Hashtable StripToStringKeys ( this IDictionary original )
static

This method copies all string-typed keys of the original into a new Hashtable.

Does not recurse (!) into hashes that might be values in the root-hash. This does not modify the original.

Parameters
original The original IDictonary to get string-typed keys from.
Returns
New Hashtable containing only string-typed keys of the original.

◆ ToStringFull() [1/2]

static string ToStringFull ( this IDictionary origin )
static

Helper method for debugging of IDictionary content, including type-information. Using this is not performant.

Should only be used for debugging as necessary.

Parameters
origin Some Dictionary or Hashtable.
Returns
String of the content of the IDictionary.

◆ ToStringFull() [2/2]

static string ToStringFull ( this object[] data )
static

Helper method for debugging of object[] content. Using this is not performant.

Should only be used for debugging as necessary.

Parameters
data Any object[].
Returns
A comma-separated string containing each value's ToString().

◆ ToStringFull< T >()

static string ToStringFull< T > ( this List< T > data )
static

Helper method for debugging of List<T> content. Using this is not performant.

Should only be used for debugging as necessary.

Parameters
data Any List<T> where T implements .ToString().
Returns
A comma-separated string containing each value's ToString().


Photon Unity Networking 2: FindFriendsOptions Class Reference

  • Realtime
  • FindFriendsOptions
Public Attributes | List of all members
FindFriendsOptions Class Reference

Options for OpFindFriends can be combined to filter which rooms of friends are returned. More...

Public Attributes

bool | CreatedOnGs = false
Include a friend's room only if it is created and confirmed by the game server. More...
bool | Visible = false
Include a friend's room only if it is visible (using Room.IsVisible). More...
bool | Open = false
Include a friend's room only if it is open (using Room.IsOpen). More...

Detailed Description

Options for OpFindFriends can be combined to filter which rooms of friends are returned.

Member Data Documentation

◆ CreatedOnGs

bool CreatedOnGs = false

Include a friend's room only if it is created and confirmed by the game server.

◆ Open

bool Open = false

Include a friend's room only if it is open (using Room.IsOpen).

◆ Visible

bool Visible = false

Include a friend's room only if it is visible (using Room.IsVisible).


Photon Unity Networking 2: FriendInfo Class Reference

  • Realtime
  • FriendInfo
Public Member Functions | Properties | List of all members
FriendInfo Class Reference

Used to store info about a friend's online state and in which room he/she is. More...

Public Member Functions

override string ToString ()

Properties

string | Name [get]
string | UserId [get, protected set]
bool | IsOnline [get, protected set]
string | Room [get, protected set]
bool | IsInRoom [get]

Detailed Description

Used to store info about a friend's online state and in which room he/she is.


Photon Unity Networking 2: GamePropertyKey Class Reference

  • Realtime
  • GamePropertyKey
Static Public Attributes | List of all members
GamePropertyKey Class Reference

Class for constants. These (byte) values are for "well known" room/game properties used in Photon LoadBalancing. More...

Static Public Attributes

const byte | MaxPlayers = 255
(255) Max number of players that "fit" into this room. 0 is for "unlimited". More...
const byte | IsVisible = 254
(254) Makes this room listed or not in the lobby on master. More...
const byte | IsOpen = 253
(253) Allows more players to join a room (or not). More...
const byte | PlayerCount = 252
(252) Current count of players in the room. Used only in the lobby on master. More...
const byte | Removed = 251
(251) True if the room is to be removed from room listing (used in update to room list in lobby on master) More...
const byte | PropsListedInLobby = 250
(250) A list of the room properties to pass to the RoomInfo list in a lobby. This is used in CreateRoom, which defines this list once per room. More...
const byte | CleanupCacheOnLeave = 249
(249) Equivalent of Operation Join parameter CleanupCacheOnLeave. More...
const byte | MasterClientId = (byte)248
(248) Code for MasterClientId, which is synced by server. When sent as op-parameter this is (byte)203. As room property this is (byte)248. More...
const byte | ExpectedUsers = (byte)247
(247) Code for ExpectedUsers in a room. Matchmaking keeps a slot open for the players with these userIDs. More...
const byte | PlayerTtl = (byte)246
(246) Player Time To Live. How long any player can be inactive (due to disconnect or leave) before the user gets removed from the playerlist (freeing a slot). More...
const byte | EmptyRoomTtl = (byte)245
(245) Room Time To Live. How long a room stays available (and in server-memory), after the last player becomes inactive. After this time, the room gets persisted or destroyed. More...

Detailed Description

Class for constants. These (byte) values are for "well known" room/game properties used in Photon LoadBalancing.

These constants are used internally. "Custom properties" have to use a string-type as key. They can be assigned at will.

Member Data Documentation

◆ CleanupCacheOnLeave

const byte CleanupCacheOnLeave = 249
static

(249) Equivalent of Operation Join parameter CleanupCacheOnLeave.

◆ EmptyRoomTtl

const byte EmptyRoomTtl = (byte)245
static

(245) Room Time To Live. How long a room stays available (and in server-memory), after the last player becomes inactive. After this time, the room gets persisted or destroyed.

◆ ExpectedUsers

const byte ExpectedUsers = (byte)247
static

(247) Code for ExpectedUsers in a room. Matchmaking keeps a slot open for the players with these userIDs.

◆ IsOpen

const byte IsOpen = 253
static

(253) Allows more players to join a room (or not).

◆ IsVisible

const byte IsVisible = 254
static

(254) Makes this room listed or not in the lobby on master.

◆ MasterClientId

const byte MasterClientId = (byte)248
static

(248) Code for MasterClientId, which is synced by server. When sent as op-parameter this is (byte)203. As room property this is (byte)248.

Tightly related to ParameterCode.MasterClientId.

◆ MaxPlayers

const byte MaxPlayers = 255
static

(255) Max number of players that "fit" into this room. 0 is for "unlimited".

◆ PlayerCount

const byte PlayerCount = 252
static

(252) Current count of players in the room. Used only in the lobby on master.

◆ PlayerTtl

const byte PlayerTtl = (byte)246
static

(246) Player Time To Live. How long any player can be inactive (due to disconnect or leave) before the user gets removed from the playerlist (freeing a slot).

◆ PropsListedInLobby

const byte PropsListedInLobby = 250
static

(250) A list of the room properties to pass to the RoomInfo list in a lobby. This is used in CreateRoom, which defines this list once per room.

◆ Removed

const byte Removed = 251
static

(251) True if the room is to be removed from room listing (used in update to room list in lobby on master)


Photon Unity Networking 2: LoadBalancingClient Class Reference

  • Realtime
  • LoadBalancingClient
Classes | Public Member Functions | Public Attributes | Properties | Events | List of all members
LoadBalancingClient Class Reference

This class implements the Photon LoadBalancing workflow by using a LoadBalancingPeer. It keeps a state and will automatically execute transitions between the Master and Game Servers. More...

Inherits IPhotonPeerListener.

Public Member Functions

LoadBalancingClient (ConnectionProtocol protocol=ConnectionProtocol.Udp)
Creates a LoadBalancingClient with UDP protocol or the one specified. More...
LoadBalancingClient (string masterAddress, string appId, string gameVersion, ConnectionProtocol protocol=ConnectionProtocol.Udp)
Creates a LoadBalancingClient, setting various values needed before connecting. More...
virtual bool | ConnectUsingSettings (AppSettings appSettings)
bool | Connect ()
virtual bool | ConnectToMasterServer ()
Starts the "process" to connect to a Master Server, using MasterServerAddress and AppId properties. More...
bool | ConnectToNameServer ()
Connects to the NameServer for Photon Cloud, where a region and server list can be obtained. More...
bool | ConnectToRegionMaster (string region)
Connects you to a specific region's Master Server, using the Name Server to find the IP. More...
bool | ReconnectToMaster ()
Can be used to reconnect to the master server after a disconnect. More...
bool | ReconnectAndRejoin ()
Can be used to return to a room quickly by directly reconnecting to a game server to rejoin a room. More...
void | Disconnect (DisconnectCause cause=DisconnectCause.DisconnectByClientLogic)
Disconnects the peer from a server or stays disconnected. If the client / peer was connected, a callback will be triggered. More...
void | SimulateConnectionLoss (bool simulateTimeout)
Useful to test loss of connection which will end in a client timeout. This modifies LoadBalancingPeer.NetworkSimulationSettings. Read remarks. More...
void | Service ()
This method dispatches all available incoming commands and then sends this client's outgoing commands. It uses DispatchIncomingCommands and SendOutgoingCommands to do that. More...
bool | OpFindFriends (string[] friendsToFind, FindFriendsOptions options=null)
Request the rooms and online status for a list of friends. All clients should set a unique UserId before connecting. The result is available in this.FriendList. More...
bool | OpJoinLobby (TypedLobby lobby)
If already connected to a Master Server, this joins the specified lobby. This request triggers an OnOperationResponse() call and the callback OnJoinedLobby(). More...
bool | OpLeaveLobby ()
Opposite of joining a lobby. You don't have to explicitly leave a lobby to join another (client can be in one max, at any time). More...
bool | OpJoinRandomRoom (OpJoinRandomRoomParams opJoinRandomRoomParams=null)
Joins a random room that matches the filter. Will callback: OnJoinedRoom or OnJoinRandomFailed. More...
bool | OpJoinRandomOrCreateRoom (OpJoinRandomRoomParams opJoinRandomRoomParams, EnterRoomParams createRoomParams)
Attempts to join a room that matches the specified filter and creates a room if none found. More...
bool | OpCreateRoom (EnterRoomParams enterRoomParams)
Creates a new room. Will callback: OnCreatedRoom and OnJoinedRoom or OnCreateRoomFailed. More...
bool | OpJoinOrCreateRoom (EnterRoomParams enterRoomParams)
Joins a specific room by name and creates it on demand. Will callback: OnJoinedRoom or OnJoinRoomFailed. More...
bool | OpJoinRoom (EnterRoomParams enterRoomParams)
Joins a room by name. Will callback: OnJoinedRoom or OnJoinRoomFailed. More...
bool | OpRejoinRoom (string roomName)
Rejoins a room by roomName (using the userID internally to return). Will callback: OnJoinedRoom or OnJoinRoomFailed. More...
bool | OpLeaveRoom (bool becomeInactive, bool sendAuthCookie=false)
Leaves the current room, optionally telling the server that the user is just becoming inactive. Will callback: OnLeftRoom. More...
bool | OpGetGameList (TypedLobby typedLobby, string sqlLobbyFilter)
Gets a list of rooms matching the (non empty) SQL filter for the given SQL-typed lobby. More...
bool | OpSetCustomPropertiesOfActor (int actorNr, Hashtable propertiesToSet, Hashtable expectedProperties=null, WebFlags webFlags=null)
Updates and synchronizes a Player's Custom Properties. Optionally, expectedProperties can be provided as condition. More...
bool | OpSetCustomPropertiesOfRoom (Hashtable propertiesToSet, Hashtable expectedProperties=null, WebFlags webFlags=null)
Updates and synchronizes this Room's Custom Properties. Optionally, expectedProperties can be provided as condition. More...
virtual bool | OpRaiseEvent (byte eventCode, object customEventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions)
Send an event with custom code/type and any content to the other players in the same room. More...
virtual bool | OpChangeGroups (byte[] groupsToRemove, byte[] groupsToAdd)
Operation to handle this client's interest groups (for events in room). More...
void | ChangeLocalID (int newID)
Internally used to set the LocalPlayer's ID (from -1 to the actual in-room ID). More...
virtual void | DebugReturn (DebugLevel level, string message)
Debug output of low level api (and this client). More...
virtual void | OnOperationResponse (OperationResponse operationResponse)
Uses the OperationResponses provided by the server to advance the internal state and call ops as needed. More...
virtual void | OnStatusChanged (StatusCode statusCode)
Uses the connection's statusCodes to advance the internal state and call operations as needed. More...
virtual void | OnEvent (EventData photonEvent)
Uses the photonEvent's provided by the server to advance the internal state and call ops as needed. More...
virtual void | OnMessage (object message)
In Photon 4, "raw messages" will get their own callback method in the interface. Not used yet. More...
bool | OpWebRpc (string uriPath, object parameters, bool sendAuthCookie=false)
This operation makes Photon call your custom web-service by path/name with the given parameters (converted into Json). Use IWebRpcCallback.OnWebRpcResponse as a callback. More...
void | AddCallbackTarget (object target)
Registers an object for callbacks for the implemented callback-interfaces. More...
void | RemoveCallbackTarget (object target)
Unregisters an object from callbacks for the implemented callback-interfaces. More...

Public Attributes

AuthModeOption | AuthMode = AuthModeOption.Auth
Enables the new Authentication workflow. More...
EncryptionMode EncryptionMode = EncryptionMode.PayloadEncryption
Defines how the communication gets encrypted. More...
string | NameServerHost = "ns.photonengine.io"
Name Server Host Name for Photon Cloud. Without port and without any prefix. More...
PhotonPortDefinition ServerPortOverrides
Defines overrides for server ports. Used per server-type if > 0. Important: You must change these when the protocol changes! More...
string | ProxyServerAddress
Defines a proxy URL for WebSocket connections. Can be the proxy or point to a .pac file. More...
ConnectionCallbacksContainer ConnectionCallbackTargets
Wraps up the target objects for a group of callbacks, so they can be called conveniently. More...
MatchMakingCallbacksContainer MatchMakingCallbackTargets
Wraps up the target objects for a group of callbacks, so they can be called conveniently. More...
bool | EnableLobbyStatistics
If enabled, the client will get a list of available lobbies from the Master Server. More...
RegionHandler RegionHandler
Contains the list if enabled regions this client may use. Null, unless the client got a response to OpGetRegions. More...
string | SummaryToCache
Set when the best region pinging is done. More...
int | NameServerPortInAppSettings

Properties

LoadBalancingPeer | LoadBalancingPeer [get]
The client uses a LoadBalancingPeer as API to communicate with the server. This is public for ease-of-use: Some methods like OpRaiseEvent are not relevant for the connection state and don't need a override. More...
SerializationProtocol | SerializationProtocol [get, set]
Gets or sets the binary protocol version used by this client More...
string | AppVersion [get, set]
The version of your client. A new version also creates a new "virtual app" to separate players from older client versions. More...
string | AppId [get, set]
The AppID as assigned from the Photon Cloud. If you host yourself, this is the "regular" Photon Server Application Name (most likely: "LoadBalancing"). More...
ClientAppType | ClientType [get, set]
The ClientAppType defines which sort of AppId should be expected. The LoadBalancingClient supports Realtime and Voice app types. Default: Realtime. More...
AuthenticationValues | AuthValues [get, set]
User authentication values to be sent to the Photon server right after connecting. More...
ConnectionProtocol? | ExpectedProtocol [get, set]
Optionally contains a protocol which will be used on Master- and GameServer. More...
bool | IsUsingNameServer [get, set]
True if this client uses a NameServer to get the Master Server address. More...
string | NameServerAddress [get]
Name Server Address for Photon Cloud (based on current protocol). You can use the default values and usually won't have to set this value. More...
bool | UseAlternativeUdpPorts [get, set]
Replaced by ServerPortOverrides. More...
bool | EnableProtocolFallback [get, set]
Enables a fallback to another protocol in case a connect to the Name Server fails. More...
string | CurrentServerAddress [get]
The currently used server address (if any). The type of server is define by Server property. More...
string | MasterServerAddress [get, set]
Your Master Server address. In PhotonCloud, call ConnectToRegionMaster() to find your Master Server. More...
string | GameServerAddress [get, set]
The game server's address for a particular room. In use temporarily, as assigned by master. More...
ServerConnection | Server [get]
The server this client is currently connected or connecting to. More...
ClientState | State [get, set]
Current state this client is in. Careful: several states are "transitions" that lead to other states. More...
bool | IsConnected [get]
Returns if this client is currently connected or connecting to some type of server. More...
bool | IsConnectedAndReady [get]
A refined version of IsConnected which is true only if your connection is ready to send operations. More...
DisconnectCause | DisconnectedCause [get, protected set]
Summarizes (aggregates) the different causes for disconnects of a client. More...
bool | InLobby [get]
Internal value if the client is in a lobby. More...
TypedLobby | CurrentLobby [get, set]
The lobby this client currently uses. Defined when joining a lobby or creating rooms More...
Player | LocalPlayer [get, set]
The local player is never null but not valid unless the client is in a room, too. The ID will be -1 outside of rooms. More...
string | NickName [get, set]
The nickname of the player (synced with others). Same as client.LocalPlayer.NickName. More...
string | UserId [get, set]
An ID for this user. Sent in OpAuthenticate when you connect. If not set, the PlayerName is applied during connect. More...
Room | CurrentRoom [get, set]
The current room this client is connected to (null if none available). More...
bool | InRoom [get]
Is true while being in a room (this.state == ClientState.Joined). More...
int | PlayersOnMasterCount [get, set]
Statistic value available on master server: Players on master (looking for games). More...
int | PlayersInRoomsCount [get, set]
Statistic value available on master server: Players in rooms (playing). More...
int | RoomsCount [get, set]
Statistic value available on master server: Rooms currently created. More...
bool | IsFetchingFriendList [get]
Internal flag to know if the client currently fetches a friend list. More...
string | CloudRegion [get]
The cloud region this client connects to. Set by ConnectToRegionMaster(). Not set if you don't use a NameServer! More...
string | CurrentCluster [get]
The cluster name provided by the Name Server. More...

Events

Action< ClientState, ClientState > | StateChanged
Register a method to be called when this client's ClientState gets set. More...
Action< EventData > | EventReceived
Register a method to be called when an event got dispatched. Gets called after the LoadBalancingClient handled the internal events first. More...
Action< OperationResponse > | OpResponseReceived
Register a method to be called when an operation response is received. More...

Detailed Description

This class implements the Photon LoadBalancing workflow by using a LoadBalancingPeer. It keeps a state and will automatically execute transitions between the Master and Game Servers.

This class (and the Player class) should be extended to implement your own game logic. You can override CreatePlayer as "factory" method for Players and return your own Player instances. The State of this class is essential to know when a client is in a lobby (or just on the master) and when in a game where the actual gameplay should take place. Extension notes: An extension of this class should override the methods of the IPhotonPeerListener, as they are called when the state changes. Call base.method first, then pick the operation or state you want to react to and put it in a switch-case. We try to provide demo to each platform where this api can be used, so lookout for those.

Constructor & Destructor Documentation

◆ LoadBalancingClient() [1/2]

LoadBalancingClient ( ConnectionProtocol protocol = ConnectionProtocol.Udp )

Creates a LoadBalancingClient with UDP protocol or the one specified.

Parameters
protocol Specifies the network protocol to use for connections.

◆ LoadBalancingClient() [2/2]

LoadBalancingClient | ( | string | masterAddress,
 |  | string | appId,
 |  | string | gameVersion,
 |  | ConnectionProtocol | protocol = ConnectionProtocol.Udp
 | ) |  |

Creates a LoadBalancingClient, setting various values needed before connecting.

Parameters
masterAddress | The Master Server's address to connect to. Used in Connect.
appId | The AppId of this title. Needed for the Photon Cloud. Find it in the Dashboard.
gameVersion | A version for this client/build. In the Photon Cloud, players are separated by AppId, GameVersion and Region.
protocol | Specifies the network protocol to use for connections.

Member Function Documentation

◆ AddCallbackTarget()

void AddCallbackTarget ( object target )

Registers an object for callbacks for the implemented callback-interfaces.

Adding and removing callback targets is queued to not mess with callbacks in execution. Internally, this means that the addition/removal is done before the LoadBalancingClient calls the next callbacks. This detail should not affect a game's workflow.

The covered callback interfaces are: IConnectionCallbacks, IMatchmakingCallbacks, ILobbyCallbacks, IInRoomCallbacks, IOnEventCallback and IWebRpcCallback.

See: The object that registers to get callbacks from this client.

◆ ChangeLocalID()

void ChangeLocalID ( int newID )

Internally used to set the LocalPlayer's ID (from -1 to the actual in-room ID).

Parameters
newID New actor ID (a.k.a actorNr) assigned when joining a room.

◆ ConnectToMasterServer()

virtual bool ConnectToMasterServer ( )
virtual

Starts the "process" to connect to a Master Server, using MasterServerAddress and AppId properties.

To connect to the Photon Cloud, use ConnectUsingSettings() or ConnectToRegionMaster().

The process to connect includes several steps: the actual connecting, establishing encryption, authentification (of app and optionally the user) and connecting to the MasterServer

Users can connect either anonymously or use "Custom Authentication" to verify each individual player's login. Custom Authentication in Photon uses external services and communities to verify users. While the client provides a user's info, the service setup is done in the Photon Cloud Dashboard. The parameter authValues will set this.AuthValues and use them in the connect process.

Connecting to the Photon Cloud might fail due to:

  • Network issues (OnStatusChanged() StatusCode.ExceptionOnConnect)
  • Region not available (OnOperationResponse() for OpAuthenticate with ReturnCode == ErrorCode.InvalidRegion)
  • Subscription CCU limit reached (OnOperationResponse() for OpAuthenticate with ReturnCode == ErrorCode.MaxCcuReached)

◆ ConnectToNameServer()

bool ConnectToNameServer ( )

Connects to the NameServer for Photon Cloud, where a region and server list can be obtained.

OpGetRegions

Returns
If the workflow was started or failed right away.

◆ ConnectToRegionMaster()

bool ConnectToRegionMaster ( string region )

Connects you to a specific region's Master Server, using the Name Server to find the IP.

If the region is null or empty, no connection will be made. If the region (code) provided is not available, the connection process will fail on the Name Server. This method connects only to the region defined. No "Best Region" pinging will be done.

If the region string does not contain a "/", this means no specific cluster is requested. To support "Sharding", the region gets a "/*" postfix in this case, to select a random cluster.

Returns
If the operation could be sent. If false, no operation was sent.

◆ DebugReturn()

virtual void DebugReturn | ( | DebugLevel | level,
 |  | string | message
 | ) |  |
virtual

Debug output of low level api (and this client).

This method is not responsible to keep up the state of a LoadBalancingClient. Calling base.DebugReturn on overrides is optional.

◆ Disconnect()

void Disconnect ( DisconnectCause cause = DisconnectCause.DisconnectByClientLogic )

Disconnects the peer from a server or stays disconnected. If the client / peer was connected, a callback will be triggered.

Disconnect will attempt to notify the server of the client closing the connection.

Clients that are in a room, will leave the room. If the room's playerTTL > 0, the player will just become inactive (and may rejoin).

This method will not change the current State, if this client State is PeerCreated, Disconnecting or Disconnected. In those cases, there is also no callback for the disconnect. The DisconnectedCause will only change if the client was connected.

◆ OnEvent()

virtual void OnEvent ( EventData photonEvent )
virtual

Uses the photonEvent's provided by the server to advance the internal state and call ops as needed.

This method is essential to update the internal state of a LoadBalancingClient. Overriding methods must call base.OnEvent.

◆ OnMessage()

virtual void OnMessage ( object message )
virtual

In Photon 4, "raw messages" will get their own callback method in the interface. Not used yet.

◆ OnOperationResponse()

virtual void OnOperationResponse ( OperationResponse operationResponse )
virtual

Uses the OperationResponses provided by the server to advance the internal state and call ops as needed.

When this method finishes, it will call your OnOpResponseAction (if any). This way, you can get any operation response without overriding this class.

To implement a more complex game/app logic, you should implement your own class that inherits the LoadBalancingClient. Override this method to use your own operation-responses easily.

This method is essential to update the internal state of a LoadBalancingClient, so overriding methods must call base.OnOperationResponse().

Parameters
operationResponse Contains the server's response for an operation called by this peer.

◆ OnStatusChanged()

virtual void OnStatusChanged ( StatusCode statusCode )
virtual

Uses the connection's statusCodes to advance the internal state and call operations as needed.

This method is essential to update the internal state of a LoadBalancingClient. Overriding methods must call base.OnStatusChanged.

◆ OpChangeGroups()

virtual bool OpChangeGroups | ( | byte[] | groupsToRemove,
 |  | byte[] | groupsToAdd
 | ) |  |
virtual

Operation to handle this client's interest groups (for events in room).

Note the difference between passing null and byte[0]: null won't add/remove any groups. byte[0] will add/remove all (existing) groups. First, removing groups is executed. This way, you could leave all groups and join only the ones provided.

Changes become active not immediately but when the server executes this operation (approximately RTT/2).

Parameters
groupsToRemove | Groups to remove from interest. Null will not remove any. A byte[0] will remove all.
groupsToAdd | Groups to add to interest. Null will not add any. A byte[0] will add all current.
Returns
If operation could be enqueued for sending. Sent when calling: Service or SendOutgoingCommands.

◆ OpCreateRoom()

bool OpCreateRoom ( EnterRoomParams enterRoomParams )

Creates a new room. Will callback: OnCreatedRoom and OnJoinedRoom or OnCreateRoomFailed.

When successful, the client will enter the specified room and callback both OnCreatedRoom and OnJoinedRoom. In all error cases, OnCreateRoomFailed gets called.

Creating a room will fail if the room name is already in use or when the RoomOptions clashing with one another. Check the EnterRoomParams reference for the various room creation options.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

When you're in the room, this client's State will become ClientState.Joined.

When entering a room, this client's Player Custom Properties will be sent to the room. Use LocalPlayer.SetCustomProperties to set them, even while not yet in the room. Note that the player properties will be cached locally and are not wiped when leaving a room.

You can define an array of expectedUsers, to block player slots in the room for these users. The corresponding feature in Photon is called "Slot Reservation" and can be found in the doc pages.

Parameters
enterRoomParams Definition of properties for the room to create.
Returns
If the operation could be sent currently (requires connection to Master Server).

◆ OpFindFriends()

bool OpFindFriends | ( | string[] | friendsToFind,
 |  | FindFriendsOptions | options = null
 | ) |  |

Request the rooms and online status for a list of friends. All clients should set a unique UserId before connecting. The result is available in this.FriendList.

Used on Master Server to find the rooms played by a selected list of users. The result will be stored in LoadBalancingClient.FriendList, which is null before the first server response.

Users identify themselves by setting a UserId in the LoadBalancingClient instance. This will send the ID in OpAuthenticate during connect (to master and game servers). Note: Changing a player's name doesn't make sense when using a friend list.

The list of usernames must be fetched from some other source (not provided by Photon).

Internal:
The server response includes 2 arrays of info (each index matching a friend from the request):
ParameterCode.FindFriendsResponseOnlineList = bool[] of online states
ParameterCode.FindFriendsResponseRoomIdList = string[] of room names (empty string if not in a room)

The options may be used to define which state a room must match to be returned.

Parameters
friendsToFind | Array of friend's names (make sure they are unique).
options | Options that affect the result of the FindFriends operation.
Returns
If the operation could be sent (requires connection).

◆ OpGetGameList()

bool OpGetGameList | ( | TypedLobby | typedLobby,
 |  | string | sqlLobbyFilter
 | ) |  |

Gets a list of rooms matching the (non empty) SQL filter for the given SQL-typed lobby.

Operation is only available for lobbies of type SqlLobby and the filter can not be empty. It will check those conditions and fail locally, returning false.

This is an async request which triggers a OnOperationResponse() call.

https://doc.photonengine.com/en-us/realtime/current/reference/matchmaking-and-lobby::sql_lobby_type

Parameters
typedLobby | The lobby to query. Has to be of type SqlLobby.
sqlLobbyFilter | The sql query statement.
Returns
If the operation could be sent (has to be connected).

◆ OpJoinLobby()

bool OpJoinLobby ( TypedLobby lobby )

If already connected to a Master Server, this joins the specified lobby. This request triggers an OnOperationResponse() call and the callback OnJoinedLobby().

Parameters
lobby The lobby to join. Use null for default lobby.
Returns
If the operation could be sent. False, if the client is not IsConnectedAndReady or when it's not connected to a Master Server.

◆ OpJoinOrCreateRoom()

bool OpJoinOrCreateRoom ( EnterRoomParams enterRoomParams )

Joins a specific room by name and creates it on demand. Will callback: OnJoinedRoom or OnJoinRoomFailed.

Useful when players make up a room name to meet in: All involved clients call the same method and whoever is first, also creates the room.

When successful, the client will enter the specified room. The client which creates the room, will callback both OnCreatedRoom and OnJoinedRoom. Clients that join an existing room will only callback OnJoinedRoom. In all error cases, OnJoinRoomFailed gets called.

Joining a room will fail, if the room is full, closed or when the user already is present in the room (checked by userId).

To return to a room, use OpRejoinRoom.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

This client's State is set to ClientState.Joining immediately, when the operation could be called. In the background, the client will switch servers and call various related operations.

When you're in the room, this client's State will become ClientState.Joined.

If you set room properties in roomOptions, they get ignored when the room is existing already. This avoids changing the room properties by late joining players.

When entering a room, this client's Player Custom Properties will be sent to the room. Use LocalPlayer.SetCustomProperties to set them, even while not yet in the room. Note that the player properties will be cached locally and are not wiped when leaving a room.

You can define an array of expectedUsers, to block player slots in the room for these users. The corresponding feature in Photon is called "Slot Reservation" and can be found in the doc pages.

Parameters
enterRoomParams Definition of properties for the room to create or join.
Returns
If the operation could be sent currently (requires connection to Master Server).

◆ OpJoinRandomOrCreateRoom()

bool OpJoinRandomOrCreateRoom | ( | OpJoinRandomRoomParams | opJoinRandomRoomParams,
 |  | EnterRoomParams | createRoomParams
 | ) |  |

Attempts to join a room that matches the specified filter and creates a room if none found.

This operation is a combination of filter-based random matchmaking with the option to create a new room, if no fitting room exists. The benefit of that is that the room creation is done by the same operation and the room can be found by the very next client, looking for similar rooms.

There are separate parameters for joining and creating a room.

This method can only be called while connected to a Master Server. This client's State is set to ClientState.Joining immediately.

Either IMatchmakingCallbacks.OnJoinedRoom or IMatchmakingCallbacks.OnCreatedRoom get called.

More about matchmaking: https://doc.photonengine.com/en-us/realtime/current/reference/matchmaking-and-lobby

Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

Returns
If the operation will be sent (requires connection to Master Server).

◆ OpJoinRandomRoom()

bool OpJoinRandomRoom ( OpJoinRandomRoomParams opJoinRandomRoomParams = null )

Joins a random room that matches the filter. Will callback: OnJoinedRoom or OnJoinRandomFailed.

Used for random matchmaking. You can join any room or one with specific properties defined in opJoinRandomRoomParams.

You can use expectedCustomRoomProperties and expectedMaxPlayers as filters for accepting rooms. If you set expectedCustomRoomProperties, a room must have the exact same key values set at Custom Properties. You need to define which Custom Room Properties will be available for matchmaking when you create a room. See: OpCreateRoom(string roomName, RoomOptions roomOptions, TypedLobby lobby)

This operation fails if no rooms are fitting or available (all full, closed or not visible). It may also fail when actually joining the room which was found. Rooms may close, become full or empty anytime.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

This client's State is set to ClientState.Joining immediately, when the operation could be called. In the background, the client will switch servers and call various related operations.

When you're in the room, this client's State will become ClientState.Joined.

When entering a room, this client's Player Custom Properties will be sent to the room. Use LocalPlayer.SetCustomProperties to set them, even while not yet in the room. Note that the player properties will be cached locally and are not wiped when leaving a room.

More about matchmaking: https://doc.photonengine.com/en-us/realtime/current/reference/matchmaking-and-lobby

You can define an array of expectedUsers, to block player slots in the room for these users. The corresponding feature in Photon is called "Slot Reservation" and can be found in the doc pages.

Parameters
opJoinRandomRoomParams Optional definition of properties to filter rooms in random matchmaking.
Returns
If the operation could be sent currently (requires connection to Master Server).

◆ OpJoinRoom()

bool OpJoinRoom ( EnterRoomParams enterRoomParams )

Joins a room by name. Will callback: OnJoinedRoom or OnJoinRoomFailed.

Useful when using lobbies or when players follow friends or invite each other.

When successful, the client will enter the specified room and callback via OnJoinedRoom. In all error cases, OnJoinRoomFailed gets called.

Joining a room will fail if the room is full, closed, not existing or when the user already is present in the room (checked by userId).

To return to a room, use OpRejoinRoom. When players invite each other and it's unclear who's first to respond, use OpJoinOrCreateRoom instead.

This method can only be called while the client is connected to a Master Server so you should implement the callback OnConnectedToMaster. Check the return value to make sure the operation will be called on the server. Note: There will be no callbacks if this method returned false.

A room's name has to be unique (per region, appid and gameversion). When your title uses a global matchmaking or invitations (e.g. an external solution), keep regions and the game versions in mind to join a room.

This client's State is set to ClientState.Joining immediately, when the operation could be called. In the background, the client will switch servers and call various related operations.

When you're in the room, this client's State will become ClientState.Joined.

When entering a room, this client's Player Custom Properties will be sent to the room. Use LocalPlayer.SetCustomProperties to set them, even while not yet in the room. Note that the player properties will be cached locally and are not wiped when leaving a room.

You can define an array of expectedUsers, to reserve player slots in the room for friends or party members. The corresponding feature in Photon is called "Slot Reservation" and can be found in the doc pages.

Parameters
enterRoomParams Definition of properties for the room to join.
Returns
If the operation could be sent currently (requires connection to Master Server).

◆ OpLeaveLobby()

bool OpLeaveLobby ( )

Opposite of joining a lobby. You don't have to explicitly leave a lobby to join another (client can be in one max, at any time).

Returns
If the operation could be sent (has to be connected).

◆ OpLeaveRoom()

bool OpLeaveRoom | ( | bool | becomeInactive,
 |  | bool | sendAuthCookie = false
 | ) |  |

Leaves the current room, optionally telling the server that the user is just becoming inactive. Will callback: OnLeftRoom.

OpLeaveRoom skips execution when the room is null or the server is not GameServer or the client is disconnecting from GS already. OpLeaveRoom returns false in those cases and won't change the state, so check return of this method.

In some cases, this method will skip the OpLeave call and just call Disconnect(), which not only leaves the room but also the server. Disconnect also triggers a leave and so that workflow is is quicker.

Parameters
becomeInactive | If true, this player becomes inactive in the game and can return later (if PlayerTTL of the room is != 0).
sendAuthCookie | WebFlag: Securely transmit the encrypted object AuthCookie to the web service in PathLeave webhook when available
Returns
If the current room could be left (impossible while not in a room).

◆ OpRaiseEvent()

virtual bool OpRaiseEvent | ( | byte | eventCode,
 |  | object | customEventContent,
 |  | RaiseEventOptions | raiseEventOptions,
 |  | SendOptions | sendOptions
 | ) |  |
virtual

Send an event with custom code/type and any content to the other players in the same room.

Parameters
eventCode | Identifies this type of event (and the content). Your game's event codes can start with 0.
customEventContent | Any serializable datatype (including Hashtable like the other OpRaiseEvent overloads).
raiseEventOptions | Contains used send options. If you pass null, the default options will be used.
sendOptions | Send options for reliable, encryption etc
Returns
If operation could be enqueued for sending. Sent when calling: Service or SendOutgoingCommands.

◆ OpRejoinRoom()

bool OpRejoinRoom ( string roomName )

Rejoins a room by roomName (using the userID internally to return). Will callback: OnJoinedRoom or OnJoinRoomFailed.

Used to return to a room, before this user was removed from the players list. Internally, the userID will be checked by the server, to make sure this user is in the room (active or inactice).

In contrast to join, this operation never adds a players to a room. It will attempt to retake an existing spot in the playerlist or fail. This makes sure the client doean't accidentally join a room when the game logic meant to re-activate an existing actor in an existing room.

This method will fail on the server, when the room does not exist, can't be loaded (persistent rooms) or when the userId is not in the player list of this room. This will lead to a callback OnJoinRoomFailed.

Rejoining room will not send any player properties. Instead client will receive up-to-date ones from server. If you want to set new player properties, do it once rejoined.

◆ OpSetCustomPropertiesOfActor()

bool OpSetCustomPropertiesOfActor | ( | int | actorNr,
 |  | Hashtable | propertiesToSet,
 |  | Hashtable | expectedProperties = null,
 |  | WebFlags | webFlags = null
 | ) |  |

Updates and synchronizes a Player's Custom Properties. Optionally, expectedProperties can be provided as condition.

Custom Properties are a set of string keys and arbitrary values which is synchronized for the players in a Room. They are available when the client enters the room, as they are in the response of OpJoin and OpCreate.

Custom Properties either relate to the (current) Room or a Player (in that Room).

Both classes locally cache the current key/values and make them available as property: CustomProperties. This is provided only to read them. You must use the method SetCustomProperties to set/modify them.

Any client can set any Custom Properties anytime (when in a room). It's up to the game logic to organize how they are best used.

You should call SetCustomProperties only with key/values that are new or changed. This reduces traffic and performance.

Unless you define some expectedProperties, setting key/values is always permitted. In this case, the property-setting client will not receive the new values from the server but instead update its local cache in SetCustomProperties.

If you define expectedProperties, the server will skip updates if the server property-cache does not contain all expectedProperties with the same values. In this case, the property-setting client will get an update from the server and update it's cached key/values at about the same time as everyone else.

The benefit of using expectedProperties can be only one client successfully sets a key from one known value to another. As example: Store who owns an item in a Custom Property "ownedBy". It's 0 initally. When multiple players reach the item, they all attempt to change "ownedBy" from 0 to their actorNumber. If you use expectedProperties {"ownedBy", 0} as condition, the first player to take the item will have it (and the others fail to set the ownership).

Properties get saved with the game state for Turnbased games (which use IsPersistent = true).

Parameters
actorNr | Defines which player the Custom Properties belong to. ActorID of a player.
propertiesToSet | Hashtable of Custom Properties that changes.
expectedProperties | Provide some keys/values to use as condition for setting the new values. Client must be in room.
webFlags | Defines if the set properties should be forwarded to a WebHook. Client must be in room.
Returns
False if propertiesToSet is null or empty or have zero string keys. If not in a room, returns true if local player and expectedProperties and webFlags are null. False if actorNr is lower than or equal to zero. Otherwise, returns if the operation could be sent to the server.

◆ OpSetCustomPropertiesOfRoom()

bool OpSetCustomPropertiesOfRoom | ( | Hashtable | propertiesToSet,
 |  | Hashtable | expectedProperties = null,
 |  | WebFlags | webFlags = null
 | ) |  |

Updates and synchronizes this Room's Custom Properties. Optionally, expectedProperties can be provided as condition.

Custom Properties are a set of string keys and arbitrary values which is synchronized for the players in a Room. They are available when the client enters the room, as they are in the response of OpJoin and OpCreate.

Custom Properties either relate to the (current) Room or a Player (in that Room).

Both classes locally cache the current key/values and make them available as property: CustomProperties. This is provided only to read them. You must use the method SetCustomProperties to set/modify them.

Any client can set any Custom Properties anytime (when in a room). It's up to the game logic to organize how they are best used.

You should call SetCustomProperties only with key/values that are new or changed. This reduces traffic and performance.

Unless you define some expectedProperties, setting key/values is always permitted. In this case, the property-setting client will not receive the new values from the server but instead update its local cache in SetCustomProperties.

If you define expectedProperties, the server will skip updates if the server property-cache does not contain all expectedProperties with the same values. In this case, the property-setting client will get an update from the server and update it's cached key/values at about the same time as everyone else.

The benefit of using expectedProperties can be only one client successfully sets a key from one known value to another. As example: Store who owns an item in a Custom Property "ownedBy". It's 0 initally. When multiple players reach the item, they all attempt to change "ownedBy" from 0 to their actorNumber. If you use expectedProperties {"ownedBy", 0} as condition, the first player to take the item will have it (and the others fail to set the ownership).

Properties get saved with the game state for Turnbased games (which use IsPersistent = true).

Parameters
propertiesToSet | Hashtable of Custom Properties that changes.
expectedProperties | Provide some keys/values to use as condition for setting the new values.
webFlags | Defines web flags for an optional PathProperties webhook.
Returns
False if propertiesToSet is null or empty or have zero string keys. Otherwise, returns if the operation could be sent to the server.

◆ OpWebRpc()

bool OpWebRpc | ( | string | uriPath,
 |  | object | parameters,
 |  | bool | sendAuthCookie = false
 | ) |  |

This operation makes Photon call your custom web-service by path/name with the given parameters (converted into Json). Use IWebRpcCallback.OnWebRpcResponse as a callback.

A WebRPC calls a custom, http-based function on a server you provide. The uriPath is relative to a "base path" which is configured server-side. The sent parameters get converted from C# types to Json. Vice versa, the response of the web-service will be converted to C# types and sent back as normal operation response.

To use this feature, you have to setup your server:

For a Photon Cloud application, visit the Dashboard and setup "WebHooks". The BaseUrl is used for WebRPCs as well.

The class WebRpcResponse is a helper-class that extracts the most valuable content from the WebRPC response.

Parameters
uriPath | The url path to call, relative to the baseUrl configured on Photon's server-side.
parameters | The parameters to send to the web-service method.
sendAuthCookie | Defines if the authentication cookie gets sent to a WebHook (if setup).

◆ ReconnectAndRejoin()

bool ReconnectAndRejoin ( )

Can be used to return to a room quickly by directly reconnecting to a game server to rejoin a room.

Rejoining room will not send any player properties. Instead client will receive up-to-date ones from server. If you want to set new player properties, do it once rejoined.

Returns
False, if the conditions are not met. Then, this client does not attempt the ReconnectAndRejoin.

◆ ReconnectToMaster()

bool ReconnectToMaster ( )

Can be used to reconnect to the master server after a disconnect.

Common use case: Press the Lock Button on a iOS device and you get disconnected immediately.

◆ RemoveCallbackTarget()

void RemoveCallbackTarget ( object target )

Unregisters an object from callbacks for the implemented callback-interfaces.

Adding and removing callback targets is queued to not mess with callbacks in execution. Internally, this means that the addition/removal is done before the LoadBalancingClient calls the next callbacks. This detail should not affect a game's workflow.

The covered callback interfaces are: IConnectionCallbacks, IMatchmakingCallbacks, ILobbyCallbacks, IInRoomCallbacks, IOnEventCallback and IWebRpcCallback.

See:

Parameters
target The object that unregisters from getting callbacks.

◆ Service()

void Service ( )

This method dispatches all available incoming commands and then sends this client's outgoing commands. It uses DispatchIncomingCommands and SendOutgoingCommands to do that.

The Photon client libraries are designed to fit easily into a game or application. The application is in control of the context (thread) in which incoming events and responses are executed and has full control of the creation of UDP/TCP packages.

Sending packages and dispatching received messages are two separate tasks. Service combines them into one method at the cost of control. It calls DispatchIncomingCommands and SendOutgoingCommands.

Call this method regularly (10..50 times a second).

This will Dispatch ANY received commands (unless a reliable command in-order is still missing) and events AND will send queued outgoing commands. Fewer calls might be more effective if a device cannot send many packets per second, as multiple operations might be combined into one package.

You could replace Service by:

while (DispatchIncomingCommands()); //Dispatch until everything is Dispatched...
SendOutgoingCommands(); //Send a UDP/TCP package with outgoing messages
See also
PhotonPeer.DispatchIncomingCommands, PhotonPeer.SendOutgoingCommands

◆ SimulateConnectionLoss()

void SimulateConnectionLoss ( bool simulateTimeout )

Useful to test loss of connection which will end in a client timeout. This modifies LoadBalancingPeer.NetworkSimulationSettings. Read remarks.

Use with care as this sets LoadBalancingPeer.IsSimulationEnabled.
Read LoadBalancingPeer.IsSimulationEnabled to check if this is on or off, if needed.

If simulateTimeout is true, LoadBalancingPeer.NetworkSimulationSettings.IncomingLossPercentage and LoadBalancingPeer.NetworkSimulationSettings.OutgoingLossPercentage will be set to 100.
Obviously, this overrides any network simulation settings done before.

If you want fine-grained network simulation control, use the NetworkSimulationSettings.

The timeout will lead to a call to IConnectionCallbacks.OnDisconnected, as usual in a client timeout.

You could modify this method (or use NetworkSimulationSettings) to deliberately run into a server timeout by just setting the OutgoingLossPercentage = 100 and the IncomingLossPercentage = 0.

Parameters
simulateTimeout If true, a connection loss is simulated. If false, the simulation ends.

Member Data Documentation

◆ AuthMode

AuthModeOption AuthMode = AuthModeOption.Auth

Enables the new Authentication workflow.

◆ ConnectionCallbackTargets

ConnectionCallbacksContainer ConnectionCallbackTargets

Wraps up the target objects for a group of callbacks, so they can be called conveniently.

By using Add or Remove, objects can "subscribe" or "unsubscribe" for this group of callbacks.

◆ EnableLobbyStatistics

bool EnableLobbyStatistics

If enabled, the client will get a list of available lobbies from the Master Server.

Set this value before the client connects to the Master Server. While connected to the Master Server, a change has no effect.

Implement OptionalInfoCallbacks.OnLobbyStatisticsUpdate, to get the list of used lobbies.

The lobby statistics can be useful if your title dynamically uses lobbies, depending (e.g.) on current player activity or such. In this case, getting a list of available lobbies, their room-count and player-count can be useful info.

ConnectUsingSettings sets this to the PhotonServerSettings value.

◆ EncryptionMode

EncryptionMode EncryptionMode = EncryptionMode.PayloadEncryption

Defines how the communication gets encrypted.

◆ MatchMakingCallbackTargets

MatchMakingCallbacksContainer MatchMakingCallbackTargets

Wraps up the target objects for a group of callbacks, so they can be called conveniently.

By using Add or Remove, objects can "subscribe" or "unsubscribe" for this group of callbacks.

◆ NameServerHost

string NameServerHost = "ns.photonengine.io"

Name Server Host Name for Photon Cloud. Without port and without any prefix.

◆ ProxyServerAddress

string ProxyServerAddress

Defines a proxy URL for WebSocket connections. Can be the proxy or point to a .pac file.

This URL supports various definitions:

"user:pass@proxyaddress:port"
"proxyaddress:port"
"system:"
"pac:"
"pac:http://host/path/pacfile.pac"

Important: Don't define a protocol, except to point to a pac file. the proxy address should not begin with http:// or https://.

◆ RegionHandler

RegionHandler RegionHandler

Contains the list if enabled regions this client may use. Null, unless the client got a response to OpGetRegions.

◆ ServerPortOverrides

PhotonPortDefinition ServerPortOverrides

Defines overrides for server ports. Used per server-type if > 0. Important: You must change these when the protocol changes!

Typical ports are listed in PhotonPortDefinition.

Instead of using the port provided from the servers, the specified port is used (independent of the protocol). If a value is 0 (default), the port is not being replaced.

Different protocols have different typical ports per server-type. https://doc.photonengine.com/en-us/pun/current/reference/tcp-and-udp-port-numbers

In case of using the AuthMode AutOnceWss, the name server's protocol is wss, while udp or tcp will be used on the master server and game server. Set the ports accordingly per protocol and server.

◆ SummaryToCache

string SummaryToCache

Set when the best region pinging is done.

Property Documentation

◆ AppId

string AppId
getset

The AppID as assigned from the Photon Cloud. If you host yourself, this is the "regular" Photon Server Application Name (most likely: "LoadBalancing").

◆ AppVersion

string AppVersion
getset

The version of your client. A new version also creates a new "virtual app" to separate players from older client versions.

◆ AuthValues

AuthenticationValues AuthValues
getset

User authentication values to be sent to the Photon server right after connecting.

Set this property or pass AuthenticationValues by Connect(..., authValues).

◆ ClientType

ClientAppType ClientType
getset

The ClientAppType defines which sort of AppId should be expected. The LoadBalancingClient supports Realtime and Voice app types. Default: Realtime.

◆ CloudRegion

string CloudRegion
get

The cloud region this client connects to. Set by ConnectToRegionMaster(). Not set if you don't use a NameServer!

◆ CurrentCluster

string CurrentCluster
get

The cluster name provided by the Name Server.

The value is provided by the OpResponse for OpAuthenticate/OpAuthenticateOnce. Default: null. This value only ever updates from the Name Server authenticate response.

◆ CurrentLobby

TypedLobby CurrentLobby
getset

The lobby this client currently uses. Defined when joining a lobby or creating rooms

◆ CurrentRoom

Room CurrentRoom
getset

The current room this client is connected to (null if none available).

◆ CurrentServerAddress

string CurrentServerAddress
get

The currently used server address (if any). The type of server is define by Server property.

◆ DisconnectedCause

DisconnectCause DisconnectedCause
getprotected set

Summarizes (aggregates) the different causes for disconnects of a client.

A disconnect can be caused by: errors in the network connection or some vital operation failing (which is considered "high level"). While operations always trigger a call to OnOperationResponse, connection related changes are treated in OnStatusChanged. The DisconnectCause is set in either case and summarizes the causes for any disconnect in a single state value which can be used to display (or debug) the cause for disconnection.

◆ EnableProtocolFallback

bool EnableProtocolFallback
getset

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

When connecting to the Name Server fails for a first time, the client will select an alternative network protocol and re-try to connect.

The fallback will use the default Name Server port as defined by ProtocolToNameServerPort.

The fallback for TCP is UDP. All other protocols fallback to TCP.

◆ ExpectedProtocol

ConnectionProtocol? ExpectedProtocol
getset

Optionally contains a protocol which will be used on Master- and GameServer.

When using AuthMode = AuthModeOption.AuthOnceWss, the client uses a wss-connection on the NameServer but another protocol on the other servers. As the NameServer sends an address, which is different per protocol, it needs to know the expected protocol.

This is nullable by design. In many cases, the protocol on the NameServer is not different from the other servers. If set, the operation AuthOnce will contain this value and the OpAuth response on the NameServer will execute a protocol switch.

summary>Simplifies getting the token for connect/init requests, if this feature is enabled.

◆ GameServerAddress

string GameServerAddress
getset

The game server's address for a particular room. In use temporarily, as assigned by master.

◆ InLobby

bool InLobby
get

Internal value if the client is in a lobby.

This is used to re-set this.State, when joining/creating a room fails.

◆ InRoom

bool InRoom
get

Is true while being in a room (this.state == ClientState.Joined).

Aside from polling this value, game logic should implement IMatchmakingCallbacks in some class and react when that gets called.
OpRaiseEvent, OpLeave and some other operations can only be used (successfully) when the client is in a room..

◆ IsConnected

bool IsConnected
get

Returns if this client is currently connected or connecting to some type of server.

This is even true while switching servers. Use IsConnectedAndReady to check only for those states that enable you to send Operations.

◆ IsConnectedAndReady

bool IsConnectedAndReady
get

A refined version of IsConnected which is true only if your connection is ready to send operations.

Not all operations can be called on all types of servers. If an operation is unavailable on the currently connected server, this will result in a OperationResponse with ErrorCode != 0.

Examples: The NameServer allows OpGetRegions which is not available anywhere else. The MasterServer does not allow you to send events (OpRaiseEvent) and on the GameServer you are unable to join a lobby (OpJoinLobby).

To check which server you are on, use: Server.

◆ IsFetchingFriendList

bool IsFetchingFriendList
get

Internal flag to know if the client currently fetches a friend list.

◆ IsUsingNameServer

bool IsUsingNameServer
getset

True if this client uses a NameServer to get the Master Server address.

This value is public, despite being an internal value, which should only be set by this client.

◆ LoadBalancingPeer

LoadBalancingPeer LoadBalancingPeer
get

The client uses a LoadBalancingPeer as API to communicate with the server. This is public for ease-of-use: Some methods like OpRaiseEvent are not relevant for the connection state and don't need a override.

◆ LocalPlayer

Player LocalPlayer
getset

The local player is never null but not valid unless the client is in a room, too. The ID will be -1 outside of rooms.

◆ MasterServerAddress

string MasterServerAddress
getset

Your Master Server address. In PhotonCloud, call ConnectToRegionMaster() to find your Master Server.

In the Photon Cloud, explicit definition of a Master Server Address is not best practice. The Photon Cloud has a "Name Server" which redirects clients to a specific Master Server (per Region and AppId).

◆ NameServerAddress

string NameServerAddress
get

Name Server Address for Photon Cloud (based on current protocol). You can use the default values and usually won't have to set this value.

◆ NickName

string NickName
getset

The nickname of the player (synced with others). Same as client.LocalPlayer.NickName.

◆ PlayersInRoomsCount

int PlayersInRoomsCount
getset

Statistic value available on master server: Players in rooms (playing).

◆ PlayersOnMasterCount

int PlayersOnMasterCount
getset

Statistic value available on master server: Players on master (looking for games).

◆ RoomsCount

int RoomsCount
getset

Statistic value available on master server: Rooms currently created.

◆ SerializationProtocol

SerializationProtocol SerializationProtocol
getset

Gets or sets the binary protocol version used by this client

Use this always instead of setting it via LoadBalancingClient.LoadBalancingPeer (PhotonPeer.SerializationProtocolType) directly, especially when WSS protocol is used.

◆ Server

ServerConnection Server
get

The server this client is currently connected or connecting to.

Each server (NameServer, MasterServer, GameServer) allow some operations and reject others.

◆ State

ClientState State
getset

Current state this client is in. Careful: several states are "transitions" that lead to other states.

◆ UseAlternativeUdpPorts

bool UseAlternativeUdpPorts
getset

Replaced by ServerPortOverrides.

◆ UserId

string UserId
getset

An ID for this user. Sent in OpAuthenticate when you connect. If not set, the PlayerName is applied during connect.

On connect, if the UserId is null or empty, the client will copy the PlayName to UserId. If PlayerName is not set either (before connect), the server applies a temporary ID which stays unknown to this client and other clients.

The UserId is what's used in FindFriends and for fetching data for your account (with WebHooks e.g.).

By convention, set this ID before you connect, not while being connected. There is no error but the ID won't change while being connected.

Event Documentation

◆ EventReceived

Action<EventData> EventReceived

Register a method to be called when an event got dispatched. Gets called after the LoadBalancingClient handled the internal events first.

This is an alternative to extending LoadBalancingClient to override OnEvent().

Note that OnEvent is calling EventReceived after it handled internal events first. That means for example: Joining players will already be in the player list but leaving players will already be removed from the room.

◆ OpResponseReceived

Action<OperationResponse> OpResponseReceived

Register a method to be called when an operation response is received.

This is an alternative to extending LoadBalancingClient to override OnOperationResponse().

Note that OnOperationResponse gets executed before your Action is called. That means for example: The OpJoinLobby response already set the state to "JoinedLobby" and the response to OpLeave already triggered the Disconnect before this is called.

◆ StateChanged

Action<ClientState, ClientState> StateChanged

Register a method to be called when this client's ClientState gets set.

This can be useful to react to being connected, joined into a room, etc.


Photon Unity Networking 2: LoadBalancingPeer Class Reference

  • Realtime
  • LoadBalancingPeer
Public Member Functions | Protected Member Functions | List of all members
LoadBalancingPeer Class Reference

A LoadBalancingPeer provides the operations and enum definitions needed to use the LoadBalancing server application which is also used in Photon Cloud. More...

Inherits PhotonPeer.

Public Member Functions

LoadBalancingPeer (ConnectionProtocol protocolType)
Creates a Peer with specified connection protocol. You need to set the Listener before using the peer. More...
LoadBalancingPeer (IPhotonPeerListener listener, ConnectionProtocol protocolType)
Creates a Peer with specified connection protocol and a Listener for callbacks. More...
virtual bool | OpGetRegions (string appId)
virtual bool | OpJoinLobby (TypedLobby lobby=null)
Joins the lobby on the Master Server, where you get a list of RoomInfos of currently open rooms. This is an async request which triggers a OnOperationResponse() call. More...
virtual bool | OpLeaveLobby ()
Leaves the lobby on the Master Server. This is an async request which triggers a OnOperationResponse() call. More...
virtual bool | OpCreateRoom (EnterRoomParams opParams)
Creates a room (on either Master or Game Server). The OperationResponse depends on the server the peer is connected to: Master will return a Game Server to connect to. Game Server will return the joined Room's data. This is an async request which triggers a OnOperationResponse() call. More...
virtual bool | OpJoinRoom (EnterRoomParams opParams)
Joins a room by name or creates new room if room with given name not exists. The OperationResponse depends on the server the peer is connected to: Master will return a Game Server to connect to. Game Server will return the joined Room's data. This is an async request which triggers a OnOperationResponse() call. More...
virtual bool | OpJoinRandomRoom (OpJoinRandomRoomParams opJoinRandomRoomParams)
Operation to join a random, available room. Overloads take additional player properties. This is an async request which triggers a OnOperationResponse() call. If all rooms are closed or full, the OperationResponse will have a returnCode of ErrorCode.NoRandomMatchFound. If successful, the OperationResponse contains a gameserver address and the name of some room. More...
virtual bool | OpJoinRandomOrCreateRoom (OpJoinRandomRoomParams opJoinRandomRoomParams, EnterRoomParams createRoomParams)
Only used on the Master Server. It will assign a game server and room to join-or-create. On the Game Server, the OpJoin is used with option "create if not exists". More...
virtual bool | OpLeaveRoom (bool becomeInactive, bool sendAuthCookie=false)
Leaves a room with option to come back later or "for good". More...
virtual bool | OpGetGameList (TypedLobby lobby, string queryData)
Gets a list of games matching a SQL-like where clause. More...
virtual bool | OpFindFriends (string[] friendsToFind, FindFriendsOptions options=null)
Request the rooms and online status for a list of friends (each client must set a unique username via OpAuthenticate). More...
bool | OpSetCustomPropertiesOfActor (int actorNr, Hashtable actorProperties)
bool | OpSetCustomPropertiesOfRoom (Hashtable gameProperties)
virtual bool | OpAuthenticate (string appId, string appVersion, AuthenticationValues authValues, string regionCode, bool getLobbyStatistics)
Sends this app's appId and appVersion to identify this application server side. This is an async request which triggers a OnOperationResponse() call. More...
virtual bool | OpAuthenticateOnce (string appId, string appVersion, AuthenticationValues authValues, string regionCode, EncryptionMode encryptionMode, ConnectionProtocol expectedProtocol)
Sends this app's appId and appVersion to identify this application server side. This is an async request which triggers a OnOperationResponse() call. More...
virtual bool | OpChangeGroups (byte[] groupsToRemove, byte[] groupsToAdd)
Operation to handle this client's interest groups (for events in room). More...
virtual bool | OpRaiseEvent (byte eventCode, object customEventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions)
Send an event with custom code/type and any content to the other players in the same room. More...
virtual bool | OpSettings (bool receiveLobbyStats)
Internally used operation to set some "per server" settings. This is for the Master Server. More...

Protected Member Functions

bool OpSetPropertyOfRoom (byte propCode, object value)

Detailed Description

A LoadBalancingPeer provides the operations and enum definitions needed to use the LoadBalancing server application which is also used in Photon Cloud.

This class is internally used. The LoadBalancingPeer does not keep a state, instead this is done by a LoadBalancingClient.

Constructor & Destructor Documentation

◆ LoadBalancingPeer() [1/2]

LoadBalancingPeer ( ConnectionProtocol protocolType )

Creates a Peer with specified connection protocol. You need to set the Listener before using the peer.

Each connection protocol has it's own default networking ports for Photon.

Parameters
protocolType The preferred option is UDP.

◆ LoadBalancingPeer() [2/2]

LoadBalancingPeer | ( | IPhotonPeerListener | listener,
 |  | ConnectionProtocol | protocolType
 | ) |  |

Creates a Peer with specified connection protocol and a Listener for callbacks.

Member Function Documentation

◆ OpAuthenticate()

virtual bool OpAuthenticate | ( | string | appId,
 |  | string | appVersion,
 |  | AuthenticationValues | authValues,
 |  | string | regionCode,
 |  | bool | getLobbyStatistics
 | ) |  |
virtual

Sends this app's appId and appVersion to identify this application server side. This is an async request which triggers a OnOperationResponse() call.

This operation makes use of encryption, if that is established before. See: EstablishEncryption(). Check encryption with IsEncryptionAvailable. This operation is allowed only once per connection (multiple calls will have ErrorCode != Ok).

Parameters
appId | Your application's name or ID to authenticate. This is assigned by Photon Cloud (webpage).
appVersion | The client's version (clients with differing client appVersions are separated and players don't meet).
authValues | Contains all values relevant for authentication. Even without account system (external Custom Auth), the clients are allowed to identify themselves.
regionCode | Optional region code, if the client should connect to a specific Photon Cloud Region.
getLobbyStatistics | Set to true on Master Server to receive "Lobby Statistics" events.
Returns
If the operation could be sent (has to be connected).

◆ OpAuthenticateOnce()

virtual bool OpAuthenticateOnce | ( | string | appId,
 |  | string | appVersion,
 |  | AuthenticationValues | authValues,
 |  | string | regionCode,
 |  | EncryptionMode | encryptionMode,
 |  | ConnectionProtocol | expectedProtocol
 | ) |  |
virtual

Sends this app's appId and appVersion to identify this application server side. This is an async request which triggers a OnOperationResponse() call.

This operation makes use of encryption, if that is established before. See: EstablishEncryption(). Check encryption with IsEncryptionAvailable. This operation is allowed only once per connection (multiple calls will have ErrorCode != Ok).

Parameters
appId | Your application's name or ID to authenticate. This is assigned by Photon Cloud (webpage).
appVersion | The client's version (clients with differing client appVersions are separated and players don't meet).
authValues | Optional authentication values. The client can set no values or a UserId or some parameters for Custom Authentication by a server.
regionCode | Optional region code, if the client should connect to a specific Photon Cloud Region.
encryptionMode
expectedProtocol
Returns
If the operation could be sent (has to be connected).

◆ OpChangeGroups()

virtual bool OpChangeGroups | ( | byte[] | groupsToRemove,
 |  | byte[] | groupsToAdd
 | ) |  |
virtual

Operation to handle this client's interest groups (for events in room).

Note the difference between passing null and byte[0]: null won't add/remove any groups. byte[0] will add/remove all (existing) groups. First, removing groups is executed. This way, you could leave all groups and join only the ones provided.

Changes become active not immediately but when the server executes this operation (approximately RTT/2).

Parameters
groupsToRemove | Groups to remove from interest. Null will not remove any. A byte[0] will remove all.
groupsToAdd | Groups to add to interest. Null will not add any. A byte[0] will add all current.
Returns
If operation could be enqueued for sending. Sent when calling: Service or SendOutgoingCommands.

◆ OpCreateRoom()

virtual bool OpCreateRoom ( EnterRoomParams opParams )
virtual

Creates a room (on either Master or Game Server). The OperationResponse depends on the server the peer is connected to: Master will return a Game Server to connect to. Game Server will return the joined Room's data. This is an async request which triggers a OnOperationResponse() call.

If the room is already existing, the OperationResponse will have a returnCode of ErrorCode.GameAlreadyExists.

◆ OpFindFriends()

virtual bool OpFindFriends | ( | string[] | friendsToFind,
 |  | FindFriendsOptions | options = null
 | ) |  |
virtual

Request the rooms and online status for a list of friends (each client must set a unique username via OpAuthenticate).

Used on Master Server to find the rooms played by a selected list of users. Users identify themselves by using OpAuthenticate with a unique user ID. The list of user IDs must be fetched from some other source (not provided by Photon).

The server response includes 2 arrays of info (each index matching a friend from the request):
ParameterCode.FindFriendsResponseOnlineList = bool[] of online states
ParameterCode.FindFriendsResponseRoomIdList = string[] of room names (empty string if not in a room)

The options may be used to define which state a room must match to be returned.

Parameters
friendsToFind | Array of friend's names (make sure they are unique).
options | Options that affect the result of the FindFriends operation.
Returns
If the operation could be sent (requires connection).

◆ OpGetGameList()

virtual bool OpGetGameList | ( | TypedLobby | lobby,
 |  | string | queryData
 | ) |  |
virtual

Gets a list of games matching a SQL-like where clause.

Operation is only available in lobbies of type SqlLobby. This is an async request which triggers a OnOperationResponse() call. Returned game list is stored in RoomInfoList.

https://doc.photonengine.com/en-us/realtime/current/reference/matchmaking-and-lobby::sql_lobby_type

Parameters
lobby | The lobby to query. Has to be of type SqlLobby.
queryData | The sql query statement.
Returns
If the operation could be sent (has to be connected).

◆ OpJoinLobby()

virtual bool OpJoinLobby ( TypedLobby lobby = null )
virtual

Joins the lobby on the Master Server, where you get a list of RoomInfos of currently open rooms. This is an async request which triggers a OnOperationResponse() call.

Parameters
lobby The lobby join to.
Returns
If the operation could be sent (has to be connected).

◆ OpJoinRandomOrCreateRoom()

virtual bool OpJoinRandomOrCreateRoom | ( | OpJoinRandomRoomParams | opJoinRandomRoomParams,
 |  | EnterRoomParams | createRoomParams
 | ) |  |
virtual

Only used on the Master Server. It will assign a game server and room to join-or-create. On the Game Server, the OpJoin is used with option "create if not exists".

◆ OpJoinRandomRoom()

virtual bool OpJoinRandomRoom ( OpJoinRandomRoomParams opJoinRandomRoomParams )
virtual

Operation to join a random, available room. Overloads take additional player properties. This is an async request which triggers a OnOperationResponse() call. If all rooms are closed or full, the OperationResponse will have a returnCode of ErrorCode.NoRandomMatchFound. If successful, the OperationResponse contains a gameserver address and the name of some room.

Returns
If the operation could be sent currently (requires connection).

◆ OpJoinRoom()

virtual bool OpJoinRoom ( EnterRoomParams opParams )
virtual

Joins a room by name or creates new room if room with given name not exists. The OperationResponse depends on the server the peer is connected to: Master will return a Game Server to connect to. Game Server will return the joined Room's data. This is an async request which triggers a OnOperationResponse() call.

If the room is not existing (anymore), the OperationResponse will have a returnCode of ErrorCode.GameDoesNotExist. Other possible ErrorCodes are: GameClosed, GameFull.

Returns
If the operation could be sent (requires connection).

◆ OpLeaveLobby()

virtual bool OpLeaveLobby ( )
virtual

Leaves the lobby on the Master Server. This is an async request which triggers a OnOperationResponse() call.

Returns
If the operation could be sent (requires connection).

◆ OpLeaveRoom()

virtual bool OpLeaveRoom | ( | bool | becomeInactive,
 |  | bool | sendAuthCookie = false
 | ) |  |
virtual

Leaves a room with option to come back later or "for good".

Parameters
becomeInactive | Async games can be re-joined (loaded) later on. Set to false, if you want to abandon a game entirely.
sendAuthCookie | WebFlag: Securely transmit the encrypted object AuthCookie to the web service in PathLeave webhook when available
Returns
If the opteration can be send currently.

◆ OpRaiseEvent()

virtual bool OpRaiseEvent | ( | byte | eventCode,
 |  | object | customEventContent,
 |  | RaiseEventOptions | raiseEventOptions,
 |  | SendOptions | sendOptions
 | ) |  |
virtual

Send an event with custom code/type and any content to the other players in the same room.

This override explicitly uses another parameter order to not mix it up with the implementation for Hashtable only.

Parameters
eventCode | Identifies this type of event (and the content). Your game's event codes can start with 0.
customEventContent | Any serializable datatype (including Hashtable like the other OpRaiseEvent overloads).
raiseEventOptions | Contains (slightly) less often used options. If you pass null, the default options will be used.
sendOptions | Send options for reliable, encryption etc
Returns
If operation could be enqueued for sending. Sent when calling: Service or SendOutgoingCommands.

◆ OpSettings()

virtual bool OpSettings ( bool receiveLobbyStats )
virtual

Internally used operation to set some "per server" settings. This is for the Master Server.

Parameters
receiveLobbyStats Set to true, to get Lobby Statistics (lists of existing lobbies).
Returns
False if the operation could not be sent.


Photon Unity Networking 2: MatchMakingCallbacksContainer Class Reference

  • Realtime
  • MatchMakingCallbacksContainer
Public Member Functions | List of all members
MatchMakingCallbacksContainer Class Reference

Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets. More...

Inherits List< IMatchmakingCallbacks >, and IMatchmakingCallbacks.

Public Member Functions

MatchMakingCallbacksContainer (LoadBalancingClient client)
void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...

Detailed Description

Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets.

While the interfaces of callbacks wrap up the methods that will be called, the container classes implement a simple way to call a method on all registered objects.

Member Function Documentation

◆ OnCreatedRoom()

void OnCreatedRoom ( )

Called when this client created a room and entered it. OnJoinedRoom() will be called as well.

This callback is only called on the client which created a room (see OpCreateRoom).

As any client might close (or drop connection) anytime, there is a chance that the creator of a room does not execute OnCreatedRoom.

If you need specific room properties or a "start signal", implement OnMasterClientSwitched() and make each new MasterClient check the room's state.

Implements IMatchmakingCallbacks.

◆ OnCreateRoomFailed()

void OnCreateRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when the server couldn't create a room (OpCreateRoom failed).

Creating a room may fail for various reasons. Most often, the room already exists (roomname in use) or the RoomOptions clash and it's impossible to create the room.

When creating a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnFriendListUpdate()

void OnFriendListUpdate ( List< FriendInfo > friendList )

Called when the server sent the response to a FindFriends request.

After calling OpFindFriends, the Master Server will cache the friend list and send updates to the friend list. The friends includes the name, userId, online state and the room (if any) for each requested user/friend.

Use the friendList to update your UI and store it, if the UI should highlight changes.

Implements IMatchmakingCallbacks.

◆ OnJoinedRoom()

void OnJoinedRoom ( )

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Implements IMatchmakingCallbacks.

◆ OnJoinRandomFailed()

void OnJoinRandomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when a previous OpJoinRandom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

This operation is only ever sent to the Master Server. Once a room is found by the Master Server, the client will head off to the designated Game Server and use the operation Join on the Game Server.

When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnJoinRoomFailed()

void OnJoinRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when a previous OpJoinRoom call failed on the server.

Joining a room may fail for various reasons. Most often, the room is full or does not exist anymore (due to someone else being faster or closing the room).

When joining a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnLeftRoom()

void OnLeftRoom ( )

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Implements IMatchmakingCallbacks.


Photon Unity Networking 2: OperationCode Class Reference

  • Realtime
  • OperationCode
Static Public Attributes | List of all members
OperationCode Class Reference

Class for constants. Contains operation codes. More...

Static Public Attributes

const byte | ExchangeKeysForEncryption = 250
const byte | Join = 255
(255) Code for OpJoin, to get into a room. More...
const byte | AuthenticateOnce = 231
(231) Authenticates this peer and connects to a virtual application More...
const byte | Authenticate = 230
(230) Authenticates this peer and connects to a virtual application More...
const byte | JoinLobby = 229
(229) Joins lobby (on master) More...
const byte | LeaveLobby = 228
(228) Leaves lobby (on master) More...
const byte | CreateGame = 227
(227) Creates a game (or fails if name exists) More...
const byte | JoinGame = 226
(226) Join game (by name) More...
const byte | JoinRandomGame = 225
(225) Joins random game (on master) More...
const byte | Leave = (byte)254
(254) Code for OpLeave, to get out of a room. More...
const byte | RaiseEvent = (byte)253
(253) Raise event (in a room, for other actors/players) More...
const byte | SetProperties = (byte)252
(252) Set Properties (of room or actor/player) More...
const byte | GetProperties = (byte)251
(251) Get Properties More...
const byte | ChangeGroups = (byte)248
(248) Operation code to change interest groups in Rooms (Lite application and extending ones). More...
const byte | FindFriends = 222
(222) Request the rooms and online status for a list of friends (by name, which should be unique). More...
const byte | GetLobbyStats = 221
(221) Request statistics about a specific list of lobbies (their user and game count). More...
const byte | GetRegions = 220
(220) Get list of regional servers from a NameServer. More...
const byte | WebRpc = 219
(219) WebRpc Operation. More...
const byte | ServerSettings = 218
(218) Operation to set some server settings. Used with different parameters on various servers. More...
const byte | GetGameList = 217
(217) Get the game list matching a supplied sql filter (SqlListLobby only) More...

Detailed Description

Class for constants. Contains operation codes.

These constants are used internally.

Member Data Documentation

◆ Authenticate

const byte Authenticate = 230
static

(230) Authenticates this peer and connects to a virtual application

◆ AuthenticateOnce

const byte AuthenticateOnce = 231
static

(231) Authenticates this peer and connects to a virtual application

◆ ChangeGroups

const byte ChangeGroups = (byte)248
static

(248) Operation code to change interest groups in Rooms (Lite application and extending ones).

◆ CreateGame

const byte CreateGame = 227
static

(227) Creates a game (or fails if name exists)

◆ FindFriends

const byte FindFriends = 222
static

(222) Request the rooms and online status for a list of friends (by name, which should be unique).

◆ GetGameList

const byte GetGameList = 217
static

(217) Get the game list matching a supplied sql filter (SqlListLobby only)

◆ GetLobbyStats

const byte GetLobbyStats = 221
static

(221) Request statistics about a specific list of lobbies (their user and game count).

◆ GetProperties

const byte GetProperties = (byte)251
static

(251) Get Properties

◆ GetRegions

const byte GetRegions = 220
static

(220) Get list of regional servers from a NameServer.

◆ Join

const byte Join = 255
static

(255) Code for OpJoin, to get into a room.

◆ JoinGame

const byte JoinGame = 226
static

(226) Join game (by name)

◆ JoinLobby

const byte JoinLobby = 229
static

(229) Joins lobby (on master)

◆ JoinRandomGame

const byte JoinRandomGame = 225
static

(225) Joins random game (on master)

◆ Leave

const byte Leave = (byte)254
static

(254) Code for OpLeave, to get out of a room.

◆ LeaveLobby

const byte LeaveLobby = 228
static

(228) Leaves lobby (on master)

◆ RaiseEvent

const byte RaiseEvent = (byte)253
static

(253) Raise event (in a room, for other actors/players)

◆ ServerSettings

const byte ServerSettings = 218
static

(218) Operation to set some server settings. Used with different parameters on various servers.

◆ SetProperties

const byte SetProperties = (byte)252
static

(252) Set Properties (of room or actor/player)

◆ WebRpc

const byte WebRpc = 219
static

(219) WebRpc Operation.


Photon Unity Networking 2: OpJoinRandomRoomParams Class Reference

  • Realtime
  • OpJoinRandomRoomParams
Public Attributes | List of all members
OpJoinRandomRoomParams Class Reference

Parameters for the matchmaking of JoinRandomRoom and JoinRandomOrCreateRoom. More...

Public Attributes

Hashtable | ExpectedCustomRoomProperties
The custom room properties a room must have to fit. All key-values must be present to match. In SQL Lobby, use SqlLobbyFilter instead. More...
byte | ExpectedMaxPlayers
Filters by the MaxPlayers value of rooms. More...
MatchmakingMode MatchingType
The MatchmakingMode affects how rooms get filled. By default, the server fills rooms. More...
TypedLobby TypedLobby
The lobby in which to match. The type affects how filters are applied. More...
string | SqlLobbyFilter
SQL query to filter room matches. For default-typed lobbies, use ExpectedCustomRoomProperties instead. More...
string[] | ExpectedUsers
The expected users list blocks player slots for your friends or team mates to join the room, too. More...

Detailed Description

Parameters for the matchmaking of JoinRandomRoom and JoinRandomOrCreateRoom.

More about matchmaking: https://doc.photonengine.com/en-us/pun/current/manuals-and-demos/matchmaking-and-lobby.

Member Data Documentation

◆ ExpectedCustomRoomProperties

Hashtable ExpectedCustomRoomProperties

The custom room properties a room must have to fit. All key-values must be present to match. In SQL Lobby, use SqlLobbyFilter instead.

◆ ExpectedMaxPlayers

byte ExpectedMaxPlayers

Filters by the MaxPlayers value of rooms.

◆ ExpectedUsers

string [] ExpectedUsers

The expected users list blocks player slots for your friends or team mates to join the room, too.

See: https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/matchmaking-and-lobby#matchmaking_slot_reservation

◆ MatchingType

MatchmakingMode MatchingType

The MatchmakingMode affects how rooms get filled. By default, the server fills rooms.

◆ SqlLobbyFilter

string SqlLobbyFilter

SQL query to filter room matches. For default-typed lobbies, use ExpectedCustomRoomProperties instead.

◆ TypedLobby

TypedLobby TypedLobby

The lobby in which to match. The type affects how filters are applied.


Photon Unity Networking 2: ParameterCode Class Reference

  • Realtime
  • ParameterCode
Static Public Attributes | List of all members
ParameterCode Class Reference

Class for constants. Codes for parameters of Operations and Events. More...

Static Public Attributes

const byte | SuppressRoomEvents = 237
(237) A bool parameter for creating games. If set to true, no room events are sent to the clients on join and leave. Default: false (and not sent). More...
const byte | EmptyRoomTTL = 236
(236) Time To Live (TTL) for a room when the last player leaves. Keeps room in memory for case a player re-joins soon. In milliseconds. More...
const byte | PlayerTTL = 235
(235) Time To Live (TTL) for an 'actor' in a room. If a client disconnects, this actor is inactive first and removed after this timeout. In milliseconds. More...
const byte | EventForward = 234
(234) Optional parameter of OpRaiseEvent and OpSetCustomProperties to forward the event/operation to a web-service. More...
const byte | IsComingBack = (byte)233
(233) Optional parameter of OpLeave in async games. If false, the player does abandons the game (forever). By default players become inactive and can re-join. More...
const byte | IsInactive = (byte)233
(233) Used in EvLeave to describe if a user is inactive (and might come back) or not. In rooms with PlayerTTL, becoming inactive is the default case. More...
const byte | CheckUserOnJoin = (byte)232
(232) Used when creating rooms to define if any userid can join the room only once. More...
const byte | ExpectedValues = (byte)231
(231) Code for "Check And Swap" (CAS) when changing properties. More...
const byte | Address = 230
(230) Address of a (game) server to use. More...
const byte | PeerCount = 229
(229) Count of players in this application in a rooms (used in stats event) More...
const byte | GameCount = 228
(228) Count of games in this application (used in stats event) More...
const byte | MasterPeerCount = 227
(227) Count of players on the master server (in this app, looking for rooms) More...
const byte | UserId = 225
(225) User's ID More...
const byte | ApplicationId = 224
(224) Your application's ID: a name on your own Photon or a GUID on the Photon Cloud More...
const byte | Position = 223
(223) Not used currently (as "Position"). If you get queued before connect, this is your position More...
const byte | MatchMakingType = 223
(223) Modifies the matchmaking algorithm used for OpJoinRandom. Allowed parameter values are defined in enum MatchmakingMode. More...
const byte | GameList = 222
(222) List of RoomInfos about open / listed rooms More...
const byte | Token = 221
(221) Internally used to establish encryption More...
const byte | AppVersion = 220
(220) Version of your application More...
const byte | AzureNodeInfo = 210
(210) Internally used in case of hosting by Azure More...
const byte | AzureLocalNodeId = 209
(209) Internally used in case of hosting by Azure More...
const byte | AzureMasterNodeId = 208
(208) Internally used in case of hosting by Azure More...
const byte | RoomName = (byte)255
(255) Code for the gameId/roomName (a unique name per room). Used in OpJoin and similar. More...
const byte | Broadcast = (byte)250
(250) Code for broadcast parameter of OpSetProperties method. More...
const byte | ActorList = (byte)252
(252) Code for list of players in a room. More...
const byte | ActorNr = (byte)254
(254) Code of the Actor of an operation. Used for property get and set. More...
const byte | PlayerProperties = (byte)249
(249) Code for property set (Hashtable). More...
const byte | CustomEventContent = (byte)245
(245) Code of data/custom content of an event. Used in OpRaiseEvent. More...
const byte | Data = (byte)245
(245) Code of data of an event. Used in OpRaiseEvent. More...
const byte | Code = (byte)244
(244) Code used when sending some code-related parameter, like OpRaiseEvent's event-code. More...
const byte | GameProperties = (byte)248
(248) Code for property set (Hashtable). More...
const byte | Properties = (byte)251
(251) Code for property-set (Hashtable). This key is used when sending only one set of properties. If either ActorProperties or GameProperties are used (or both), check those keys. More...
const byte | TargetActorNr = (byte)253
(253) Code of the target Actor of an operation. Used for property set. Is 0 for game More...
const byte | ReceiverGroup = (byte)246
(246) Code to select the receivers of events (used in Lite, Operation RaiseEvent). More...
const byte | Cache = (byte)247
(247) Code for caching events while raising them. More...
const byte | CleanupCacheOnLeave = (byte)241
(241) Bool parameter of CreateGame Operation. If true, server cleans up roomcache of leaving players (their cached events get removed). More...
const byte | Group = 240
(240) Code for "group" operation-parameter (as used in Op RaiseEvent). More...
const byte | Remove = 239
(239) The "Remove" operation-parameter can be used to remove something from a list. E.g. remove groups from player's interest groups. More...
const byte | PublishUserId = 239
(239) Used in Op Join to define if UserIds of the players are broadcast in the room. Useful for FindFriends and reserving slots for expected users. More...
const byte | Add = 238
(238) The "Add" operation-parameter can be used to add something to some list or set. E.g. add groups to player's interest groups. More...
const byte | Info = 218
(218) Content for EventCode.ErrorInfo and internal debug operations. More...
const byte | ClientAuthenticationType = 217
(217) This key's (byte) value defines the target custom authentication type/service the client connects with. Used in OpAuthenticate More...
const byte | ClientAuthenticationParams = 216
(216) This key's (string) value provides parameters sent to the custom authentication type/service the client connects with. Used in OpAuthenticate More...
const byte | JoinMode = 215
(215) Makes the server create a room if it doesn't exist. OpJoin uses this to always enter a room, unless it exists and is full/closed. More...
const byte | ClientAuthenticationData = 214
(214) This key's (string or byte[]) value provides parameters sent to the custom authentication service setup in Photon Dashboard. Used in OpAuthenticate More...
const byte | MasterClientId = (byte)203
(203) Code for MasterClientId, which is synced by server. When sent as op-parameter this is code 203. More...
const byte | FindFriendsRequestList = (byte)1
(1) Used in Op FindFriends request. Value must be string[] of friends to look up. More...
const byte | FindFriendsOptions = (byte)2
(2) Used in Op FindFriends request. An integer containing option-flags to filter the results. More...
const byte | FindFriendsResponseOnlineList = (byte)1
(1) Used in Op FindFriends response. Contains bool[] list of online states (false if not online). More...
const byte | FindFriendsResponseRoomIdList = (byte)2
(2) Used in Op FindFriends response. Contains string[] of room names ("" where not known or no room joined). More...
const byte | LobbyName = (byte)213
(213) Used in matchmaking-related methods and when creating a room to name a lobby (to join or to attach a room to). More...
const byte | LobbyType = (byte)212
(212) Used in matchmaking-related methods and when creating a room to define the type of a lobby. Combined with the lobby name this identifies the lobby. More...
const byte | LobbyStats = (byte)211
(211) This (optional) parameter can be sent in Op Authenticate to turn on Lobby Stats (info about lobby names and their user- and game-counts). More...
const byte | Region = (byte)210
(210) Used for region values in OpAuth and OpGetRegions. More...
const byte | UriPath = 209
(209) Path of the WebRPC that got called. Also known as "WebRpc Name". Type: string. More...
const byte | WebRpcParameters = 208
(208) Parameters for a WebRPC as: Dictionary<string, object>. This will get serialized to JSon. More...
const byte | WebRpcReturnCode = 207
(207) ReturnCode for the WebRPC, as sent by the web service (not by Photon, which uses ErrorCode). Type: byte. More...
const byte | WebRpcReturnMessage = 206
(206) Message returned by WebRPC server. Analog to Photon's debug message. Type: string. More...
const byte | CacheSliceIndex = 205
(205) Used to define a "slice" for cached events. Slices can easily be removed from cache. Type: int. More...
const byte | Plugins = 204
(204) Informs the server of the expected plugin setup. More...
const byte | NickName = 202
(202) Used by the server in Operation Responses, when it sends the nickname of the client (the user's nickname). More...
const byte | PluginName = 201
(201) Informs user about name of plugin load to game More...
const byte | PluginVersion = 200
(200) Informs user about version of plugin load to game More...
const byte | Cluster = 196
(196) Cluster info provided in OpAuthenticate/OpAuthenticateOnce responses. More...
const byte | ExpectedProtocol = 195
(195) Protocol which will be used by client to connect master/game servers. Used for nameserver. More...
const byte | CustomInitData = 194
(194) Set of custom parameters which are sent in auth request. More...
const byte | EncryptionMode = 193
(193) How are we going to encrypt data. More...
const byte | EncryptionData = 192
(192) Parameter of Authentication, which contains encryption keys (depends on AuthMode and EncryptionMode). More...
const byte | RoomOptionFlags = 191
(191) An int parameter summarizing several boolean room-options with bit-flags. More...

Detailed Description

Class for constants. Codes for parameters of Operations and Events.

These constants are used internally.

Member Data Documentation

◆ ActorList

const byte ActorList = (byte)252
static

(252) Code for list of players in a room.

◆ ActorNr

const byte ActorNr = (byte)254
static

(254) Code of the Actor of an operation. Used for property get and set.

◆ Add

const byte Add = 238
static

(238) The "Add" operation-parameter can be used to add something to some list or set. E.g. add groups to player's interest groups.

◆ Address

const byte Address = 230
static

(230) Address of a (game) server to use.

◆ ApplicationId

const byte ApplicationId = 224
static

(224) Your application's ID: a name on your own Photon or a GUID on the Photon Cloud

◆ AppVersion

const byte AppVersion = 220
static

(220) Version of your application

◆ AzureLocalNodeId

const byte AzureLocalNodeId = 209
static

(209) Internally used in case of hosting by Azure

◆ AzureMasterNodeId

const byte AzureMasterNodeId = 208
static

(208) Internally used in case of hosting by Azure

◆ AzureNodeInfo

const byte AzureNodeInfo = 210
static

(210) Internally used in case of hosting by Azure

◆ Broadcast

const byte Broadcast = (byte)250
static

(250) Code for broadcast parameter of OpSetProperties method.

◆ Cache

const byte Cache = (byte)247
static

(247) Code for caching events while raising them.

◆ CacheSliceIndex

const byte CacheSliceIndex = 205
static

(205) Used to define a "slice" for cached events. Slices can easily be removed from cache. Type: int.

◆ CheckUserOnJoin

const byte CheckUserOnJoin = (byte)232
static

(232) Used when creating rooms to define if any userid can join the room only once.

◆ CleanupCacheOnLeave

const byte CleanupCacheOnLeave = (byte)241
static

(241) Bool parameter of CreateGame Operation. If true, server cleans up roomcache of leaving players (their cached events get removed).

◆ ClientAuthenticationData

const byte ClientAuthenticationData = 214
static

(214) This key's (string or byte[]) value provides parameters sent to the custom authentication service setup in Photon Dashboard. Used in OpAuthenticate

◆ ClientAuthenticationParams

const byte ClientAuthenticationParams = 216
static

(216) This key's (string) value provides parameters sent to the custom authentication type/service the client connects with. Used in OpAuthenticate

◆ ClientAuthenticationType

const byte ClientAuthenticationType = 217
static

(217) This key's (byte) value defines the target custom authentication type/service the client connects with. Used in OpAuthenticate

◆ Cluster

const byte Cluster = 196
static

(196) Cluster info provided in OpAuthenticate/OpAuthenticateOnce responses.

◆ Code

const byte Code = (byte)244
static

(244) Code used when sending some code-related parameter, like OpRaiseEvent's event-code.

This is not the same as the Operation's code, which is no longer sent as part of the parameter Dictionary in Photon 3.

◆ CustomEventContent

const byte CustomEventContent = (byte)245
static

(245) Code of data/custom content of an event. Used in OpRaiseEvent.

◆ CustomInitData

const byte CustomInitData = 194
static

(194) Set of custom parameters which are sent in auth request.

◆ Data

const byte Data = (byte)245
static

(245) Code of data of an event. Used in OpRaiseEvent.

◆ EmptyRoomTTL

const byte EmptyRoomTTL = 236
static

(236) Time To Live (TTL) for a room when the last player leaves. Keeps room in memory for case a player re-joins soon. In milliseconds.

◆ EncryptionData

const byte EncryptionData = 192
static

(192) Parameter of Authentication, which contains encryption keys (depends on AuthMode and EncryptionMode).

◆ EncryptionMode

const byte EncryptionMode = 193
static

(193) How are we going to encrypt data.

◆ EventForward

const byte EventForward = 234
static

(234) Optional parameter of OpRaiseEvent and OpSetCustomProperties to forward the event/operation to a web-service.

◆ ExpectedProtocol

const byte ExpectedProtocol = 195
static

(195) Protocol which will be used by client to connect master/game servers. Used for nameserver.

◆ ExpectedValues

const byte ExpectedValues = (byte)231
static

(231) Code for "Check And Swap" (CAS) when changing properties.

◆ FindFriendsOptions

const byte FindFriendsOptions = (byte)2
static

(2) Used in Op FindFriends request. An integer containing option-flags to filter the results.

◆ FindFriendsRequestList

const byte FindFriendsRequestList = (byte)1
static

(1) Used in Op FindFriends request. Value must be string[] of friends to look up.

◆ FindFriendsResponseOnlineList

const byte FindFriendsResponseOnlineList = (byte)1
static

(1) Used in Op FindFriends response. Contains bool[] list of online states (false if not online).

◆ FindFriendsResponseRoomIdList

const byte FindFriendsResponseRoomIdList = (byte)2
static

(2) Used in Op FindFriends response. Contains string[] of room names ("" where not known or no room joined).

◆ GameCount

const byte GameCount = 228
static

(228) Count of games in this application (used in stats event)

◆ GameList

const byte GameList = 222
static

(222) List of RoomInfos about open / listed rooms

◆ GameProperties

const byte GameProperties = (byte)248
static

(248) Code for property set (Hashtable).

◆ Group

const byte Group = 240
static

(240) Code for "group" operation-parameter (as used in Op RaiseEvent).

◆ Info

const byte Info = 218
static

(218) Content for EventCode.ErrorInfo and internal debug operations.

◆ IsComingBack

const byte IsComingBack = (byte)233
static

(233) Optional parameter of OpLeave in async games. If false, the player does abandons the game (forever). By default players become inactive and can re-join.

◆ IsInactive

const byte IsInactive = (byte)233
static

(233) Used in EvLeave to describe if a user is inactive (and might come back) or not. In rooms with PlayerTTL, becoming inactive is the default case.

◆ JoinMode

const byte JoinMode = 215
static

(215) Makes the server create a room if it doesn't exist. OpJoin uses this to always enter a room, unless it exists and is full/closed.

(215) The JoinMode enum defines which variant of joining a room will be executed: Join only if available, create if not exists or re-join.

Replaces CreateIfNotExists which was only a bool-value.

◆ LobbyName

const byte LobbyName = (byte)213
static

(213) Used in matchmaking-related methods and when creating a room to name a lobby (to join or to attach a room to).

◆ LobbyStats

const byte LobbyStats = (byte)211
static

(211) This (optional) parameter can be sent in Op Authenticate to turn on Lobby Stats (info about lobby names and their user- and game-counts).

◆ LobbyType

const byte LobbyType = (byte)212
static

(212) Used in matchmaking-related methods and when creating a room to define the type of a lobby. Combined with the lobby name this identifies the lobby.

◆ MasterClientId

const byte MasterClientId = (byte)203
static

(203) Code for MasterClientId, which is synced by server. When sent as op-parameter this is code 203.

Tightly related to GamePropertyKey.MasterClientId.

◆ MasterPeerCount

const byte MasterPeerCount = 227
static

(227) Count of players on the master server (in this app, looking for rooms)

◆ MatchMakingType

const byte MatchMakingType = 223
static

(223) Modifies the matchmaking algorithm used for OpJoinRandom. Allowed parameter values are defined in enum MatchmakingMode.

◆ NickName

const byte NickName = 202
static

(202) Used by the server in Operation Responses, when it sends the nickname of the client (the user's nickname).

◆ PeerCount

const byte PeerCount = 229
static

(229) Count of players in this application in a rooms (used in stats event)

◆ PlayerProperties

const byte PlayerProperties = (byte)249
static

(249) Code for property set (Hashtable).

◆ PlayerTTL

const byte PlayerTTL = 235
static

(235) Time To Live (TTL) for an 'actor' in a room. If a client disconnects, this actor is inactive first and removed after this timeout. In milliseconds.

◆ PluginName

const byte PluginName = 201
static

(201) Informs user about name of plugin load to game

◆ Plugins

const byte Plugins = 204
static

(204) Informs the server of the expected plugin setup.

The operation will fail in case of a plugin mismatch returning error code PluginMismatch 32751(0x7FFF - 16). Setting string[]{} means the client expects no plugin to be setup. Note: for backwards compatibility null omits any check.

◆ PluginVersion

const byte PluginVersion = 200
static

(200) Informs user about version of plugin load to game

◆ Position

const byte Position = 223
static

(223) Not used currently (as "Position"). If you get queued before connect, this is your position

◆ Properties

const byte Properties = (byte)251
static

(251) Code for property-set (Hashtable). This key is used when sending only one set of properties. If either ActorProperties or GameProperties are used (or both), check those keys.

◆ PublishUserId

const byte PublishUserId = 239
static

(239) Used in Op Join to define if UserIds of the players are broadcast in the room. Useful for FindFriends and reserving slots for expected users.

◆ ReceiverGroup

const byte ReceiverGroup = (byte)246
static

(246) Code to select the receivers of events (used in Lite, Operation RaiseEvent).

◆ Region

const byte Region = (byte)210
static

(210) Used for region values in OpAuth and OpGetRegions.

◆ Remove

const byte Remove = 239
static

(239) The "Remove" operation-parameter can be used to remove something from a list. E.g. remove groups from player's interest groups.

◆ RoomName

const byte RoomName = (byte)255
static

(255) Code for the gameId/roomName (a unique name per room). Used in OpJoin and similar.

◆ RoomOptionFlags

const byte RoomOptionFlags = 191
static

(191) An int parameter summarizing several boolean room-options with bit-flags.

◆ SuppressRoomEvents

const byte SuppressRoomEvents = 237
static

(237) A bool parameter for creating games. If set to true, no room events are sent to the clients on join and leave. Default: false (and not sent).

◆ TargetActorNr

const byte TargetActorNr = (byte)253
static

(253) Code of the target Actor of an operation. Used for property set. Is 0 for game

◆ Token

const byte Token = 221
static

(221) Internally used to establish encryption

◆ UriPath

const byte UriPath = 209
static

(209) Path of the WebRPC that got called. Also known as "WebRpc Name". Type: string.

◆ UserId

const byte UserId = 225
static

(225) User's ID

◆ WebRpcParameters

const byte WebRpcParameters = 208
static

(208) Parameters for a WebRPC as: Dictionary<string, object>. This will get serialized to JSon.

◆ WebRpcReturnCode

const byte WebRpcReturnCode = 207
static

(207) ReturnCode for the WebRPC, as sent by the web service (not by Photon, which uses ErrorCode). Type: byte.

◆ WebRpcReturnMessage

const byte WebRpcReturnMessage = 206
static

(206) Message returned by WebRPC server. Analog to Photon's debug message. Type: string.


Photon Unity Networking 2: PhotonAppSettings Class Reference

  • Realtime
  • PhotonAppSettings
Static Public Member Functions | Public Attributes | Properties | List of all members
PhotonAppSettings Class Reference

Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings. More...

Inherits ScriptableObject.

Static Public Member Functions

static void LoadOrCreateSettings ()

Public Attributes

AppSettings AppSettings

Properties

static PhotonAppSettings Instance [get]
Serialized server settings, written by the Setup Wizard for use in ConnectUsingSettings. More...

Detailed Description

Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings.

Includes the AppSettings class from the Realtime APIs plus some other, PUN-relevant, settings.

Property Documentation

◆ Instance

PhotonAppSettings Instance
staticget

Serialized server settings, written by the Setup Wizard for use in ConnectUsingSettings.


Photon Unity Networking 2: PhotonPing Class Reference

  • Realtime
  • PhotonPing
Public Member Functions | Public Attributes | List of all members
PhotonPing Class Reference

Abstract implementation of PhotonPing, ase for pinging servers to find the "Best Region". More...

Inherits IDisposable.

Inherited by PingMono.

Public Member Functions

virtual bool | StartPing (string ip)
virtual bool | Done ()
virtual void | Dispose ()

Public Attributes

string | DebugString = ""
bool | Successful

Detailed Description

Abstract implementation of PhotonPing, ase for pinging servers to find the "Best Region".


Photon Unity Networking 2: PhotonPortDefinition Struct Reference

  • Realtime
  • PhotonPortDefinition
Public Attributes | Static Public Attributes | List of all members
PhotonPortDefinition Struct Reference

Container for port definitions. More...

Public Attributes

ushort | NameServerPort
Typical ports: UDP: 5058 or 27000, TCP: 4533, WSS: 19093 or 443. More...
ushort | MasterServerPort
Typical ports: UDP: 5056 or 27002, TCP: 4530, WSS: 19090 or 443. More...
ushort | GameServerPort
Typical ports: UDP: 5055 or 27001, TCP: 4531, WSS: 19091 or 443. More...

Static Public Attributes

static readonly PhotonPortDefinition AlternativeUdpPorts = new PhotonPortDefinition() { NameServerPort = 27000, MasterServerPort = 27001, GameServerPort = 27002}

Detailed Description

Container for port definitions.

Member Data Documentation

◆ GameServerPort

ushort GameServerPort

Typical ports: UDP: 5055 or 27001, TCP: 4531, WSS: 19091 or 443.

◆ MasterServerPort

ushort MasterServerPort

Typical ports: UDP: 5056 or 27002, TCP: 4530, WSS: 19090 or 443.

◆ NameServerPort

ushort NameServerPort

Typical ports: UDP: 5058 or 27000, TCP: 4533, WSS: 19093 or 443.


Photon Unity Networking 2: PingMono Class Reference

  • Realtime
  • PingMono
Public Member Functions | List of all members
PingMono Class Reference

Uses C# Socket class from System.Net.Sockets (as Unity usually does). More...

Inherits PhotonPing.

Public Member Functions

override bool | StartPing (string ip)
Sends a "Photon Ping" to a server. More...
override bool | Done ()
override void | Dispose ()

Additional Inherited Members

- Public Attributes inherited from PhotonPing
string | DebugString = ""
bool | Successful

Detailed Description

Uses C# Socket class from System.Net.Sockets (as Unity usually does).

Incompatible with Windows 8 Store/Phone API.

Member Function Documentation

◆ StartPing()

override bool StartPing ( string ip )
virtual

Sends a "Photon Ping" to a server.

Parameters
ip Address in IPv4 or IPv6 format. An address containing a '.' will be interpreted as IPv4.
Returns
True if the Photon Ping could be sent.

Reimplemented from PhotonPing.


Photon Unity Networking 2: Player Class Reference

  • Realtime
  • Player
Public Member Functions | Public Attributes | Properties | List of all members
Player Class Reference

Summarizes a "player" within a room, identified (in that room) by ID (or "actorNumber"). More...

Public Member Functions

Player | Get (int id)
Get a Player by ActorNumber (Player.ID). More...
Player GetNext ()
Gets this Player's next Player, as sorted by ActorNumber (Player.ID). Wraps around. More...
Player | GetNextFor (Player currentPlayer)
Gets a Player's next Player, as sorted by ActorNumber (Player.ID). Wraps around. More...
Player | GetNextFor (int currentPlayerId)
Gets a Player's next Player, as sorted by ActorNumber (Player.ID). Wraps around. More...
override string | ToString ()
Brief summary string of the Player: ActorNumber and NickName More...
string | ToStringFull ()
String summary of the Player: player.ID, name and all custom properties of this user. More...
override bool | Equals (object p)
If players are equal (by GetHasCode, which returns this.ID). More...
override int | GetHashCode ()
Accompanies Equals, using the ID (actorNumber) as HashCode to return. More...
bool | SetCustomProperties (Hashtable propertiesToSet, Hashtable expectedValues=null, WebFlags webFlags=null)
Updates and synchronizes this Player's Custom Properties. Optionally, expectedProperties can be provided as condition. More...

Public Attributes

readonly bool | IsLocal
Only one player is controlled by each client. Others are not local. More...
object | TagObject
Can be used to store a reference that's useful to know "by player". More...

Properties

int | ActorNumber [get]
Identifier of this player in current room. Also known as: actorNumber or actorNumber. It's -1 outside of rooms. More...
bool | HasRejoined [get, set]
string | NickName [get, set]
Non-unique nickname of this player. Synced automatically in a room. More...
string | UserId [get, set]
UserId of the player, available when the room got created with RoomOptions.PublishUserId = true. More...
bool | IsMasterClient [get]
True if this player is the Master Client of the current room. More...
bool | IsInactive [get, set]
If this player is active in the room (and getting events which are currently being sent). More...
Hashtable | CustomProperties [get, set]
Read-only cache for custom properties of player. Set via Player.SetCustomProperties. More...

Detailed Description

Summarizes a "player" within a room, identified (in that room) by ID (or "actorNumber").

Each player has a actorNumber, valid for that room. It's -1 until assigned by server (and client logic).

Member Function Documentation

◆ Equals()

override bool Equals ( object p )

If players are equal (by GetHasCode, which returns this.ID).

◆ Get()

Player Get ( int id )

Get a Player by ActorNumber (Player.ID).

Parameters
id ActorNumber of the a player in this room.
Returns
Player or null.

◆ GetHashCode()

override int GetHashCode ( )

Accompanies Equals, using the ID (actorNumber) as HashCode to return.

◆ GetNext()

Player GetNext ( )

Gets this Player's next Player, as sorted by ActorNumber (Player.ID). Wraps around.

Returns
Player or null.

◆ GetNextFor() [1/2]

Player GetNextFor ( int currentPlayerId )

Gets a Player's next Player, as sorted by ActorNumber (Player.ID). Wraps around.

Useful when you pass something to the next player. For example: passing the turn to the next player.

Parameters
currentPlayerId The ActorNumber (Player.ID) for which the next is being needed.
Returns
Player or null.

◆ GetNextFor() [2/2]

Player GetNextFor ( Player currentPlayer )

Gets a Player's next Player, as sorted by ActorNumber (Player.ID). Wraps around.

Useful when you pass something to the next player. For example: passing the turn to the next player.

Parameters
currentPlayer The Player for which the next is being needed.
Returns
Player or null.

◆ SetCustomProperties()

bool SetCustomProperties | ( | Hashtable | propertiesToSet,
 |  | Hashtable | expectedValues = null,
 |  | WebFlags | webFlags = null
 | ) |  |

Updates and synchronizes this Player's Custom Properties. Optionally, expectedProperties can be provided as condition.

Custom Properties are a set of string keys and arbitrary values which is synchronized for the players in a Room. They are available when the client enters the room, as they are in the response of OpJoin and OpCreate.

Custom Properties either relate to the (current) Room or a Player (in that Room).

Both classes locally cache the current key/values and make them available as property: CustomProperties. This is provided only to read them. You must use the method SetCustomProperties to set/modify them.

Any client can set any Custom Properties anytime (when in a room). It's up to the game logic to organize how they are best used.

You should call SetCustomProperties only with key/values that are new or changed. This reduces traffic and performance.

Unless you define some expectedProperties, setting key/values is always permitted. In this case, the property-setting client will not receive the new values from the server but instead update its local cache in SetCustomProperties.

If you define expectedProperties, the server will skip updates if the server property-cache does not contain all expectedProperties with the same values. In this case, the property-setting client will get an update from the server and update it's cached key/values at about the same time as everyone else.

The benefit of using expectedProperties can be only one client successfully sets a key from one known value to another. As example: Store who owns an item in a Custom Property "ownedBy". It's 0 initally. When multiple players reach the item, they all attempt to change "ownedBy" from 0 to their actorNumber. If you use expectedProperties {"ownedBy", 0} as condition, the first player to take the item will have it (and the others fail to set the ownership).

Properties get saved with the game state for Turnbased games (which use IsPersistent = true).

Parameters
propertiesToSet | Hashtable of Custom Properties to be set.
expectedValues | If non-null, these are the property-values the server will check as condition for this update.
webFlags | Defines if this SetCustomProperties-operation gets forwarded to your WebHooks. Client must be in room.
Returns
False if propertiesToSet is null or empty or have zero string keys. True in offline mode even if expectedProperties or webFlags are used. If not in a room, returns true if local player and expectedValues and webFlags are null. (Use this to cache properties to be sent when joining a room). Otherwise, returns if this operation could be sent to the server.

◆ ToString()

override string ToString ( )

Brief summary string of the Player: ActorNumber and NickName

◆ ToStringFull()

string ToStringFull ( )

String summary of the Player: player.ID, name and all custom properties of this user.

Use with care and not every frame! Converts the customProperties to a String on every single call.

Member Data Documentation

◆ IsLocal

readonly bool IsLocal

Only one player is controlled by each client. Others are not local.

◆ TagObject

object TagObject

Can be used to store a reference that's useful to know "by player".

Example: Set a player's character as Tag by assigning the GameObject on Instantiate.

Property Documentation

◆ ActorNumber

int ActorNumber
get

Identifier of this player in current room. Also known as: actorNumber or actorNumber. It's -1 outside of rooms.

The ID is assigned per room and only valid in that context. It will change even on leave and re-join. IDs are never re-used per room.

◆ CustomProperties

Hashtable CustomProperties
getset

Read-only cache for custom properties of player. Set via Player.SetCustomProperties.

Don't modify the content of this Hashtable. Use SetCustomProperties and the properties of this class to modify values. When you use those, the client will sync values with the server.

SetCustomProperties

◆ IsInactive

bool IsInactive
getset

If this player is active in the room (and getting events which are currently being sent).

Inactive players keep their spot in a room but otherwise behave as if offline (no matter what their actual connection status is). The room needs a PlayerTTL != 0. If a player is inactive for longer than PlayerTTL, the server will remove this player from the room. For a client "rejoining" a room, is the same as joining it: It gets properties, cached events and then the live events.

◆ IsMasterClient

bool IsMasterClient
get

True if this player is the Master Client of the current room.

◆ NickName

string NickName
getset

Non-unique nickname of this player. Synced automatically in a room.

A player might change his own playername in a room (it's only a property). Setting this value updates the server and other players (using an operation).

◆ UserId

string UserId
getset

UserId of the player, available when the room got created with RoomOptions.PublishUserId = true.

Useful for LoadBalancingClient.OpFindFriends and blocking slots in a room for expected players (e.g. in LoadBalancingClient.OpCreateRoom).


Photon Unity Networking 2: RaiseEventOptions Class Reference

  • Realtime
  • RaiseEventOptions
Public Attributes | Static Public Attributes | List of all members
RaiseEventOptions Class Reference

Aggregates several less-often used options for operation RaiseEvent. See field descriptions for usage details. More...

Public Attributes

EventCaching CachingOption
Defines if the server should simply send the event, put it in the cache or remove events that are like this one. More...
byte | InterestGroup
The number of the Interest Group to send this to. 0 goes to all users but to get 1 and up, clients must subscribe to the group first. More...
int[] | TargetActors
A list of Player.ActorNumbers to send this event to. You can implement events that just go to specific users this way. More...
ReceiverGroup Receivers
Sends the event to All, MasterClient or Others (default). Be careful with MasterClient, as the client might disconnect before it got the event and it gets lost. More...
byte | SequenceChannel
Events are ordered per "channel". If you have events that are independent of others, they can go into another sequence or channel. More...
WebFlags | Flags = WebFlags.Default
Optional flags to be used in Photon client SDKs with Op RaiseEvent and Op SetProperties. More...

Static Public Attributes

static readonly RaiseEventOptions Default = new RaiseEventOptions()
Default options: CachingOption: DoNotCache, InterestGroup: 0, targetActors: null, receivers: Others, sequenceChannel: 0. More...

Detailed Description

Aggregates several less-often used options for operation RaiseEvent. See field descriptions for usage details.

Member Data Documentation

◆ CachingOption

EventCaching CachingOption

Defines if the server should simply send the event, put it in the cache or remove events that are like this one.

When using option: SliceSetIndex, SlicePurgeIndex or SlicePurgeUpToIndex, set a CacheSliceIndex. All other options except SequenceChannel get ignored.

◆ Default

readonly RaiseEventOptions Default = new RaiseEventOptions()
static

Default options: CachingOption: DoNotCache, InterestGroup: 0, targetActors: null, receivers: Others, sequenceChannel: 0.

◆ Flags

WebFlags Flags = WebFlags.Default

Optional flags to be used in Photon client SDKs with Op RaiseEvent and Op SetProperties.

Introduced mainly for webhooks 1.2 to control behavior of forwarded HTTP requests.

◆ InterestGroup

byte InterestGroup

The number of the Interest Group to send this to. 0 goes to all users but to get 1 and up, clients must subscribe to the group first.

◆ Receivers

ReceiverGroup Receivers

Sends the event to All, MasterClient or Others (default). Be careful with MasterClient, as the client might disconnect before it got the event and it gets lost.

◆ SequenceChannel

byte SequenceChannel

Events are ordered per "channel". If you have events that are independent of others, they can go into another sequence or channel.

◆ TargetActors

int [] TargetActors

A list of Player.ActorNumbers to send this event to. You can implement events that just go to specific users this way.


Photon Unity Networking 2: Region Class Reference

  • Realtime
  • Region
Public Member Functions | Properties | List of all members
Region Class Reference

Public Member Functions

Region (string code, string address)
Region (string code, int ping)
override string | ToString ()
string | ToString (bool compact=false)

Properties

string | Code [get]
string | Cluster [get]
Unlike the CloudRegionCode, this may contain cluster information. More...
string | HostAndPort [get, set]
int | Ping [get, set]
bool | WasPinged [get]

Property Documentation

◆ Cluster

string Cluster
get

Unlike the CloudRegionCode, this may contain cluster information.


Photon Unity Networking 2: RegionHandler Class Reference

  • Realtime
  • RegionHandler
Public Member Functions | Static Public Attributes | Properties | List of all members
RegionHandler Class Reference

Provides methods to work with Photon's regions (Photon Cloud) and can be use to find the one with best ping. More...

Public Member Functions

string | GetResults ()
void | SetRegions (OperationResponse opGetRegions)
RegionHandler (ushort masterServerPortOverride=0)
bool | PingMinimumOfRegions (Action< RegionHandler > onCompleteCallback, string previousSummary)

Static Public Attributes

static Type PingImplementation
The implementation of PhotonPing to use for region pinging (Best Region detection). More...

Properties

List< Region > | EnabledRegions [get, set]
A list of region names for the Photon Cloud. Set by the result of OpGetRegions(). More...
Region | BestRegion [get]
When PingMinimumOfRegions was called and completed, the BestRegion is identified by best ping. More...
string | SummaryToCache [get]
This value summarizes the results of pinging currently available regions (after PingMinimumOfRegions finished). More...
bool | IsPinging [get]

Detailed Description

Provides methods to work with Photon's regions (Photon Cloud) and can be use to find the one with best ping.

When a client uses a Name Server to fetch the list of available regions, the LoadBalancingClient will create a RegionHandler and provide it via the OnRegionListReceived callback.

Your logic can decide to either connect to one of those regional servers, or it may use PingMinimumOfRegions to test which region provides the best ping.

It makes sense to make clients "sticky" to a region when one gets selected. This can be achieved by storing the SummaryToCache value, once pinging was done. When the client connects again, the previous SummaryToCache helps limiting the number of regions to ping. In best case, only the previously selected region gets re-pinged and if the current ping is not much worse, this one region is used again.

Member Data Documentation

◆ PingImplementation

Type PingImplementation
static

The implementation of PhotonPing to use for region pinging (Best Region detection).

Defaults to null, which means the Type is set automatically.

Property Documentation

◆ BestRegion

Region BestRegion
get

When PingMinimumOfRegions was called and completed, the BestRegion is identified by best ping.

◆ EnabledRegions

List<Region> EnabledRegions
getset

A list of region names for the Photon Cloud. Set by the result of OpGetRegions().

Implement ILoadBalancingCallbacks and register for the callbacks to get OnRegionListReceived(RegionHandler regionHandler). You can also put a "case OperationCode.GetRegions:" into your OnOperationResponse method to notice when the result is available.

◆ SummaryToCache

string SummaryToCache
get

This value summarizes the results of pinging currently available regions (after PingMinimumOfRegions finished).

This value should be stored in the client by the game logic. When connecting again, use it as previous summary to speed up pinging regions and to make the best region sticky for the client.


Photon Unity Networking 2: RegionPinger Class Reference

  • Realtime
  • RegionPinger
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
RegionPinger Class Reference

Public Member Functions

RegionPinger (Region region, Action< Region > onDoneCallback)
bool | Start ()
Starts the ping routine for the assigned region. More...
string | GetResults ()

Static Public Member Functions

static string ResolveHost (string hostName)
Attempts to resolve a hostname into an IP string or returns empty string if that fails. More...

Public Attributes

int CurrentAttempt = 0

Static Public Attributes

static int | Attempts = 5
static bool | IgnoreInitialAttempt = true
static int | MaxMilliseconsPerPing = 800
static int | PingWhenFailed = Attempts * MaxMilliseconsPerPing

Properties

bool Done [get]

Member Function Documentation

◆ ResolveHost()

static string ResolveHost ( string hostName )
static

Attempts to resolve a hostname into an IP string or returns empty string if that fails.

To be compatible with most platforms, the address family is checked like this:
if (ipAddress.AddressFamily.ToString().Contains("6")) // ipv6...

Parameters
hostName Hostname to resolve.
Returns
IP string or empty string if resolution fails

◆ Start()

bool Start ( )

Starts the ping routine for the assigned region.

Pinging runs in a ThreadPool worker item or (if needed) in a Thread. WebGL runs pinging on the Main Thread as coroutine.

Returns
Always true.


Photon Unity Networking 2: Room Class Reference

  • Realtime
  • Room
Public Member Functions | Properties | List of all members
Room Class Reference

This class represents a room a client joins/joined. More...

Inherits RoomInfo.

Public Member Functions

Room (string roomName, RoomOptions options, bool isOffline=false)
Creates a Room (representation) with given name and properties and the "listing options" as provided by parameters. More...
virtual bool | SetCustomProperties (Hashtable propertiesToSet, Hashtable expectedProperties=null, WebFlags webFlags=null)
Updates and synchronizes this Room's Custom Properties. Optionally, expectedProperties can be provided as condition. More...
bool | SetPropertiesListedInLobby (string[] lobbyProps)
Enables you to define the properties available in the lobby if not all properties are needed to pick a room. More...
bool | SetMasterClient (Player masterClientPlayer)
Asks the server to assign another player as Master Client of your current room. More...
virtual bool | AddPlayer (Player player)
Checks if the player is in the room's list already and calls StorePlayer() if not. More...
virtual Player | StorePlayer (Player player)
Updates a player reference in the Players dictionary (no matter if it existed before or not). More...
virtual Player | GetPlayer (int id, bool findMaster=false)
Tries to find the player with given actorNumber (a.k.a. ID). Only useful when in a Room, as IDs are only valid per Room. More...
bool | ClearExpectedUsers ()
Attempts to remove all current expected users from the server's Slot Reservation list. More...
bool | SetExpectedUsers (string[] newExpectedUsers)
Attempts to update the expected users from the server's Slot Reservation list. More...
override string | ToString ()
Returns a summary of this Room instance as string. More...
new string | ToStringFull ()
Returns a summary of this Room instance as longer string, including Custom Properties. More...
- Public Member Functions inherited from RoomInfo
override bool | Equals (object other)
Makes RoomInfo comparable (by name). More...
override int | GetHashCode ()
Accompanies Equals, using the name's HashCode as return. More...
override string | ToString ()
Returns most interesting room values as string. More...
string | ToStringFull ()
Returns most interesting room values as string, including custom properties. More...

Properties

LoadBalancingClient | LoadBalancingClient [get, set]
A reference to the LoadBalancingClient which is currently keeping the connection and state. More...
new string | Name [get, set]
The name of a room. Unique identifier (per region and virtual appid) for a room/match. More...
bool | IsOffline [get]
new bool | IsOpen [get, set]
Defines if the room can be joined. More...
new bool | IsVisible [get, set]
Defines if the room is listed in its lobby. More...
new byte | MaxPlayers [get, set]
Sets a limit of players to this room. This property is synced and shown in lobby, too. If the room is full (players count == maxplayers), joining this room will fail. More...
new byte | PlayerCount [get]
The count of players in this Room (using this.Players.Count). More...
Dictionary< int, Player > | Players [get]
While inside a Room, this is the list of players who are also in that room. More...
string[] | ExpectedUsers [get]
List of users who are expected to join this room. In matchmaking, Photon blocks a slot for each of these UserIDs out of the MaxPlayers. More...
int | PlayerTtl [get, set]
Player Time To Live. How long any player can be inactive (due to disconnect or leave) before the user gets removed from the playerlist (freeing a slot). More...
int | EmptyRoomTtl [get, set]
Room Time To Live. How long a room stays available (and in server-memory), after the last player becomes inactive. After this time, the room gets persisted or destroyed. More...
int | MasterClientId [get]
The ID (actorNumber, actorNumber) of the player who's the master of this Room. Note: This changes when the current master leaves the room. More...
string[] | PropertiesListedInLobby [get]
Gets a list of custom properties that are in the RoomInfo of the Lobby. This list is defined when creating the room and can't be changed afterwards. Compare: LoadBalancingClient.OpCreateRoom() More...
bool | AutoCleanUp [get]
Gets if this room cleans up the event cache when a player (actor) leaves. More...
bool | BroadcastPropertiesChangeToAll [get]
Define if the client who calls SetProperties should receive the properties update event or not. More...
bool | SuppressRoomEvents [get]
Define if Join and Leave events should not be sent to clients in the room. More...
bool | SuppressPlayerInfo [get]
Extends SuppressRoomEvents: Define if Join and Leave events but also the actors' list and their respective properties should not be sent to clients. More...
bool | PublishUserId [get]
Define if UserIds of the players are broadcast in the room. Useful for FindFriends and reserving slots for expected users. More...
bool | DeleteNullProperties [get]
Define if actor or room properties with null values are removed on the server or kept. More...
- Properties inherited from RoomInfo
Hashtable | CustomProperties [get]
Read-only "cache" of custom properties of a room. Set via Room.SetCustomProperties (not available for RoomInfo class!). More...
string | Name [get]
The name of a room. Unique identifier for a room/match (per AppId + game-Version). More...
int | PlayerCount [get]
Count of players currently in room. This property is overwritten by the Room class (used when you're in a Room). More...
byte | MaxPlayers [get]
The limit of players for this room. This property is shown in lobby, too. If the room is full (players count == maxplayers), joining this room will fail. More...
bool | IsOpen [get]
Defines if the room can be joined. This does not affect listing in a lobby but joining the room will fail if not open. If not open, the room is excluded from random matchmaking. Due to racing conditions, found matches might become closed even while you join them. Simply re-connect to master and find another. Use property "IsVisible" to not list the room. More...
bool | IsVisible [get]
Defines if the room is listed in its lobby. Rooms can be created invisible, or changed to invisible. To change if a room can be joined, use property: open. More...

Additional Inherited Members

- Public Attributes inherited from RoomInfo
bool | RemovedFromList
Used in lobby, to mark rooms that are no longer listed (for being full, closed or hidden). More...
int | masterClientId
Backing field for master client id (actorNumber). defined by server in room props and ev leave. More...
- Protected Attributes inherited from RoomInfo
byte | maxPlayers = 0
Backing field for property. More...
int | emptyRoomTtl = 0
Backing field for property. More...
int | playerTtl = 0
Backing field for property. More...
string[] | expectedUsers
Backing field for property. More...
bool | isOpen = true
Backing field for property. More...
bool | isVisible = true
Backing field for property. More...
bool | autoCleanUp = true
Backing field for property. False unless the GameProperty is set to true (else it's not sent). More...
string | name
Backing field for property. More...
string[] | propertiesListedInLobby
Backing field for property. More...

Detailed Description

This class represents a room a client joins/joined.

Contains a list of current players, their properties and those of this room, too. A room instance has a number of "well known" properties like IsOpen, MaxPlayers which can be changed. Your own, custom properties can be set via SetCustomProperties() while being in the room.

Typically, this class should be extended by a game-specific implementation with logic and extra features.

Constructor & Destructor Documentation

◆ Room()

Room | ( | string | roomName,
 |  | RoomOptions | options,
 |  | bool | isOffline = false
 | ) |  |

Creates a Room (representation) with given name and properties and the "listing options" as provided by parameters.

Parameters
roomName | Name of the room (can be null until it's actually created on server).
options | Room options.

Member Function Documentation

◆ AddPlayer()

virtual bool AddPlayer ( Player player )
virtual

Checks if the player is in the room's list already and calls StorePlayer() if not.

Parameters
player The new player - identified by ID.
Returns
False if the player could not be added (cause it was in the list already).

◆ ClearExpectedUsers()

bool ClearExpectedUsers ( )

Attempts to remove all current expected users from the server's Slot Reservation list.

Note that this operation can conflict with new/other users joining. They might be adding users to the list of expected users before or after this client called ClearExpectedUsers.

This room's expectedUsers value will update, when the server sends a successful update.

Internals: This methods wraps up setting the ExpectedUsers property of a room.

Returns
If the operation could be sent to the server.

◆ GetPlayer()

virtual Player GetPlayer | ( | int | id,
 |  | bool | findMaster = false
 | ) |  |
virtual

Tries to find the player with given actorNumber (a.k.a. ID). Only useful when in a Room, as IDs are only valid per Room.

Parameters
id | ID to look for.
findMaster | If true, the Master Client is returned for ID == 0.
Returns
The player with the ID or null.

◆ SetCustomProperties()

virtual bool SetCustomProperties | ( | Hashtable | propertiesToSet,
 |  | Hashtable | expectedProperties = null,
 |  | WebFlags | webFlags = null
 | ) |  |
virtual

Updates and synchronizes this Room's Custom Properties. Optionally, expectedProperties can be provided as condition.

Custom Properties are a set of string keys and arbitrary values which is synchronized for the players in a Room. They are available when the client enters the room, as they are in the response of OpJoin and OpCreate.

Custom Properties either relate to the (current) Room or a Player (in that Room).

Both classes locally cache the current key/values and make them available as property: CustomProperties. This is provided only to read them. You must use the method SetCustomProperties to set/modify them.

Any client can set any Custom Properties anytime (when in a room). It's up to the game logic to organize how they are best used.

You should call SetCustomProperties only with key/values that are new or changed. This reduces traffic and performance.

Unless you define some expectedProperties, setting key/values is always permitted. In this case, the property-setting client will not receive the new values from the server but instead update its local cache in SetCustomProperties.

If you define expectedProperties, the server will skip updates if the server property-cache does not contain all expectedProperties with the same values. In this case, the property-setting client will get an update from the server and update it's cached key/values at about the same time as everyone else.

The benefit of using expectedProperties can be only one client successfully sets a key from one known value to another. As example: Store who owns an item in a Custom Property "ownedBy". It's 0 initally. When multiple players reach the item, they all attempt to change "ownedBy" from 0 to their actorNumber. If you use expectedProperties {"ownedBy", 0} as condition, the first player to take the item will have it (and the others fail to set the ownership).

Properties get saved with the game state for Turnbased games (which use IsPersistent = true).

Parameters
propertiesToSet | Hashtable of Custom Properties that changes.
expectedProperties | Provide some keys/values to use as condition for setting the new values. Client must be in room.
webFlags | Defines if this SetCustomProperties-operation gets forwarded to your WebHooks. Client must be in room.
Returns
False if propertiesToSet is null or empty or have zero string keys. True in offline mode even if expectedProperties or webFlags are used. Otherwise, returns if this operation could be sent to the server.

◆ SetExpectedUsers()

bool SetExpectedUsers ( string[] newExpectedUsers )

Attempts to update the expected users from the server's Slot Reservation list.

Note that this operation can conflict with new/other users joining. They might be adding users to the list of expected users before or after this client called SetExpectedUsers.

This room's expectedUsers value will update, when the server sends a successful update.

Internals: This methods wraps up setting the ExpectedUsers property of a room.

Parameters
newExpectedUsers The new array of UserIDs to be reserved in the room.
Returns
If the operation could be sent to the server.

◆ SetMasterClient()

bool SetMasterClient ( Player masterClientPlayer )

Asks the server to assign another player as Master Client of your current room.

RaiseEvent has the option to send messages only to the Master Client of a room. SetMasterClient affects which client gets those messages.

This method calls an operation on the server to set a new Master Client, which takes a roundtrip. In case of success, this client and the others get the new Master Client from the server.

SetMasterClient tells the server which current Master Client should be replaced with the new one. It will fail, if anything switches the Master Client moments earlier. There is no callback for this error. All clients should get the new Master Client assigned by the server anyways.

See also: MasterClientId

Parameters
masterClientPlayer The player to become the next Master Client.
Returns
False when this operation couldn't be done currently. Requires a v4 Photon Server.

◆ SetPropertiesListedInLobby()

bool SetPropertiesListedInLobby ( string[] lobbyProps )

Enables you to define the properties available in the lobby if not all properties are needed to pick a room.

Limit the amount of properties sent to users in the lobby to improve speed and stability.

Parameters
lobbyProps An array of custom room property names to forward to the lobby.
Returns
If the operation could be sent to the server.

◆ StorePlayer()

virtual Player StorePlayer ( Player player )
virtual

Updates a player reference in the Players dictionary (no matter if it existed before or not).

Parameters
player The Player instance to insert into the room.

◆ ToString()

override string ToString ( )

Returns a summary of this Room instance as string.

Returns
Summary of this Room instance.

◆ ToStringFull()

new string ToStringFull ( )

Returns a summary of this Room instance as longer string, including Custom Properties.

Returns
Summary of this Room instance.

Property Documentation

◆ AutoCleanUp

bool AutoCleanUp
get

Gets if this room cleans up the event cache when a player (actor) leaves.

This affects which events joining players get.

Set in room creation via RoomOptions.CleanupCacheOnLeave.

Within PUN, auto cleanup of events means that cached RPCs and instantiated networked objects are deleted from the room.

◆ BroadcastPropertiesChangeToAll

bool BroadcastPropertiesChangeToAll
get

Define if the client who calls SetProperties should receive the properties update event or not.

◆ DeleteNullProperties

bool DeleteNullProperties
get

Define if actor or room properties with null values are removed on the server or kept.

◆ EmptyRoomTtl

int EmptyRoomTtl
getset

Room Time To Live. How long a room stays available (and in server-memory), after the last player becomes inactive. After this time, the room gets persisted or destroyed.

◆ ExpectedUsers

string [] ExpectedUsers
get

List of users who are expected to join this room. In matchmaking, Photon blocks a slot for each of these UserIDs out of the MaxPlayers.

The corresponding feature in Photon is called "Slot Reservation" and can be found in the doc pages. Define expected players in the methods: LoadBalancingClient.OpCreateRoom, LoadBalancingClient.OpJoinRoom and LoadBalancingClient.OpJoinRandomRoom.

◆ IsOpen

new bool IsOpen
getset

Defines if the room can be joined.

This does not affect listing in a lobby but joining the room will fail if not open. If not open, the room is excluded from random matchmaking. Due to racing conditions, found matches might become closed while users are trying to join. Simply re-connect to master and find another. Use property "IsVisible" to not list the room.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ IsVisible

new bool IsVisible
getset

Defines if the room is listed in its lobby.

Rooms can be created invisible, or changed to invisible. To change if a room can be joined, use property: open.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ LoadBalancingClient

LoadBalancingClient LoadBalancingClient
getset

A reference to the LoadBalancingClient which is currently keeping the connection and state.

◆ MasterClientId

int MasterClientId
get

The ID (actorNumber, actorNumber) of the player who's the master of this Room. Note: This changes when the current master leaves the room.

◆ MaxPlayers

new byte MaxPlayers
getset

Sets a limit of players to this room. This property is synced and shown in lobby, too. If the room is full (players count == maxplayers), joining this room will fail.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ Name

new string Name
getset

The name of a room. Unique identifier (per region and virtual appid) for a room/match.

The name can't be changed once it's set by the server.

◆ PlayerCount

new byte PlayerCount
get

The count of players in this Room (using this.Players.Count).

◆ Players

Dictionary<int, Player> Players
get

While inside a Room, this is the list of players who are also in that room.

◆ PlayerTtl

int PlayerTtl
getset

Player Time To Live. How long any player can be inactive (due to disconnect or leave) before the user gets removed from the playerlist (freeing a slot).

◆ PropertiesListedInLobby

string [] PropertiesListedInLobby
get

Gets a list of custom properties that are in the RoomInfo of the Lobby. This list is defined when creating the room and can't be changed afterwards. Compare: LoadBalancingClient.OpCreateRoom()

You could name properties that are not set from the beginning. Those will be synced with the lobby when added later on.

◆ PublishUserId

bool PublishUserId
get

Define if UserIds of the players are broadcast in the room. Useful for FindFriends and reserving slots for expected users.

◆ SuppressPlayerInfo

bool SuppressPlayerInfo
get

Extends SuppressRoomEvents: Define if Join and Leave events but also the actors' list and their respective properties should not be sent to clients.

◆ SuppressRoomEvents

bool SuppressRoomEvents
get

Define if Join and Leave events should not be sent to clients in the room.


Photon Unity Networking 2: RoomInfo Class Reference

  • Realtime
  • RoomInfo
Public Member Functions | Public Attributes | Protected Attributes | Properties | List of all members
RoomInfo Class Reference

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...

Inherited by Room.

Public Member Functions

override bool | Equals (object other)
Makes RoomInfo comparable (by name). More...
override int | GetHashCode ()
Accompanies Equals, using the name's HashCode as return. More...
override string | ToString ()
Returns most interesting room values as string. More...
string | ToStringFull ()
Returns most interesting room values as string, including custom properties. More...

Public Attributes

bool | RemovedFromList
Used in lobby, to mark rooms that are no longer listed (for being full, closed or hidden). More...
int | masterClientId
Backing field for master client id (actorNumber). defined by server in room props and ev leave. More...

Protected Attributes

byte | maxPlayers = 0
Backing field for property. More...
int | emptyRoomTtl = 0
Backing field for property. More...
int | playerTtl = 0
Backing field for property. More...
string[] | expectedUsers
Backing field for property. More...
bool | isOpen = true
Backing field for property. More...
bool | isVisible = true
Backing field for property. More...
bool | autoCleanUp = true
Backing field for property. False unless the GameProperty is set to true (else it's not sent). More...
string | name
Backing field for property. More...
string[] | propertiesListedInLobby
Backing field for property. More...

Properties

Hashtable | CustomProperties [get]
Read-only "cache" of custom properties of a room. Set via Room.SetCustomProperties (not available for RoomInfo class!). More...
string | Name [get]
The name of a room. Unique identifier for a room/match (per AppId + game-Version). More...
int | PlayerCount [get]
Count of players currently in room. This property is overwritten by the Room class (used when you're in a Room). More...
byte | MaxPlayers [get]
The limit of players for this room. This property is shown in lobby, too. If the room is full (players count == maxplayers), joining this room will fail. More...
bool | IsOpen [get]
Defines if the room can be joined. This does not affect listing in a lobby but joining the room will fail if not open. If not open, the room is excluded from random matchmaking. Due to racing conditions, found matches might become closed even while you join them. Simply re-connect to master and find another. Use property "IsVisible" to not list the room. More...
bool | IsVisible [get]
Defines if the room is listed in its lobby. Rooms can be created invisible, or changed to invisible. To change if a room can be joined, use property: open. More...

Detailed Description

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).

This class resembles info about available rooms, as sent by the Master server's lobby. Consider all values as readonly. None are synced (only updated by events by server).

Member Function Documentation

◆ Equals()

override bool Equals ( object other )

Makes RoomInfo comparable (by name).

◆ GetHashCode()

override int GetHashCode ( )

Accompanies Equals, using the name's HashCode as return.

Returns

◆ ToString()

override string ToString ( )

Returns most interesting room values as string.

Returns
Summary of this RoomInfo instance.

◆ ToStringFull()

string ToStringFull ( )

Returns most interesting room values as string, including custom properties.

Returns
Summary of this RoomInfo instance.

Member Data Documentation

◆ autoCleanUp

bool autoCleanUp = true
protected

Backing field for property. False unless the GameProperty is set to true (else it's not sent).

◆ emptyRoomTtl

int emptyRoomTtl = 0
protected

Backing field for property.

◆ expectedUsers

string [] expectedUsers
protected

Backing field for property.

◆ isOpen

bool isOpen = true
protected

Backing field for property.

◆ isVisible

bool isVisible = true
protected

Backing field for property.

◆ masterClientId

int masterClientId

Backing field for master client id (actorNumber). defined by server in room props and ev leave.

◆ maxPlayers

byte maxPlayers = 0
protected

Backing field for property.

◆ name

string name
protected

Backing field for property.

◆ playerTtl

int playerTtl = 0
protected

Backing field for property.

◆ propertiesListedInLobby

string [] propertiesListedInLobby
protected

Backing field for property.

◆ RemovedFromList

bool RemovedFromList

Used in lobby, to mark rooms that are no longer listed (for being full, closed or hidden).

Property Documentation

◆ CustomProperties

Hashtable CustomProperties
get

Read-only "cache" of custom properties of a room. Set via Room.SetCustomProperties (not available for RoomInfo class!).

All keys are string-typed and the values depend on the game/application.

Room.SetCustomProperties

◆ IsOpen

bool IsOpen
get

Defines if the room can be joined. This does not affect listing in a lobby but joining the room will fail if not open. If not open, the room is excluded from random matchmaking. Due to racing conditions, found matches might become closed even while you join them. Simply re-connect to master and find another. Use property "IsVisible" to not list the room.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ IsVisible

bool IsVisible
get

Defines if the room is listed in its lobby. Rooms can be created invisible, or changed to invisible. To change if a room can be joined, use property: open.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ MaxPlayers

byte MaxPlayers
get

The limit of players for this room. This property is shown in lobby, too. If the room is full (players count == maxplayers), joining this room will fail.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ Name

string Name
get

The name of a room. Unique identifier for a room/match (per AppId + game-Version).

◆ PlayerCount

int PlayerCount
get

Count of players currently in room. This property is overwritten by the Room class (used when you're in a Room).


Photon Unity Networking 2: RoomOptions Class Reference

  • Realtime
  • RoomOptions
Public Attributes | Properties | List of all members
RoomOptions Class Reference

Wraps up common room properties needed when you create rooms. Read the individual entries for more details. More...

Public Attributes

byte | MaxPlayers
Max number of players that can be in the room at any time. 0 means "no limit". More...
int | PlayerTtl
Time To Live (TTL) for an 'actor' in a room. If a client disconnects, this actor is inactive first and removed after this timeout. In milliseconds. More...
int | EmptyRoomTtl
Time To Live (TTL) for a room when the last player leaves. Keeps room in memory for case a player re-joins soon. In milliseconds. More...
Hashtable | CustomRoomProperties
The room's custom properties to set. Use string keys! More...
string[] | CustomRoomPropertiesForLobby = new string[0]
Defines the custom room properties that get listed in the lobby. More...
string[] | Plugins
Informs the server of the expected plugin setup. More...

Properties

bool | IsVisible [get, set]
Defines if this room is listed in the lobby. If not, it also is not joined randomly. More...
bool | IsOpen [get, set]
Defines if this room can be joined at all. More...
bool | CleanupCacheOnLeave [get, set]
Removes a user's events and properties from the room when a user leaves. More...
bool | SuppressRoomEvents [get, set]
Tells the server to skip room events for joining and leaving players. More...
bool | SuppressPlayerInfo [get, set]
Disables events join and leave from the server as well as property broadcasts in a room (to minimize traffic) More...
bool | PublishUserId [get, set]
Defines if the UserIds of players get "published" in the room. Useful for FindFriends, if players want to play another game together. More...
bool | DeleteNullProperties [get, set]
Optionally, properties get deleted, when null gets assigned as value. Defaults to off / false. More...
bool | BroadcastPropsChangeToAll [get, set]
By default, property changes are sent back to the client that's setting them to avoid de-sync when properties are set concurrently. More...

Detailed Description

Wraps up common room properties needed when you create rooms. Read the individual entries for more details.

This directly maps to the fields in the Room class.

Member Data Documentation

◆ CustomRoomProperties

Hashtable CustomRoomProperties

The room's custom properties to set. Use string keys!

Custom room properties are any key-values you need to define the game's setup. The shorter your keys are, the better. Example: Map, Mode (could be "m" when used with "Map"), TileSet (could be "t").

◆ CustomRoomPropertiesForLobby

string [] CustomRoomPropertiesForLobby = new string[0]

Defines the custom room properties that get listed in the lobby.

Name the custom room properties that should be available to clients that are in a lobby. Use with care. Unless a custom property is essential for matchmaking or user info, it should not be sent to the lobby, which causes traffic and delays for clients in the lobby.

Default: No custom properties are sent to the lobby.

◆ EmptyRoomTtl

int EmptyRoomTtl

Time To Live (TTL) for a room when the last player leaves. Keeps room in memory for case a player re-joins soon. In milliseconds.

◆ MaxPlayers

byte MaxPlayers

Max number of players that can be in the room at any time. 0 means "no limit".

◆ PlayerTtl

int PlayerTtl

Time To Live (TTL) for an 'actor' in a room. If a client disconnects, this actor is inactive first and removed after this timeout. In milliseconds.

◆ Plugins

string [] Plugins

Informs the server of the expected plugin setup.

The operation will fail in case of a plugin missmatch returning error code PluginMismatch 32757(0x7FFF - 10). Setting string[]{} means the client expects no plugin to be setup. Note: for backwards compatibility null omits any check.

Property Documentation

◆ BroadcastPropsChangeToAll

bool BroadcastPropsChangeToAll
getset

By default, property changes are sent back to the client that's setting them to avoid de-sync when properties are set concurrently.

This option is enables by default to fix this scenario:

1) On server, room property ABC is set to value FOO, which triggers notifications to all the clients telling them that the property changed. 2) While that notification is in flight, a client sets the ABC property to value BAR. 3) Client receives notification from the server and changes it�s local copy of ABC to FOO. 4) Server receives the set operation and changes the official value of ABC to BAR, but never notifies the client that sent the set operation that the value is now BAR.

Without this option, the client that set the value to BAR never hears from the server that the official copy has been updated to BAR, and thus gets stuck with a value of FOO.

◆ CleanupCacheOnLeave

bool CleanupCacheOnLeave
getset

Removes a user's events and properties from the room when a user leaves.

This makes sense when in rooms where players can't place items in the room and just vanish entirely. When you disable this, the event history can become too long to load if the room stays in use indefinitely. Default: true. Cleans up the cache and props of leaving users.

◆ DeleteNullProperties

bool DeleteNullProperties
getset

Optionally, properties get deleted, when null gets assigned as value. Defaults to off / false.

When Op SetProperties is setting a key's value to null, the server and clients should remove the key/value from the Custom Properties. By default, the server keeps the keys (and null values) and sends them to joining players.

Important: Only when SetProperties does a "broadcast", the change (key, value = null) is sent to clients to update accordingly. This applies to Custom Properties for rooms and actors/players.

◆ IsOpen

bool IsOpen
getset

Defines if this room can be joined at all.

If a room is closed, no player can join this. As example this makes sense when 3 of 4 possible players start their gameplay early and don't want anyone to join during the game. The room can still be listed in the lobby (set isVisible to control lobby-visibility).

◆ IsVisible

bool IsVisible
getset

Defines if this room is listed in the lobby. If not, it also is not joined randomly.

A room that is not visible will be excluded from the room lists that are sent to the clients in lobbies. An invisible room can be joined by name but is excluded from random matchmaking.

Use this to "hide" a room and simulate "private rooms". Players can exchange a roomname and create it invisble to avoid anyone else joining it.

◆ PublishUserId

bool PublishUserId
getset

Defines if the UserIds of players get "published" in the room. Useful for FindFriends, if players want to play another game together.

When you set this to true, Photon will publish the UserIds of the players in that room. In that case, you can use PhotonPlayer.userId, to access any player's userID. This is useful for FindFriends and to set "expected users" to reserve slots in a room.

◆ SuppressPlayerInfo

bool SuppressPlayerInfo
getset

Disables events join and leave from the server as well as property broadcasts in a room (to minimize traffic)

◆ SuppressRoomEvents

bool SuppressRoomEvents
getset

Tells the server to skip room events for joining and leaving players.

Using this makes the client unaware of the other players in a room. That can save some traffic if you have some server logic that updates players but it can also limit the client's usability.


Photon Unity Networking 2: SupportLogger Class Reference

  • Realtime
  • SupportLogger
Classes | Public Member Functions | Public Attributes | Properties | List of all members
SupportLogger Class Reference

Helper class to debug log basic information about Photon client and vital traffic statistics. More...

Inherits IConnectionCallbacks, IInRoomCallbacks, IMatchmakingCallbacks, and ILobbyCallbacks.

Public Member Functions

void | StartLogStats ()
void | StopLogStats ()
void | LogStats ()
Debug logs vital traffic statistics about the attached Photon Client. More...
void | OnConnected ()
Called to signal that the "low level connection" got established but before the client can call operation on the server. More...
void | OnConnectedToMaster ()
Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
void | OnFriendListUpdate (List< FriendInfo > friendList)
Called when the server sent the response to a FindFriends request. More...
void | OnJoinedLobby ()
Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
void | OnLeftLobby ()
Called after leaving a lobby. More...
void | OnCreateRoomFailed (short returnCode, string message)
Called when the server couldn't create a room (OpCreateRoom failed). More...
void | OnJoinedRoom ()
Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
void | OnJoinRoomFailed (short returnCode, string message)
Called when a previous OpJoinRoom call failed on the server. More...
void | OnJoinRandomFailed (short returnCode, string message)
Called when a previous OpJoinRandom call failed on the server. More...
void | OnCreatedRoom ()
Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
void | OnLeftRoom ()
Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
void | OnDisconnected (DisconnectCause cause)
Called after disconnecting from the Photon server. It could be a failure or an explicit disconnect call More...
void | OnRegionListReceived (RegionHandler regionHandler)
Called when the Name Server provided a list of regions for your title. More...
void | OnRoomListUpdate (List< RoomInfo > roomList)
Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
void | OnPlayerEnteredRoom (Player newPlayer)
Called when a remote player entered the room. This Player is already added to the playerlist. More...
void | OnPlayerLeftRoom (Player otherPlayer)
Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
void | OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
void | OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
void | OnMasterClientSwitched (Player newMasterClient)
Called after switching to a new MasterClient when the current one leaves. More...
void | OnCustomAuthenticationResponse (Dictionary< string, object > data)
Called when your Custom Authentication service responds with additional data. More...
void | OnCustomAuthenticationFailed (string debugMessage)
Called when the custom authentication failed. Followed by disconnect! More...
void | OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
Called when the Master Server sent an update for the Lobby Statistics. More...
void | OnErrorInfo (ErrorInfo errorInfo)

Public Attributes

bool LogTrafficStats = true
Toggle to enable or disable traffic statistics logging. More...

Properties

LoadBalancingClient Client [get, set]
Photon client to log information and statistics from. More...

Detailed Description

Helper class to debug log basic information about Photon client and vital traffic statistics.

Set SupportLogger.Client for this to work.

Member Function Documentation

◆ LogStats()

void LogStats ( )

Debug logs vital traffic statistics about the attached Photon Client.

◆ OnConnected()

void OnConnected ( )

Called to signal that the "low level connection" got established but before the client can call operation on the server.

After the (low level transport) connection is established, the client will automatically send the Authentication operation, which needs to get a response before the client can call other operations.

Your logic should wait for either: OnRegionListReceived or OnConnectedToMaster.

This callback is useful to detect if the server can be reached at all (technically). Most often, it's enough to implement OnDisconnected(DisconnectCause cause) and check for the cause.

This is not called for transitions from the masterserver to game servers.

Implements IConnectionCallbacks.

◆ OnConnectedToMaster()

void OnConnectedToMaster ( )

Called when the client is connected to the Master Server and ready for matchmaking and other tasks.

The list of available rooms won't become available unless you join a lobby via LoadBalancingClient.OpJoinLobby. You can join rooms and create them even without being in a lobby. The default lobby is used in that case.

Implements IConnectionCallbacks.

◆ OnCreatedRoom()

void OnCreatedRoom ( )

Called when this client created a room and entered it. OnJoinedRoom() will be called as well.

This callback is only called on the client which created a room (see OpCreateRoom).

As any client might close (or drop connection) anytime, there is a chance that the creator of a room does not execute OnCreatedRoom.

If you need specific room properties or a "start signal", implement OnMasterClientSwitched() and make each new MasterClient check the room's state.

Implements IMatchmakingCallbacks.

◆ OnCreateRoomFailed()

void OnCreateRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when the server couldn't create a room (OpCreateRoom failed).

Creating a room may fail for various reasons. Most often, the room already exists (roomname in use) or the RoomOptions clash and it's impossible to create the room.

When creating a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnCustomAuthenticationFailed()

void OnCustomAuthenticationFailed ( string debugMessage )

Called when the custom authentication failed. Followed by disconnect!

Custom Authentication can fail due to user-input, bad tokens/secrets. If authentication is successful, this method is not called. Implement OnJoinedLobby() or OnConnectedToMaster() (as usual).

During development of a game, it might also fail due to wrong configuration on the server side. In those cases, logging the debugMessage is very important.

Unless you setup a custom authentication service for your app (in the Dashboard), this won't be called!

Parameters
debugMessage Contains a debug message why authentication failed. This has to be fixed during development.

Implements IConnectionCallbacks.

◆ OnCustomAuthenticationResponse()

void OnCustomAuthenticationResponse ( Dictionary< string, object > data )

Called when your Custom Authentication service responds with additional data.

Custom Authentication services can include some custom data in their response. When present, that data is made available in this callback as Dictionary. While the keys of your data have to be strings, the values can be either string or a number (in Json). You need to make extra sure, that the value type is the one you expect. Numbers become (currently) int64.

Example: void OnCustomAuthenticationResponse(Dictionary<string, object> data) { ... }

https://doc.photonengine.com/en-us/realtime/current/reference/custom-authentication

Implements IConnectionCallbacks.

◆ OnDisconnected()

void OnDisconnected ( DisconnectCause cause )

Called after disconnecting from the Photon server. It could be a failure or an explicit disconnect call

The reason for this disconnect is provided as DisconnectCause.

Implements IConnectionCallbacks.

◆ OnFriendListUpdate()

void OnFriendListUpdate ( List< FriendInfo > friendList )

Called when the server sent the response to a FindFriends request.

After calling OpFindFriends, the Master Server will cache the friend list and send updates to the friend list. The friends includes the name, userId, online state and the room (if any) for each requested user/friend.

Use the friendList to update your UI and store it, if the UI should highlight changes.

Implements IMatchmakingCallbacks.

◆ OnJoinedLobby()

void OnJoinedLobby ( )

Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate.

While in the lobby, the roomlist is automatically updated in fixed intervals (which you can't modify in the public cloud). The room list gets available via OnRoomListUpdate.

Implements ILobbyCallbacks.

◆ OnJoinedRoom()

void OnJoinedRoom ( )

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Implements IMatchmakingCallbacks.

◆ OnJoinRandomFailed()

void OnJoinRandomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when a previous OpJoinRandom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

This operation is only ever sent to the Master Server. Once a room is found by the Master Server, the client will head off to the designated Game Server and use the operation Join on the Game Server.

When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnJoinRoomFailed()

void OnJoinRoomFailed | ( | short | returnCode,
 |  | string | message
 | ) |  |

Called when a previous OpJoinRoom call failed on the server.

Joining a room may fail for various reasons. Most often, the room is full or does not exist anymore (due to someone else being faster or closing the room).

When joining a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCode | Operation ReturnCode from the server.
message | Debug message for the error.

Implements IMatchmakingCallbacks.

◆ OnLeftLobby()

void OnLeftLobby ( )

Called after leaving a lobby.

When you leave a lobby, OpCreateRoom and OpJoinRandomRoom automatically refer to the default lobby.

Implements ILobbyCallbacks.

◆ OnLeftRoom()

void OnLeftRoom ( )

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Implements IMatchmakingCallbacks.

◆ OnLobbyStatisticsUpdate()

void OnLobbyStatisticsUpdate ( List< TypedLobbyInfo > lobbyStatistics )

Called when the Master Server sent an update for the Lobby Statistics.

This callback has two preconditions: EnableLobbyStatistics must be set to true, before this client connects. And the client has to be connected to the Master Server, which is providing the info about lobbies.

Implements ILobbyCallbacks.

◆ OnMasterClientSwitched()

void OnMasterClientSwitched ( Player newMasterClient )

Called after switching to a new MasterClient when the current one leaves.

This is not called when this client enters a room. The former MasterClient is still in the player list when this method get called.

Implements IInRoomCallbacks.

◆ OnPlayerEnteredRoom()

void OnPlayerEnteredRoom ( Player newPlayer )

Called when a remote player entered the room. This Player is already added to the playerlist.

If your game starts with a certain number of players, this callback can be useful to check the Room.playerCount and find out if you can start.

Implements IInRoomCallbacks.

◆ OnPlayerLeftRoom()

void OnPlayerLeftRoom ( Player otherPlayer )

Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive.

If another player leaves the room or if the server detects a lost connection, this callback will be used to notify your game logic.

Depending on the room's setup, players may become inactive, which means they may return and retake their spot in the room. In such cases, the Player stays in the Room.Players dictionary.

If the player is not just inactive, it gets removed from the Room.Players dictionary, before the callback is called.

Implements IInRoomCallbacks.

◆ OnPlayerPropertiesUpdate()

void OnPlayerPropertiesUpdate | ( | Player | targetPlayer,
 |  | Hashtable | changedProps
 | ) |  |

Called when custom player-properties are changed. Player and the changed properties are passed as object[].

Changing properties must be done by Player.SetCustomProperties, which causes this callback locally, too.

Parameters
targetPlayer | Contains Player that changed.
changedProps | Contains the properties that changed.

Implements IInRoomCallbacks.

◆ OnRegionListReceived()

void OnRegionListReceived ( RegionHandler regionHandler )

Called when the Name Server provided a list of regions for your title.

Check the RegionHandler class description, to make use of the provided values.

Parameters
regionHandler The currently used RegionHandler.

Implements IConnectionCallbacks.

◆ OnRoomListUpdate()

void OnRoomListUpdate ( List< RoomInfo > roomList )

Called for any update of the room-listing while in a lobby (InLobby) on the Master Server.

Each item is a RoomInfo which might include custom properties (provided you defined those as lobby-listed when creating a room). Not all types of lobbies provide a listing of rooms to the client. Some are silent and specialized for server-side matchmaking.

Implements ILobbyCallbacks.

◆ OnRoomPropertiesUpdate()

void OnRoomPropertiesUpdate ( Hashtable propertiesThatChanged )

Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties.

Since v1.25 this method has one parameter: Hashtable propertiesThatChanged.
Changing properties must be done by Room.SetCustomProperties, which causes this callback locally, too.

Parameters
propertiesThatChanged

Implements IInRoomCallbacks.

Member Data Documentation

◆ LogTrafficStats

bool LogTrafficStats = true

Toggle to enable or disable traffic statistics logging.

Property Documentation

◆ Client

LoadBalancingClient Client
getset

Photon client to log information and statistics from.


Photon Unity Networking 2: TypedLobby Class Reference

  • Realtime
  • TypedLobby
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
TypedLobby Class Reference

Refers to a specific lobby on the server. More...

Inherited by TypedLobbyInfo.

Public Member Functions

TypedLobby (string name, LobbyType type)
Sets Name and Type of the new instance. Make sure name is not empty or null, as that always points to the "default lobby" (TypedLobby.Default). More...
override string ToString ()

Public Attributes

string Name
Name of the lobby. Default: null, pointing to the "default lobby". More...
LobbyType Type
Type (and behaviour) of the lobby. More...

Static Public Attributes

static readonly TypedLobby Default = new TypedLobby()
A reference to the default lobby which is the unique lobby that uses null as name and is of type LobbyType.Default. More...

Properties

bool IsDefault [get]
Returns whether or not this instance points to the "default lobby" (TypedLobby.Default). More...

Detailed Description

Refers to a specific lobby on the server.

Name and Type combined are the unique identifier for a lobby.
The server will create lobbies "on demand", so no registration or setup is required.
An empty or null Name always points to the "default lobby" as special case.

Constructor & Destructor Documentation

◆ TypedLobby()

TypedLobby | ( | string | name,
 |  | LobbyType | type
 | ) |  |

Sets Name and Type of the new instance. Make sure name is not empty or null, as that always points to the "default lobby" (TypedLobby.Default).

Parameters
name | Some string to identify a lobby.
type | The type of a lobby defines it's capabilities and behaviour.

Member Data Documentation

◆ Default

readonly TypedLobby Default = new TypedLobby()
static

A reference to the default lobby which is the unique lobby that uses null as name and is of type LobbyType.Default.

There is only a single lobby with an empty name on the server. It is always of type LobbyType.Default.
On the other hand, this is a shortcut and reusable reference to the default lobby.
Do not change Name or Type.

◆ Name

string Name

Name of the lobby. Default: null, pointing to the "default lobby".

If Name is null or empty, a TypedLobby will point to the "default lobby". This ignores the Type value and always acts as LobbyType.Default.

◆ Type

LobbyType Type

Type (and behaviour) of the lobby.

An empty or null Name always points to the "default lobby" as special case.

Property Documentation

◆ IsDefault

bool IsDefault
get

Returns whether or not this instance points to the "default lobby" (TypedLobby.Default).

This comes up to checking if the Name is null or empty. LobbyType.Default is not the same thing as the "default lobby" (TypedLobby.Default).


Photon Unity Networking 2: TypedLobbyInfo Class Reference

  • Realtime
  • TypedLobbyInfo
Public Member Functions | Public Attributes | List of all members
TypedLobbyInfo Class Reference

Info for a lobby on the server. Used when LoadBalancingClient.EnableLobbyStatistics is true. More...

Inherits TypedLobby.

Public Member Functions

override string | ToString ()
- Public Member Functions inherited from TypedLobby
TypedLobby (string name, LobbyType type)
Sets Name and Type of the new instance. Make sure name is not empty or null, as that always points to the "default lobby" (TypedLobby.Default). More...
override string | ToString ()

Public Attributes

int | PlayerCount
Count of players that currently joined this lobby. More...
int | RoomCount
Count of rooms currently associated with this lobby. More...
- Public Attributes inherited from TypedLobby
string | Name
Name of the lobby. Default: null, pointing to the "default lobby". More...
LobbyType Type
Type (and behaviour) of the lobby. More...

Additional Inherited Members

- Static Public Attributes inherited from TypedLobby
static readonly TypedLobby | Default = new TypedLobby()
A reference to the default lobby which is the unique lobby that uses null as name and is of type LobbyType.Default. More...
- Properties inherited from TypedLobby
bool | IsDefault [get]
Returns whether or not this instance points to the "default lobby" (TypedLobby.Default). More...

Detailed Description

Info for a lobby on the server. Used when LoadBalancingClient.EnableLobbyStatistics is true.

Member Data Documentation

◆ PlayerCount

int PlayerCount

Count of players that currently joined this lobby.

◆ RoomCount

int RoomCount

Count of rooms currently associated with this lobby.


Photon Unity Networking 2: WebFlags Class Reference

  • Realtime
  • WebFlags
Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
WebFlags Class Reference

Optional flags to be used in Photon client SDKs with Op RaiseEvent and Op SetProperties. Introduced mainly for webhooks 1.2 to control behavior of forwarded HTTP requests. More...

Public Member Functions

WebFlags (byte webhookFlags)

Public Attributes

byte WebhookFlags

Static Public Attributes

static readonly WebFlags | Default = new WebFlags(0)
const byte | HttpForwardConst = 0x01
const byte | SendAuthCookieConst = 0x02
const byte | SendSyncConst = 0x04
const byte | SendStateConst = 0x08

Properties

bool | HttpForward [get, set]
Indicates whether to forward HTTP request to web service or not. More...
bool | SendAuthCookie [get, set]
Indicates whether to send AuthCookie of actor in the HTTP request to web service or not. More...
bool | SendSync [get, set]
Indicates whether to send HTTP request synchronously or asynchronously to web service. More...
bool | SendState [get, set]
Indicates whether to send serialized game state in HTTP request to web service or not. More...

Detailed Description

Optional flags to be used in Photon client SDKs with Op RaiseEvent and Op SetProperties. Introduced mainly for webhooks 1.2 to control behavior of forwarded HTTP requests.

Property Documentation

◆ HttpForward

bool HttpForward
getset

Indicates whether to forward HTTP request to web service or not.

◆ SendAuthCookie

bool SendAuthCookie
getset

Indicates whether to send AuthCookie of actor in the HTTP request to web service or not.

◆ SendState

bool SendState
getset

Indicates whether to send serialized game state in HTTP request to web service or not.

◆ SendSync

bool SendSync
getset

Indicates whether to send HTTP request synchronously or asynchronously to web service.


Photon Unity Networking 2: WebRpcResponse Class Reference

  • Realtime
  • WebRpcResponse
Public Member Functions | Properties | List of all members
WebRpcResponse Class Reference

Reads an operation response of a WebRpc and provides convenient access to most common values. More...

Public Member Functions

WebRpcResponse (OperationResponse response)
An OperationResponse for a WebRpc is needed to read it's values. More...
string ToStringFull ()
Turns the response into an easier to read string. More...

Properties

string | Name [get]
Name of the WebRpc that was called. More...
int | ResultCode [get]
ResultCode of the WebService that answered the WebRpc. More...
int | ReturnCode [get]
string | Message [get]
Might be empty or null. More...
string | DebugMessage [get]
Dictionary< string, object > | Parameters [get]
Other key/values returned by the webservice that answered the WebRpc. More...

Detailed Description

Reads an operation response of a WebRpc and provides convenient access to most common values.

See LoadBalancingClient.OpWebRpc.
Create a WebRpcResponse to access common result values.
The operationResponse.OperationCode should be: OperationCode.WebRpc.

Constructor & Destructor Documentation

◆ WebRpcResponse()

WebRpcResponse ( OperationResponse response )

An OperationResponse for a WebRpc is needed to read it's values.

Member Function Documentation

◆ ToStringFull()

string ToStringFull ( )

Turns the response into an easier to read string.

Returns
String resembling the result.

Property Documentation

◆ Message

string Message
get

Might be empty or null.

◆ Name

string Name
get

Name of the WebRpc that was called.

◆ Parameters

Dictionary<string, object> Parameters
get

Other key/values returned by the webservice that answered the WebRpc.

◆ ResultCode

int ResultCode
get

ResultCode of the WebService that answered the WebRpc.

0 is: "OK" for WebRPCs.
-1 is: No ResultCode by WebRpc service (check OperationResponse.ReturnCode).
Other ResultCode are defined by the individual WebRpc and service.


Photon Unity Networking 2: Class Index

Class Index
a | b | c | d | e | f | g | i | l | m | n | o | p | r | s | t | w
a
ErrorCode (Photon.Realtime)
l
PhotonPing (Photon.Realtime) RegionPinger (Photon.Realtime)
ErrorCode (Photon.Chat) PhotonPortDefinition (Photon.Realtime) Room (Photon.Realtime)
ActorProperties (Photon.Realtime) ErrorInfo (Photon.Realtime) LoadBalancingClient (Photon.Realtime) PhotonRigidbody2DView (Photon.Pun) RoomInfo (Photon.Realtime)
AppSettings (Photon.Realtime) EventCode (Photon.Realtime) LoadBalancingPeer (Photon.Realtime) PhotonRigidbodyView (Photon.Pun) RoomOptions (Photon.Realtime)
AuthenticationValues (Photon.Chat) EventSystemSpawner (Photon.Pun.UtilityScripts)
m
PhotonStatsGui (Photon.Pun.UtilityScripts)
s
AuthenticationValues (Photon.Realtime) Extensions (Photon.Realtime) PhotonStream (Photon.Pun)
b
f
MatchMakingCallbacksContainer (Photon.Realtime) PhotonStreamQueue (Photon.Pun) SceneManagerHelper (Photon.Pun)
MonoBehaviourPun (Photon.Pun) PhotonTeam (Photon.Pun.UtilityScripts) ScoreExtensions (Photon.Pun.UtilityScripts)
ButtonInsideScrollList (Photon.Pun.UtilityScripts) FindFriendsOptions (Photon.Realtime) MonoBehaviourPunCallbacks (Photon.Pun) PhotonTeamExtensions (Photon.Pun.UtilityScripts) ServerSettings (Photon.Pun)
ByteComparer (Photon.Pun.UtilityScripts) FriendInfo (Photon.Realtime) MoveByKeys (Photon.Pun.UtilityScripts) PhotonTeamsManager (Photon.Pun.UtilityScripts) SmoothSyncMovement (Photon.Pun.UtilityScripts)
c
g
n
PhotonTransformView (Photon.Pun) StatesGui (Photon.Pun.UtilityScripts)
PhotonTransformViewClassic (Photon.Pun) SupportLogger (Photon.Realtime)
CellTree (Photon.Pun.UtilityScripts) GamePropertyKey (Photon.Realtime) NestedComponentUtilities (Photon.Pun) PhotonTransformViewPositionControl (Photon.Pun) PhotonAnimatorView.SynchronizedLayer (Photon.Pun)
CellTreeNode (Photon.Pun.UtilityScripts) GraphicToggleIsOnTransition (Photon.Pun.UtilityScripts)
o
PhotonTransformViewPositionModel (Photon.Pun) PhotonAnimatorView.SynchronizedParameter (Photon.Pun)
ChannelCreationOptions (Photon.Chat)
i
PhotonTransformViewRotationControl (Photon.Pun)
t
ChannelWellKnownProperties (Photon.Chat) OnClickDestroy (Photon.Pun.UtilityScripts) PhotonTransformViewRotationModel (Photon.Pun)
ChatAppSettings (Photon.Chat) IChatClientListener (Photon.Chat) OnClickInstantiate (Photon.Pun.UtilityScripts) PhotonTransformViewScaleControl (Photon.Pun) TabViewManager.Tab (Photon.Pun.UtilityScripts)
ChatChannel (Photon.Chat) IConnectionCallbacks (Photon.Realtime) OnClickRpc (Photon.Pun.UtilityScripts) PhotonTransformViewScaleModel (Photon.Pun) TabViewManager.TabChangeEvent (Photon.Pun.UtilityScripts)
ChatClient (Photon.Chat) IErrorInfoCallback (Photon.Realtime) OnEscapeQuit (Photon.Pun.UtilityScripts) PhotonView (Photon.Pun) TabViewManager (Photon.Pun.UtilityScripts)
ChatEventCode (Photon.Chat) IInRoomCallbacks (Photon.Realtime) OnJoinedInstantiate (Photon.Pun.UtilityScripts) PingMono (Photon.Realtime) TeamExtensions (Photon.Pun.UtilityScripts)
ChatOperationCode (Photon.Chat) ILobbyCallbacks (Photon.Realtime) OnPointerOverTooltip (Photon.Pun.UtilityScripts) Player (Photon.Realtime) TextButtonTransition (Photon.Pun.UtilityScripts)
ChatParameterCode (Photon.Chat) IMatchmakingCallbacks (Photon.Realtime) OnStartDelete (Photon.Pun.UtilityScripts) PlayerNumbering (Photon.Pun.UtilityScripts) TextToggleIsOnTransition (Photon.Pun.UtilityScripts)
ChatPeer (Photon.Chat) InstantiateParameters (Photon.Pun) OperationCode (Photon.Realtime) PlayerNumberingExtensions (Photon.Pun.UtilityScripts) TurnExtensions (Photon.Pun.UtilityScripts)
ChatUserStatus (Photon.Chat) IOnEventCallback (Photon.Realtime) OpJoinRandomRoomParams (Photon.Realtime) PointedAtGameObjectInfo (Photon.Pun.UtilityScripts) TypedLobby (Photon.Realtime)
ConnectAndJoinRandom (Photon.Pun.UtilityScripts) IOnPhotonViewControllerChange (Photon.Pun)
p
PunExtensions (Photon.Pun) TypedLobbyInfo (Photon.Realtime)
ConnectionCallbacksContainer (Photon.Realtime) IOnPhotonViewOwnerChange (Photon.Pun) PunPlayerScores (Photon.Pun.UtilityScripts)
w
ConnectionHandler (Photon.Realtime) IOnPhotonViewPreNetDestroy (Photon.Pun) ParameterCode (Photon.Chat) PunRPC (Photon.Pun)
CountdownTimer (Photon.Pun.UtilityScripts) IPhotonViewCallback (Photon.Pun) ParameterCode (Photon.Realtime) PunTeams (Photon.Pun.UtilityScripts) WebFlags (Photon.Realtime)
CullArea (Photon.Pun.UtilityScripts) IPunInstantiateMagicCallback (Photon.Pun) PhotonAnimatorView (Photon.Pun) PunTurnManager (Photon.Pun.UtilityScripts) WebRpcResponse (Photon.Realtime)
CullingHandler (Photon.Pun.UtilityScripts) IPunObservable (Photon.Pun) PhotonAppSettings (Photon.Realtime)
r
d
IPunOwnershipCallbacks (Photon.Pun) PhotonHandler (Photon.Pun)
IPunPrefabPool (Photon.Pun) PhotonLagSimulationGui (Photon.Pun.UtilityScripts) RaiseEventOptions (Photon.Realtime)
DefaultPool (Photon.Pun) IPunTurnManagerCallbacks (Photon.Pun.UtilityScripts) PhotonMessageInfo (Photon.Pun) Region (Photon.Realtime)
e
IWebRpcCallback (Photon.Realtime) PhotonNetwork (Photon.Pun) RegionHandler (Photon.Realtime)
EnterRoomParams (Photon.Realtime)
a | b | c | d | e | f | g | i | l | m | n | o | p | r | s | t | w


Photon Unity Networking 2: Class Hierarchy

Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 123]
C ActorProperties | Class for constants. These (byte) values define "well known" properties for an Actor / Player
C AppSettings | Settings for Photon application(s) and the server to connect to
►C Attribute |
C PunRPC | Replacement for RPC attribute with different name. Used to flag methods as remote-callable
C AuthenticationValues | Container for user authentication in Photon. Set AuthValues before you connect - all else is handled
C AuthenticationValues | Container for user authentication in Photon. Set AuthValues before you connect - all else is handled
C CellTree | Represents the tree accessible from its root node
C CellTreeNode | Represents a single node of the tree
C ChannelCreationOptions |
C ChannelWellKnownProperties |
C ChatAppSettings | Settings for Photon application(s) and the server to connect to
C ChatChannel | A channel of communication in Photon Chat, updated by ChatClient and provided as READ ONLY
C ChatEventCode | Wraps up internally used constants in Photon Chat events. You don't have to use them directly usually
C ChatOperationCode | Wraps up codes for operations used internally in Photon Chat. You don't have to use them directly usually
C ChatParameterCode | Wraps up codes for parameters (in operations and events) used internally in Photon Chat. You don't have to use them directly usually
C ChatUserStatus | Contains commonly used status values for SetOnlineStatus. You can define your own
►C ConnectionHandler |
C PhotonHandler | Internal MonoBehaviour that allows Photon to run an Update loop
C EnterRoomParams | Parameters for creating rooms
C ErrorCode | ErrorCode defines the default codes associated with Photon client/server communication
C ErrorCode | ErrorCode defines the default codes associated with Photon client/server communication
C ErrorInfo | Class wrapping the received EventCode.ErrorInfo event
C EventCode | Class for constants. These values are for events defined by Photon LoadBalancing
C Extensions | This static class defines some useful extension methods for several existing classes (e.g. Vector3, float and others)
C FindFriendsOptions | Options for OpFindFriends can be combined to filter which rooms of friends are returned
C FriendInfo | Used to store info about a friend's online state and in which room he/she is
C GamePropertyKey | Class for constants. These (byte) values are for "well known" room/game properties used in Photon LoadBalancing
C IChatClientListener | Callback interface for Chat client side. Contains callback methods to notify your app about updates. Must be provided to new ChatClient in constructor
►C IComparer |
C ByteComparer |
►C IConnectionCallbacks | Collection of "organizational" callbacks for the Realtime Api to cover: Connection and Regions
►C MonoBehaviourPunCallbacks | This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use
C ConnectAndJoinRandom | Simple component to call ConnectUsingSettings and to get into a PUN room easily
C CountdownTimer | This is a basic, network-synced CountdownTimer based on properties
C PlayerNumbering | Implements consistent numbering in a room/game with help of room properties. Access them by Player.GetPlayerNumber() extension
C PunTeams | Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension
C PunTurnManager | Pun turnBased Game manager. Provides an Interface (IPunTurnManagerCallbacks) for the typical turn flow and logic, between players Provides Extensions for Player, Room and RoomInfo to feature dedicated api for TurnBased Needs
C ConnectionCallbacksContainer | Container type for callbacks defined by IConnectionCallbacks. See LoadBalancingCallbackTargets
C SupportLogger | Helper class to debug log basic information about Photon client and vital traffic statistics
►C IDisposable |
►C PhotonPing | Abstract implementation of PhotonPing, ase for pinging servers to find the "Best Region"
C PingMono | Uses C# Socket class from System.Net.Sockets (as Unity usually does)
►C IErrorInfoCallback | Interface for EventCode.ErrorInfo event callback for the Realtime Api
C MonoBehaviourPunCallbacks | This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use
►C IInRoomCallbacks | Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching
C MonoBehaviourPunCallbacks | This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use
C PhotonHandler | Internal MonoBehaviour that allows Photon to run an Update loop
C PhotonTeamsManager | Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension
C SupportLogger | Helper class to debug log basic information about Photon client and vital traffic statistics
►C ILobbyCallbacks | Collection of "organizational" callbacks for the Realtime Api to cover the Lobby
C MonoBehaviourPunCallbacks | This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use
C SupportLogger | Helper class to debug log basic information about Photon client and vital traffic statistics
►C IMatchmakingCallbacks | Collection of "organizational" callbacks for the Realtime Api to cover Matchmaking
C MonoBehaviourPunCallbacks | This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use
C PhotonHandler | Internal MonoBehaviour that allows Photon to run an Update loop
C OnJoinedInstantiate | This component will instantiate a network GameObject when a room is joined
C PhotonTeamsManager | Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension
C MatchMakingCallbacksContainer | Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets
C SupportLogger | Helper class to debug log basic information about Photon client and vital traffic statistics
C InstantiateParameters |
►C IOnEventCallback | Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent
C PunTurnManager | Pun turnBased Game manager. Provides an Interface (IPunTurnManagerCallbacks) for the typical turn flow and logic, between players Provides Extensions for Player, Room and RoomInfo to feature dedicated api for TurnBased Needs
►C IPhotonPeerListener |
C ChatClient | Central class of the Photon Chat API to connect, handle channels and messages
C LoadBalancingClient | This class implements the Photon LoadBalancing workflow by using a LoadBalancingPeer. It keeps a state and will automatically execute transitions between the Master and Game Servers
►C IPhotonViewCallback | Empty Base class for all PhotonView callbacks
C IOnPhotonViewControllerChange | This interface defines a callback for changes to the PhotonView's controller
C IOnPhotonViewOwnerChange | This interface defines a callback for changes to the PhotonView's owner
C IOnPhotonViewPreNetDestroy | This interface defines a callback which fires prior to the PhotonNetwork destroying the PhotonView and Gameobject
►C IPointerClickHandler |
C OnClickDestroy | Destroys the networked GameObject either by PhotonNetwork.Destroy or by sending an RPC which calls Object.Destroy()
C OnClickInstantiate | Instantiates a networked GameObject on click
C OnClickRpc | This component will instantiate a network GameObject when in a room and the user click on that component's GameObject. Uses PhysicsRaycaster for positioning
►C IPointerDownHandler |
C ButtonInsideScrollList | Button inside scroll list will stop scrolling ability of scrollRect container, so that when pressing down on a button and draggin up and down will not affect scrolling. this doesn't do anything if no scrollRect component found in Parent Hierarchy
►C IPointerEnterHandler |
C GraphicToggleIsOnTransition | Use this on toggles texts to have some color transition on the text depending on the isOn State
C OnPointerOverTooltip | Set focus to a given photonView when pointed is over
C TextButtonTransition | Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour
C TextToggleIsOnTransition | Use this on toggles texts to have some color transition on the text depending on the isOn State
►C IPointerExitHandler |
C GraphicToggleIsOnTransition | Use this on toggles texts to have some color transition on the text depending on the isOn State
C OnPointerOverTooltip | Set focus to a given photonView when pointed is over
C TextButtonTransition | Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour
C TextToggleIsOnTransition | Use this on toggles texts to have some color transition on the text depending on the isOn State
►C IPointerUpHandler |
C ButtonInsideScrollList | Button inside scroll list will stop scrolling ability of scrollRect container, so that when pressing down on a button and draggin up and down will not affect scrolling. this doesn't do anything if no scrollRect component found in Parent Hierarchy
C IPunInstantiateMagicCallback |
►C IPunObservable | Defines the OnPhotonSerializeView method to make it easy to implement correctly for observable scripts
C PhotonAnimatorView | This class helps you to synchronize Mecanim animations Simply add the component to your GameObject and make sure that the PhotonAnimatorView is added to the list of observed components
C PhotonRigidbody2DView |
C PhotonRigidbodyView |
C PhotonTransformView |
C PhotonTransformViewClassic | This class helps you to synchronize position, rotation and scale of a GameObject. It also gives you many different options to make the synchronized values appear smooth, even when the data is only send a couple of times per second. Simply add the component to your GameObject and make sure that the PhotonTransformViewClassic is added to the list of observed components
C CullingHandler | Handles the network culling
C SmoothSyncMovement | Smoothed out movement for network gameobjects
C IPunOwnershipCallbacks | Global Callback interface for ownership changes. These callbacks will fire for changes to ANY PhotonView that changes. Consider using IOnPhotonViewControllerChange for callbacks from a specific PhotonView
►C IPunPrefabPool | Defines an interface for object pooling, used in PhotonNetwork.Instantiate and PhotonNetwork.Destroy
C DefaultPool | The default implementation of a PrefabPool for PUN, which actually Instantiates and Destroys GameObjects but pools a resource
C IPunTurnManagerCallbacks |
►C IWebRpcCallback | Interface for "WebRpc" callbacks for the Realtime Api. Currently includes only responses for Web RPCs
C MonoBehaviourPunCallbacks | This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use
►C List |
C ConnectionCallbacksContainer | Container type for callbacks defined by IConnectionCallbacks. See LoadBalancingCallbackTargets
C MatchMakingCallbacksContainer | Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets
►C MonoBehaviour |
►C MonoBehaviourPun | This class adds the property photonView, while logging a warning when your game still uses the networkView
C MonoBehaviourPunCallbacks | This class provides a .photonView and all callbacks/events that PUN can call. Override the events/methods you want to use
C PhotonAnimatorView | This class helps you to synchronize Mecanim animations Simply add the component to your GameObject and make sure that the PhotonAnimatorView is added to the list of observed components
C PhotonRigidbody2DView |
C PhotonRigidbodyView |
C PhotonTransformView |
C PhotonTransformViewClassic | This class helps you to synchronize position, rotation and scale of a GameObject. It also gives you many different options to make the synchronized values appear smooth, even when the data is only send a couple of times per second. Simply add the component to your GameObject and make sure that the PhotonTransformViewClassic is added to the list of observed components
C MoveByKeys | Very basic component to move a GameObject by WASD and Space
C OnClickDestroy | Destroys the networked GameObject either by PhotonNetwork.Destroy or by sending an RPC which calls Object.Destroy()
C OnClickRpc | This component will instantiate a network GameObject when in a room and the user click on that component's GameObject. Uses PhysicsRaycaster for positioning
C SmoothSyncMovement | Smoothed out movement for network gameobjects
C PhotonView | A PhotonView identifies an object across the network (viewID) and configures how the controlling client updates remote instances
C ButtonInsideScrollList | Button inside scroll list will stop scrolling ability of scrollRect container, so that when pressing down on a button and draggin up and down will not affect scrolling. this doesn't do anything if no scrollRect component found in Parent Hierarchy
C CullArea | Represents the cull area used for network culling
C CullingHandler | Handles the network culling
C EventSystemSpawner | Event system spawner. Will add an EventSystem GameObject with an EventSystem component and a StandaloneInputModule component. Use this in additive scene loading context where you would otherwise get a "Multiple EventSystem in scene... this is not supported" error from Unity
C GraphicToggleIsOnTransition | Use this on toggles texts to have some color transition on the text depending on the isOn State
C OnClickInstantiate | Instantiates a networked GameObject on click
C OnEscapeQuit | This component will quit the application when escape key is pressed
C OnJoinedInstantiate | This component will instantiate a network GameObject when a room is joined
C OnPointerOverTooltip | Set focus to a given photonView when pointed is over
C OnStartDelete | This component will destroy the GameObject it is attached to (in Start())
C PhotonLagSimulationGui | This MonoBehaviour is a basic GUI for the Photon client's network-simulation feature. It can modify lag (fixed delay), jitter (random lag) and packet loss
C PhotonStatsGui | Basic GUI to show traffic and health statistics of the connection to Photon, toggled by shift+tab
C PhotonTeamsManager | Implements teams in a room/game with help of player properties. Access them by Player.GetTeam extension
C PointedAtGameObjectInfo | Display ViewId, OwnerActorNr, IsCeneView and IsMine when clicked
C PunPlayerScores | Scoring system for PhotonPlayer
C StatesGui | Output detailed information about Pun Current states, using the old Unity UI framework
C TabViewManager | Tab view manager. Handles Tab views activation and deactivation, and provides a Unity Event Callback when a tab was selected
C TextButtonTransition | Use this on Button texts to have some color transition on the text as well without corrupting button's behaviour
C TextToggleIsOnTransition | Use this on toggles texts to have some color transition on the text depending on the isOn State
C NestedComponentUtilities |
C OperationCode | Class for constants. Contains operation codes
C OpJoinRandomRoomParams | Parameters for the matchmaking of JoinRandomRoom and JoinRandomOrCreateRoom
C ParameterCode | Class for constants. Codes for parameters of Operations and Events
C ParameterCode | Class for constants. Codes for parameters of Operations and Events
C PhotonMessageInfo | Container class for info about a particular message, RPC or update
C PhotonNetwork | The main class to use the PhotonNetwork plugin. This class is static
►C PhotonPeer |
C ChatPeer | Provides basic operations of the Photon Chat server. This internal class is used by public ChatClient
C LoadBalancingPeer | A LoadBalancingPeer provides the operations and enum definitions needed to use the LoadBalancing server application which is also used in Photon Cloud
C PhotonPortDefinition | Container for port definitions
C PhotonStream | This container is used in OnPhotonSerializeView() to either provide incoming data of a PhotonView or for you to provide it
C PhotonStreamQueue | The PhotonStreamQueue helps you poll object states at higher frequencies than what PhotonNetwork.SendRate dictates and then sends all those states at once when Serialize() is called. On the receiving end you can call Deserialize() and then the stream will roll out the received object states in the same order and timeStep they were recorded in
C PhotonTeam |
C PhotonTeamExtensions | Extension methods for the Player class that make use of PhotonTeamsManager
C PhotonTransformViewPositionControl |
C PhotonTransformViewPositionModel |
C PhotonTransformViewRotationControl |
C PhotonTransformViewRotationModel |
C PhotonTransformViewScaleControl |
C PhotonTransformViewScaleModel |
C Player | Summarizes a "player" within a room, identified (in that room) by ID (or "actorNumber")
C PlayerNumberingExtensions | Extension used for PlayerRoomIndexing and Player class
C PunExtensions | Small number of extension methods that make it easier for PUN to work cross-Unity-versions
C RaiseEventOptions | Aggregates several less-often used options for operation RaiseEvent. See field descriptions for usage details
C Region |
C RegionHandler | Provides methods to work with Photon's regions (Photon Cloud) and can be use to find the one with best ping
C RegionPinger |
►C 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)
C Room | This class represents a room a client joins/joined
C RoomOptions | Wraps up common room properties needed when you create rooms. Read the individual entries for more details
C SceneManagerHelper |
C ScoreExtensions |
►C ScriptableObject |
C ServerSettings | Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings
C PhotonAppSettings | Collection of connection-relevant settings, used internally by PhotonNetwork.ConnectUsingSettings
C PhotonAnimatorView.SynchronizedLayer |
C PhotonAnimatorView.SynchronizedParameter |
C TabViewManager.Tab |
C TeamExtensions | Extension used for PunTeams and Player class. Wraps access to the player's custom property
C TurnExtensions |
►C TypedLobby | Refers to a specific lobby on the server
C TypedLobbyInfo | Info for a lobby on the server. Used when LoadBalancingClient.EnableLobbyStatistics is true
►C UnityEvent |
C TabViewManager.TabChangeEvent | Tab change event
C WebFlags | Optional flags to be used in Photon client SDKs with Op RaiseEvent and Op SetProperties. Introduced mainly for webhooks 1.2 to control behavior of forwarded HTTP requests
C WebRpcResponse | Reads an operation response of a WebRpc and provides convenient access to most common values


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • ActorList : ParameterCode
  • ActorNr : ParameterCode
  • ActorNumber : Player
  • Add() : ChatChannel , ParameterCode
  • AddAuthParameter() : AuthenticationValues
  • AddCallback< T >() : PhotonView
  • AddCallbackTarget() : PhotonNetwork , PhotonView , LoadBalancingClient
  • AddChild() : CellTreeNode
  • AddFriends() : ChatClient , ChatOperationCode
  • AddPlayer() : Room
  • Address : ParameterCode
  • AllocateRoomViewID() : PhotonNetwork
  • AllocateViewID() : PhotonNetwork
  • AlmostEquals() : PunExtensions
  • AppId : ChatAppSettings , ChatClient , LoadBalancingClient
  • AppIdChat : ChatAppSettings , AppSettings
  • AppIdFusion : AppSettings
  • AppIdRealtime : AppSettings
  • AppIdVoice : AppSettings
  • ApplicationId : ParameterCode
  • ApplyDontDestroyOnLoad : ConnectionHandler
  • AppQuits : ConnectionHandler
  • AppStats : EventCode
  • AppVersion : ChatAppSettings , ChatClient , ParameterCode , PhotonNetwork , AppSettings , LoadBalancingClient , ParameterCode
  • Authenticate : ChatOperationCode , OperationCode
  • AuthenticateOnce : OperationCode
  • AuthenticateOnNameServer() : ChatPeer
  • AuthenticationTicketExpired : ErrorCode
  • AuthenticationValues() : AuthenticationValues
  • AuthEvent : EventCode
  • AuthGetParameters : AuthenticationValues
  • AuthMode : AppSettings , LoadBalancingClient
  • AuthPostData : AuthenticationValues
  • AuthType : AuthenticationValues
  • AuthValues : ChatClient , PhotonNetwork , LoadBalancingClient
  • AutoCleanUp : Room
  • autoCleanUp : RoomInfo
  • AutoConnect : ConnectAndJoinRandom
  • AutomaticallySyncScene : PhotonNetwork
  • Away : ChatUserStatus
  • AzureLocalNodeId : ParameterCode
  • AzureMasterNodeId : ParameterCode
  • AzureNodeInfo : EventCode , ParameterCode


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- b -

  • BeginTurn() : PunTurnManager
  • BestRegion : RegionHandler
  • BestRegionSummaryFromStorage : AppSettings
  • BestRegionSummaryInPreferences : PhotonNetwork , ServerSettings
  • Broadcast : ChatParameterCode , ParameterCode
  • BroadcastPropertiesChangeToAll : Room
  • BroadcastPropsChangeToAll : RoomOptions
  • buttonsOn : PhotonStatsGui


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • Cache : ParameterCode
  • CacheDiscreteTriggers() : PhotonAnimatorView
  • CacheSliceChanged : EventCode
  • CacheSliceIndex : ParameterCode
  • CachingOption : RaiseEventOptions
  • CanChat : ChatClient
  • CanChatInChannel() : ChatClient
  • CellTree() : CellTree
  • CellTreeNode() : CellTreeNode
  • Center : CellTreeNode
  • ChangeGroups : OperationCode
  • ChangeLocalID() : LoadBalancingClient
  • Channel : ChatParameterCode
  • ChannelHistory : ChatOperationCode
  • ChannelID : ChatChannel
  • Channels : ChatParameterCode
  • ChannelSubscribers : ChatParameterCode
  • ChannelUserCount : ChatParameterCode
  • ChatChannel() : ChatChannel
  • ChatClient() : ChatClient
  • ChatMessages : ChatEventCode
  • chatPeer : ChatClient
  • ChatPeer() : ChatPeer
  • ChatRegion : ChatClient
  • CheckUserOnJoin : ParameterCode
  • Childs : CellTreeNode
  • CleanupCacheOnLeave : GamePropertyKey , ParameterCode , RoomOptions
  • ClearExpectedUsers() : Room
  • ClearMessages() : ChatChannel
  • Client : ConnectionHandler , SupportLogger
  • ClientAuthenticationData : ParameterCode
  • ClientAuthenticationParams : ParameterCode
  • ClientAuthenticationType : ParameterCode
  • ClientType : LoadBalancingClient
  • CloseConnection() : PhotonNetwork
  • CloudRegion : PhotonNetwork , LoadBalancingClient
  • Cluster : ParameterCode , Region
  • Code : ParameterCode
  • Compare() : ByteComparer
  • Connect() : ChatClient , ChatPeer
  • ConnectAndSetStatus() : ChatClient
  • ConnectionCallbackTargets : LoadBalancingClient
  • ConnectMethod : PhotonNetwork
  • ConnectToBestCloudServer() : PhotonNetwork
  • ConnectToMaster() : PhotonNetwork
  • ConnectToMasterServer() : LoadBalancingClient
  • ConnectToNameServer() : LoadBalancingClient
  • ConnectToRegion() : PhotonNetwork
  • ConnectToRegionMaster() : LoadBalancingClient
  • ConnectUsingSettings() : PhotonNetwork
  • Contains() : Extensions
  • CopyTo() : AuthenticationValues
  • Count : PhotonStream
  • CountdownTimerHasExpired() : CountdownTimer
  • CountOfPlayers : PhotonNetwork
  • CountOfPlayersInRooms : PhotonNetwork
  • CountOfPlayersOnMaster : PhotonNetwork
  • CountOfRooms : PhotonNetwork
  • CountSendAcksOnly : ConnectionHandler
  • CrcCheckEnabled : PhotonNetwork
  • CreatedOnGs : FindFriendsOptions
  • CreateGame : OperationCode
  • CreateRoom() : PhotonNetwork
  • CurrentCluster : PhotonNetwork , LoadBalancingClient
  • CurrentLobby : PhotonNetwork , LoadBalancingClient
  • CurrentRoom : PhotonNetwork , LoadBalancingClient
  • CurrentServerAddress : LoadBalancingClient
  • CustomAuthenticationFailed : ErrorCode
  • CustomEventContent : ParameterCode
  • CustomInitData : ParameterCode
  • CustomProperties : Player , RoomInfo
  • CustomRoomProperties : RoomOptions
  • CustomRoomPropertiesForLobby : RoomOptions


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- d -

  • Data : ParameterCode
  • DebugData : ChatParameterCode
  • DebugOut : ChatClient
  • DebugReturn() : IChatClientListener , LoadBalancingClient
  • Default : ChannelCreationOptions , RaiseEventOptions , TypedLobby
  • DefaultMaxSubscribers : ChatClient
  • DeleteNullProperties : Room , RoomOptions
  • Deserialize() : PhotonStreamQueue
  • DespawnObjects() : OnJoinedInstantiate
  • Destroy() : DefaultPool , IPunPrefabPool , PhotonNetwork
  • DestroyAll() : PhotonNetwork
  • DestroyPlayerObjects() : PhotonNetwork
  • DevRegion : ServerSettings
  • Disconnect() : ChatClient , PhotonNetwork , LoadBalancingClient
  • DisconnectAfterKeepAlive : ConnectionHandler
  • DisconnectedCause : ChatClient , LoadBalancingClient
  • Dispatch() : PhotonHandler
  • DND : ChatUserStatus
  • DoesLayerSynchronizeTypeExist() : PhotonAnimatorView
  • DoesParameterSynchronizeTypeExist() : PhotonAnimatorView
  • dontDestroyOnLoad : PlayerNumbering
  • Draw() : CellTreeNode


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- e -

  • ElapsedTimeInTurn : PunTurnManager
  • EmptyRoomTtl : GamePropertyKey
  • EmptyRoomTTL : ParameterCode
  • EmptyRoomTtl : Room
  • emptyRoomTtl : RoomInfo
  • EmptyRoomTtl : RoomOptions
  • EnableCloseConnection : PhotonNetwork
  • EnabledRegions : RegionHandler
  • EnableLobbyStatistics : PhotonNetwork , AppSettings , LoadBalancingClient
  • EnableProtocolFallback : ChatAppSettings , ChatClient , AppSettings , LoadBalancingClient
  • EncryptionData : ParameterCode
  • EncryptionMode : LoadBalancingClient , ParameterCode
  • Equals() : Player , RoomInfo
  • ErrorInfo : ChatEventCode , EventCode
  • EventForward : ParameterCode
  • EventReceived : LoadBalancingClient
  • EvFinalMove : PunTurnManager
  • EvMove : PunTurnManager
  • ExpectedCustomRoomProperties : OpJoinRandomRoomParams
  • ExpectedMaxPlayers : OpJoinRandomRoomParams
  • ExpectedProtocol : LoadBalancingClient , ParameterCode
  • ExpectedUsers : EnterRoomParams , GamePropertyKey , OpJoinRandomRoomParams , Room
  • expectedUsers : RoomInfo
  • ExpectedValues : ChatParameterCode , ParameterCode
  • ExternalHttpCallFailed : ErrorCode


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- f -

  • FallbackThreadRunning : ConnectionHandler
  • FetchServerTimestamp() : PhotonNetwork
  • Find() : PhotonView
  • FindFriends() : PhotonNetwork , OperationCode
  • FindFriendsOptions : ParameterCode
  • FindFriendsRequestList : ParameterCode
  • FindFriendsResponseOnlineList : ParameterCode
  • FindFriendsResponseRoomIdList : ParameterCode
  • FindGameObjectsWithComponent() : PhotonNetwork
  • FindObservables() : PhotonView
  • FinishedTurnPropKey : TurnExtensions
  • FIRST_GROUP_ID : CullArea
  • FixedRegion : ChatAppSettings , AppSettings
  • FixedUpdate() : PhotonHandler
  • Flags : RaiseEventOptions
  • Friends : ChatParameterCode
  • FriendsList : ChatEventCode
  • FrontendAddress : ChatClient


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- g -

  • GameClosed : ErrorCode
  • GameCount : ParameterCode
  • GameDoesNotExist : ErrorCode
  • GameFull : ErrorCode
  • GameIdAlreadyExists : ErrorCode
  • GameList : EventCode , ParameterCode
  • GameListUpdate : EventCode
  • GameProperties : ParameterCode
  • GameServerAddress : LoadBalancingClient
  • GameServerPort : PhotonPortDefinition
  • GameVersion : PhotonNetwork
  • Get() : Player
  • GetActiveCells() : CellTreeNode , CullArea
  • GetAvailableTeams() : PhotonTeamsManager
  • GetCustomRoomList() : PhotonNetwork
  • GetExtrapolatedPositionOffset() : PhotonTransformViewPositionControl
  • GetFinishedTurn() : TurnExtensions
  • GetGameList : OperationCode
  • GetHashCode() : Player , RoomInfo
  • GetLayerSynchronizeType() : PhotonAnimatorView
  • GetLobbyStats : OperationCode
  • GetNestedComponentInParent< T, NestedT >() : NestedComponentUtilities
  • GetNestedComponentInParents< T, NestedT >() : NestedComponentUtilities
  • GetNestedComponentsInChildren< T >() : NestedComponentUtilities
  • GetNestedComponentsInChildren< T, NestedT >() : NestedComponentUtilities
  • GetNestedComponentsInChildren< T, SearchT, NestedT >() : NestedComponentUtilities
  • GetNestedComponentsInParents< T >() : NestedComponentUtilities
  • GetNestedComponentsInParents< T, NestedT >() : NestedComponentUtilities
  • GetNetworkPosition() : PhotonTransformViewPositionControl
  • GetNetworkRotation() : PhotonTransformViewRotationControl
  • GetNetworkScale() : PhotonTransformViewScaleControl
  • GetNext() : Player
  • GetNextFor() : Player
  • GetParameterSynchronizeType() : PhotonAnimatorView
  • GetParentComponent< T >() : NestedComponentUtilities
  • GetPhotonTeam() : PhotonTeamExtensions
  • GetPing() : PhotonNetwork
  • GetPlayer() : Room
  • GetPlayerFinishedTurn() : PunTurnManager
  • GetPlayerNumber() : PlayerNumberingExtensions
  • GetPrivateChannelNameByUser() : ChatClient
  • GetProperties : OperationCode
  • GetRandomOffset() : OnJoinedInstantiate
  • GetRegions : OperationCode
  • GetSpawnPoint() : OnJoinedInstantiate
  • GetSynchronizedLayers() : PhotonAnimatorView
  • GetSynchronizedParameters() : PhotonAnimatorView
  • GetTeam() : TeamExtensions
  • GetTeamMembersCount() : PhotonTeamsManager
  • GetTurn() : TurnExtensions
  • GetTurnStart() : TurnExtensions
  • Group : ParameterCode


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- h -

  • HasQueuedObjects() : PhotonStreamQueue
  • healthStatsVisible : PhotonStatsGui
  • HistoryLength : ChatParameterCode
  • HoverColor : TextButtonTransition
  • HoverOffColor : TextToggleIsOnTransition
  • HoverOnColor : TextToggleIsOnTransition
  • HttpForward : WebFlags
  • HttpLimitReached : ErrorCode


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- i -

  • Id : CellTreeNode
  • Info : ErrorInfo , ParameterCode
  • InLobby : PhotonNetwork , LoadBalancingClient
  • InRoom : PhotonNetwork , LoadBalancingClient
  • instance : PlayerNumbering
  • Instance : PhotonAppSettings
  • Instantiate() : DefaultPool , IPunPrefabPool
  • InstantiationData : PhotonView
  • InterestGroup : RaiseEventOptions
  • InternalServerError : ErrorCode
  • InvalidAuthentication : ErrorCode
  • InvalidEncryptionParameters : ErrorCode
  • InvalidOperation : ErrorCode
  • InvalidOperationCode : ErrorCode
  • InvalidRegion : ErrorCode
  • Invisible : ChatUserStatus
  • IsAppId() : ServerSettings , AppSettings
  • IsBestRegion : AppSettings
  • IsComingBack : ParameterCode
  • IsCompletedByAll : PunTurnManager
  • IsConnected : PhotonNetwork , LoadBalancingClient
  • IsConnectedAndReady : PhotonNetwork , LoadBalancingClient
  • IsDefault : TypedLobby
  • IsDefaultNameServer : ChatAppSettings , AppSettings
  • IsDefaultPort : AppSettings
  • IsFetchingFriendList : LoadBalancingClient
  • IsFinishedByMe : PunTurnManager
  • IsInactive : ActorProperties , ParameterCode , Player
  • IsLocal : Player
  • IsMasterClient : PhotonNetwork , Player
  • IsMasterServerAddress : AppSettings
  • IsMessageQueueRunning : PhotonNetwork
  • IsMine : PhotonView
  • IsOpen : GamePropertyKey , Room
  • isOpen : RoomInfo
  • IsOpen : RoomInfo , RoomOptions
  • IsOver : PunTurnManager
  • IsPointInsideCell() : CellTreeNode
  • IsPointNearCell() : CellTreeNode
  • IsPrivate : ChatChannel
  • IsReading : PhotonStream
  • IsRoomView : PhotonView
  • IsUsingNameServer : LoadBalancingClient
  • IsVisible : GamePropertyKey , Room
  • isVisible : RoomInfo
  • IsVisible : RoomInfo , RoomOptions
  • IsWriting : PhotonStream


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- j -

  • Join : EventCode , OperationCode
  • JoinFailedFoundActiveJoiner : ErrorCode
  • JoinFailedFoundExcludedUserId : ErrorCode
  • JoinFailedFoundInactiveJoiner : ErrorCode
  • JoinFailedPeerAlreadyJoined : ErrorCode
  • JoinFailedWithRejoinerNotFound : ErrorCode
  • JoinGame : OperationCode
  • JoinLobby() : PhotonNetwork , OperationCode
  • JoinMode : ParameterCode
  • JoinOrCreateRoom() : PhotonNetwork
  • JoinRandomGame : OperationCode
  • JoinRandomOrCreateRoom() : PhotonNetwork
  • JoinRandomRoom() : PhotonNetwork
  • JoinRoom() : PhotonNetwork
  • JoinTeam() : PhotonTeamExtensions


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- k -

  • KeepAliveInBackground : PhotonNetwork , ConnectionHandler


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- l -

  • LastMsgId : ChatChannel
  • LateUpdate() : PhotonHandler
  • Leave : EventCode , OperationCode
  • LeaveCurrentTeam() : PhotonTeamExtensions
  • LeaveLobby() : PhotonNetwork , OperationCode
  • LeaveRoom() : PhotonNetwork
  • LevelLoadingProgress : PhotonNetwork
  • LFG : ChatUserStatus
  • LoadBalancingClient() : LoadBalancingClient , Room
  • LoadBalancingPeer : LoadBalancingClient , LoadBalancingPeer
  • LoadLevel() : PhotonNetwork
  • Lobby : EnterRoomParams
  • LobbyName : ParameterCode
  • LobbyStats : EventCode , ParameterCode
  • LobbyType : ParameterCode
  • LocalPlayer : PhotonNetwork , LoadBalancingClient
  • LogLevel : PhotonNetwork
  • LogStats() : SupportLogger
  • LogTrafficStats : SupportLogger


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- m -

  • MasterClient : PhotonNetwork
  • MasterClientId : GamePropertyKey , ParameterCode , Room
  • masterClientId : RoomInfo
  • MasterPeerCount : ParameterCode
  • MasterServerAddress : LoadBalancingClient
  • MasterServerPort : PhotonPortDefinition
  • Match : EventCode
  • MatchingType : OpJoinRandomRoomParams
  • MatchMakingCallbackTargets : LoadBalancingClient
  • MatchMakingType : ParameterCode
  • MAX_VIEW_IDS : PhotonNetwork
  • MaxCcuReached : ErrorCode
  • MaxDatagrams : PhotonHandler
  • MaxPlayers : ConnectAndJoinRandom , GamePropertyKey , Room , RoomInfo
  • maxPlayers : RoomInfo
  • MaxPlayers : RoomOptions
  • MaxResendsBeforeDisconnect : PhotonNetwork
  • MaxSubscribers : ChannelCreationOptions , ChatChannel
  • Merge() : Extensions
  • MergeStringKeys() : Extensions
  • Message : ChatParameterCode , WebRpcResponse
  • MessageCount : ChatChannel
  • MessageLimit : ChatChannel , ChatClient
  • Messages : ChatChannel , ChatParameterCode
  • MinimalTimeScaleToDispatchInFixedUpdate : PhotonNetwork
  • MsgId : ChatParameterCode
  • MsgIds : ChatParameterCode


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- n -

  • Name : ChatChannel , Room , RoomInfo
  • name : RoomInfo
  • Name : TypedLobby , WebRpcResponse
  • NameServerAddress : ChatClient , ChatPeer , LoadBalancingClient
  • NameServerHost : ChatPeer , LoadBalancingClient
  • NameServerPort : PhotonPortDefinition
  • NameServerPortOverride : ChatPeer
  • NetworkClientState : PhotonNetwork
  • NetworkingClient : PhotonNetwork
  • NetworkLogging : ChatAppSettings , AppSettings
  • NetworkStatisticsEnabled : PhotonNetwork
  • NetworkStatisticsReset() : PhotonNetwork
  • NetworkStatisticsToString() : PhotonNetwork
  • NickName : PhotonNetwork , LoadBalancingClient , ParameterCode , Player
  • NodeType : CellTreeNode
  • NoRandomMatchFound : ErrorCode
  • NormalColor : TextButtonTransition
  • NormalOffColor : TextToggleIsOnTransition
  • NormalOnColor : TextToggleIsOnTransition


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- o -

  • ObjectsInOneUpdate : PhotonNetwork
  • observableSearch : PhotonView
  • Offline : ChatUserStatus
  • OfflineMode : PhotonNetwork
  • Ok : ErrorCode
  • OnChatStateChange() : IChatClientListener
  • OnConnected() : IChatClientListener , MonoBehaviourPunCallbacks , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnConnectedToMaster() : MonoBehaviourPunCallbacks , ConnectAndJoinRandom , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnControllerChange() : IOnPhotonViewControllerChange
  • OnCountdownTimerHasExpired : CountdownTimer
  • OnCreatedRoom() : MonoBehaviourPunCallbacks , PhotonHandler , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnCreateRoomFailed() : MonoBehaviourPunCallbacks , PhotonHandler , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnCustomAuthenticationFailed() : MonoBehaviourPunCallbacks , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnCustomAuthenticationResponse() : MonoBehaviourPunCallbacks , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnDisconnected() : IChatClientListener , MonoBehaviourPunCallbacks , ConnectAndJoinRandom , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnDrawGizmos() : CullArea
  • OnErrorInfo() : MonoBehaviourPunCallbacks , IErrorInfoCallback
  • OnEvent() : PunTurnManager , IOnEventCallback , LoadBalancingClient
  • OnFriendListUpdate() : MonoBehaviourPunCallbacks , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnGetMessages() : IChatClientListener
  • OnJoinedLobby() : MonoBehaviourPunCallbacks , ConnectAndJoinRandom , ILobbyCallbacks , SupportLogger
  • OnJoinedRoom() : MonoBehaviourPunCallbacks , PhotonHandler , ConnectAndJoinRandom , OnJoinedInstantiate , PlayerNumbering , PunTeams , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnJoinRandomFailed() : MonoBehaviourPunCallbacks , PhotonHandler , ConnectAndJoinRandom , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnJoinRoomFailed() : MonoBehaviourPunCallbacks , PhotonHandler , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnLeftLobby() : MonoBehaviourPunCallbacks , ILobbyCallbacks , SupportLogger
  • OnLeftRoom() : MonoBehaviourPunCallbacks , PhotonHandler , OnJoinedInstantiate , PlayerNumbering , PunTeams , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • Online : ChatUserStatus
  • OnLobbyStatisticsUpdate() : MonoBehaviourPunCallbacks , ILobbyCallbacks , SupportLogger
  • OnMasterClientSwitched() : MonoBehaviourPunCallbacks , PhotonHandler , IInRoomCallbacks , SupportLogger
  • OnMessage() : LoadBalancingClient
  • OnOperationResponse() : LoadBalancingClient
  • OnOwnerChange() : IOnPhotonViewOwnerChange
  • OnOwnershipRequest() : IPunOwnershipCallbacks
  • OnOwnershipTransfered() : IPunOwnershipCallbacks
  • OnOwnershipTransferFailed() : IPunOwnershipCallbacks
  • OnPhotonSerializeView() : IPunObservable , PhotonAnimatorView , PhotonRigidbody2DView , PhotonRigidbodyView , PhotonTransformView , PhotonTransformViewClassic , CullingHandler , SmoothSyncMovement
  • OnPlayerEnteredRoom() : MonoBehaviourPunCallbacks , PhotonHandler , PlayerNumbering , PunTeams , IInRoomCallbacks , SupportLogger
  • OnPlayerFinished() : IPunTurnManagerCallbacks
  • OnPlayerLeftRoom() : MonoBehaviourPunCallbacks , PhotonHandler , PlayerNumbering , PunTeams , IInRoomCallbacks , SupportLogger
  • OnPlayerMove() : IPunTurnManagerCallbacks
  • OnPlayerNumberingChanged : PlayerNumbering
  • OnPlayerPropertiesUpdate() : MonoBehaviourPunCallbacks , PhotonHandler , PlayerNumbering , PunTeams , IInRoomCallbacks , SupportLogger
  • OnPreNetDestroy() : IOnPhotonViewPreNetDestroy
  • OnPrivateMessage() : IChatClientListener
  • OnRegionListReceived() : MonoBehaviourPunCallbacks , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnRoomListUpdate() : MonoBehaviourPunCallbacks , ILobbyCallbacks , SupportLogger
  • OnRoomPropertiesUpdate() : MonoBehaviourPunCallbacks , PhotonHandler , CountdownTimer , PunTurnManager , IInRoomCallbacks , SupportLogger
  • OnStatusChanged() : LoadBalancingClient
  • OnStatusUpdate() : IChatClientListener
  • OnSubscribed() : IChatClientListener
  • OnTabChanged : TabViewManager
  • OnTurnBegins() : IPunTurnManagerCallbacks
  • OnTurnCompleted() : IPunTurnManagerCallbacks
  • OnTurnTimeEnds() : IPunTurnManagerCallbacks
  • OnUnsubscribed() : IChatClientListener
  • OnUserSubscribed() : IChatClientListener
  • OnUserUnsubscribed() : IChatClientListener
  • OnWebRpcResponse() : MonoBehaviourPunCallbacks , IWebRpcCallback
  • OpAuthenticate() : LoadBalancingPeer
  • OpAuthenticateOnce() : LoadBalancingPeer
  • OpChangeGroups() : LoadBalancingClient , LoadBalancingPeer
  • OpCleanActorRpcBuffer() : PhotonNetwork
  • OpCleanRpcBuffer() : PhotonNetwork
  • OpCreateRoom() : LoadBalancingClient , LoadBalancingPeer
  • Open : FindFriendsOptions
  • OperationLimitReached : ErrorCode
  • OperationNotAllowedInCurrentState : ErrorCode
  • OpFindFriends() : LoadBalancingClient , LoadBalancingPeer
  • OpGetGameList() : LoadBalancingClient , LoadBalancingPeer
  • OpJoinLobby() : LoadBalancingClient , LoadBalancingPeer
  • OpJoinOrCreateRoom() : LoadBalancingClient
  • OpJoinRandomOrCreateRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpJoinRandomRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpJoinRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpLeaveLobby() : LoadBalancingClient , LoadBalancingPeer
  • OpLeaveRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpRaiseEvent() : LoadBalancingClient , LoadBalancingPeer
  • OpRejoinRoom() : LoadBalancingClient
  • OpRemoveCompleteCacheOfPlayer() : PhotonNetwork
  • OpResponseReceived : LoadBalancingClient
  • OpSetCustomPropertiesOfActor() : LoadBalancingClient
  • OpSetCustomPropertiesOfRoom() : LoadBalancingClient
  • OpSettings() : LoadBalancingPeer
  • OpWebRpc() : LoadBalancingClient
  • Owner : PhotonView
  • OwnershipTransfer : PhotonView


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- p -

  • PacketLossByCrcCheck : PhotonNetwork
  • Parameters : WebRpcResponse
  • Parent : CellTreeNode
  • PeekNext() : PhotonStream
  • Peer : PhotonLagSimulationGui
  • PeerCount : ParameterCode
  • PhotonServerSettings : PhotonNetwork
  • PhotonStream() : PhotonStream
  • PhotonStreamQueue() : PhotonStreamQueue
  • photonView : MonoBehaviourPun
  • PhotonViewCollection : PhotonNetwork
  • PhotonViews : PhotonNetwork
  • PingImplementation : RegionHandler
  • PlayerCount : GamePropertyKey , Room , RoomInfo , TypedLobbyInfo
  • PlayerList : PhotonNetwork
  • PlayerListOthers : PhotonNetwork
  • PlayerName : ActorProperties
  • PlayerNumberingChanged() : PlayerNumbering
  • PlayerProperties : EnterRoomParams , ParameterCode
  • Players : Room
  • PlayersInRoomsCount : LoadBalancingClient
  • PlayersOnMasterCount : LoadBalancingClient
  • PlayersPerTeam : PunTeams
  • PlayerTtl : GamePropertyKey
  • PlayerTTL : ParameterCode
  • PlayerTtl : Room
  • playerTtl : RoomInfo
  • PlayerTtl : RoomOptions
  • Playing : ChatUserStatus
  • PluginMismatch : ErrorCode
  • PluginName : ParameterCode
  • PluginReportedError : ErrorCode
  • Plugins : ParameterCode , RoomOptions
  • PluginVersion : ParameterCode
  • Port : ChatAppSettings , AppSettings
  • Position : ParameterCode
  • PrecisionForFloatSynchronization : PhotonNetwork
  • PrecisionForQuaternionSynchronization : PhotonNetwork
  • PrecisionForVectorSynchronization : PhotonNetwork
  • PrefabPool : PhotonNetwork
  • PrivateChannels : ChatClient
  • PrivateChatHistoryLength : ChatClient
  • PrivateMessage : ChatEventCode
  • Properties : ChatParameterCode , ParameterCode
  • PropertiesChanged : ChatEventCode , EventCode
  • PropertiesListedInLobby : Room
  • propertiesListedInLobby : RoomInfo
  • PropsListedInLobby : GamePropertyKey
  • Protocol : ChatAppSettings , AppSettings
  • ProxyServer : AppSettings
  • ProxyServerAddress : LoadBalancingClient
  • PublicChannels : ChatClient
  • Publish : ChatOperationCode
  • PublishMessage() : ChatClient
  • PublishSubscribers : ChannelCreationOptions , ChatChannel
  • PublishUserId : ParameterCode , Room , RoomOptions
  • PunVersion : PhotonNetwork


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- q -

  • QueueState : EventCode
  • QuickResends : PhotonNetwork


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- r -

  • RaiseEvent() : PhotonNetwork , OperationCode
  • RealtimeFallbackThread() : ConnectionHandler
  • ReceiveNext() : PhotonStream , PhotonStreamQueue
  • ReceiverGroup : ParameterCode
  • Receivers : RaiseEventOptions
  • Reconnect() : PhotonNetwork
  • ReconnectAndRejoin() : PhotonNetwork , LoadBalancingClient
  • ReconnectToMaster() : LoadBalancingClient
  • RefreshData() : PlayerNumbering
  • RefreshRpcMonoBehaviourCache() : PhotonView
  • Region : ParameterCode
  • RegionHandler : LoadBalancingClient
  • RejoinRoom() : PhotonNetwork
  • RemainingSecondsInTurn : PunTurnManager
  • Remove : ParameterCode
  • RemoveBufferedRPCs() : PhotonNetwork
  • RemoveCallback< T >() : PhotonView
  • RemoveCallbackTarget() : PhotonNetwork , PhotonView , LoadBalancingClient
  • Removed : GamePropertyKey
  • RemovedFromList : RoomInfo
  • RemoveFriends() : ChatClient , ChatOperationCode
  • RemovePlayerCustomProperties() : PhotonNetwork
  • RemoveRPCs() : PhotonNetwork
  • RemoveRPCsInGroup() : PhotonNetwork
  • RequestOwnership() : PhotonView
  • ResentReliableCommands : PhotonNetwork
  • Reset() : PhotonStreamQueue
  • ResetBestRegionCodeInPreferences() : ServerSettings
  • ResolveHost() : RegionPinger
  • ResourceCache : DefaultPool
  • ResultCode : WebRpcResponse
  • Room() : Room
  • RoomCount : TypedLobbyInfo
  • RoomName : EnterRoomParams , ParameterCode
  • RoomOptionFlags : ParameterCode
  • RoomOptions : EnterRoomParams
  • RoomPlayerIndexedProp : PlayerNumbering
  • RoomsCount : LoadBalancingClient
  • RootNode : CellTree
  • RPC() : PhotonView
  • RpcSecure() : PhotonView
  • RunRpcCoroutines : PhotonNetwork


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- s -

  • sceneViewId : PhotonView
  • Secret : ChatParameterCode , ParameterCode
  • Selectable : TextButtonTransition
  • SelectTab() : TabViewManager
  • SendAcksOnly() : ChatClient
  • SendAllOutgoingCommands() : PhotonNetwork
  • SendAsap : PhotonHandler
  • SendAuthCookie : WebFlags
  • Sender : ChatParameterCode , PhotonMessageInfo
  • Senders : ChatChannel , ChatParameterCode
  • SendMove() : PunTurnManager
  • SendNext() : PhotonStream , PhotonStreamQueue
  • SendPrivate : ChatOperationCode
  • SendPrivateMessage() : ChatClient
  • SendRate : PhotonNetwork
  • SendState : WebFlags
  • SendSync : WebFlags
  • SequenceChannel : RaiseEventOptions
  • SerializationProtocol : LoadBalancingClient
  • SerializationRate : PhotonNetwork
  • Serialize() : PhotonStream , PhotonStreamQueue
  • Server : ChatAppSettings , PhotonNetwork , AppSettings , LoadBalancingClient
  • ServerAddress : PhotonNetwork
  • ServerFull : ErrorCode
  • ServerPortOverrides : PhotonNetwork , LoadBalancingClient
  • ServerSettings : OperationCode
  • ServerSettingsFileName : PhotonNetwork
  • ServerTimestamp : PhotonNetwork
  • Service() : ChatClient , LoadBalancingClient
  • SetAuthPostData() : AuthenticationValues
  • SetCustomProperties() : Player , Room
  • SetExpectedUsers() : Room
  • SetFinishedTurn() : TurnExtensions
  • SetInterestGroups() : PhotonNetwork
  • SetLayerSynchronized() : PhotonAnimatorView
  • SetLevelPrefix() : PhotonNetwork
  • SetMasterClient() : PhotonNetwork , Room
  • SetOnlineStatus() : ChatClient
  • SetParameterSynchronized() : PhotonAnimatorView
  • SetPlayerCustomProperties() : PhotonNetwork
  • SetPlayerNumber() : PlayerNumberingExtensions
  • SetProperties : ChatOperationCode , EventCode , OperationCode
  • SetPropertiesListedInLobby() : Room
  • SetSendingEnabled() : PhotonNetwork
  • SetSynchronizedValues() : PhotonTransformViewClassic , PhotonTransformViewPositionControl
  • SetTeam() : TeamExtensions
  • SetTurn() : TurnExtensions
  • SimulateConnectionLoss() : LoadBalancingClient
  • SkipMessage : ChatParameterCode
  • SlotError : ErrorCode
  • SocketImplementationConfig : ChatClient
  • SqlLobbyFilter : OpJoinRandomRoomParams
  • Start() : RegionPinger
  • StartPing() : PingMono
  • State : ChatClient , LoadBalancingClient
  • StateChanged : LoadBalancingClient
  • statsOn : PhotonStatsGui
  • statsRect : PhotonStatsGui
  • statsWindowOn : PhotonStatsGui
  • Status : ChatParameterCode
  • StatusUpdate : ChatEventCode
  • StopThread() : ChatClient
  • StorePlayer() : Room
  • StripKeysWithNullValues() : Extensions
  • StripToStringKeys() : Extensions
  • SUBDIVISION_FIRST_LEVEL_ORDER : CullArea
  • SUBDIVISION_SECOND_LEVEL_ORDER : CullArea
  • SUBDIVISION_THIRD_LEVEL_ORDER : CullArea
  • Subscribe() : ChatClient , ChatEventCode , ChatOperationCode
  • SubscribeResults : ChatParameterCode
  • Subscribers : ChatChannel
  • SummaryToCache : LoadBalancingClient , RegionHandler
  • SuppressPlayerInfo : Room , RoomOptions
  • SuppressRoomEvents : ParameterCode , Room , RoomOptions
  • SwitchTeam() : PhotonTeamExtensions


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- t -

  • Tabs : TabViewManager
  • TagObject : Player
  • TargetActorNr : ParameterCode
  • TargetActors : RaiseEventOptions
  • Team : PunTeams
  • TeamPlayerProp : PhotonTeamsManager , PunTeams
  • Time : PhotonNetwork
  • ToArray() : PhotonStream
  • toggle : TextToggleIsOnTransition
  • ToggleGroup : TabViewManager
  • Token : AuthenticationValues , ParameterCode
  • ToString() : AuthenticationValues , ServerSettings , AuthenticationValues , Player , Room , RoomInfo
  • ToStringFull() : AppSettings , Extensions , Player , Room , RoomInfo , WebRpcResponse
  • ToStringFull< T >() : Extensions
  • ToStringMessages() : ChatChannel
  • trafficStatsOn : PhotonStatsGui
  • TransferOwnership() : PhotonView
  • TransportProtocol : ChatClient
  • TruncateMessages() : ChatChannel
  • TryGetChannel() : ChatClient
  • TryGetPrivateChannelByUser() : ChatClient
  • TryGetTeamByCode() : PhotonTeamsManager
  • TryGetTeamByName() : PhotonTeamsManager
  • TryGetTeamMates() : PhotonTeamExtensions
  • TryGetTeamMatesOfPlayer() : PhotonTeamsManager
  • TryGetTeamMembers() : PhotonTeamsManager
  • Turn : PunTurnManager
  • TurnDuration : PunTurnManager
  • TurnManagerEventOffset : PunTurnManager
  • TurnManagerListener : PunTurnManager
  • TurnPropKey : TurnExtensions
  • TurnStartPropKey : TurnExtensions
  • Type : TypedLobby
  • TypedLobby : OpJoinRandomRoomParams , TypedLobby


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- u -

  • UniqueRoomId : ChatParameterCode
  • Unsubscribe() : ChatClient , ChatEventCode , ChatOperationCode
  • Update() : PhotonStatsGui
  • UpdatePosition() : PhotonTransformViewPositionControl
  • UpdateStatus : ChatOperationCode
  • UriPath : ParameterCode
  • UseAlternativeUdpPorts : PhotonNetwork , LoadBalancingClient
  • UseBackgroundWorkerForSending : ChatClient
  • UseCloud() : ServerSettings
  • UseNameServer : AppSettings
  • UserBlocked : ErrorCode
  • UserId : AuthenticationValues , ChatClient , ChatParameterCode , ParameterCode , ActorProperties , AuthenticationValues , LoadBalancingClient , ParameterCode , Player
  • UseRpcMonoBehaviourCache : PhotonNetwork
  • UserProperties : ChatParameterCode
  • Users : ChatEventCode
  • UserSubscribed : ChatEventCode
  • UserUnsubscribed : ChatEventCode


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- v -

  • Version : ConnectAndJoinRandom
  • ViewID : PhotonView
  • Visible : PhotonLagSimulationGui , FindFriendsOptions


Photon Unity Networking 2: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- w -

  • WebFlags : ChatParameterCode
  • WebRpc() : PhotonNetwork , OperationCode
  • WebRpcParameters : ParameterCode
  • WebRpcResponse() : WebRpcResponse
  • WebRpcReturnCode : ParameterCode
  • WebRpcReturnMessage : ParameterCode
  • WindowId : PhotonLagSimulationGui , PhotonStatsGui
  • WindowRect : PhotonLagSimulationGui


Photon Unity Networking 2: Class Members - Functions

- a -

  • Add() : ChatChannel
  • AddAuthParameter() : AuthenticationValues
  • AddCallback< T >() : PhotonView
  • AddCallbackTarget() : PhotonNetwork , PhotonView , LoadBalancingClient
  • AddChild() : CellTreeNode
  • AddFriends() : ChatClient
  • AddPlayer() : Room
  • AllocateRoomViewID() : PhotonNetwork
  • AllocateViewID() : PhotonNetwork
  • AlmostEquals() : PunExtensions
  • AuthenticateOnNameServer() : ChatPeer
  • AuthenticationValues() : AuthenticationValues


Photon Unity Networking 2: Class Members - Functions

- b -

  • BeginTurn() : PunTurnManager


Photon Unity Networking 2: Class Members - Functions

- c -

  • CacheDiscreteTriggers() : PhotonAnimatorView
  • CanChatInChannel() : ChatClient
  • CellTree() : CellTree
  • CellTreeNode() : CellTreeNode
  • ChangeLocalID() : LoadBalancingClient
  • ChatChannel() : ChatChannel
  • ChatClient() : ChatClient
  • ChatPeer() : ChatPeer
  • ClearExpectedUsers() : Room
  • ClearMessages() : ChatChannel
  • CloseConnection() : PhotonNetwork
  • Compare() : ByteComparer
  • Connect() : ChatClient , ChatPeer
  • ConnectAndSetStatus() : ChatClient
  • ConnectToBestCloudServer() : PhotonNetwork
  • ConnectToMaster() : PhotonNetwork
  • ConnectToMasterServer() : LoadBalancingClient
  • ConnectToNameServer() : LoadBalancingClient
  • ConnectToRegion() : PhotonNetwork
  • ConnectToRegionMaster() : LoadBalancingClient
  • ConnectUsingSettings() : PhotonNetwork
  • Contains() : Extensions
  • CopyTo() : AuthenticationValues
  • CountdownTimerHasExpired() : CountdownTimer
  • CreateRoom() : PhotonNetwork


Photon Unity Networking 2: Class Members - Functions

- d -

  • DebugReturn() : IChatClientListener , LoadBalancingClient
  • Deserialize() : PhotonStreamQueue
  • DespawnObjects() : OnJoinedInstantiate
  • Destroy() : DefaultPool , IPunPrefabPool , PhotonNetwork
  • DestroyAll() : PhotonNetwork
  • DestroyPlayerObjects() : PhotonNetwork
  • Disconnect() : ChatClient , PhotonNetwork , LoadBalancingClient
  • Dispatch() : PhotonHandler
  • DoesLayerSynchronizeTypeExist() : PhotonAnimatorView
  • DoesParameterSynchronizeTypeExist() : PhotonAnimatorView
  • Draw() : CellTreeNode


Photon Unity Networking 2: Class Members - Functions

- e -

  • Equals() : Player , RoomInfo


Photon Unity Networking 2: Class Members - Functions

- f -

  • FetchServerTimestamp() : PhotonNetwork
  • Find() : PhotonView
  • FindFriends() : PhotonNetwork
  • FindGameObjectsWithComponent() : PhotonNetwork
  • FindObservables() : PhotonView
  • FixedUpdate() : PhotonHandler


Photon Unity Networking 2: Class Members - Functions

- g -

  • Get() : Player
  • GetActiveCells() : CellTreeNode , CullArea
  • GetAvailableTeams() : PhotonTeamsManager
  • GetCustomRoomList() : PhotonNetwork
  • GetExtrapolatedPositionOffset() : PhotonTransformViewPositionControl
  • GetFinishedTurn() : TurnExtensions
  • GetHashCode() : Player , RoomInfo
  • GetLayerSynchronizeType() : PhotonAnimatorView
  • GetNestedComponentInParent< T, NestedT >() : NestedComponentUtilities
  • GetNestedComponentInParents< T, NestedT >() : NestedComponentUtilities
  • GetNestedComponentsInChildren< T >() : NestedComponentUtilities
  • GetNestedComponentsInChildren< T, NestedT >() : NestedComponentUtilities
  • GetNestedComponentsInChildren< T, SearchT, NestedT >() : NestedComponentUtilities
  • GetNestedComponentsInParents< T >() : NestedComponentUtilities
  • GetNestedComponentsInParents< T, NestedT >() : NestedComponentUtilities
  • GetNetworkPosition() : PhotonTransformViewPositionControl
  • GetNetworkRotation() : PhotonTransformViewRotationControl
  • GetNetworkScale() : PhotonTransformViewScaleControl
  • GetNext() : Player
  • GetNextFor() : Player
  • GetParameterSynchronizeType() : PhotonAnimatorView
  • GetParentComponent< T >() : NestedComponentUtilities
  • GetPhotonTeam() : PhotonTeamExtensions
  • GetPing() : PhotonNetwork
  • GetPlayer() : Room
  • GetPlayerFinishedTurn() : PunTurnManager
  • GetPlayerNumber() : PlayerNumberingExtensions
  • GetPrivateChannelNameByUser() : ChatClient
  • GetRandomOffset() : OnJoinedInstantiate
  • GetSpawnPoint() : OnJoinedInstantiate
  • GetSynchronizedLayers() : PhotonAnimatorView
  • GetSynchronizedParameters() : PhotonAnimatorView
  • GetTeam() : TeamExtensions
  • GetTeamMembersCount() : PhotonTeamsManager
  • GetTurn() : TurnExtensions
  • GetTurnStart() : TurnExtensions


Photon Unity Networking 2: Class Members - Functions

- h -

  • HasQueuedObjects() : PhotonStreamQueue


Photon Unity Networking 2: Class Members - Functions

- i -

  • Instantiate() : DefaultPool , IPunPrefabPool
  • IsAppId() : ServerSettings , AppSettings
  • IsPointInsideCell() : CellTreeNode
  • IsPointNearCell() : CellTreeNode


Photon Unity Networking 2: Class Members - Functions

- j -

  • JoinLobby() : PhotonNetwork
  • JoinOrCreateRoom() : PhotonNetwork
  • JoinRandomOrCreateRoom() : PhotonNetwork
  • JoinRandomRoom() : PhotonNetwork
  • JoinRoom() : PhotonNetwork
  • JoinTeam() : PhotonTeamExtensions


Photon Unity Networking 2: Class Members - Functions

- l -

  • LateUpdate() : PhotonHandler
  • LeaveCurrentTeam() : PhotonTeamExtensions
  • LeaveLobby() : PhotonNetwork
  • LeaveRoom() : PhotonNetwork
  • LoadBalancingClient() : LoadBalancingClient
  • LoadBalancingPeer() : LoadBalancingPeer
  • LoadLevel() : PhotonNetwork
  • LogStats() : SupportLogger


Photon Unity Networking 2: Class Members - Functions

- m -

  • Merge() : Extensions
  • MergeStringKeys() : Extensions


Photon Unity Networking 2: Class Members - Functions

- n -

  • NetworkStatisticsReset() : PhotonNetwork
  • NetworkStatisticsToString() : PhotonNetwork


Photon Unity Networking 2: Class Members - Functions

- o -

  • OnChatStateChange() : IChatClientListener
  • OnConnected() : IChatClientListener , MonoBehaviourPunCallbacks , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnConnectedToMaster() : MonoBehaviourPunCallbacks , ConnectAndJoinRandom , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnControllerChange() : IOnPhotonViewControllerChange
  • OnCreatedRoom() : MonoBehaviourPunCallbacks , PhotonHandler , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnCreateRoomFailed() : MonoBehaviourPunCallbacks , PhotonHandler , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnCustomAuthenticationFailed() : MonoBehaviourPunCallbacks , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnCustomAuthenticationResponse() : MonoBehaviourPunCallbacks , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnDisconnected() : IChatClientListener , MonoBehaviourPunCallbacks , ConnectAndJoinRandom , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnDrawGizmos() : CullArea
  • OnErrorInfo() : MonoBehaviourPunCallbacks , IErrorInfoCallback
  • OnEvent() : PunTurnManager , IOnEventCallback , LoadBalancingClient
  • OnFriendListUpdate() : MonoBehaviourPunCallbacks , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnGetMessages() : IChatClientListener
  • OnJoinedLobby() : MonoBehaviourPunCallbacks , ConnectAndJoinRandom , ILobbyCallbacks , SupportLogger
  • OnJoinedRoom() : MonoBehaviourPunCallbacks , PhotonHandler , ConnectAndJoinRandom , OnJoinedInstantiate , PlayerNumbering , PunTeams , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnJoinRandomFailed() : MonoBehaviourPunCallbacks , PhotonHandler , ConnectAndJoinRandom , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnJoinRoomFailed() : MonoBehaviourPunCallbacks , PhotonHandler , OnJoinedInstantiate , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnLeftLobby() : MonoBehaviourPunCallbacks , ILobbyCallbacks , SupportLogger
  • OnLeftRoom() : MonoBehaviourPunCallbacks , PhotonHandler , OnJoinedInstantiate , PlayerNumbering , PunTeams , IMatchmakingCallbacks , MatchMakingCallbacksContainer , SupportLogger
  • OnLobbyStatisticsUpdate() : MonoBehaviourPunCallbacks , ILobbyCallbacks , SupportLogger
  • OnMasterClientSwitched() : MonoBehaviourPunCallbacks , PhotonHandler , IInRoomCallbacks , SupportLogger
  • OnMessage() : LoadBalancingClient
  • OnOperationResponse() : LoadBalancingClient
  • OnOwnerChange() : IOnPhotonViewOwnerChange
  • OnOwnershipRequest() : IPunOwnershipCallbacks
  • OnOwnershipTransfered() : IPunOwnershipCallbacks
  • OnOwnershipTransferFailed() : IPunOwnershipCallbacks
  • OnPhotonSerializeView() : IPunObservable , PhotonAnimatorView , PhotonRigidbody2DView , PhotonRigidbodyView , PhotonTransformView , PhotonTransformViewClassic , CullingHandler , SmoothSyncMovement
  • OnPlayerEnteredRoom() : MonoBehaviourPunCallbacks , PhotonHandler , PlayerNumbering , PunTeams , IInRoomCallbacks , SupportLogger
  • OnPlayerFinished() : IPunTurnManagerCallbacks
  • OnPlayerLeftRoom() : MonoBehaviourPunCallbacks , PhotonHandler , PlayerNumbering , PunTeams , IInRoomCallbacks , SupportLogger
  • OnPlayerMove() : IPunTurnManagerCallbacks
  • OnPlayerPropertiesUpdate() : MonoBehaviourPunCallbacks , PhotonHandler , PlayerNumbering , PunTeams , IInRoomCallbacks , SupportLogger
  • OnPreNetDestroy() : IOnPhotonViewPreNetDestroy
  • OnPrivateMessage() : IChatClientListener
  • OnRegionListReceived() : MonoBehaviourPunCallbacks , ConnectionCallbacksContainer , IConnectionCallbacks , SupportLogger
  • OnRoomListUpdate() : MonoBehaviourPunCallbacks , ILobbyCallbacks , SupportLogger
  • OnRoomPropertiesUpdate() : MonoBehaviourPunCallbacks , PhotonHandler , CountdownTimer , PunTurnManager , IInRoomCallbacks , SupportLogger
  • OnStatusChanged() : LoadBalancingClient
  • OnStatusUpdate() : IChatClientListener
  • OnSubscribed() : IChatClientListener
  • OnTurnBegins() : IPunTurnManagerCallbacks
  • OnTurnCompleted() : IPunTurnManagerCallbacks
  • OnTurnTimeEnds() : IPunTurnManagerCallbacks
  • OnUnsubscribed() : IChatClientListener
  • OnUserSubscribed() : IChatClientListener
  • OnUserUnsubscribed() : IChatClientListener
  • OnWebRpcResponse() : MonoBehaviourPunCallbacks , IWebRpcCallback
  • OpAuthenticate() : LoadBalancingPeer
  • OpAuthenticateOnce() : LoadBalancingPeer
  • OpChangeGroups() : LoadBalancingClient , LoadBalancingPeer
  • OpCleanActorRpcBuffer() : PhotonNetwork
  • OpCleanRpcBuffer() : PhotonNetwork
  • OpCreateRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpFindFriends() : LoadBalancingClient , LoadBalancingPeer
  • OpGetGameList() : LoadBalancingClient , LoadBalancingPeer
  • OpJoinLobby() : LoadBalancingClient , LoadBalancingPeer
  • OpJoinOrCreateRoom() : LoadBalancingClient
  • OpJoinRandomOrCreateRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpJoinRandomRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpJoinRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpLeaveLobby() : LoadBalancingClient , LoadBalancingPeer
  • OpLeaveRoom() : LoadBalancingClient , LoadBalancingPeer
  • OpRaiseEvent() : LoadBalancingClient , LoadBalancingPeer
  • OpRejoinRoom() : LoadBalancingClient
  • OpRemoveCompleteCacheOfPlayer() : PhotonNetwork
  • OpSetCustomPropertiesOfActor() : LoadBalancingClient
  • OpSetCustomPropertiesOfRoom() : LoadBalancingClient
  • OpSettings() : LoadBalancingPeer
  • OpWebRpc() : LoadBalancingClient


Photon Unity Networking 2: Class Members - Functions

- p -

  • PeekNext() : PhotonStream
  • PhotonStream() : PhotonStream
  • PhotonStreamQueue() : PhotonStreamQueue
  • PlayerNumberingChanged() : PlayerNumbering
  • PublishMessage() : ChatClient


Photon Unity Networking 2: Class Members - Functions

- r -

  • RaiseEvent() : PhotonNetwork
  • RealtimeFallbackThread() : ConnectionHandler
  • ReceiveNext() : PhotonStream , PhotonStreamQueue
  • Reconnect() : PhotonNetwork
  • ReconnectAndRejoin() : PhotonNetwork , LoadBalancingClient
  • ReconnectToMaster() : LoadBalancingClient
  • RefreshData() : PlayerNumbering
  • RefreshRpcMonoBehaviourCache() : PhotonView
  • RejoinRoom() : PhotonNetwork
  • RemoveBufferedRPCs() : PhotonNetwork
  • RemoveCallback< T >() : PhotonView
  • RemoveCallbackTarget() : PhotonNetwork , PhotonView , LoadBalancingClient
  • RemoveFriends() : ChatClient
  • RemovePlayerCustomProperties() : PhotonNetwork
  • RemoveRPCs() : PhotonNetwork
  • RemoveRPCsInGroup() : PhotonNetwork
  • RequestOwnership() : PhotonView
  • Reset() : PhotonStreamQueue
  • ResetBestRegionCodeInPreferences() : ServerSettings
  • ResolveHost() : RegionPinger
  • Room() : Room
  • RPC() : PhotonView
  • RpcSecure() : PhotonView


Photon Unity Networking 2: Class Members - Functions

- s -

  • SelectTab() : TabViewManager
  • SendAcksOnly() : ChatClient
  • SendAllOutgoingCommands() : PhotonNetwork
  • SendMove() : PunTurnManager
  • SendNext() : PhotonStream , PhotonStreamQueue
  • SendPrivateMessage() : ChatClient
  • Serialize() : PhotonStream , PhotonStreamQueue
  • Service() : ChatClient , LoadBalancingClient
  • SetAuthPostData() : AuthenticationValues
  • SetCustomProperties() : Player , Room
  • SetExpectedUsers() : Room
  • SetFinishedTurn() : TurnExtensions
  • SetInterestGroups() : PhotonNetwork
  • SetLayerSynchronized() : PhotonAnimatorView
  • SetLevelPrefix() : PhotonNetwork
  • SetMasterClient() : PhotonNetwork , Room
  • SetOnlineStatus() : ChatClient
  • SetParameterSynchronized() : PhotonAnimatorView
  • SetPlayerCustomProperties() : PhotonNetwork
  • SetPlayerNumber() : PlayerNumberingExtensions
  • SetPropertiesListedInLobby() : Room
  • SetSendingEnabled() : PhotonNetwork
  • SetSynchronizedValues() : PhotonTransformViewClassic , PhotonTransformViewPositionControl
  • SetTeam() : TeamExtensions
  • SetTurn() : TurnExtensions
  • SimulateConnectionLoss() : LoadBalancingClient
  • Start() : RegionPinger
  • StartPing() : PingMono
  • StopThread() : ChatClient
  • StorePlayer() : Room
  • StripKeysWithNullValues() : Extensions
  • StripToStringKeys() : Extensions
  • Subscribe() : ChatClient
  • SwitchTeam() : PhotonTeamExtensions


Photon Unity Networking 2: Class Members - Functions

- t -

  • ToArray() : PhotonStream
  • ToString() : AuthenticationValues , ServerSettings , AuthenticationValues , Player , Room , RoomInfo
  • ToStringFull() : AppSettings , Extensions , Player , Room , RoomInfo , WebRpcResponse
  • ToStringFull< T >() : Extensions
  • ToStringMessages() : ChatChannel
  • TransferOwnership() : PhotonView
  • TruncateMessages() : ChatChannel
  • TryGetChannel() : ChatClient
  • TryGetPrivateChannelByUser() : ChatClient
  • TryGetTeamByCode() : PhotonTeamsManager
  • TryGetTeamByName() : PhotonTeamsManager
  • TryGetTeamMates() : PhotonTeamExtensions
  • TryGetTeamMatesOfPlayer() : PhotonTeamsManager
  • TryGetTeamMembers() : PhotonTeamsManager
  • TypedLobby() : TypedLobby


Photon Unity Networking 2: Class Members - Functions

- u -

  • Unsubscribe() : ChatClient
  • Update() : PhotonStatsGui
  • UpdatePosition() : PhotonTransformViewPositionControl
  • UseCloud() : ServerSettings


Photon Unity Networking 2: Class Members - Functions

- w -

  • WebRpc() : PhotonNetwork
  • WebRpcResponse() : WebRpcResponse


Photon Unity Networking 2: Class Members - Variables

- a -

  • ActorList : ParameterCode
  • ActorNr : ParameterCode
  • Add : ParameterCode
  • AddFriends : ChatOperationCode
  • Address : ParameterCode
  • AppIdChat : ChatAppSettings , AppSettings
  • AppIdFusion : AppSettings
  • AppIdRealtime : AppSettings
  • AppIdVoice : AppSettings
  • ApplicationId : ParameterCode
  • ApplyDontDestroyOnLoad : ConnectionHandler
  • AppQuits : ConnectionHandler
  • AppStats : EventCode
  • AppVersion : ChatAppSettings , ParameterCode , AppSettings , ParameterCode
  • Authenticate : ChatOperationCode , OperationCode
  • AuthenticateOnce : OperationCode
  • AuthenticationTicketExpired : ErrorCode
  • AuthEvent : EventCode
  • AuthMode : AppSettings , LoadBalancingClient
  • autoCleanUp : RoomInfo
  • AutoConnect : ConnectAndJoinRandom
  • Away : ChatUserStatus
  • AzureLocalNodeId : ParameterCode
  • AzureMasterNodeId : ParameterCode
  • AzureNodeInfo : EventCode , ParameterCode


Photon Unity Networking 2: Class Members - Variables

- b -

  • BestRegionSummaryFromStorage : AppSettings
  • Broadcast : ChatParameterCode , ParameterCode
  • buttonsOn : PhotonStatsGui


Photon Unity Networking 2: Class Members - Variables

- c -

  • Cache : ParameterCode
  • CacheSliceChanged : EventCode
  • CacheSliceIndex : ParameterCode
  • CachingOption : RaiseEventOptions
  • Center : CellTreeNode
  • ChangeGroups : OperationCode
  • Channel : ChatParameterCode
  • ChannelHistory : ChatOperationCode
  • ChannelID : ChatChannel
  • Channels : ChatParameterCode
  • ChannelSubscribers : ChatParameterCode
  • ChannelUserCount : ChatParameterCode
  • ChatMessages : ChatEventCode
  • chatPeer : ChatClient
  • CheckUserOnJoin : ParameterCode
  • Childs : CellTreeNode
  • CleanupCacheOnLeave : GamePropertyKey , ParameterCode
  • ClientAuthenticationData : ParameterCode
  • ClientAuthenticationParams : ParameterCode
  • ClientAuthenticationType : ParameterCode
  • Cluster : ParameterCode
  • Code : ParameterCode
  • ConnectionCallbackTargets : LoadBalancingClient
  • ConnectMethod : PhotonNetwork
  • CreatedOnGs : FindFriendsOptions
  • CreateGame : OperationCode
  • CustomAuthenticationFailed : ErrorCode
  • CustomEventContent : ParameterCode
  • CustomInitData : ParameterCode
  • CustomRoomProperties : RoomOptions
  • CustomRoomPropertiesForLobby : RoomOptions


Photon Unity Networking 2: Class Members - Variables

- d -

  • Data : ParameterCode
  • DebugData : ChatParameterCode
  • Default : ChannelCreationOptions , RaiseEventOptions , TypedLobby
  • DefaultMaxSubscribers : ChatClient
  • DevRegion : ServerSettings
  • DisconnectAfterKeepAlive : ConnectionHandler
  • DND : ChatUserStatus
  • dontDestroyOnLoad : PlayerNumbering


Photon Unity Networking 2: Class Members - Variables

- e -

  • EmptyRoomTtl : GamePropertyKey
  • EmptyRoomTTL : ParameterCode
  • emptyRoomTtl : RoomInfo
  • EmptyRoomTtl : RoomOptions
  • EnableCloseConnection : PhotonNetwork
  • EnableLobbyStatistics : AppSettings , LoadBalancingClient
  • EnableProtocolFallback : ChatAppSettings , AppSettings
  • EncryptionData : ParameterCode
  • EncryptionMode : LoadBalancingClient , ParameterCode
  • ErrorInfo : ChatEventCode , EventCode
  • EventForward : ParameterCode
  • EvFinalMove : PunTurnManager
  • EvMove : PunTurnManager
  • ExpectedCustomRoomProperties : OpJoinRandomRoomParams
  • ExpectedMaxPlayers : OpJoinRandomRoomParams
  • ExpectedProtocol : ParameterCode
  • ExpectedUsers : EnterRoomParams , GamePropertyKey , OpJoinRandomRoomParams
  • expectedUsers : RoomInfo
  • ExpectedValues : ChatParameterCode , ParameterCode
  • ExternalHttpCallFailed : ErrorCode


Photon Unity Networking 2: Class Members - Variables

- f -

  • FindFriends : OperationCode
  • FindFriendsOptions : ParameterCode
  • FindFriendsRequestList : ParameterCode
  • FindFriendsResponseOnlineList : ParameterCode
  • FindFriendsResponseRoomIdList : ParameterCode
  • FinishedTurnPropKey : TurnExtensions
  • FIRST_GROUP_ID : CullArea
  • FixedRegion : ChatAppSettings , AppSettings
  • Flags : RaiseEventOptions
  • Friends : ChatParameterCode
  • FriendsList : ChatEventCode


Photon Unity Networking 2: Class Members - Variables

- g -

  • GameClosed : ErrorCode
  • GameCount : ParameterCode
  • GameDoesNotExist : ErrorCode
  • GameFull : ErrorCode
  • GameIdAlreadyExists : ErrorCode
  • GameList : EventCode , ParameterCode
  • GameListUpdate : EventCode
  • GameProperties : ParameterCode
  • GameServerPort : PhotonPortDefinition
  • GetGameList : OperationCode
  • GetLobbyStats : OperationCode
  • GetProperties : OperationCode
  • GetRegions : OperationCode
  • Group : ParameterCode


Photon Unity Networking 2: Class Members - Variables

- h -

  • healthStatsVisible : PhotonStatsGui
  • HistoryLength : ChatParameterCode
  • HoverColor : TextButtonTransition
  • HoverOffColor : TextToggleIsOnTransition
  • HoverOnColor : TextToggleIsOnTransition
  • HttpLimitReached : ErrorCode


Photon Unity Networking 2: Class Members - Variables

- i -

  • Id : CellTreeNode
  • Info : ErrorInfo , ParameterCode
  • instance : PlayerNumbering
  • InterestGroup : RaiseEventOptions
  • InternalServerError : ErrorCode
  • InvalidAuthentication : ErrorCode
  • InvalidEncryptionParameters : ErrorCode
  • InvalidOperation : ErrorCode
  • InvalidOperationCode : ErrorCode
  • InvalidRegion : ErrorCode
  • Invisible : ChatUserStatus
  • IsComingBack : ParameterCode
  • IsInactive : ActorProperties , ParameterCode
  • IsLocal : Player
  • IsOpen : GamePropertyKey
  • isOpen : RoomInfo
  • IsVisible : GamePropertyKey
  • isVisible : RoomInfo


Photon Unity Networking 2: Class Members - Variables

- j -

  • Join : EventCode , OperationCode
  • JoinFailedFoundActiveJoiner : ErrorCode
  • JoinFailedFoundExcludedUserId : ErrorCode
  • JoinFailedFoundInactiveJoiner : ErrorCode
  • JoinFailedPeerAlreadyJoined : ErrorCode
  • JoinFailedWithRejoinerNotFound : ErrorCode
  • JoinGame : OperationCode
  • JoinLobby : OperationCode
  • JoinMode : ParameterCode
  • JoinRandomGame : OperationCode


Photon Unity Networking 2: Class Members - Variables

- k -

  • KeepAliveInBackground : ConnectionHandler


Photon Unity Networking 2: Class Members - Variables

- l -

  • Leave : EventCode , OperationCode
  • LeaveLobby : OperationCode
  • LFG : ChatUserStatus
  • Lobby : EnterRoomParams
  • LobbyName : ParameterCode
  • LobbyStats : EventCode , ParameterCode
  • LobbyType : ParameterCode
  • LogLevel : PhotonNetwork
  • LogTrafficStats : SupportLogger


Photon Unity Networking 2: Class Members - Variables

- m -

  • MasterClientId : GamePropertyKey , ParameterCode
  • masterClientId : RoomInfo
  • MasterPeerCount : ParameterCode
  • MasterServerPort : PhotonPortDefinition
  • Match : EventCode
  • MatchingType : OpJoinRandomRoomParams
  • MatchMakingCallbackTargets : LoadBalancingClient
  • MatchMakingType : ParameterCode
  • MAX_VIEW_IDS : PhotonNetwork
  • MaxCcuReached : ErrorCode
  • MaxDatagrams : PhotonHandler
  • MaxPlayers : ConnectAndJoinRandom , GamePropertyKey
  • maxPlayers : RoomInfo
  • MaxPlayers : RoomOptions
  • Message : ChatParameterCode
  • MessageLimit : ChatChannel , ChatClient
  • Messages : ChatChannel , ChatParameterCode
  • MinimalTimeScaleToDispatchInFixedUpdate : PhotonNetwork
  • MsgId : ChatParameterCode
  • MsgIds : ChatParameterCode


Photon Unity Networking 2: Class Members - Variables

- n -

  • Name : ChatChannel
  • name : RoomInfo
  • Name : TypedLobby
  • NameServerHost : ChatPeer , LoadBalancingClient
  • NameServerPort : PhotonPortDefinition
  • NameServerPortOverride : ChatPeer
  • NetworkingClient : PhotonNetwork
  • NetworkLogging : ChatAppSettings , AppSettings
  • NickName : ParameterCode
  • NodeType : CellTreeNode
  • NoRandomMatchFound : ErrorCode
  • NormalColor : TextButtonTransition
  • NormalOffColor : TextToggleIsOnTransition
  • NormalOnColor : TextToggleIsOnTransition


Photon Unity Networking 2: Class Members - Variables

- o -

  • ObjectsInOneUpdate : PhotonNetwork
  • observableSearch : PhotonView
  • Offline : ChatUserStatus
  • Ok : ErrorCode
  • Online : ChatUserStatus
  • OnTabChanged : TabViewManager
  • Open : FindFriendsOptions
  • OperationLimitReached : ErrorCode
  • OperationNotAllowedInCurrentState : ErrorCode
  • OwnershipTransfer : PhotonView


Photon Unity Networking 2: Class Members - Variables

- p -

  • Parent : CellTreeNode
  • PeerCount : ParameterCode
  • PingImplementation : RegionHandler
  • PlayerCount : GamePropertyKey , TypedLobbyInfo
  • PlayerName : ActorProperties
  • PlayerProperties : EnterRoomParams , ParameterCode
  • PlayersPerTeam : PunTeams
  • PlayerTtl : GamePropertyKey
  • PlayerTTL : ParameterCode
  • playerTtl : RoomInfo
  • PlayerTtl : RoomOptions
  • Playing : ChatUserStatus
  • PluginMismatch : ErrorCode
  • PluginName : ParameterCode
  • PluginReportedError : ErrorCode
  • Plugins : ParameterCode , RoomOptions
  • PluginVersion : ParameterCode
  • Port : ChatAppSettings , AppSettings
  • Position : ParameterCode
  • PrecisionForFloatSynchronization : PhotonNetwork
  • PrecisionForQuaternionSynchronization : PhotonNetwork
  • PrecisionForVectorSynchronization : PhotonNetwork
  • PrivateChannels : ChatClient
  • PrivateChatHistoryLength : ChatClient
  • PrivateMessage : ChatEventCode
  • Properties : ChatParameterCode , ParameterCode
  • PropertiesChanged : ChatEventCode , EventCode
  • propertiesListedInLobby : RoomInfo
  • PropsListedInLobby : GamePropertyKey
  • Protocol : ChatAppSettings , AppSettings
  • ProxyServer : AppSettings
  • ProxyServerAddress : LoadBalancingClient
  • PublicChannels : ChatClient
  • Publish : ChatOperationCode
  • PublishUserId : ParameterCode
  • PunVersion : PhotonNetwork


Photon Unity Networking 2: Class Members - Variables

- q -

  • QueueState : EventCode


Photon Unity Networking 2: Class Members - Variables

- r -

  • RaiseEvent : OperationCode
  • ReceiverGroup : ParameterCode
  • Receivers : RaiseEventOptions
  • Region : ParameterCode
  • RegionHandler : LoadBalancingClient
  • Remove : ParameterCode
  • Removed : GamePropertyKey
  • RemovedFromList : RoomInfo
  • RemoveFriends : ChatOperationCode
  • ResourceCache : DefaultPool
  • RoomCount : TypedLobbyInfo
  • RoomName : EnterRoomParams , ParameterCode
  • RoomOptionFlags : ParameterCode
  • RoomOptions : EnterRoomParams
  • RoomPlayerIndexedProp : PlayerNumbering
  • RunRpcCoroutines : PhotonNetwork


Photon Unity Networking 2: Class Members - Variables

- s -

  • sceneViewId : PhotonView
  • Secret : ChatParameterCode , ParameterCode
  • Selectable : TextButtonTransition
  • SendAsap : PhotonHandler
  • Sender : ChatParameterCode , PhotonMessageInfo
  • Senders : ChatChannel , ChatParameterCode
  • SendPrivate : ChatOperationCode
  • SequenceChannel : RaiseEventOptions
  • Server : ChatAppSettings , AppSettings
  • ServerFull : ErrorCode
  • ServerPortOverrides : LoadBalancingClient
  • ServerSettings : OperationCode
  • ServerSettingsFileName : PhotonNetwork
  • SetProperties : ChatOperationCode , EventCode , OperationCode
  • SkipMessage : ChatParameterCode
  • SlotError : ErrorCode
  • SqlLobbyFilter : OpJoinRandomRoomParams
  • statsOn : PhotonStatsGui
  • statsRect : PhotonStatsGui
  • statsWindowOn : PhotonStatsGui
  • Status : ChatParameterCode
  • StatusUpdate : ChatEventCode
  • SUBDIVISION_FIRST_LEVEL_ORDER : CullArea
  • SUBDIVISION_SECOND_LEVEL_ORDER : CullArea
  • SUBDIVISION_THIRD_LEVEL_ORDER : CullArea
  • Subscribe : ChatEventCode , ChatOperationCode
  • SubscribeResults : ChatParameterCode
  • Subscribers : ChatChannel
  • SummaryToCache : LoadBalancingClient
  • SuppressRoomEvents : ParameterCode


Photon Unity Networking 2: Class Members - Variables

- t -

  • Tabs : TabViewManager
  • TagObject : Player
  • TargetActorNr : ParameterCode
  • TargetActors : RaiseEventOptions
  • TeamPlayerProp : PhotonTeamsManager , PunTeams
  • toggle : TextToggleIsOnTransition
  • ToggleGroup : TabViewManager
  • Token : ParameterCode
  • trafficStatsOn : PhotonStatsGui
  • TurnDuration : PunTurnManager
  • TurnManagerEventOffset : PunTurnManager
  • TurnManagerListener : PunTurnManager
  • TurnPropKey : TurnExtensions
  • TurnStartPropKey : TurnExtensions
  • Type : TypedLobby
  • TypedLobby : OpJoinRandomRoomParams


Photon Unity Networking 2: Class Members - Variables

- u -

  • UniqueRoomId : ChatParameterCode
  • Unsubscribe : ChatEventCode , ChatOperationCode
  • UpdateStatus : ChatOperationCode
  • UriPath : ParameterCode
  • UseNameServer : AppSettings
  • UserBlocked : ErrorCode
  • UserId : ChatParameterCode , ParameterCode , ActorProperties , ParameterCode
  • UseRpcMonoBehaviourCache : PhotonNetwork
  • UserProperties : ChatParameterCode
  • Users : ChatEventCode
  • UserSubscribed : ChatEventCode
  • UserUnsubscribed : ChatEventCode


Photon Unity Networking 2: Class Members - Variables

- v -

  • Version : ConnectAndJoinRandom
  • Visible : PhotonLagSimulationGui , FindFriendsOptions


Photon Unity Networking 2: Class Members - Variables

- w -

  • WebFlags : ChatParameterCode
  • WebRpc : OperationCode
  • WebRpcParameters : ParameterCode
  • WebRpcReturnCode : ParameterCode
  • WebRpcReturnMessage : ParameterCode
  • WindowId : PhotonLagSimulationGui , PhotonStatsGui
  • WindowRect : PhotonLagSimulationGui


Photon Unity Networking 2: Class Members - Enumerations

  • Team : PunTeams


Photon Unity Networking 2: Class Members - Properties

- a -

  • ActorNumber : Player
  • AppId : ChatAppSettings , ChatClient , LoadBalancingClient
  • AppVersion : ChatClient , PhotonNetwork , LoadBalancingClient
  • AuthGetParameters : AuthenticationValues
  • AuthPostData : AuthenticationValues
  • AuthType : AuthenticationValues
  • AuthValues : ChatClient , PhotonNetwork , LoadBalancingClient
  • AutoCleanUp : Room
  • AutomaticallySyncScene : PhotonNetwork

- b -

  • BestRegion : RegionHandler
  • BestRegionSummaryInPreferences : PhotonNetwork , ServerSettings
  • BroadcastPropertiesChangeToAll : Room
  • BroadcastPropsChangeToAll : RoomOptions

- c -

  • CanChat : ChatClient
  • ChatRegion : ChatClient
  • CleanupCacheOnLeave : RoomOptions
  • Client : ConnectionHandler , SupportLogger
  • ClientType : LoadBalancingClient
  • CloudRegion : PhotonNetwork , LoadBalancingClient
  • Cluster : Region
  • Count : PhotonStream
  • CountOfPlayers : PhotonNetwork
  • CountOfPlayersInRooms : PhotonNetwork
  • CountOfPlayersOnMaster : PhotonNetwork
  • CountOfRooms : PhotonNetwork
  • CountSendAcksOnly : ConnectionHandler
  • CrcCheckEnabled : PhotonNetwork
  • CurrentCluster : PhotonNetwork , LoadBalancingClient
  • CurrentLobby : PhotonNetwork , LoadBalancingClient
  • CurrentRoom : PhotonNetwork , LoadBalancingClient
  • CurrentServerAddress : LoadBalancingClient
  • CustomProperties : Player , RoomInfo

- d -

  • DebugOut : ChatClient
  • DeleteNullProperties : Room , RoomOptions
  • DisconnectedCause : ChatClient , LoadBalancingClient

- e -

  • ElapsedTimeInTurn : PunTurnManager
  • EmptyRoomTtl : Room
  • EnabledRegions : RegionHandler
  • EnableLobbyStatistics : PhotonNetwork
  • EnableProtocolFallback : ChatClient , LoadBalancingClient
  • ExpectedProtocol : LoadBalancingClient
  • ExpectedUsers : Room

- f -

  • FallbackThreadRunning : ConnectionHandler
  • FrontendAddress : ChatClient

- g -

  • GameServerAddress : LoadBalancingClient
  • GameVersion : PhotonNetwork

- h -

  • HttpForward : WebFlags

- i -

  • InLobby : PhotonNetwork , LoadBalancingClient
  • InRoom : PhotonNetwork , LoadBalancingClient
  • Instance : PhotonAppSettings
  • InstantiationData : PhotonView
  • IsBestRegion : AppSettings
  • IsCompletedByAll : PunTurnManager
  • IsConnected : PhotonNetwork , LoadBalancingClient
  • IsConnectedAndReady : PhotonNetwork , LoadBalancingClient
  • IsDefault : TypedLobby
  • IsDefaultNameServer : ChatAppSettings , AppSettings
  • IsDefaultPort : AppSettings
  • IsFetchingFriendList : LoadBalancingClient
  • IsFinishedByMe : PunTurnManager
  • IsInactive : Player
  • IsMasterClient : PhotonNetwork , Player
  • IsMasterServerAddress : AppSettings
  • IsMessageQueueRunning : PhotonNetwork
  • IsMine : PhotonView
  • IsOpen : Room , RoomInfo , RoomOptions
  • IsOver : PunTurnManager
  • IsPrivate : ChatChannel
  • IsReading : PhotonStream
  • IsRoomView : PhotonView
  • IsUsingNameServer : LoadBalancingClient
  • IsVisible : Room , RoomInfo , RoomOptions
  • IsWriting : PhotonStream

- k -

  • KeepAliveInBackground : PhotonNetwork

- l -

  • LastMsgId : ChatChannel
  • LevelLoadingProgress : PhotonNetwork
  • LoadBalancingClient : Room
  • LoadBalancingPeer : LoadBalancingClient
  • LocalPlayer : PhotonNetwork , LoadBalancingClient

- m -

  • MasterClient : PhotonNetwork
  • MasterClientId : Room
  • MasterServerAddress : LoadBalancingClient
  • MaxPlayers : Room , RoomInfo
  • MaxResendsBeforeDisconnect : PhotonNetwork
  • MaxSubscribers : ChannelCreationOptions , ChatChannel
  • Message : WebRpcResponse
  • MessageCount : ChatChannel

- n -

  • Name : Room , RoomInfo , WebRpcResponse
  • NameServerAddress : ChatClient , ChatPeer , LoadBalancingClient
  • NetworkClientState : PhotonNetwork
  • NetworkStatisticsEnabled : PhotonNetwork
  • NickName : PhotonNetwork , LoadBalancingClient , Player

- o -

  • OfflineMode : PhotonNetwork
  • Owner : PhotonView

- p -

  • PacketLossByCrcCheck : PhotonNetwork
  • Parameters : WebRpcResponse
  • Peer : PhotonLagSimulationGui
  • PhotonServerSettings : PhotonNetwork
  • photonView : MonoBehaviourPun
  • PhotonViewCollection : PhotonNetwork
  • PhotonViews : PhotonNetwork
  • PlayerCount : Room , RoomInfo
  • PlayerList : PhotonNetwork
  • PlayerListOthers : PhotonNetwork
  • Players : Room
  • PlayersInRoomsCount : LoadBalancingClient
  • PlayersOnMasterCount : LoadBalancingClient
  • PlayerTtl : Room
  • PrefabPool : PhotonNetwork
  • PropertiesListedInLobby : Room
  • PublishSubscribers : ChannelCreationOptions , ChatChannel
  • PublishUserId : Room , RoomOptions

- q -

  • QuickResends : PhotonNetwork

- r -

  • RemainingSecondsInTurn : PunTurnManager
  • ResentReliableCommands : PhotonNetwork
  • ResultCode : WebRpcResponse
  • RoomsCount : LoadBalancingClient
  • RootNode : CellTree

- s -

  • SendAuthCookie : WebFlags
  • SendRate : PhotonNetwork
  • SendState : WebFlags
  • SendSync : WebFlags
  • SerializationProtocol : LoadBalancingClient
  • SerializationRate : PhotonNetwork
  • Server : PhotonNetwork , LoadBalancingClient
  • ServerAddress : PhotonNetwork
  • ServerPortOverrides : PhotonNetwork
  • ServerTimestamp : PhotonNetwork
  • SocketImplementationConfig : ChatClient
  • State : ChatClient , LoadBalancingClient
  • SummaryToCache : RegionHandler
  • SuppressPlayerInfo : Room , RoomOptions
  • SuppressRoomEvents : Room , RoomOptions

- t -

  • Time : PhotonNetwork
  • Token : AuthenticationValues
  • TransportProtocol : ChatClient
  • Turn : PunTurnManager

- u -

  • UseAlternativeUdpPorts : PhotonNetwork , LoadBalancingClient
  • UseBackgroundWorkerForSending : ChatClient
  • UserId : AuthenticationValues , ChatClient , AuthenticationValues , LoadBalancingClient , Player

- v -

  • ViewID : PhotonView


Photon Unity Networking 2: Class Members - Events

  • EventReceived : LoadBalancingClient
  • OnCountdownTimerHasExpired : CountdownTimer
  • OnPlayerNumberingChanged : PlayerNumbering
  • OpResponseReceived : LoadBalancingClient
  • StateChanged : LoadBalancingClient


Photon Unity Networking 2: Member List

  • Chat
  • AuthenticationValues
AuthenticationValues Member List

This is the complete list of members for AuthenticationValues, including all inherited members.

AddAuthParameter(string key, string value) | AuthenticationValues | virtual
AuthenticationValues() | AuthenticationValues |
AuthenticationValues(string userId) | AuthenticationValues |
AuthGetParameters | AuthenticationValues |
AuthPostData | AuthenticationValues |
AuthType | AuthenticationValues |
CopyTo(AuthenticationValues copy) | AuthenticationValues |
SetAuthPostData(string stringData) | AuthenticationValues | virtual
SetAuthPostData(byte[] byteData) | AuthenticationValues | virtual
SetAuthPostData(Dictionary< string, object > dictData) | AuthenticationValues | virtual
Token | AuthenticationValues |
ToString() | AuthenticationValues |
UserId | AuthenticationValues |


Photon Unity Networking 2: Member List

  • Chat
  • ChannelCreationOptions
ChannelCreationOptions Member List

This is the complete list of members for ChannelCreationOptions, including all inherited members.

Default | ChannelCreationOptions | static
MaxSubscribers | ChannelCreationOptions |
PublishSubscribers | ChannelCreationOptions |


Photon Unity Networking 2: Member List

  • Chat
  • ChannelWellKnownProperties
ChannelWellKnownProperties Member List

This is the complete list of members for ChannelWellKnownProperties, including all inherited members.

MaxSubscribers (defined in ChannelWellKnownProperties) | ChannelWellKnownProperties | static
PublishSubscribers (defined in ChannelWellKnownProperties) | ChannelWellKnownProperties | static


Photon Unity Networking 2: Member List

  • Chat
  • ChatAppSettings
ChatAppSettings Member List

This is the complete list of members for ChatAppSettings, including all inherited members.

AppId | ChatAppSettings
AppIdChat | ChatAppSettings
AppVersion | ChatAppSettings
EnableProtocolFallback | ChatAppSettings
FixedRegion | ChatAppSettings
IsDefaultNameServer | ChatAppSettings
NetworkLogging | ChatAppSettings
Port | ChatAppSettings
Protocol | ChatAppSettings
Server | ChatAppSettings


Photon Unity Networking 2: Member List

  • Chat
  • ChatChannel
ChatChannel Member List

This is the complete list of members for ChatChannel, including all inherited members.

Add(string sender, object message, int msgId) | ChatChannel
Add(string[] senders, object[] messages, int lastMsgId) | ChatChannel
ChannelID | ChatChannel
ChatChannel(string name) | ChatChannel
ClearMessages() | ChatChannel
IsPrivate | ChatChannel
LastMsgId | ChatChannel
MaxSubscribers | ChatChannel
MessageCount | ChatChannel
MessageLimit | ChatChannel
Messages | ChatChannel
Name | ChatChannel
PublishSubscribers | ChatChannel
Senders | ChatChannel
Subscribers | ChatChannel
ToStringMessages() | ChatChannel
TruncateMessages() | ChatChannel


Photon Unity Networking 2: Member List

  • Chat
  • ChatClient
ChatClient Member List

This is the complete list of members for ChatClient, including all inherited members.

AddFriends(string[] friends) | ChatClient |
AppId | ChatClient |
AppVersion | ChatClient |
AuthValues | ChatClient |
CanChat | ChatClient |
CanChatInChannel(string channelName) | ChatClient |
ChatClient(IChatClientListener listener, ConnectionProtocol protocol=ConnectionProtocol.Udp) | ChatClient |
chatPeer | ChatClient |
ChatRegion | ChatClient |
Connect(string appId, string appVersion, AuthenticationValues authValues) | ChatClient |
ConnectAndSetStatus(string appId, string appVersion, AuthenticationValues authValues, int status=ChatUserStatus.Online, object message=null) | ChatClient |
ConnectUsingSettings(ChatAppSettings appSettings) (defined in ChatClient) | ChatClient |
DebugOut | ChatClient |
DefaultMaxSubscribers | ChatClient | static
Disconnect(ChatDisconnectCause cause=ChatDisconnectCause.DisconnectByClientLogic) | ChatClient |
DisconnectedCause | ChatClient |
EnableProtocolFallback | ChatClient |
FrontendAddress | ChatClient |
GetPrivateChannelNameByUser(string userName) | ChatClient |
MessageLimit | ChatClient |
NameServerAddress | ChatClient |
PrivateChannels | ChatClient |
PrivateChatHistoryLength | ChatClient |
PublicChannels | ChatClient |
PublishMessage(string channelName, object message, bool forwardAsWebhook=false) | ChatClient |
RemoveFriends(string[] friends) | ChatClient |
SendAcksOnly() | ChatClient |
SendPrivateMessage(string target, object message, bool forwardAsWebhook=false) | ChatClient |
SendPrivateMessage(string target, object message, bool encrypt, bool forwardAsWebhook) | ChatClient |
Service() | ChatClient |
SetOnlineStatus(int status) | ChatClient |
SetOnlineStatus(int status, object message) | ChatClient |
SocketImplementationConfig | ChatClient |
State | ChatClient |
StopThread() | ChatClient |
Subscribe(string[] channels) | ChatClient |
Subscribe(string[] channels, int[] lastMsgIds) | ChatClient |
Subscribe(string[] channels, int messagesFromHistory) | ChatClient |
Subscribe(string channel, int lastMsgId=0, int messagesFromHistory=-1, ChannelCreationOptions creationOptions=null) | ChatClient |
TransportProtocol | ChatClient |
TryGetChannel(string channelName, bool isPrivate, out ChatChannel channel) | ChatClient |
TryGetChannel(string channelName, out ChatChannel channel) | ChatClient |
TryGetPrivateChannelByUser(string userId, out ChatChannel channel) | ChatClient |
Unsubscribe(string[] channels) | ChatClient |
UseBackgroundWorkerForSending | ChatClient |
UserId | ChatClient |


Photon Unity Networking 2: Member List

  • Chat
  • ChatEventCode
ChatEventCode Member List

This is the complete list of members for ChatEventCode, including all inherited members.

ChatMessages | ChatEventCode | static
ErrorInfo | ChatEventCode | static
FriendsList | ChatEventCode | static
PrivateMessage | ChatEventCode | static
PropertiesChanged | ChatEventCode | static
StatusUpdate | ChatEventCode | static
Subscribe | ChatEventCode | static
Unsubscribe | ChatEventCode | static
Users | ChatEventCode | static
UserSubscribed | ChatEventCode | static
UserUnsubscribed | ChatEventCode | static


Photon Unity Networking 2: Member List

  • Chat
  • ChatOperationCode
ChatOperationCode Member List

This is the complete list of members for ChatOperationCode, including all inherited members.

AddFriends | ChatOperationCode | static
Authenticate | ChatOperationCode | static
ChannelHistory | ChatOperationCode | static
Publish | ChatOperationCode | static
RemoveFriends | ChatOperationCode | static
SendPrivate | ChatOperationCode | static
SetProperties | ChatOperationCode | static
Subscribe | ChatOperationCode | static
Unsubscribe | ChatOperationCode | static
UpdateStatus | ChatOperationCode | static


Photon Unity Networking 2: Member List

  • Chat
  • ChatParameterCode
ChatParameterCode Member List

This is the complete list of members for ChatParameterCode, including all inherited members.

Broadcast | ChatParameterCode | static
Channel | ChatParameterCode | static
Channels | ChatParameterCode | static
ChannelSubscribers | ChatParameterCode | static
ChannelUserCount | ChatParameterCode | static
DebugData | ChatParameterCode | static
DebugMessage (defined in ChatParameterCode) | ChatParameterCode | static
ExpectedValues | ChatParameterCode | static
Friends | ChatParameterCode | static
HistoryLength | ChatParameterCode | static
Message | ChatParameterCode | static
Messages | ChatParameterCode | static
MsgId | ChatParameterCode | static
MsgIds | ChatParameterCode | static
Properties | ChatParameterCode | static
Secret | ChatParameterCode | static
Sender | ChatParameterCode | static
Senders | ChatParameterCode | static
SkipMessage | ChatParameterCode | static
Status | ChatParameterCode | static
SubscribeResults | ChatParameterCode | static
UniqueRoomId | ChatParameterCode | static
UserId | ChatParameterCode | static
UserProperties | ChatParameterCode | static
WebFlags | ChatParameterCode | static


Photon Unity Networking 2: Member List

  • Chat
  • ChatPeer
ChatPeer Member List

This is the complete list of members for ChatPeer, including all inherited members.

AuthenticateOnNameServer(string appId, string appVersion, string region, AuthenticationValues authValues) | ChatPeer
ChatPeer(IPhotonPeerListener listener, ConnectionProtocol protocol) | ChatPeer
Connect() | ChatPeer
NameServerAddress | ChatPeer
NameServerHost | ChatPeer
NameServerPortOverride | ChatPeer


Photon Unity Networking 2: Member List

  • Chat
  • ChatUserStatus
ChatUserStatus Member List

This is the complete list of members for ChatUserStatus, including all inherited members.

Away | ChatUserStatus | static
DND | ChatUserStatus | static
Invisible | ChatUserStatus | static
LFG | ChatUserStatus | static
Offline | ChatUserStatus | static
Online | ChatUserStatus | static
Playing | ChatUserStatus | static


Photon Unity Networking 2: Member List

  • Chat
  • ErrorCode
ErrorCode Member List

This is the complete list of members for ErrorCode, including all inherited members.

AuthenticationTicketExpired | ErrorCode | static
CustomAuthenticationFailed | ErrorCode | static
GameClosed | ErrorCode | static
GameDoesNotExist | ErrorCode | static
GameFull | ErrorCode | static
GameIdAlreadyExists | ErrorCode | static
InternalServerError | ErrorCode | static
InvalidAuthentication | ErrorCode | static
InvalidOperationCode | ErrorCode | static
InvalidRegion | ErrorCode | static
MaxCcuReached | ErrorCode | static
NoRandomMatchFound | ErrorCode | static
Ok | ErrorCode | static
OperationNotAllowedInCurrentState | ErrorCode | static
ServerFull | ErrorCode | static
UserBlocked | ErrorCode | static


Photon Unity Networking 2: Member List

  • Chat
  • ParameterCode
ParameterCode Member List

This is the complete list of members for ParameterCode, including all inherited members.

Address | ParameterCode | static
ApplicationId | ParameterCode | static
AppVersion | ParameterCode | static
ClientAuthenticationData | ParameterCode | static
ClientAuthenticationParams | ParameterCode | static
ClientAuthenticationType | ParameterCode | static
Region | ParameterCode | static
Secret | ParameterCode | static
UserId | ParameterCode | static


Photon Unity Networking 2: Member List

  • Pun
  • DefaultPool
DefaultPool Member List

This is the complete list of members for DefaultPool, including all inherited members.

Destroy(GameObject gameObject) | DefaultPool
Instantiate(string prefabId, Vector3 position, Quaternion rotation) | DefaultPool
ResourceCache | DefaultPool


Photon Unity Networking 2: Member List

  • Pun
  • MonoBehaviourPun
MonoBehaviourPun Member List

This is the complete list of members for MonoBehaviourPun, including all inherited members.

photonView MonoBehaviourPun


Photon Unity Networking 2: Member List

  • Pun
  • MonoBehaviourPunCallbacks
MonoBehaviourPunCallbacks Member List

This is the complete list of members for MonoBehaviourPunCallbacks, including all inherited members.

OnConnected() | MonoBehaviourPunCallbacks | virtual
OnConnectedToMaster() | MonoBehaviourPunCallbacks | virtual
OnCreatedRoom() | MonoBehaviourPunCallbacks | virtual
OnCreateRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationFailed(string debugMessage) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationResponse(Dictionary< string, object > data) | MonoBehaviourPunCallbacks | virtual
OnDisable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnDisconnected(DisconnectCause cause) | MonoBehaviourPunCallbacks | virtual
OnEnable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnErrorInfo(ErrorInfo errorInfo) | MonoBehaviourPunCallbacks | virtual
OnFriendListUpdate(List< FriendInfo > friendList) | MonoBehaviourPunCallbacks | virtual
OnJoinedLobby() | MonoBehaviourPunCallbacks | virtual
OnJoinedRoom() | MonoBehaviourPunCallbacks | virtual
OnJoinRandomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnJoinRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnLeftLobby() | MonoBehaviourPunCallbacks | virtual
OnLeftRoom() | MonoBehaviourPunCallbacks | virtual
OnLobbyStatisticsUpdate(List< TypedLobbyInfo > lobbyStatistics) | MonoBehaviourPunCallbacks | virtual
OnMasterClientSwitched(Player newMasterClient) | MonoBehaviourPunCallbacks | virtual
OnPlayerEnteredRoom(Player newPlayer) | MonoBehaviourPunCallbacks | virtual
OnPlayerLeftRoom(Player otherPlayer) | MonoBehaviourPunCallbacks | virtual
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | MonoBehaviourPunCallbacks | virtual
OnRegionListReceived(RegionHandler regionHandler) | MonoBehaviourPunCallbacks | virtual
OnRoomListUpdate(List< RoomInfo > roomList) | MonoBehaviourPunCallbacks | virtual
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | MonoBehaviourPunCallbacks | virtual
OnWebRpcResponse(OperationResponse response) | MonoBehaviourPunCallbacks | virtual
photonView | MonoBehaviourPun |


Photon Unity Networking 2: Member List

  • Pun
  • NestedComponentUtilities
NestedComponentUtilities Member List

This is the complete list of members for NestedComponentUtilities, including all inherited members.

EnsureRootComponentExists< T, NestedT >(this Transform transform) (defined in NestedComponentUtilities) | NestedComponentUtilities | static
GetNestedComponentInChildren< T, NestedT >(this Transform t, bool includeInactive) (defined in NestedComponentUtilities) | NestedComponentUtilities | static
GetNestedComponentInParent< T, NestedT >(this Transform t) | NestedComponentUtilities | static
GetNestedComponentInParents< T, NestedT >(this Transform t) | NestedComponentUtilities | static
GetNestedComponentsInChildren< T >(this Transform t, List< T > list, bool includeInactive=true, params System.Type[] stopOn) | NestedComponentUtilities | static
GetNestedComponentsInChildren< T, NestedT >(this Transform t, List< T > list, bool includeInactive=true) | NestedComponentUtilities | static
GetNestedComponentsInChildren< T, SearchT, NestedT >(this Transform t, bool includeInactive, List< T > list) | NestedComponentUtilities | static
GetNestedComponentsInParents< T >(this Transform t, List< T > list) | NestedComponentUtilities | static
GetNestedComponentsInParents< T, NestedT >(this Transform t, List< T > list) | NestedComponentUtilities | static
GetParentComponent< T >(this Transform t) | NestedComponentUtilities | static
searchLists (defined in NestedComponentUtilities) | NestedComponentUtilities | static


Photon Unity Networking 2: Member List

  • Pun
  • PhotonAnimatorView
PhotonAnimatorView Member List

This is the complete list of members for PhotonAnimatorView, including all inherited members.

CacheDiscreteTriggers() | PhotonAnimatorView
DoesLayerSynchronizeTypeExist(int layerIndex) | PhotonAnimatorView
DoesParameterSynchronizeTypeExist(string name) | PhotonAnimatorView
GetLayerSynchronizeType(int layerIndex) | PhotonAnimatorView
GetParameterSynchronizeType(string name) | PhotonAnimatorView
GetSynchronizedLayers() | PhotonAnimatorView
GetSynchronizedParameters() | PhotonAnimatorView
OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) | PhotonAnimatorView
ParameterType enum name (defined in PhotonAnimatorView) | PhotonAnimatorView
photonView | MonoBehaviourPun
SetLayerSynchronized(int layerIndex, SynchronizeType synchronizeType) | PhotonAnimatorView
SetParameterSynchronized(string name, ParameterType type, SynchronizeType synchronizeType) | PhotonAnimatorView
SynchronizeType enum name (defined in PhotonAnimatorView) | PhotonAnimatorView


Photon Unity Networking 2: Member List

  • Pun
  • PhotonAnimatorView
  • SynchronizedLayer
PhotonAnimatorView.SynchronizedLayer Member List

This is the complete list of members for PhotonAnimatorView.SynchronizedLayer, including all inherited members.

LayerIndex (defined in PhotonAnimatorView.SynchronizedLayer) | PhotonAnimatorView.SynchronizedLayer
SynchronizeType (defined in PhotonAnimatorView.SynchronizedLayer) | PhotonAnimatorView.SynchronizedLayer


Photon Unity Networking 2: Member List

  • Pun
  • PhotonAnimatorView
  • SynchronizedParameter
PhotonAnimatorView.SynchronizedParameter Member List

This is the complete list of members for PhotonAnimatorView.SynchronizedParameter, including all inherited members.

Name (defined in PhotonAnimatorView.SynchronizedParameter) | PhotonAnimatorView.SynchronizedParameter
SynchronizeType (defined in PhotonAnimatorView.SynchronizedParameter) | PhotonAnimatorView.SynchronizedParameter
Type (defined in PhotonAnimatorView.SynchronizedParameter) | PhotonAnimatorView.SynchronizedParameter


Photon Unity Networking 2: Member List

  • Pun
  • PhotonHandler
PhotonHandler Member List

This is the complete list of members for PhotonHandler, including all inherited members.

ApplyDontDestroyOnLoad | ConnectionHandler |
AppQuits | ConnectionHandler | static
Awake() (defined in PhotonHandler) | PhotonHandler | protected
Client | ConnectionHandler |
CountSendAcksOnly | ConnectionHandler |
DisconnectAfterKeepAlive | ConnectionHandler |
Dispatch() | PhotonHandler | protected
FallbackThreadRunning | ConnectionHandler |
FixedUpdate() | PhotonHandler | protected
KeepAliveInBackground | ConnectionHandler |
LateUpdate() | PhotonHandler | protected
MaxDatagrams | PhotonHandler | static
OnCreatedRoom() | PhotonHandler |
OnCreateRoomFailed(short returnCode, string message) | PhotonHandler |
OnDisable() (defined in PhotonHandler) | PhotonHandler | protected
OnEnable() (defined in PhotonHandler) | PhotonHandler | protectedvirtual
OnFriendListUpdate(System.Collections.Generic.List< FriendInfo > friendList) (defined in PhotonHandler) | PhotonHandler |
Photon::Realtime::IMatchmakingCallbacks.OnFriendListUpdate(List< FriendInfo > friendList) | IMatchmakingCallbacks |
OnJoinedRoom() | PhotonHandler |
OnJoinRandomFailed(short returnCode, string message) | PhotonHandler |
OnJoinRoomFailed(short returnCode, string message) | PhotonHandler |
OnLeftRoom() | PhotonHandler |
OnMasterClientSwitched(Player newMasterClient) | PhotonHandler |
OnPlayerEnteredRoom(Player newPlayer) | PhotonHandler |
OnPlayerLeftRoom(Player otherPlayer) | PhotonHandler |
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | PhotonHandler |
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | PhotonHandler |
RealtimeFallbackThread() | ConnectionHandler |
reusableIntList (defined in PhotonHandler) | PhotonHandler | protected
SendAsap | PhotonHandler | static
Start() (defined in PhotonHandler) | PhotonHandler | protected
StartFallbackSendAckThread() (defined in ConnectionHandler) | ConnectionHandler |
StopFallbackSendAckThread() (defined in ConnectionHandler) | ConnectionHandler |


Photon Unity Networking 2: Member List

  • Pun
  • PhotonNetwork
PhotonNetwork Member List

This is the complete list of members for PhotonNetwork, including all inherited members.

AddCallbackTarget(object target) | PhotonNetwork | static
AllocateRoomViewID(PhotonView view) | PhotonNetwork | static
AllocateSceneViewID(PhotonView view) (defined in PhotonNetwork) | PhotonNetwork | static
AllocateViewID(PhotonView view) | PhotonNetwork | static
AllocateViewID(bool roomObject) | PhotonNetwork | static
AllocateViewID(int ownerId) | PhotonNetwork | static
AppVersion | PhotonNetwork | static
AuthValues | PhotonNetwork | static
AutomaticallySyncScene | PhotonNetwork | static
BestRegionSummaryInPreferences | PhotonNetwork | static
CleanRpcBufferIfMine(PhotonView view) (defined in PhotonNetwork) | PhotonNetwork | static
CloseConnection(Player kickPlayer) | PhotonNetwork | static
CloudRegion | PhotonNetwork | static
ConnectMethod | PhotonNetwork | static
ConnectToBestCloudServer() | PhotonNetwork | static
ConnectToMaster(string masterServerAddress, int port, string appID) | PhotonNetwork | static
ConnectToRegion(string region) | PhotonNetwork | static
ConnectUsingSettings() | PhotonNetwork | static
ConnectUsingSettings(AppSettings appSettings, bool startInOfflineMode=false) (defined in PhotonNetwork) | PhotonNetwork | static
CountOfPlayers | PhotonNetwork | static
CountOfPlayersInRooms | PhotonNetwork | static
CountOfPlayersOnMaster | PhotonNetwork | static
CountOfRooms | PhotonNetwork | static
CrcCheckEnabled | PhotonNetwork | static
CreateRoom(string roomName, RoomOptions roomOptions=null, TypedLobby typedLobby=null, string[] expectedUsers=null) | PhotonNetwork | static
CurrentCluster | PhotonNetwork | static
CurrentLobby | PhotonNetwork | static
CurrentRoom | PhotonNetwork | static
Destroy(PhotonView targetView) | PhotonNetwork | static
Destroy(GameObject targetGo) | PhotonNetwork | static
DestroyAll() | PhotonNetwork | static
DestroyAll(bool localOnly) (defined in PhotonNetwork) | PhotonNetwork | static
DestroyPlayerObjects(Player targetPlayer) | PhotonNetwork | static
DestroyPlayerObjects(int targetPlayerId) | PhotonNetwork | static
DestroyPlayerObjects(int playerId, bool localOnly) | PhotonNetwork | static
Disconnect() | PhotonNetwork | static
EnableCloseConnection | PhotonNetwork | static
EnableLobbyStatistics | PhotonNetwork | static
FetchServerTimestamp() | PhotonNetwork | static
FindFriends(string[] friendsToFind) | PhotonNetwork | static
FindGameObjectsWithComponent(Type type) | PhotonNetwork | static
GameVersion | PhotonNetwork | static
GetCustomRoomList(TypedLobby typedLobby, string sqlLobbyFilter) | PhotonNetwork | static
GetPhotonView(int viewID) (defined in PhotonNetwork) | PhotonNetwork | static
GetPing() | PhotonNetwork | static
InLobby | PhotonNetwork | static
InRoom | PhotonNetwork | static
Instantiate(string prefabName, Vector3 position, Quaternion rotation, byte group=0, object[] data=null) (defined in PhotonNetwork) | PhotonNetwork | static
InstantiateRoomObject(string prefabName, Vector3 position, Quaternion rotation, byte group=0, object[] data=null) (defined in PhotonNetwork) | PhotonNetwork | static
InstantiateSceneObject(string prefabName, Vector3 position, Quaternion rotation, byte group=0, object[] data=null) (defined in PhotonNetwork) | PhotonNetwork | static
IsConnected | PhotonNetwork | static
IsConnectedAndReady | PhotonNetwork | static
IsMasterClient | PhotonNetwork | static
IsMessageQueueRunning | PhotonNetwork | static
JoinLobby() | PhotonNetwork | static
JoinLobby(TypedLobby typedLobby) | PhotonNetwork | static
JoinOrCreateRoom(string roomName, RoomOptions roomOptions, TypedLobby typedLobby, string[] expectedUsers=null) | PhotonNetwork | static
JoinRandomOrCreateRoom(Hashtable expectedCustomRoomProperties=null, byte expectedMaxPlayers=0, MatchmakingMode matchingType=MatchmakingMode.FillRoom, TypedLobby typedLobby=null, string sqlLobbyFilter=null, string roomName=null, RoomOptions roomOptions=null, string[] expectedUsers=null) | PhotonNetwork | static
JoinRandomRoom() | PhotonNetwork | static
JoinRandomRoom(Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers) | PhotonNetwork | static
JoinRandomRoom(Hashtable expectedCustomRoomProperties, byte expectedMaxPlayers, MatchmakingMode matchingType, TypedLobby typedLobby, string sqlLobbyFilter, string[] expectedUsers=null) | PhotonNetwork | static
JoinRoom(string roomName, string[] expectedUsers=null) | PhotonNetwork | static
KeepAliveInBackground | PhotonNetwork | static
LeaveLobby() | PhotonNetwork | static
LeaveRoom(bool becomeInactive=true) | PhotonNetwork | static
LevelLoadingProgress | PhotonNetwork | static
LoadLevel(int levelNumber) | PhotonNetwork | static
LoadLevel(string levelName) | PhotonNetwork | static
LoadOrCreateSettings(bool reload=false) (defined in PhotonNetwork) | PhotonNetwork | static
LocalCleanPhotonView(PhotonView view) (defined in PhotonNetwork) | PhotonNetwork | static
LocalPlayer | PhotonNetwork | static
LogLevel | PhotonNetwork | static
MasterClient | PhotonNetwork | static
MAX_VIEW_IDS | PhotonNetwork | static
MaxResendsBeforeDisconnect | PhotonNetwork | static
MinimalTimeScaleToDispatchInFixedUpdate | PhotonNetwork | static
NetworkClientState | PhotonNetwork | static
NetworkingClient | PhotonNetwork | static
NetworkStatisticsEnabled | PhotonNetwork | static
NetworkStatisticsReset() | PhotonNetwork | static
NetworkStatisticsToString() | PhotonNetwork | static
NickName | PhotonNetwork | static
ObjectsInOneUpdate | PhotonNetwork | static
OfflineMode | PhotonNetwork | static
OpCleanActorRpcBuffer(int actorNumber) | PhotonNetwork | static
OpCleanRpcBuffer(PhotonView view) | PhotonNetwork | static
OpRemoveCompleteCache() (defined in PhotonNetwork) | PhotonNetwork | static
OpRemoveCompleteCacheOfPlayer(int actorNumber) | PhotonNetwork | static
PacketLossByCrcCheck | PhotonNetwork | static
PhotonServerSettings | PhotonNetwork | static
PhotonViewCollection | PhotonNetwork | static
PhotonViews | PhotonNetwork | static
PlayerList | PhotonNetwork | static
PlayerListOthers | PhotonNetwork | static
PrecisionForFloatSynchronization | PhotonNetwork | static
PrecisionForQuaternionSynchronization | PhotonNetwork | static
PrecisionForVectorSynchronization | PhotonNetwork | static
PrefabPool | PhotonNetwork | static
PunVersion | PhotonNetwork | static
QuickResends | PhotonNetwork | static
RaiseEvent(byte eventCode, object eventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions) | PhotonNetwork | static
Reconnect() | PhotonNetwork | static
ReconnectAndRejoin() | PhotonNetwork | static
RegisterPhotonView(PhotonView netView) (defined in PhotonNetwork) | PhotonNetwork | static
RejoinRoom(string roomName) | PhotonNetwork | static
RemoveBufferedRPCs(int viewId=0, string methodName=null, int[] callersActorNumbers=null) | PhotonNetwork | static
RemoveCallbackTarget(object target) | PhotonNetwork | static
RemovePlayerCustomProperties(string[] customPropertiesToDelete) | PhotonNetwork | static
RemoveRPCs(Player targetPlayer) | PhotonNetwork | static
RemoveRPCs(PhotonView targetPhotonView) | PhotonNetwork | static
RemoveRPCsInGroup(int group) | PhotonNetwork | static
ResentReliableCommands | PhotonNetwork | static
RunRpcCoroutines | PhotonNetwork | static
SendAllOutgoingCommands() | PhotonNetwork | static
SendRate | PhotonNetwork | static
SerializationRate | PhotonNetwork | static
Server | PhotonNetwork | static
ServerAddress | PhotonNetwork | static
ServerPortOverrides | PhotonNetwork | static
ServerSettingsFileName | PhotonNetwork | static
ServerTimestamp | PhotonNetwork | static
SetInterestGroups(byte group, bool enabled) | PhotonNetwork | static
SetInterestGroups(byte[] disableGroups, byte[] enableGroups) | PhotonNetwork | static
SetLevelPrefix(byte prefix) | PhotonNetwork | static
SetMasterClient(Player masterClientPlayer) | PhotonNetwork | static
SetPlayerCustomProperties(Hashtable customProperties) | PhotonNetwork | static
SetSendingEnabled(byte group, bool enabled) | PhotonNetwork | static
SetSendingEnabled(byte[] disableGroups, byte[] enableGroups) | PhotonNetwork | static
SyncCompressed (defined in PhotonNetwork) | PhotonNetwork | static
SyncFirstValue (defined in PhotonNetwork) | PhotonNetwork | static
SyncNullValues (defined in PhotonNetwork) | PhotonNetwork | static
SyncViewId (defined in PhotonNetwork) | PhotonNetwork | static
Time | PhotonNetwork | static
UseAlternativeUdpPorts | PhotonNetwork | static
UseRpcMonoBehaviourCache | PhotonNetwork | static
ViewCount (defined in PhotonNetwork) | PhotonNetwork | static
WebRpc(string name, object parameters, bool sendAuthCookie=false) | PhotonNetwork | static


Photon Unity Networking 2: Member List

  • Pun
  • PhotonRigidbody2DView
PhotonRigidbody2DView Member List

This is the complete list of members for PhotonRigidbody2DView, including all inherited members.

Awake() (defined in PhotonRigidbody2DView) | PhotonRigidbody2DView
FixedUpdate() (defined in PhotonRigidbody2DView) | PhotonRigidbody2DView
m_SynchronizeAngularVelocity (defined in PhotonRigidbody2DView) | PhotonRigidbody2DView
m_SynchronizeVelocity (defined in PhotonRigidbody2DView) | PhotonRigidbody2DView
m_TeleportEnabled (defined in PhotonRigidbody2DView) | PhotonRigidbody2DView
m_TeleportIfDistanceGreaterThan (defined in PhotonRigidbody2DView) | PhotonRigidbody2DView
OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) | PhotonRigidbody2DView
photonView | MonoBehaviourPun


Photon Unity Networking 2: Member List

  • Pun
  • PhotonRigidbodyView
PhotonRigidbodyView Member List

This is the complete list of members for PhotonRigidbodyView, including all inherited members.

Awake() (defined in PhotonRigidbodyView) | PhotonRigidbodyView
FixedUpdate() (defined in PhotonRigidbodyView) | PhotonRigidbodyView
m_SynchronizeAngularVelocity (defined in PhotonRigidbodyView) | PhotonRigidbodyView
m_SynchronizeVelocity (defined in PhotonRigidbodyView) | PhotonRigidbodyView
m_TeleportEnabled (defined in PhotonRigidbodyView) | PhotonRigidbodyView
m_TeleportIfDistanceGreaterThan (defined in PhotonRigidbodyView) | PhotonRigidbodyView
OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) | PhotonRigidbodyView
photonView | MonoBehaviourPun


Photon Unity Networking 2: Member List

  • Pun
  • PhotonStream
PhotonStream Member List

This is the complete list of members for PhotonStream, including all inherited members.

CopyToListAndClear(List< object > target) (defined in PhotonStream) | PhotonStream
Count | PhotonStream
IsReading | PhotonStream
IsWriting | PhotonStream
PeekNext() | PhotonStream
PhotonStream(bool write, object[] incomingData) | PhotonStream
ReceiveNext() | PhotonStream
SendNext(object obj) | PhotonStream
Serialize(ref bool myBool) | PhotonStream
Serialize(ref int myInt) | PhotonStream
Serialize(ref string value) | PhotonStream
Serialize(ref char value) | PhotonStream
Serialize(ref short value) | PhotonStream
Serialize(ref float obj) | PhotonStream
Serialize(ref Player obj) | PhotonStream
Serialize(ref Vector3 obj) | PhotonStream
Serialize(ref Vector2 obj) | PhotonStream
Serialize(ref Quaternion obj) | PhotonStream
SetReadStream(object[] incomingData, int pos=0) (defined in PhotonStream) | PhotonStream
ToArray() | PhotonStream


Photon Unity Networking 2: Member List

  • Pun
  • PhotonStreamQueue
PhotonStreamQueue Member List

This is the complete list of members for PhotonStreamQueue, including all inherited members.

Deserialize(PhotonStream stream) | PhotonStreamQueue
HasQueuedObjects() | PhotonStreamQueue
PhotonStreamQueue(int sampleRate) | PhotonStreamQueue
ReceiveNext() | PhotonStreamQueue
Reset() | PhotonStreamQueue
SendNext(object obj) | PhotonStreamQueue
Serialize(PhotonStream stream) | PhotonStreamQueue


Photon Unity Networking 2: Member List

  • Pun
  • PhotonTransformView
PhotonTransformView Member List

This is the complete list of members for PhotonTransformView, including all inherited members.

Awake() (defined in PhotonTransformView) | PhotonTransformView
m_SynchronizePosition (defined in PhotonTransformView) | PhotonTransformView
m_SynchronizeRotation (defined in PhotonTransformView) | PhotonTransformView
m_SynchronizeScale (defined in PhotonTransformView) | PhotonTransformView
m_UseLocal (defined in PhotonTransformView) | PhotonTransformView
OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) | PhotonTransformView
photonView | MonoBehaviourPun
Update() (defined in PhotonTransformView) | PhotonTransformView


Photon Unity Networking 2: Member List

  • Pun
  • PhotonTransformViewClassic
PhotonTransformViewClassic Member List

This is the complete list of members for PhotonTransformViewClassic, including all inherited members.

m_PositionModel (defined in PhotonTransformViewClassic) | PhotonTransformViewClassic
m_RotationModel (defined in PhotonTransformViewClassic) | PhotonTransformViewClassic
m_ScaleModel (defined in PhotonTransformViewClassic) | PhotonTransformViewClassic
OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) | PhotonTransformViewClassic
photonView | MonoBehaviourPun
SetSynchronizedValues(Vector3 speed, float turnSpeed) | PhotonTransformViewClassic


Photon Unity Networking 2: Member List

  • Pun
  • PhotonTransformViewPositionControl
PhotonTransformViewPositionControl Member List

This is the complete list of members for PhotonTransformViewPositionControl, including all inherited members.

GetExtrapolatedPositionOffset() | PhotonTransformViewPositionControl
GetNetworkPosition() | PhotonTransformViewPositionControl
OnPhotonSerializeView(Vector3 currentPosition, PhotonStream stream, PhotonMessageInfo info) (defined in PhotonTransformViewPositionControl) | PhotonTransformViewPositionControl
PhotonTransformViewPositionControl(PhotonTransformViewPositionModel model) (defined in PhotonTransformViewPositionControl) | PhotonTransformViewPositionControl
SetSynchronizedValues(Vector3 speed, float turnSpeed) | PhotonTransformViewPositionControl
UpdatePosition(Vector3 currentPosition) | PhotonTransformViewPositionControl


Photon Unity Networking 2: Member List

  • Pun
  • PhotonTransformViewPositionModel
PhotonTransformViewPositionModel Member List

This is the complete list of members for PhotonTransformViewPositionModel, including all inherited members.

ExtrapolateIncludingRoundTripTime (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
ExtrapolateNumberOfStoredPositions (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
ExtrapolateOption (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
ExtrapolateOptions enum name (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
ExtrapolateSpeed (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
InterpolateLerpSpeed (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
InterpolateMoveTowardsSpeed (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
InterpolateOption (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
InterpolateOptions enum name (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
SynchronizeEnabled (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
TeleportEnabled (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel
TeleportIfDistanceGreaterThan (defined in PhotonTransformViewPositionModel) | PhotonTransformViewPositionModel


Photon Unity Networking 2: Member List

  • Pun
  • PhotonTransformViewRotationControl
PhotonTransformViewRotationControl Member List

This is the complete list of members for PhotonTransformViewRotationControl, including all inherited members.

GetNetworkRotation() | PhotonTransformViewRotationControl
GetRotation(Quaternion currentRotation) (defined in PhotonTransformViewRotationControl) | PhotonTransformViewRotationControl
OnPhotonSerializeView(Quaternion currentRotation, PhotonStream stream, PhotonMessageInfo info) (defined in PhotonTransformViewRotationControl) | PhotonTransformViewRotationControl
PhotonTransformViewRotationControl(PhotonTransformViewRotationModel model) (defined in PhotonTransformViewRotationControl) | PhotonTransformViewRotationControl


Photon Unity Networking 2: Member List

  • Pun
  • PhotonTransformViewRotationModel
PhotonTransformViewRotationModel Member List

This is the complete list of members for PhotonTransformViewRotationModel, including all inherited members.

InterpolateLerpSpeed (defined in PhotonTransformViewRotationModel) | PhotonTransformViewRotationModel
InterpolateOption (defined in PhotonTransformViewRotationModel) | PhotonTransformViewRotationModel
InterpolateOptions enum name (defined in PhotonTransformViewRotationModel) | PhotonTransformViewRotationModel
InterpolateRotateTowardsSpeed (defined in PhotonTransformViewRotationModel) | PhotonTransformViewRotationModel
SynchronizeEnabled (defined in PhotonTransformViewRotationModel) | PhotonTransformViewRotationModel


Photon Unity Networking 2: Member List

  • Pun
  • PhotonTransformViewScaleControl
PhotonTransformViewScaleControl Member List

This is the complete list of members for PhotonTransformViewScaleControl, including all inherited members.

GetNetworkScale() | PhotonTransformViewScaleControl
GetScale(Vector3 currentScale) (defined in PhotonTransformViewScaleControl) | PhotonTransformViewScaleControl
OnPhotonSerializeView(Vector3 currentScale, PhotonStream stream, PhotonMessageInfo info) (defined in PhotonTransformViewScaleControl) | PhotonTransformViewScaleControl
PhotonTransformViewScaleControl(PhotonTransformViewScaleModel model) (defined in PhotonTransformViewScaleControl) | PhotonTransformViewScaleControl


Photon Unity Networking 2: Member List

  • Pun
  • PhotonTransformViewScaleModel
PhotonTransformViewScaleModel Member List

This is the complete list of members for PhotonTransformViewScaleModel, including all inherited members.

InterpolateLerpSpeed (defined in PhotonTransformViewScaleModel) | PhotonTransformViewScaleModel
InterpolateMoveTowardsSpeed (defined in PhotonTransformViewScaleModel) | PhotonTransformViewScaleModel
InterpolateOption (defined in PhotonTransformViewScaleModel) | PhotonTransformViewScaleModel
InterpolateOptions enum name (defined in PhotonTransformViewScaleModel) | PhotonTransformViewScaleModel
SynchronizeEnabled (defined in PhotonTransformViewScaleModel) | PhotonTransformViewScaleModel


Photon Unity Networking 2: Member List

  • Pun
  • PhotonView
PhotonView Member List

This is the complete list of members for PhotonView, including all inherited members.

AddCallback< T >(IPhotonViewCallback obj) | PhotonView |
AddCallbackTarget(IPhotonViewCallback obj) | PhotonView |
AmController (defined in PhotonView) | PhotonView |
AmOwner (defined in PhotonView) | PhotonView |
Controller (defined in PhotonView) | PhotonView |
ControllerActorNr (defined in PhotonView) | PhotonView |
CreatorActorNr (defined in PhotonView) | PhotonView |
DeserializeView(PhotonStream stream, PhotonMessageInfo info) (defined in PhotonView) | PhotonView |
Find(int viewID) | PhotonView | static
FindObservables(bool force=false) | PhotonView |
Get(Component component) (defined in PhotonView) | PhotonView | static
Get(GameObject gameObj) (defined in PhotonView) | PhotonView | static
Group (defined in PhotonView) | PhotonView |
InstantiationData | PhotonView |
InstantiationId (defined in PhotonView) | PhotonView |
IsMine | PhotonView |
IsOwnerActive (defined in PhotonView) | PhotonView |
IsRoomView | PhotonView |
isRuntimeInstantiated (defined in PhotonView) | PhotonView |
IsSceneView (defined in PhotonView) | PhotonView |
observableSearch | PhotonView |
ObservableSearch enum name (defined in PhotonView) | PhotonView |
ObservedComponents (defined in PhotonView) | PhotonView |
OnPreNetDestroy(PhotonView rootView) (defined in PhotonView) | PhotonView |
Owner | PhotonView |
OwnerActorNr (defined in PhotonView) | PhotonView |
OwnershipTransfer | PhotonView |
Prefix (defined in PhotonView) | PhotonView |
prefixField (defined in PhotonView) | PhotonView |
RefreshRpcMonoBehaviourCache() | PhotonView |
RemoveCallback< T >(IPhotonViewCallback obj) | PhotonView |
RemoveCallbackTarget(IPhotonViewCallback obj) | PhotonView |
RequestOwnership() | PhotonView |
RPC(string methodName, RpcTarget target, params object[] parameters) | PhotonView |
RPC(string methodName, Player targetPlayer, params object[] parameters) | PhotonView |
RpcSecure(string methodName, RpcTarget target, bool encrypt, params object[] parameters) | PhotonView |
RpcSecure(string methodName, Player targetPlayer, bool encrypt, params object[] parameters) | PhotonView |
sceneViewId | PhotonView |
SerializeView(PhotonStream stream, PhotonMessageInfo info) (defined in PhotonView) | PhotonView |
Synchronization (defined in PhotonView) | PhotonView |
ToString() (defined in PhotonView) | PhotonView |
TransferOwnership(Player newOwner) | PhotonView |
TransferOwnership(int newOwnerId) | PhotonView |
ViewID | PhotonView |


Photon Unity Networking 2: Member List

  • Pun
  • PunExtensions
PunExtensions Member List

This is the complete list of members for PunExtensions, including all inherited members.

AlmostEquals(this Vector3 target, Vector3 second, float sqrMagnitudePrecision) | PunExtensions | static
AlmostEquals(this Vector2 target, Vector2 second, float sqrMagnitudePrecision) | PunExtensions | static
AlmostEquals(this Quaternion target, Quaternion second, float maxAngle) | PunExtensions | static
AlmostEquals(this float target, float second, float floatDiff) | PunExtensions | static
CheckIsAssignableFrom(this Type to, Type from) (defined in PunExtensions) | PunExtensions | static
CheckIsInterface(this Type to) (defined in PunExtensions) | PunExtensions | static
GetCachedParemeters(this MethodInfo mo) (defined in PunExtensions) | PunExtensions | static
GetPhotonView(this UnityEngine.GameObject go) (defined in PunExtensions) | PunExtensions | static
GetPhotonViewsInChildren(this UnityEngine.GameObject go) (defined in PunExtensions) | PunExtensions | static
ParametersOfMethods (defined in PunExtensions) | PunExtensions | static


Photon Unity Networking 2: Member List

  • Pun
  • SceneManagerHelper
SceneManagerHelper Member List

This is the complete list of members for SceneManagerHelper, including all inherited members.

ActiveSceneBuildIndex (defined in SceneManagerHelper) | SceneManagerHelper | static
ActiveSceneName (defined in SceneManagerHelper) | SceneManagerHelper | static


Photon Unity Networking 2: Member List

  • Pun
  • ServerSettings
ServerSettings Member List

This is the complete list of members for ServerSettings, including all inherited members.

AppSettings (defined in ServerSettings) | ServerSettings |
BestRegionSummaryInPreferences | ServerSettings | static
DevRegion | ServerSettings |
EnableSupportLogger (defined in ServerSettings) | ServerSettings |
IsAppId(string val) | ServerSettings | static
PunLogging (defined in ServerSettings) | ServerSettings |
ResetBestRegionCodeInPreferences() | ServerSettings | static
RpcList (defined in ServerSettings) | ServerSettings |
RunInBackground (defined in ServerSettings) | ServerSettings |
StartInOfflineMode (defined in ServerSettings) | ServerSettings |
ToString() | ServerSettings |
UseCloud(string cloudAppid, string code="") | ServerSettings |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • ButtonInsideScrollList
ButtonInsideScrollList Member List

This is the complete list of members for ButtonInsideScrollList, including all inherited members.


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • ByteComparer
ByteComparer Member List

This is the complete list of members for ByteComparer, including all inherited members.

Compare(byte x, byte y) ByteComparer


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • CellTree
CellTree Member List

This is the complete list of members for CellTree, including all inherited members.

CellTree() | CellTree
CellTree(CellTreeNode root) | CellTree
RootNode | CellTree


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • CellTreeNode
CellTreeNode Member List

This is the complete list of members for CellTreeNode, including all inherited members.

AddChild(CellTreeNode child) | CellTreeNode
CellTreeNode() | CellTreeNode
CellTreeNode(byte id, ENodeType nodeType, CellTreeNode parent) | CellTreeNode
Center | CellTreeNode
Childs | CellTreeNode
Draw() | CellTreeNode
ENodeType enum name (defined in CellTreeNode) | CellTreeNode
GetActiveCells(List< byte > activeCells, bool yIsUpAxis, Vector3 position) | CellTreeNode
Id | CellTreeNode
IsPointInsideCell(bool yIsUpAxis, Vector3 point) | CellTreeNode
IsPointNearCell(bool yIsUpAxis, Vector3 point) | CellTreeNode
NodeType | CellTreeNode
Parent | CellTreeNode


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • ConnectAndJoinRandom
ConnectAndJoinRandom Member List

This is the complete list of members for ConnectAndJoinRandom, including all inherited members.

AutoConnect | ConnectAndJoinRandom |
ConnectNow() (defined in ConnectAndJoinRandom) | ConnectAndJoinRandom |
MaxPlayers | ConnectAndJoinRandom |
OnConnected() | MonoBehaviourPunCallbacks | virtual
OnConnectedToMaster() | ConnectAndJoinRandom | virtual
OnCreatedRoom() | MonoBehaviourPunCallbacks | virtual
OnCreateRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationFailed(string debugMessage) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationResponse(Dictionary< string, object > data) | MonoBehaviourPunCallbacks | virtual
OnDisable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnDisconnected(DisconnectCause cause) | ConnectAndJoinRandom | virtual
OnEnable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnErrorInfo(ErrorInfo errorInfo) | MonoBehaviourPunCallbacks | virtual
OnFriendListUpdate(List< FriendInfo > friendList) | MonoBehaviourPunCallbacks | virtual
OnJoinedLobby() | ConnectAndJoinRandom | virtual
OnJoinedRoom() | ConnectAndJoinRandom | virtual
OnJoinRandomFailed(short returnCode, string message) | ConnectAndJoinRandom | virtual
OnJoinRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnLeftLobby() | MonoBehaviourPunCallbacks | virtual
OnLeftRoom() | MonoBehaviourPunCallbacks | virtual
OnLobbyStatisticsUpdate(List< TypedLobbyInfo > lobbyStatistics) | MonoBehaviourPunCallbacks | virtual
OnMasterClientSwitched(Player newMasterClient) | MonoBehaviourPunCallbacks | virtual
OnPlayerEnteredRoom(Player newPlayer) | MonoBehaviourPunCallbacks | virtual
OnPlayerLeftRoom(Player otherPlayer) | MonoBehaviourPunCallbacks | virtual
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | MonoBehaviourPunCallbacks | virtual
OnRegionListReceived(RegionHandler regionHandler) | MonoBehaviourPunCallbacks | virtual
OnRoomListUpdate(List< RoomInfo > roomList) | MonoBehaviourPunCallbacks | virtual
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | MonoBehaviourPunCallbacks | virtual
OnWebRpcResponse(OperationResponse response) | MonoBehaviourPunCallbacks | virtual
photonView | MonoBehaviourPun |
playerTTL (defined in ConnectAndJoinRandom) | ConnectAndJoinRandom |
Start() (defined in ConnectAndJoinRandom) | ConnectAndJoinRandom |
Version | ConnectAndJoinRandom |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • CountdownTimer
CountdownTimer Member List

This is the complete list of members for CountdownTimer, including all inherited members.

Countdown (defined in CountdownTimer) | CountdownTimer |
CountdownStartTime (defined in CountdownTimer) | CountdownTimer | static
CountdownTimerHasExpired() | CountdownTimer |
OnConnected() | MonoBehaviourPunCallbacks | virtual
OnConnectedToMaster() | MonoBehaviourPunCallbacks | virtual
OnCountdownTimerHasExpired | CountdownTimer | static
OnCreatedRoom() | MonoBehaviourPunCallbacks | virtual
OnCreateRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationFailed(string debugMessage) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationResponse(Dictionary< string, object > data) | MonoBehaviourPunCallbacks | virtual
OnDisable() (defined in CountdownTimer) | CountdownTimer | virtual
OnDisconnected(DisconnectCause cause) | MonoBehaviourPunCallbacks | virtual
OnEnable() (defined in CountdownTimer) | CountdownTimer | virtual
OnErrorInfo(ErrorInfo errorInfo) | MonoBehaviourPunCallbacks | virtual
OnFriendListUpdate(List< FriendInfo > friendList) | MonoBehaviourPunCallbacks | virtual
OnJoinedLobby() | MonoBehaviourPunCallbacks | virtual
OnJoinedRoom() | MonoBehaviourPunCallbacks | virtual
OnJoinRandomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnJoinRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnLeftLobby() | MonoBehaviourPunCallbacks | virtual
OnLeftRoom() | MonoBehaviourPunCallbacks | virtual
OnLobbyStatisticsUpdate(List< TypedLobbyInfo > lobbyStatistics) | MonoBehaviourPunCallbacks | virtual
OnMasterClientSwitched(Player newMasterClient) | MonoBehaviourPunCallbacks | virtual
OnPlayerEnteredRoom(Player newPlayer) | MonoBehaviourPunCallbacks | virtual
OnPlayerLeftRoom(Player otherPlayer) | MonoBehaviourPunCallbacks | virtual
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | MonoBehaviourPunCallbacks | virtual
OnRegionListReceived(RegionHandler regionHandler) | MonoBehaviourPunCallbacks | virtual
OnRoomListUpdate(List< RoomInfo > roomList) | MonoBehaviourPunCallbacks | virtual
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | CountdownTimer | virtual
OnWebRpcResponse(OperationResponse response) | MonoBehaviourPunCallbacks | virtual
photonView | MonoBehaviourPun |
SetStartTime() (defined in CountdownTimer) | CountdownTimer | static
Start() (defined in CountdownTimer) | CountdownTimer |
Text (defined in CountdownTimer) | CountdownTimer |
TryGetStartTime(out int startTimestamp) (defined in CountdownTimer) | CountdownTimer | static
Update() (defined in CountdownTimer) | CountdownTimer |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • CullArea
CullArea Member List

This is the complete list of members for CullArea, including all inherited members.

CellCount (defined in CullArea) | CullArea |
CellTree (defined in CullArea) | CullArea |
Center (defined in CullArea) | CullArea |
FIRST_GROUP_ID | CullArea |
GetActiveCells(Vector3 position) | CullArea |
Map (defined in CullArea) | CullArea |
MAX_NUMBER_OF_SUBDIVISIONS (defined in CullArea) | CullArea | static
NumberOfSubdivisions (defined in CullArea) | CullArea |
OnDrawGizmos() | CullArea |
RecreateCellHierarchy (defined in CullArea) | CullArea |
Size (defined in CullArea) | CullArea |
SUBDIVISION_FIRST_LEVEL_ORDER | CullArea |
SUBDIVISION_SECOND_LEVEL_ORDER | CullArea |
SUBDIVISION_THIRD_LEVEL_ORDER | CullArea |
Subdivisions (defined in CullArea) | CullArea |
YIsUpAxis (defined in CullArea) | CullArea |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • CullingHandler
CullingHandler Member List

This is the complete list of members for CullingHandler, including all inherited members.

OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) CullingHandler


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • EventSystemSpawner
EventSystemSpawner Member List

This is the complete list of members for EventSystemSpawner, including all inherited members.


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • GraphicToggleIsOnTransition
GraphicToggleIsOnTransition Member List

This is the complete list of members for GraphicToggleIsOnTransition, including all inherited members.

HoverOffColor (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
HoverOnColor (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
NormalOffColor (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
NormalOnColor (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
OnDisable() (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
OnEnable() (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
OnPointerEnter(PointerEventData eventData) (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
OnPointerExit(PointerEventData eventData) (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
OnValueChanged(bool isOn) (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition
toggle (defined in GraphicToggleIsOnTransition) | GraphicToggleIsOnTransition


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • MoveByKeys
MoveByKeys Member List

This is the complete list of members for MoveByKeys, including all inherited members.

FixedUpdate() (defined in MoveByKeys) | MoveByKeys
JumpForce (defined in MoveByKeys) | MoveByKeys
JumpTimeout (defined in MoveByKeys) | MoveByKeys
photonView | MonoBehaviourPun
Speed (defined in MoveByKeys) | MoveByKeys
Start() (defined in MoveByKeys) | MoveByKeys


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • OnClickDestroy
OnClickDestroy Member List

This is the complete list of members for OnClickDestroy, including all inherited members.

Button (defined in OnClickDestroy) | OnClickDestroy
DestroyByRpc (defined in OnClickDestroy) | OnClickDestroy
DestroyRpc() (defined in OnClickDestroy) | OnClickDestroy
ModifierKey (defined in OnClickDestroy) | OnClickDestroy
photonView | MonoBehaviourPun


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • OnClickInstantiate
OnClickInstantiate Member List

This is the complete list of members for OnClickInstantiate, including all inherited members.

Button (defined in OnClickInstantiate) | OnClickInstantiate
InstantiateOption enum name (defined in OnClickInstantiate) | OnClickInstantiate
ModifierKey (defined in OnClickInstantiate) | OnClickInstantiate
Prefab (defined in OnClickInstantiate) | OnClickInstantiate


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • OnClickRpc
OnClickRpc Member List

This is the complete list of members for OnClickRpc, including all inherited members.

Button (defined in OnClickRpc) | OnClickRpc
ClickFlash() (defined in OnClickRpc) | OnClickRpc
ClickRpc() (defined in OnClickRpc) | OnClickRpc
ModifierKey (defined in OnClickRpc) | OnClickRpc
photonView | MonoBehaviourPun
Target (defined in OnClickRpc) | OnClickRpc


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • OnEscapeQuit
OnEscapeQuit Member List

This is the complete list of members for OnEscapeQuit, including all inherited members.

Update() (defined in OnEscapeQuit) OnEscapeQuit


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • OnJoinedInstantiate
OnJoinedInstantiate Member List

This is the complete list of members for OnJoinedInstantiate, including all inherited members.

AutoSpawnObjects (defined in OnJoinedInstantiate) | OnJoinedInstantiate |
ClampY (defined in OnJoinedInstantiate) | OnJoinedInstantiate |
DespawnObjects(bool localOnly) | OnJoinedInstantiate | virtual
GetRandomOffset() | OnJoinedInstantiate | protectedvirtual
GetSpawnPoint(out Vector3 spawnPos, out Quaternion spawnRot) | OnJoinedInstantiate | virtual
GetSpawnPoint() | OnJoinedInstantiate | protectedvirtual
lastUsedSpawnPointIndex (defined in OnJoinedInstantiate) | OnJoinedInstantiate | protected
OnCreatedRoom() | OnJoinedInstantiate | virtual
OnCreateRoomFailed(short returnCode, string message) | OnJoinedInstantiate | virtual
OnDisable() (defined in OnJoinedInstantiate) | OnJoinedInstantiate | virtual
OnEnable() (defined in OnJoinedInstantiate) | OnJoinedInstantiate | virtual
OnFriendListUpdate(List< FriendInfo > friendList) | OnJoinedInstantiate | virtual
OnJoinedRoom() | OnJoinedInstantiate | virtual
OnJoinRandomFailed(short returnCode, string message) | OnJoinedInstantiate | virtual
OnJoinRoomFailed(short returnCode, string message) | OnJoinedInstantiate | virtual
OnLeftRoom() | OnJoinedInstantiate | virtual
PrefabsToInstantiate (defined in OnJoinedInstantiate) | OnJoinedInstantiate |
RandomOffset (defined in OnJoinedInstantiate) | OnJoinedInstantiate |
Sequence (defined in OnJoinedInstantiate) | OnJoinedInstantiate |
spawnedAsActorId (defined in OnJoinedInstantiate) | OnJoinedInstantiate | protected
SpawnedObjects (defined in OnJoinedInstantiate) | OnJoinedInstantiate |
SpawnObjects() (defined in OnJoinedInstantiate) | OnJoinedInstantiate | virtual
SpawnPoints (defined in OnJoinedInstantiate) | OnJoinedInstantiate |
SpawnSequence enum name (defined in OnJoinedInstantiate) | OnJoinedInstantiate |
UseRandomOffset (defined in OnJoinedInstantiate) | OnJoinedInstantiate |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • OnPointerOverTooltip
OnPointerOverTooltip Member List

This is the complete list of members for OnPointerOverTooltip, including all inherited members.


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • OnStartDelete
OnStartDelete Member List

This is the complete list of members for OnStartDelete, including all inherited members.


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PhotonLagSimulationGui
PhotonLagSimulationGui Member List

This is the complete list of members for PhotonLagSimulationGui, including all inherited members.

OnGUI() (defined in PhotonLagSimulationGui) | PhotonLagSimulationGui
Peer | PhotonLagSimulationGui
Start() (defined in PhotonLagSimulationGui) | PhotonLagSimulationGui
Visible | PhotonLagSimulationGui
WindowId | PhotonLagSimulationGui
WindowRect | PhotonLagSimulationGui


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PhotonStatsGui
PhotonStatsGui Member List

This is the complete list of members for PhotonStatsGui, including all inherited members.

buttonsOn | PhotonStatsGui
healthStatsVisible | PhotonStatsGui
OnGUI() (defined in PhotonStatsGui) | PhotonStatsGui
Start() (defined in PhotonStatsGui) | PhotonStatsGui
statsOn | PhotonStatsGui
statsRect | PhotonStatsGui
statsWindowOn | PhotonStatsGui
trafficStatsOn | PhotonStatsGui
TrafficStatsWindow(int windowID) (defined in PhotonStatsGui) | PhotonStatsGui
Update() | PhotonStatsGui
WindowId | PhotonStatsGui


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PhotonTeam
PhotonTeam Member List

This is the complete list of members for PhotonTeam, including all inherited members.

Code (defined in PhotonTeam) | PhotonTeam
Name (defined in PhotonTeam) | PhotonTeam
ToString() (defined in PhotonTeam) | PhotonTeam


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PhotonTeamExtensions
PhotonTeamExtensions Member List

This is the complete list of members for PhotonTeamExtensions, including all inherited members.

GetPhotonTeam(this Player player) | PhotonTeamExtensions | static
JoinTeam(this Player player, PhotonTeam team) | PhotonTeamExtensions | static
JoinTeam(this Player player, byte teamCode) | PhotonTeamExtensions | static
JoinTeam(this Player player, string teamName) | PhotonTeamExtensions | static
LeaveCurrentTeam(this Player player) | PhotonTeamExtensions | static
SwitchTeam(this Player player, PhotonTeam team) | PhotonTeamExtensions | static
SwitchTeam(this Player player, byte teamCode) | PhotonTeamExtensions | static
SwitchTeam(this Player player, string teamName) | PhotonTeamExtensions | static
TryGetTeamMates(this Player player, out Player[] teamMates) | PhotonTeamExtensions | static


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PhotonTeamsManager
PhotonTeamsManager Member List

This is the complete list of members for PhotonTeamsManager, including all inherited members.

GetAvailableTeams() | PhotonTeamsManager |
GetTeamMembersCount(byte code) | PhotonTeamsManager |
GetTeamMembersCount(string name) | PhotonTeamsManager |
GetTeamMembersCount(PhotonTeam team) | PhotonTeamsManager |
Instance (defined in PhotonTeamsManager) | PhotonTeamsManager | static
PlayerJoinedTeam (defined in PhotonTeamsManager) | PhotonTeamsManager | static
PlayerLeftTeam (defined in PhotonTeamsManager) | PhotonTeamsManager | static
TeamPlayerProp | PhotonTeamsManager | static
TryGetTeamByCode(byte code, out PhotonTeam team) | PhotonTeamsManager |
TryGetTeamByName(string teamName, out PhotonTeam team) | PhotonTeamsManager |
TryGetTeamMatesOfPlayer(Player player, out Player[] teamMates) | PhotonTeamsManager |
TryGetTeamMembers(byte code, out Player[] members) | PhotonTeamsManager |
TryGetTeamMembers(string teamName, out Player[] members) | PhotonTeamsManager |
TryGetTeamMembers(PhotonTeam team, out Player[] members) | PhotonTeamsManager |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PlayerNumbering
PlayerNumbering Member List

This is the complete list of members for PlayerNumbering, including all inherited members.

Awake() (defined in PlayerNumbering) | PlayerNumbering |
dontDestroyOnLoad | PlayerNumbering |
instance | PlayerNumbering | static
OnConnected() | MonoBehaviourPunCallbacks | virtual
OnConnectedToMaster() | MonoBehaviourPunCallbacks | virtual
OnCreatedRoom() | MonoBehaviourPunCallbacks | virtual
OnCreateRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationFailed(string debugMessage) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationResponse(Dictionary< string, object > data) | MonoBehaviourPunCallbacks | virtual
OnDisable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnDisconnected(DisconnectCause cause) | MonoBehaviourPunCallbacks | virtual
OnEnable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnErrorInfo(ErrorInfo errorInfo) | MonoBehaviourPunCallbacks | virtual
OnFriendListUpdate(List< FriendInfo > friendList) | MonoBehaviourPunCallbacks | virtual
OnJoinedLobby() | MonoBehaviourPunCallbacks | virtual
OnJoinedRoom() | PlayerNumbering | virtual
OnJoinRandomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnJoinRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnLeftLobby() | MonoBehaviourPunCallbacks | virtual
OnLeftRoom() | PlayerNumbering | virtual
OnLobbyStatisticsUpdate(List< TypedLobbyInfo > lobbyStatistics) | MonoBehaviourPunCallbacks | virtual
OnMasterClientSwitched(Player newMasterClient) | MonoBehaviourPunCallbacks | virtual
OnPlayerEnteredRoom(Player newPlayer) | PlayerNumbering | virtual
OnPlayerLeftRoom(Player otherPlayer) | PlayerNumbering | virtual
OnPlayerNumberingChanged | PlayerNumbering | static
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | PlayerNumbering | virtual
OnRegionListReceived(RegionHandler regionHandler) | MonoBehaviourPunCallbacks | virtual
OnRoomListUpdate(List< RoomInfo > roomList) | MonoBehaviourPunCallbacks | virtual
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | MonoBehaviourPunCallbacks | virtual
OnWebRpcResponse(OperationResponse response) | MonoBehaviourPunCallbacks | virtual
photonView | MonoBehaviourPun |
PlayerNumberingChanged() | PlayerNumbering |
RefreshData() | PlayerNumbering |
RoomPlayerIndexedProp | PlayerNumbering | static
SortedPlayers (defined in PlayerNumbering) | PlayerNumbering | static


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PlayerNumberingExtensions
PlayerNumberingExtensions Member List

This is the complete list of members for PlayerNumberingExtensions, including all inherited members.

GetPlayerNumber(this Player player) | PlayerNumberingExtensions | static
SetPlayerNumber(this Player player, int playerNumber) | PlayerNumberingExtensions | static


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PointedAtGameObjectInfo
PointedAtGameObjectInfo Member List

This is the complete list of members for PointedAtGameObjectInfo, including all inherited members.

Instance (defined in PointedAtGameObjectInfo) | PointedAtGameObjectInfo | static
RemoveFocus(PhotonView pv) (defined in PointedAtGameObjectInfo) | PointedAtGameObjectInfo |
SetFocus(PhotonView pv) (defined in PointedAtGameObjectInfo) | PointedAtGameObjectInfo |
text (defined in PointedAtGameObjectInfo) | PointedAtGameObjectInfo |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PunPlayerScores
PunPlayerScores Member List

This is the complete list of members for PunPlayerScores, including all inherited members.

PlayerScoreProp (defined in PunPlayerScores) PunPlayerScores static


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PunTeams
PunTeams Member List

This is the complete list of members for PunTeams, including all inherited members.

OnConnected() | MonoBehaviourPunCallbacks | virtual
OnConnectedToMaster() | MonoBehaviourPunCallbacks | virtual
OnCreatedRoom() | MonoBehaviourPunCallbacks | virtual
OnCreateRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationFailed(string debugMessage) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationResponse(Dictionary< string, object > data) | MonoBehaviourPunCallbacks | virtual
OnDisable() (defined in PunTeams) | PunTeams | virtual
OnDisconnected(DisconnectCause cause) | MonoBehaviourPunCallbacks | virtual
OnEnable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnErrorInfo(ErrorInfo errorInfo) | MonoBehaviourPunCallbacks | virtual
OnFriendListUpdate(List< FriendInfo > friendList) | MonoBehaviourPunCallbacks | virtual
OnJoinedLobby() | MonoBehaviourPunCallbacks | virtual
OnJoinedRoom() | PunTeams | virtual
OnJoinRandomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnJoinRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnLeftLobby() | MonoBehaviourPunCallbacks | virtual
OnLeftRoom() | PunTeams | virtual
OnLobbyStatisticsUpdate(List< TypedLobbyInfo > lobbyStatistics) | MonoBehaviourPunCallbacks | virtual
OnMasterClientSwitched(Player newMasterClient) | MonoBehaviourPunCallbacks | virtual
OnPlayerEnteredRoom(Player newPlayer) | PunTeams | virtual
OnPlayerLeftRoom(Player otherPlayer) | PunTeams | virtual
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | PunTeams | virtual
OnRegionListReceived(RegionHandler regionHandler) | MonoBehaviourPunCallbacks | virtual
OnRoomListUpdate(List< RoomInfo > roomList) | MonoBehaviourPunCallbacks | virtual
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | MonoBehaviourPunCallbacks | virtual
OnWebRpcResponse(OperationResponse response) | MonoBehaviourPunCallbacks | virtual
photonView | MonoBehaviourPun |
PlayersPerTeam | PunTeams | static
Start() (defined in PunTeams) | PunTeams |
Team enum name | PunTeams |
TeamPlayerProp | PunTeams | static
UpdateTeams() (defined in PunTeams) | PunTeams |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • PunTurnManager
PunTurnManager Member List

This is the complete list of members for PunTurnManager, including all inherited members.

BeginTurn() | PunTurnManager |
ElapsedTimeInTurn | PunTurnManager |
EvFinalMove | PunTurnManager | static
EvMove | PunTurnManager | static
GetPlayerFinishedTurn(Player player) | PunTurnManager |
IsCompletedByAll | PunTurnManager |
IsFinishedByMe | PunTurnManager |
IsOver | PunTurnManager |
OnConnected() | MonoBehaviourPunCallbacks | virtual
OnConnectedToMaster() | MonoBehaviourPunCallbacks | virtual
OnCreatedRoom() | MonoBehaviourPunCallbacks | virtual
OnCreateRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationFailed(string debugMessage) | MonoBehaviourPunCallbacks | virtual
OnCustomAuthenticationResponse(Dictionary< string, object > data) | MonoBehaviourPunCallbacks | virtual
OnDisable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnDisconnected(DisconnectCause cause) | MonoBehaviourPunCallbacks | virtual
OnEnable() (defined in MonoBehaviourPunCallbacks) | MonoBehaviourPunCallbacks | virtual
OnErrorInfo(ErrorInfo errorInfo) | MonoBehaviourPunCallbacks | virtual
OnEvent(EventData photonEvent) | PunTurnManager |
OnFriendListUpdate(List< FriendInfo > friendList) | MonoBehaviourPunCallbacks | virtual
OnJoinedLobby() | MonoBehaviourPunCallbacks | virtual
OnJoinedRoom() | MonoBehaviourPunCallbacks | virtual
OnJoinRandomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnJoinRoomFailed(short returnCode, string message) | MonoBehaviourPunCallbacks | virtual
OnLeftLobby() | MonoBehaviourPunCallbacks | virtual
OnLeftRoom() | MonoBehaviourPunCallbacks | virtual
OnLobbyStatisticsUpdate(List< TypedLobbyInfo > lobbyStatistics) | MonoBehaviourPunCallbacks | virtual
OnMasterClientSwitched(Player newMasterClient) | MonoBehaviourPunCallbacks | virtual
OnPlayerEnteredRoom(Player newPlayer) | MonoBehaviourPunCallbacks | virtual
OnPlayerLeftRoom(Player otherPlayer) | MonoBehaviourPunCallbacks | virtual
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | MonoBehaviourPunCallbacks | virtual
OnRegionListReceived(RegionHandler regionHandler) | MonoBehaviourPunCallbacks | virtual
OnRoomListUpdate(List< RoomInfo > roomList) | MonoBehaviourPunCallbacks | virtual
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | PunTurnManager | virtual
OnWebRpcResponse(OperationResponse response) | MonoBehaviourPunCallbacks | virtual
photonView | MonoBehaviourPun |
RemainingSecondsInTurn | PunTurnManager |
SendMove(object move, bool finished) | PunTurnManager |
Turn | PunTurnManager |
TurnDuration | PunTurnManager |
TurnManagerEventOffset | PunTurnManager | static
TurnManagerListener | PunTurnManager |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • ScoreExtensions
ScoreExtensions Member List

This is the complete list of members for ScoreExtensions, including all inherited members.

AddScore(this Player player, int scoreToAddToCurrent) (defined in ScoreExtensions) | ScoreExtensions | static
GetScore(this Player player) (defined in ScoreExtensions) | ScoreExtensions | static
SetScore(this Player player, int newScore) (defined in ScoreExtensions) | ScoreExtensions | static


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • SmoothSyncMovement
SmoothSyncMovement Member List

This is the complete list of members for SmoothSyncMovement, including all inherited members.

Awake() (defined in SmoothSyncMovement) | SmoothSyncMovement
OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) | SmoothSyncMovement
photonView | MonoBehaviourPun
SmoothingDelay (defined in SmoothSyncMovement) | SmoothSyncMovement
Update() (defined in SmoothSyncMovement) | SmoothSyncMovement


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • StatesGui
StatesGui Member List

This is the complete list of members for StatesGui, including all inherited members.

AppVersion (defined in StatesGui) | StatesGui
Buttons (defined in StatesGui) | StatesGui
DetailedConnection (defined in StatesGui) | StatesGui
DontDestroy (defined in StatesGui) | StatesGui
EventsIn (defined in StatesGui) | StatesGui
ExpectedUsers (defined in StatesGui) | StatesGui
GuiOffset (defined in StatesGui) | StatesGui
LocalPlayer (defined in StatesGui) | StatesGui
Others (defined in StatesGui) | StatesGui
PlayerProps (defined in StatesGui) | StatesGui
Room (defined in StatesGui) | StatesGui
RoomProps (defined in StatesGui) | StatesGui
Server (defined in StatesGui) | StatesGui
ServerTimestamp (defined in StatesGui) | StatesGui
UserId (defined in StatesGui) | StatesGui


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • TabViewManager
TabViewManager Member List

This is the complete list of members for TabViewManager, including all inherited members.

CurrentTab (defined in TabViewManager) | TabViewManager | protected
OnTabChanged | TabViewManager |
SelectTab(string id) | TabViewManager |
Tabs | TabViewManager |
ToggleGroup | TabViewManager |


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • TabViewManager
  • Tab
TabViewManager.Tab Member List

This is the complete list of members for TabViewManager.Tab, including all inherited members.

ID (defined in TabViewManager.Tab) | TabViewManager.Tab
Toggle (defined in TabViewManager.Tab) | TabViewManager.Tab
View (defined in TabViewManager.Tab) | TabViewManager.Tab


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • TeamExtensions
TeamExtensions Member List

This is the complete list of members for TeamExtensions, including all inherited members.

GetTeam(this Player player) | TeamExtensions | static
SetTeam(this Player player, PunTeams.Team team) | TeamExtensions | static


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • TextButtonTransition
TextButtonTransition Member List

This is the complete list of members for TextButtonTransition, including all inherited members.

Awake() (defined in TextButtonTransition) | TextButtonTransition
HoverColor | TextButtonTransition
NormalColor | TextButtonTransition
OnDisable() (defined in TextButtonTransition) | TextButtonTransition
OnEnable() (defined in TextButtonTransition) | TextButtonTransition
OnPointerEnter(PointerEventData eventData) (defined in TextButtonTransition) | TextButtonTransition
OnPointerExit(PointerEventData eventData) (defined in TextButtonTransition) | TextButtonTransition
Selectable | TextButtonTransition


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • TextToggleIsOnTransition
TextToggleIsOnTransition Member List

This is the complete list of members for TextToggleIsOnTransition, including all inherited members.

HoverOffColor | TextToggleIsOnTransition
HoverOnColor | TextToggleIsOnTransition
NormalOffColor | TextToggleIsOnTransition
NormalOnColor | TextToggleIsOnTransition
OnDisable() (defined in TextToggleIsOnTransition) | TextToggleIsOnTransition
OnEnable() (defined in TextToggleIsOnTransition) | TextToggleIsOnTransition
OnPointerEnter(PointerEventData eventData) (defined in TextToggleIsOnTransition) | TextToggleIsOnTransition
OnPointerExit(PointerEventData eventData) (defined in TextToggleIsOnTransition) | TextToggleIsOnTransition
OnValueChanged(bool isOn) (defined in TextToggleIsOnTransition) | TextToggleIsOnTransition
toggle | TextToggleIsOnTransition


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • TurnExtensions
TurnExtensions Member List

This is the complete list of members for TurnExtensions, including all inherited members.

FinishedTurnPropKey | TurnExtensions | static
GetFinishedTurn(this Player player) | TurnExtensions | static
GetTurn(this RoomInfo room) | TurnExtensions | static
GetTurnStart(this RoomInfo room) | TurnExtensions | static
SetFinishedTurn(this Player player, int turn) | TurnExtensions | static
SetTurn(this Room room, int turn, bool setStartTime=false) | TurnExtensions | static
TurnPropKey | TurnExtensions | static
TurnStartPropKey | TurnExtensions | static


Photon Unity Networking 2: Member List

  • Realtime
  • ActorProperties
ActorProperties Member List

This is the complete list of members for ActorProperties, including all inherited members.

IsInactive | ActorProperties | static
PlayerName | ActorProperties | static
UserId | ActorProperties | static


Photon Unity Networking 2: Member List

  • Realtime
  • AppSettings
AppSettings Member List

This is the complete list of members for AppSettings, including all inherited members.

AppIdChat | AppSettings |
AppIdFusion | AppSettings |
AppIdRealtime | AppSettings |
AppIdVoice | AppSettings |
AppVersion | AppSettings |
AuthMode | AppSettings |
BestRegionSummaryFromStorage | AppSettings |
CopyTo(AppSettings d) (defined in AppSettings) | AppSettings |
EnableLobbyStatistics | AppSettings |
EnableProtocolFallback | AppSettings |
FixedRegion | AppSettings |
IsAppId(string val) | AppSettings | static
IsBestRegion | AppSettings |
IsDefaultNameServer | AppSettings |
IsDefaultPort | AppSettings |
IsMasterServerAddress | AppSettings |
NetworkLogging | AppSettings |
Port | AppSettings |
Protocol | AppSettings |
ProxyServer | AppSettings |
Server | AppSettings |
ToStringFull() | AppSettings |
UseNameServer | AppSettings |


Photon Unity Networking 2: Member List

  • Realtime
  • AuthenticationValues
AuthenticationValues Member List

This is the complete list of members for AuthenticationValues, including all inherited members.

AddAuthParameter(string key, string value) | AuthenticationValues | virtual
AuthenticationValues() | AuthenticationValues |
AuthenticationValues(string userId) | AuthenticationValues |
AuthGetParameters | AuthenticationValues |
AuthPostData | AuthenticationValues |
AuthType | AuthenticationValues |
CopyTo(AuthenticationValues copy) | AuthenticationValues |
SetAuthPostData(string stringData) | AuthenticationValues | virtual
SetAuthPostData(byte[] byteData) | AuthenticationValues | virtual
SetAuthPostData(Dictionary< string, object > dictData) | AuthenticationValues | virtual
Token | AuthenticationValues |
ToString() | AuthenticationValues |
UserId | AuthenticationValues |


Photon Unity Networking 2: Member List

  • Realtime
  • ConnectionCallbacksContainer
ConnectionCallbacksContainer Member List

This is the complete list of members for ConnectionCallbacksContainer, including all inherited members.

ConnectionCallbacksContainer(LoadBalancingClient client) (defined in ConnectionCallbacksContainer) | ConnectionCallbacksContainer
OnConnected() | ConnectionCallbacksContainer
OnConnectedToMaster() | ConnectionCallbacksContainer
OnCustomAuthenticationFailed(string debugMessage) | ConnectionCallbacksContainer
OnCustomAuthenticationResponse(Dictionary< string, object > data) | ConnectionCallbacksContainer
OnDisconnected(DisconnectCause cause) | ConnectionCallbacksContainer
OnRegionListReceived(RegionHandler regionHandler) | ConnectionCallbacksContainer


Photon Unity Networking 2: Member List

  • Realtime
  • ConnectionHandler
ConnectionHandler Member List

This is the complete list of members for ConnectionHandler, including all inherited members.

ApplyDontDestroyOnLoad | ConnectionHandler |
AppQuits | ConnectionHandler | static
Client | ConnectionHandler |
CountSendAcksOnly | ConnectionHandler |
DisconnectAfterKeepAlive | ConnectionHandler |
FallbackThreadRunning | ConnectionHandler |
KeepAliveInBackground | ConnectionHandler |
RealtimeFallbackThread() | ConnectionHandler |
StartFallbackSendAckThread() (defined in ConnectionHandler) | ConnectionHandler |
StopFallbackSendAckThread() (defined in ConnectionHandler) | ConnectionHandler |


Photon Unity Networking 2: Member List

  • Realtime
  • EnterRoomParams
EnterRoomParams Member List

This is the complete list of members for EnterRoomParams, including all inherited members.

ExpectedUsers | EnterRoomParams
Lobby | EnterRoomParams
PlayerProperties | EnterRoomParams
RoomName | EnterRoomParams
RoomOptions | EnterRoomParams


Photon Unity Networking 2: Member List

  • Realtime
  • ErrorCode
ErrorCode Member List

This is the complete list of members for ErrorCode, including all inherited members.

AlreadyMatched (defined in ErrorCode) | ErrorCode | static
AuthenticationTicketExpired | ErrorCode | static
CustomAuthenticationFailed | ErrorCode | static
ExternalHttpCallFailed | ErrorCode | static
GameClosed | ErrorCode | static
GameDoesNotExist | ErrorCode | static
GameFull | ErrorCode | static
GameIdAlreadyExists | ErrorCode | static
HttpLimitReached | ErrorCode | static
InternalServerError | ErrorCode | static
InvalidAuthentication | ErrorCode | static
InvalidEncryptionParameters | ErrorCode | static
InvalidOperation | ErrorCode | static
InvalidOperationCode | ErrorCode | static
InvalidRegion | ErrorCode | static
JoinFailedFoundActiveJoiner | ErrorCode | static
JoinFailedFoundExcludedUserId | ErrorCode | static
JoinFailedFoundInactiveJoiner | ErrorCode | static
JoinFailedPeerAlreadyJoined | ErrorCode | static
JoinFailedWithRejoinerNotFound | ErrorCode | static
MaxCcuReached | ErrorCode | static
NoRandomMatchFound | ErrorCode | static
Ok | ErrorCode | static
OperationLimitReached | ErrorCode | static
OperationNotAllowedInCurrentState | ErrorCode | static
PluginMismatch | ErrorCode | static
PluginReportedError | ErrorCode | static
ServerFull | ErrorCode | static
SlotError | ErrorCode | static
UserBlocked | ErrorCode | static


Photon Unity Networking 2: Member List

  • Realtime
  • ErrorInfo
ErrorInfo Member List

This is the complete list of members for ErrorInfo, including all inherited members.

ErrorInfo(EventData eventData) (defined in ErrorInfo) | ErrorInfo
Info | ErrorInfo
ToString() (defined in ErrorInfo) | ErrorInfo


Photon Unity Networking 2: Member List

  • Realtime
  • EventCode
EventCode Member List

This is the complete list of members for EventCode, including all inherited members.

AppStats | EventCode | static
AuthEvent | EventCode | static
AzureNodeInfo | EventCode | static
CacheSliceChanged | EventCode | static
ErrorInfo | EventCode | static
GameList | EventCode | static
GameListUpdate | EventCode | static
Join | EventCode | static
Leave | EventCode | static
LobbyStats | EventCode | static
Match | EventCode | static
PropertiesChanged | EventCode | static
QueueState | EventCode | static
SetProperties | EventCode | static


Photon Unity Networking 2: Member List

  • Realtime
  • Extensions
Extensions Member List

This is the complete list of members for Extensions, including all inherited members.

Contains(this int[] target, int nr) | Extensions | static
Merge(this IDictionary target, IDictionary addHash) | Extensions | static
MergeStringKeys(this IDictionary target, IDictionary addHash) | Extensions | static
StripKeysWithNullValues(this IDictionary original) | Extensions | static
StripKeysWithNullValues(this Hashtable original) | Extensions | static
StripToStringKeys(this IDictionary original) | Extensions | static
StripToStringKeys(this Hashtable original) | Extensions | static
ToStringFull(this IDictionary origin) | Extensions | static
ToStringFull(this object[] data) | Extensions | static
ToStringFull< T >(this List< T > data) | Extensions | static


Photon Unity Networking 2: Member List

  • Realtime
  • FindFriendsOptions
FindFriendsOptions Member List

This is the complete list of members for FindFriendsOptions, including all inherited members.

CreatedOnGs | FindFriendsOptions
Open | FindFriendsOptions
Visible | FindFriendsOptions


Photon Unity Networking 2: Member List

  • Realtime
  • FriendInfo
FriendInfo Member List

This is the complete list of members for FriendInfo, including all inherited members.

IsInRoom (defined in FriendInfo) | FriendInfo
IsOnline (defined in FriendInfo) | FriendInfo
Name (defined in FriendInfo) | FriendInfo
Room (defined in FriendInfo) | FriendInfo
ToString() (defined in FriendInfo) | FriendInfo
UserId (defined in FriendInfo) | FriendInfo


Photon Unity Networking 2: Member List

  • Realtime
  • GamePropertyKey
GamePropertyKey Member List

This is the complete list of members for GamePropertyKey, including all inherited members.

CleanupCacheOnLeave | GamePropertyKey | static
EmptyRoomTtl | GamePropertyKey | static
ExpectedUsers | GamePropertyKey | static
IsOpen | GamePropertyKey | static
IsVisible | GamePropertyKey | static
MasterClientId | GamePropertyKey | static
MaxPlayers | GamePropertyKey | static
PlayerCount | GamePropertyKey | static
PlayerTtl | GamePropertyKey | static
PropsListedInLobby | GamePropertyKey | static
Removed | GamePropertyKey | static


Photon Unity Networking 2: Member List

  • Realtime
  • LoadBalancingClient
LoadBalancingClient Member List

This is the complete list of members for LoadBalancingClient, including all inherited members.

AddCallbackTarget(object target) | LoadBalancingClient |
AppId | LoadBalancingClient |
AppVersion | LoadBalancingClient |
AuthMode | LoadBalancingClient |
AuthValues | LoadBalancingClient |
ChangeLocalID(int newID) | LoadBalancingClient |
ClientType | LoadBalancingClient |
CloudRegion | LoadBalancingClient |
Connect() (defined in LoadBalancingClient) | LoadBalancingClient |
ConnectionCallbackTargets | LoadBalancingClient |
ConnectToMasterServer() | LoadBalancingClient | virtual
ConnectToNameServer() | LoadBalancingClient |
ConnectToRegionMaster(string region) | LoadBalancingClient |
ConnectUsingSettings(AppSettings appSettings) (defined in LoadBalancingClient) | LoadBalancingClient | virtual
CurrentCluster | LoadBalancingClient |
CurrentLobby | LoadBalancingClient |
CurrentRoom | LoadBalancingClient |
CurrentServerAddress | LoadBalancingClient |
DebugReturn(DebugLevel level, string message) | LoadBalancingClient | virtual
Disconnect(DisconnectCause cause=DisconnectCause.DisconnectByClientLogic) | LoadBalancingClient |
DisconnectedCause | LoadBalancingClient |
EnableLobbyStatistics | LoadBalancingClient |
EnableProtocolFallback | LoadBalancingClient |
EncryptionMode | LoadBalancingClient |
EventReceived | LoadBalancingClient |
ExpectedProtocol | LoadBalancingClient |
GameServerAddress | LoadBalancingClient |
InLobby | LoadBalancingClient |
InRoom | LoadBalancingClient |
IsConnected | LoadBalancingClient |
IsConnectedAndReady | LoadBalancingClient |
IsFetchingFriendList | LoadBalancingClient |
IsUsingNameServer | LoadBalancingClient |
LoadBalancingClient(ConnectionProtocol protocol=ConnectionProtocol.Udp) | LoadBalancingClient |
LoadBalancingClient(string masterAddress, string appId, string gameVersion, ConnectionProtocol protocol=ConnectionProtocol.Udp) | LoadBalancingClient |
LoadBalancingPeer | LoadBalancingClient |
LocalPlayer | LoadBalancingClient |
MasterServerAddress | LoadBalancingClient |
MatchMakingCallbackTargets | LoadBalancingClient |
NameServerAddress | LoadBalancingClient |
NameServerHost | LoadBalancingClient |
NameServerPortInAppSettings (defined in LoadBalancingClient) | LoadBalancingClient |
NickName | LoadBalancingClient |
OnEvent(EventData photonEvent) | LoadBalancingClient | virtual
OnMessage(object message) | LoadBalancingClient | virtual
OnOperationResponse(OperationResponse operationResponse) | LoadBalancingClient | virtual
OnStatusChanged(StatusCode statusCode) | LoadBalancingClient | virtual
OpChangeGroups(byte[] groupsToRemove, byte[] groupsToAdd) | LoadBalancingClient | virtual
OpCreateRoom(EnterRoomParams enterRoomParams) | LoadBalancingClient |
OpFindFriends(string[] friendsToFind, FindFriendsOptions options=null) | LoadBalancingClient |
OpGetGameList(TypedLobby typedLobby, string sqlLobbyFilter) | LoadBalancingClient |
OpJoinLobby(TypedLobby lobby) | LoadBalancingClient |
OpJoinOrCreateRoom(EnterRoomParams enterRoomParams) | LoadBalancingClient |
OpJoinRandomOrCreateRoom(OpJoinRandomRoomParams opJoinRandomRoomParams, EnterRoomParams createRoomParams) | LoadBalancingClient |
OpJoinRandomRoom(OpJoinRandomRoomParams opJoinRandomRoomParams=null) | LoadBalancingClient |
OpJoinRoom(EnterRoomParams enterRoomParams) | LoadBalancingClient |
OpLeaveLobby() | LoadBalancingClient |
OpLeaveRoom(bool becomeInactive, bool sendAuthCookie=false) | LoadBalancingClient |
OpRaiseEvent(byte eventCode, object customEventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions) | LoadBalancingClient | virtual
OpRejoinRoom(string roomName) | LoadBalancingClient |
OpResponseReceived | LoadBalancingClient |
OpSetCustomPropertiesOfActor(int actorNr, Hashtable propertiesToSet, Hashtable expectedProperties=null, WebFlags webFlags=null) | LoadBalancingClient |
OpSetCustomPropertiesOfRoom(Hashtable propertiesToSet, Hashtable expectedProperties=null, WebFlags webFlags=null) | LoadBalancingClient |
OpWebRpc(string uriPath, object parameters, bool sendAuthCookie=false) | LoadBalancingClient |
PlayersInRoomsCount | LoadBalancingClient |
PlayersOnMasterCount | LoadBalancingClient |
ProxyServerAddress | LoadBalancingClient |
ReconnectAndRejoin() | LoadBalancingClient |
ReconnectToMaster() | LoadBalancingClient |
RegionHandler | LoadBalancingClient |
RemoveCallbackTarget(object target) | LoadBalancingClient |
RoomsCount | LoadBalancingClient |
SerializationProtocol | LoadBalancingClient |
Server | LoadBalancingClient |
ServerPortOverrides | LoadBalancingClient |
Service() | LoadBalancingClient |
SimulateConnectionLoss(bool simulateTimeout) | LoadBalancingClient |
State | LoadBalancingClient |
StateChanged | LoadBalancingClient |
SummaryToCache | LoadBalancingClient |
UseAlternativeUdpPorts | LoadBalancingClient |
UserId | LoadBalancingClient |


Photon Unity Networking 2: Member List

  • Realtime
  • LoadBalancingPeer
LoadBalancingPeer Member List

This is the complete list of members for LoadBalancingPeer, including all inherited members.

LoadBalancingPeer(ConnectionProtocol protocolType) | LoadBalancingPeer |
LoadBalancingPeer(IPhotonPeerListener listener, ConnectionProtocol protocolType) | LoadBalancingPeer |
OpAuthenticate(string appId, string appVersion, AuthenticationValues authValues, string regionCode, bool getLobbyStatistics) | LoadBalancingPeer | virtual
OpAuthenticateOnce(string appId, string appVersion, AuthenticationValues authValues, string regionCode, EncryptionMode encryptionMode, ConnectionProtocol expectedProtocol) | LoadBalancingPeer | virtual
OpChangeGroups(byte[] groupsToRemove, byte[] groupsToAdd) | LoadBalancingPeer | virtual
OpCreateRoom(EnterRoomParams opParams) | LoadBalancingPeer | virtual
OpFindFriends(string[] friendsToFind, FindFriendsOptions options=null) | LoadBalancingPeer | virtual
OpGetGameList(TypedLobby lobby, string queryData) | LoadBalancingPeer | virtual
OpGetRegions(string appId) (defined in LoadBalancingPeer) | LoadBalancingPeer | virtual
OpJoinLobby(TypedLobby lobby=null) | LoadBalancingPeer | virtual
OpJoinRandomOrCreateRoom(OpJoinRandomRoomParams opJoinRandomRoomParams, EnterRoomParams createRoomParams) | LoadBalancingPeer | virtual
OpJoinRandomRoom(OpJoinRandomRoomParams opJoinRandomRoomParams) | LoadBalancingPeer | virtual
OpJoinRoom(EnterRoomParams opParams) | LoadBalancingPeer | virtual
OpLeaveLobby() | LoadBalancingPeer | virtual
OpLeaveRoom(bool becomeInactive, bool sendAuthCookie=false) | LoadBalancingPeer | virtual
OpRaiseEvent(byte eventCode, object customEventContent, RaiseEventOptions raiseEventOptions, SendOptions sendOptions) | LoadBalancingPeer | virtual
OpSetCustomPropertiesOfActor(int actorNr, Hashtable actorProperties) (defined in LoadBalancingPeer) | LoadBalancingPeer |
OpSetCustomPropertiesOfRoom(Hashtable gameProperties) (defined in LoadBalancingPeer) | LoadBalancingPeer |
OpSetPropertyOfRoom(byte propCode, object value) (defined in LoadBalancingPeer) | LoadBalancingPeer | protected
OpSettings(bool receiveLobbyStats) | LoadBalancingPeer | virtual


Photon Unity Networking 2: Member List

  • Realtime
  • MatchMakingCallbacksContainer
MatchMakingCallbacksContainer Member List

This is the complete list of members for MatchMakingCallbacksContainer, including all inherited members.

MatchMakingCallbacksContainer(LoadBalancingClient client) (defined in MatchMakingCallbacksContainer) | MatchMakingCallbacksContainer
OnCreatedRoom() | MatchMakingCallbacksContainer
OnCreateRoomFailed(short returnCode, string message) | MatchMakingCallbacksContainer
OnFriendListUpdate(List< FriendInfo > friendList) | MatchMakingCallbacksContainer
OnJoinedRoom() | MatchMakingCallbacksContainer
OnJoinRandomFailed(short returnCode, string message) | MatchMakingCallbacksContainer
OnJoinRoomFailed(short returnCode, string message) | MatchMakingCallbacksContainer
OnLeftRoom() | MatchMakingCallbacksContainer


Photon Unity Networking 2: Member List

  • Realtime
  • OpJoinRandomRoomParams
OpJoinRandomRoomParams Member List

This is the complete list of members for OpJoinRandomRoomParams, including all inherited members.

ExpectedCustomRoomProperties | OpJoinRandomRoomParams
ExpectedMaxPlayers | OpJoinRandomRoomParams
ExpectedUsers | OpJoinRandomRoomParams
MatchingType | OpJoinRandomRoomParams
SqlLobbyFilter | OpJoinRandomRoomParams
TypedLobby | OpJoinRandomRoomParams


Photon Unity Networking 2: Member List

  • Realtime
  • OperationCode
OperationCode Member List

This is the complete list of members for OperationCode, including all inherited members.

Authenticate | OperationCode | static
AuthenticateOnce | OperationCode | static
ChangeGroups | OperationCode | static
CreateGame | OperationCode | static
ExchangeKeysForEncryption (defined in OperationCode) | OperationCode | static
FindFriends | OperationCode | static
GetGameList | OperationCode | static
GetLobbyStats | OperationCode | static
GetProperties | OperationCode | static
GetRegions | OperationCode | static
Join | OperationCode | static
JoinGame | OperationCode | static
JoinLobby | OperationCode | static
JoinRandomGame | OperationCode | static
Leave | OperationCode | static
LeaveLobby | OperationCode | static
RaiseEvent | OperationCode | static
ServerSettings | OperationCode | static
SetProperties | OperationCode | static
WebRpc | OperationCode | static


Photon Unity Networking 2: Member List

  • Realtime
  • ParameterCode
ParameterCode Member List

This is the complete list of members for ParameterCode, including all inherited members.

ActorList | ParameterCode | static
ActorNr | ParameterCode | static
Add | ParameterCode | static
Address | ParameterCode | static
ApplicationId | ParameterCode | static
AppVersion | ParameterCode | static
AzureLocalNodeId | ParameterCode | static
AzureMasterNodeId | ParameterCode | static
AzureNodeInfo | ParameterCode | static
Broadcast | ParameterCode | static
Cache | ParameterCode | static
CacheSliceIndex | ParameterCode | static
CheckUserOnJoin | ParameterCode | static
CleanupCacheOnLeave | ParameterCode | static
ClientAuthenticationData | ParameterCode | static
ClientAuthenticationParams | ParameterCode | static
ClientAuthenticationType | ParameterCode | static
Cluster | ParameterCode | static
Code | ParameterCode | static
CustomEventContent | ParameterCode | static
CustomInitData | ParameterCode | static
Data | ParameterCode | static
EmptyRoomTTL | ParameterCode | static
EncryptionData | ParameterCode | static
EncryptionMode | ParameterCode | static
EventForward | ParameterCode | static
ExpectedProtocol | ParameterCode | static
ExpectedValues | ParameterCode | static
FindFriendsOptions | ParameterCode | static
FindFriendsRequestList | ParameterCode | static
FindFriendsResponseOnlineList | ParameterCode | static
FindFriendsResponseRoomIdList | ParameterCode | static
GameCount | ParameterCode | static
GameList | ParameterCode | static
GameProperties | ParameterCode | static
Group | ParameterCode | static
Info | ParameterCode | static
IsComingBack | ParameterCode | static
IsInactive | ParameterCode | static
JoinMode | ParameterCode | static
LobbyName | ParameterCode | static
LobbyStats | ParameterCode | static
LobbyType | ParameterCode | static
MasterClientId | ParameterCode | static
MasterPeerCount | ParameterCode | static
MatchMakingType | ParameterCode | static
NickName | ParameterCode | static
PeerCount | ParameterCode | static
PlayerProperties | ParameterCode | static
PlayerTTL | ParameterCode | static
PluginName | ParameterCode | static
Plugins | ParameterCode | static
PluginVersion | ParameterCode | static
Position | ParameterCode | static
Properties | ParameterCode | static
PublishUserId | ParameterCode | static
ReceiverGroup | ParameterCode | static
Region | ParameterCode | static
Remove | ParameterCode | static
RoomName | ParameterCode | static
RoomOptionFlags | ParameterCode | static
SuppressRoomEvents | ParameterCode | static
TargetActorNr | ParameterCode | static
Token | ParameterCode | static
UriPath | ParameterCode | static
UserId | ParameterCode | static
WebRpcParameters | ParameterCode | static
WebRpcReturnCode | ParameterCode | static
WebRpcReturnMessage | ParameterCode | static


Photon Unity Networking 2: Member List

  • Realtime
  • PhotonAppSettings
PhotonAppSettings Member List

This is the complete list of members for PhotonAppSettings, including all inherited members.

AppSettings (defined in PhotonAppSettings) | PhotonAppSettings |
Instance | PhotonAppSettings | static
LoadOrCreateSettings() (defined in PhotonAppSettings) | PhotonAppSettings | static


Photon Unity Networking 2: Member List

  • Realtime
  • PhotonPing
PhotonPing Member List

This is the complete list of members for PhotonPing, including all inherited members.

DebugString (defined in PhotonPing) | PhotonPing |
Dispose() (defined in PhotonPing) | PhotonPing | virtual
Done() (defined in PhotonPing) | PhotonPing | virtual
StartPing(string ip) (defined in PhotonPing) | PhotonPing | virtual
Successful (defined in PhotonPing) | PhotonPing |


Photon Unity Networking 2: Member List

  • Realtime
  • PingMono
PingMono Member List

This is the complete list of members for PingMono, including all inherited members.

DebugString (defined in PhotonPing) | PhotonPing |
Dispose() (defined in PingMono) | PingMono | virtual
Done() (defined in PingMono) | PingMono | virtual
StartPing(string ip) | PingMono | virtual
Successful (defined in PhotonPing) | PhotonPing |


Photon Unity Networking 2: Member List

  • Realtime
  • Player
Player Member List

This is the complete list of members for Player, including all inherited members.

ActorNumber | Player
CustomProperties | Player
Equals(object p) | Player
Get(int id) | Player
GetHashCode() | Player
GetNext() | Player
GetNextFor(Player currentPlayer) | Player
GetNextFor(int currentPlayerId) | Player
HasRejoined (defined in Player) | Player
IsInactive | Player
IsLocal | Player
IsMasterClient | Player
NickName | Player
SetCustomProperties(Hashtable propertiesToSet, Hashtable expectedValues=null, WebFlags webFlags=null) | Player
TagObject | Player
ToString() | Player
ToStringFull() | Player
UserId | Player


Photon Unity Networking 2: Member List

  • Realtime
  • RaiseEventOptions
RaiseEventOptions Member List

This is the complete list of members for RaiseEventOptions, including all inherited members.

CachingOption | RaiseEventOptions |
Default | RaiseEventOptions | static
Flags | RaiseEventOptions |
InterestGroup | RaiseEventOptions |
Receivers | RaiseEventOptions |
SequenceChannel | RaiseEventOptions |
TargetActors | RaiseEventOptions |


Photon Unity Networking 2: Member List

  • Realtime
  • Region
Region Member List

This is the complete list of members for Region, including all inherited members.

Cluster | Region
Code (defined in Region) | Region
HostAndPort (defined in Region) | Region
Ping (defined in Region) | Region
Region(string code, string address) (defined in Region) | Region
Region(string code, int ping) (defined in Region) | Region
ToString() (defined in Region) | Region
ToString(bool compact=false) (defined in Region) | Region
WasPinged (defined in Region) | Region


Photon Unity Networking 2: Member List

  • Realtime
  • RegionHandler
RegionHandler Member List

This is the complete list of members for RegionHandler, including all inherited members.

BestRegion | RegionHandler |
EnabledRegions | RegionHandler |
GetResults() (defined in RegionHandler) | RegionHandler |
IsPinging (defined in RegionHandler) | RegionHandler |
PingImplementation | RegionHandler | static
PingMinimumOfRegions(Action< RegionHandler > onCompleteCallback, string previousSummary) (defined in RegionHandler) | RegionHandler |
RegionHandler(ushort masterServerPortOverride=0) (defined in RegionHandler) | RegionHandler |
SetRegions(OperationResponse opGetRegions) (defined in RegionHandler) | RegionHandler |
SummaryToCache | RegionHandler |


Photon Unity Networking 2: Member List

  • Realtime
  • RegionPinger
RegionPinger Member List

This is the complete list of members for RegionPinger, including all inherited members.

Attempts (defined in RegionPinger) | RegionPinger | static
CurrentAttempt (defined in RegionPinger) | RegionPinger |
Done (defined in RegionPinger) | RegionPinger |
GetResults() (defined in RegionPinger) | RegionPinger |
IgnoreInitialAttempt (defined in RegionPinger) | RegionPinger | static
MaxMilliseconsPerPing (defined in RegionPinger) | RegionPinger | static
PingWhenFailed (defined in RegionPinger) | RegionPinger | static
RegionPinger(Region region, Action< Region > onDoneCallback) (defined in RegionPinger) | RegionPinger |
ResolveHost(string hostName) | RegionPinger | static
Start() | RegionPinger |


Photon Unity Networking 2: Member List

  • Realtime
  • Room
Room Member List

This is the complete list of members for Room, including all inherited members.

AddPlayer(Player player) | Room | virtual
autoCleanUp | RoomInfo | protected
AutoCleanUp | Room |
BroadcastPropertiesChangeToAll | Room |
ClearExpectedUsers() | Room |
CustomProperties | RoomInfo |
DeleteNullProperties | Room |
EmptyRoomTtl | Room |
emptyRoomTtl | RoomInfo | protected
Equals(object other) | RoomInfo |
expectedUsers | RoomInfo | protected
ExpectedUsers | Room |
GetHashCode() | RoomInfo |
GetPlayer(int id, bool findMaster=false) | Room | virtual
IsOffline (defined in Room) | Room |
isOpen | RoomInfo | protected
IsOpen | Room |
isVisible | RoomInfo | protected
IsVisible | Room |
LoadBalancingClient | Room |
masterClientId | RoomInfo |
MasterClientId | Room |
maxPlayers | RoomInfo | protected
MaxPlayers | Room |
Name | Room |
name | RoomInfo | protected
PlayerCount | Room |
Players | Room |
PlayerTtl | Room |
playerTtl | RoomInfo | protected
PropertiesListedInLobby | Room |
propertiesListedInLobby | RoomInfo | protected
PublishUserId | Room |
RemovedFromList | RoomInfo |
Room(string roomName, RoomOptions options, bool isOffline=false) | Room |
SetCustomProperties(Hashtable propertiesToSet, Hashtable expectedProperties=null, WebFlags webFlags=null) | Room | virtual
SetExpectedUsers(string[] newExpectedUsers) | Room |
SetMasterClient(Player masterClientPlayer) | Room |
SetPropertiesListedInLobby(string[] lobbyProps) | Room |
StorePlayer(Player player) | Room | virtual
SuppressPlayerInfo | Room |
SuppressRoomEvents | Room |
ToString() | Room |
ToStringFull() | Room |


Photon Unity Networking 2: Member List

  • Realtime
  • RoomInfo
RoomInfo Member List

This is the complete list of members for RoomInfo, including all inherited members.

autoCleanUp | RoomInfo | protected
CustomProperties | RoomInfo |
emptyRoomTtl | RoomInfo | protected
Equals(object other) | RoomInfo |
expectedUsers | RoomInfo | protected
GetHashCode() | RoomInfo |
IsOpen | RoomInfo |
isOpen | RoomInfo | protected
isVisible | RoomInfo | protected
IsVisible | RoomInfo |
masterClientId | RoomInfo |
MaxPlayers | RoomInfo |
maxPlayers | RoomInfo | protected
name | RoomInfo | protected
Name | RoomInfo |
PlayerCount | RoomInfo |
playerTtl | RoomInfo | protected
propertiesListedInLobby | RoomInfo | protected
RemovedFromList | RoomInfo |
ToString() | RoomInfo |
ToStringFull() | RoomInfo |


Photon Unity Networking 2: Member List

  • Realtime
  • RoomOptions
RoomOptions Member List

This is the complete list of members for RoomOptions, including all inherited members.

BroadcastPropsChangeToAll | RoomOptions
CleanupCacheOnLeave | RoomOptions
CustomRoomProperties | RoomOptions
CustomRoomPropertiesForLobby | RoomOptions
DeleteNullProperties | RoomOptions
EmptyRoomTtl | RoomOptions
IsOpen | RoomOptions
IsVisible | RoomOptions
MaxPlayers | RoomOptions
PlayerTtl | RoomOptions
Plugins | RoomOptions
PublishUserId | RoomOptions
SuppressPlayerInfo | RoomOptions
SuppressRoomEvents | RoomOptions


Photon Unity Networking 2: Member List

  • Realtime
  • SupportLogger
SupportLogger Member List

This is the complete list of members for SupportLogger, including all inherited members.

Client | SupportLogger
LogStats() | SupportLogger
LogTrafficStats | SupportLogger
OnConnected() | SupportLogger
OnConnectedToMaster() | SupportLogger
OnCreatedRoom() | SupportLogger
OnCreateRoomFailed(short returnCode, string message) | SupportLogger
OnCustomAuthenticationFailed(string debugMessage) | SupportLogger
OnCustomAuthenticationResponse(Dictionary< string, object > data) | SupportLogger
OnDisconnected(DisconnectCause cause) | SupportLogger
OnErrorInfo(ErrorInfo errorInfo) (defined in SupportLogger) | SupportLogger
OnFriendListUpdate(List< FriendInfo > friendList) | SupportLogger
OnJoinedLobby() | SupportLogger
OnJoinedRoom() | SupportLogger
OnJoinRandomFailed(short returnCode, string message) | SupportLogger
OnJoinRoomFailed(short returnCode, string message) | SupportLogger
OnLeftLobby() | SupportLogger
OnLeftRoom() | SupportLogger
OnLobbyStatisticsUpdate(List< TypedLobbyInfo > lobbyStatistics) | SupportLogger
OnMasterClientSwitched(Player newMasterClient) | SupportLogger
OnPlayerEnteredRoom(Player newPlayer) | SupportLogger
OnPlayerLeftRoom(Player otherPlayer) | SupportLogger
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | SupportLogger
OnRegionListReceived(RegionHandler regionHandler) | SupportLogger
OnRoomListUpdate(List< RoomInfo > roomList) | SupportLogger
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | SupportLogger
StartLogStats() (defined in SupportLogger) | SupportLogger
StopLogStats() (defined in SupportLogger) | SupportLogger


Photon Unity Networking 2: Member List

  • Realtime
  • TypedLobby
TypedLobby Member List

This is the complete list of members for TypedLobby, including all inherited members.

Default | TypedLobby | static
IsDefault | TypedLobby |
Name | TypedLobby |
ToString() (defined in TypedLobby) | TypedLobby |
Type | TypedLobby |
TypedLobby(string name, LobbyType type) | TypedLobby |


Photon Unity Networking 2: Member List

  • Realtime
  • TypedLobbyInfo
TypedLobbyInfo Member List

This is the complete list of members for TypedLobbyInfo, including all inherited members.

Default | TypedLobby | static
IsDefault | TypedLobby |
Name | TypedLobby |
PlayerCount | TypedLobbyInfo |
RoomCount | TypedLobbyInfo |
ToString() (defined in TypedLobbyInfo) | TypedLobbyInfo |
Type | TypedLobby |
TypedLobby(string name, LobbyType type) | TypedLobby |


Photon Unity Networking 2: Member List

  • Realtime
  • WebFlags
WebFlags Member List

This is the complete list of members for WebFlags, including all inherited members.

Default (defined in WebFlags) | WebFlags | static
HttpForward | WebFlags |
HttpForwardConst (defined in WebFlags) | WebFlags | static
SendAuthCookie | WebFlags |
SendAuthCookieConst (defined in WebFlags) | WebFlags | static
SendState | WebFlags |
SendStateConst (defined in WebFlags) | WebFlags | static
SendSync | WebFlags |
SendSyncConst (defined in WebFlags) | WebFlags | static
WebFlags(byte webhookFlags) (defined in WebFlags) | WebFlags |
WebhookFlags (defined in WebFlags) | WebFlags |


Photon Unity Networking 2: Member List

  • Realtime
  • WebRpcResponse
WebRpcResponse Member List

This is the complete list of members for WebRpcResponse, including all inherited members.

DebugMessage (defined in WebRpcResponse) | WebRpcResponse
Message | WebRpcResponse
Name | WebRpcResponse
Parameters | WebRpcResponse
ResultCode | WebRpcResponse
ReturnCode (defined in WebRpcResponse) | WebRpcResponse
ToStringFull() | WebRpcResponse
WebRpcResponse(OperationResponse response) | WebRpcResponse


Photon Unity Networking 2: PhotonPlayer Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
  • PhotonPlayer
PhotonPlayer Directory Reference


Photon Unity Networking 2: Utilities Directory Reference

  • Assets
  • PhotonUnityNetworking
  • Code
  • Utilities
Utilities Directory Reference


Photon Unity Networking 2: Photon Directory Reference

  • Assets
Photon Directory Reference


Photon Unity Networking 2: Debugging Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
  • Debugging
Debugging Directory Reference


Photon Unity Networking 2: Code Directory Reference

  • Assets
  • PhotonRealtime
  • Code
Code Directory Reference

Directories

© Exit Games ®, all rights reserved.
Documentation Contact Terms Status


Photon Unity Networking 2: UtilityScripts Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
UtilityScripts Directory Reference

Directories

© Exit Games ®, all rights reserved.
Documentation Contact Terms Status


Photon Unity Networking 2: Assets Directory Reference

  • Assets
Assets Directory Reference


Photon Unity Networking 2: PhotonChat Directory Reference

  • Assets
  • PhotonChat
PhotonChat Directory Reference

Directories

© Exit Games ®, all rights reserved.
Documentation Contact Terms Status


Photon Unity Networking 2: Unity Directory Reference

  • Assets
  • PhotonRealtime
  • Code
  • Unity
Unity Directory Reference


Photon Unity Networking 2: Culling Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
  • Culling
Culling Directory Reference


Photon Unity Networking 2: Views Directory Reference

  • Assets
  • PhotonUnityNetworking
  • Code
  • Views
Views Directory Reference


Photon Unity Networking 2: Prototyping Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
  • Prototyping
Prototyping Directory Reference


Photon Unity Networking 2: Interfaces Directory Reference

  • Assets
  • PhotonUnityNetworking
  • Code
  • Interfaces
Interfaces Directory Reference


Photon Unity Networking 2: PhotonRealtime Directory Reference

  • Assets
  • PhotonRealtime
PhotonRealtime Directory Reference

Directories

© Exit Games ®, all rights reserved.
Documentation Contact Terms Status


Photon Unity Networking 2: UI Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
  • UI
UI Directory Reference


Photon Unity Networking 2: TurnBased Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
  • TurnBased
TurnBased Directory Reference


Photon Unity Networking 2: PhotonView Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
  • PhotonView
PhotonView Directory Reference


Photon Unity Networking 2: PhotonUnityNetworking Directory Reference

  • Assets
  • PhotonUnityNetworking
PhotonUnityNetworking Directory Reference

Directories

directory UtilityScripts


Photon Unity Networking 2: Code Directory Reference

  • Assets
  • PhotonUnityNetworking
  • Code
Code Directory Reference

Directories

© Exit Games ®, all rights reserved.
Documentation Contact Terms Status


Photon Unity Networking 2: Code Directory Reference

  • Assets
  • PhotonChat
  • Code
Code Directory Reference


Photon Unity Networking 2: Room Directory Reference

  • Assets
  • PhotonUnityNetworking
  • UtilityScripts
  • Room
Room Directory Reference


Photon Unity Networking 2: Member List

  • Chat
  • IChatClientListener
IChatClientListener Member List

This is the complete list of members for IChatClientListener, including all inherited members.

DebugReturn(DebugLevel level, string message) | IChatClientListener
OnChatStateChange(ChatState state) | IChatClientListener
OnConnected() | IChatClientListener
OnDisconnected() | IChatClientListener
OnGetMessages(string channelName, string[] senders, object[] messages) | IChatClientListener
OnPrivateMessage(string sender, object message, string channelName) | IChatClientListener
OnStatusUpdate(string user, int status, bool gotMessage, object message) | IChatClientListener
OnSubscribed(string[] channels, bool[] results) | IChatClientListener
OnUnsubscribed(string[] channels) | IChatClientListener
OnUserSubscribed(string channel, string user) | IChatClientListener
OnUserUnsubscribed(string channel, string user) | IChatClientListener


Photon Unity Networking 2: Member List

  • Pun
  • IOnPhotonViewControllerChange
IOnPhotonViewControllerChange Member List

This is the complete list of members for IOnPhotonViewControllerChange, including all inherited members.

OnControllerChange(Player newController, Player previousController) IOnPhotonViewControllerChange


Photon Unity Networking 2: Member List

  • Pun
  • IOnPhotonViewOwnerChange
IOnPhotonViewOwnerChange Member List

This is the complete list of members for IOnPhotonViewOwnerChange, including all inherited members.

OnOwnerChange(Player newOwner, Player previousOwner) IOnPhotonViewOwnerChange


Photon Unity Networking 2: Member List

  • Pun
  • IOnPhotonViewPreNetDestroy
IOnPhotonViewPreNetDestroy Member List

This is the complete list of members for IOnPhotonViewPreNetDestroy, including all inherited members.

OnPreNetDestroy(PhotonView rootView) IOnPhotonViewPreNetDestroy


Photon Unity Networking 2: Member List

  • Pun
  • IPunInstantiateMagicCallback
IPunInstantiateMagicCallback Member List

This is the complete list of members for IPunInstantiateMagicCallback, including all inherited members.

OnPhotonInstantiate(PhotonMessageInfo info) (defined in IPunInstantiateMagicCallback) IPunInstantiateMagicCallback


Photon Unity Networking 2: Member List

  • Pun
  • IPunObservable
IPunObservable Member List

This is the complete list of members for IPunObservable, including all inherited members.

OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) IPunObservable


Photon Unity Networking 2: Member List

  • Pun
  • IPunOwnershipCallbacks
IPunOwnershipCallbacks Member List

This is the complete list of members for IPunOwnershipCallbacks, including all inherited members.

OnOwnershipRequest(PhotonView targetView, Player requestingPlayer) | IPunOwnershipCallbacks
OnOwnershipTransfered(PhotonView targetView, Player previousOwner) | IPunOwnershipCallbacks
OnOwnershipTransferFailed(PhotonView targetView, Player senderOfFailedRequest) | IPunOwnershipCallbacks


Photon Unity Networking 2: Member List

  • Pun
  • IPunPrefabPool
IPunPrefabPool Member List

This is the complete list of members for IPunPrefabPool, including all inherited members.

Destroy(GameObject gameObject) | IPunPrefabPool
Instantiate(string prefabId, Vector3 position, Quaternion rotation) | IPunPrefabPool


Photon Unity Networking 2: Member List

  • Pun
  • UtilityScripts
  • IPunTurnManagerCallbacks
IPunTurnManagerCallbacks Member List

This is the complete list of members for IPunTurnManagerCallbacks, including all inherited members.

OnPlayerFinished(Player player, int turn, object move) | IPunTurnManagerCallbacks
OnPlayerMove(Player player, int turn, object move) | IPunTurnManagerCallbacks
OnTurnBegins(int turn) | IPunTurnManagerCallbacks
OnTurnCompleted(int turn) | IPunTurnManagerCallbacks
OnTurnTimeEnds(int turn) | IPunTurnManagerCallbacks


Photon Unity Networking 2: Member List

  • Realtime
  • IConnectionCallbacks
IConnectionCallbacks Member List

This is the complete list of members for IConnectionCallbacks, including all inherited members.

OnConnected() | IConnectionCallbacks
OnConnectedToMaster() | IConnectionCallbacks
OnCustomAuthenticationFailed(string debugMessage) | IConnectionCallbacks
OnCustomAuthenticationResponse(Dictionary< string, object > data) | IConnectionCallbacks
OnDisconnected(DisconnectCause cause) | IConnectionCallbacks
OnRegionListReceived(RegionHandler regionHandler) | IConnectionCallbacks


Photon Unity Networking 2: Member List

  • Realtime
  • IErrorInfoCallback
IErrorInfoCallback Member List

This is the complete list of members for IErrorInfoCallback, including all inherited members.

OnErrorInfo(ErrorInfo errorInfo) IErrorInfoCallback


Photon Unity Networking 2: Member List

  • Realtime
  • IInRoomCallbacks
IInRoomCallbacks Member List

This is the complete list of members for IInRoomCallbacks, including all inherited members.

OnMasterClientSwitched(Player newMasterClient) | IInRoomCallbacks
OnPlayerEnteredRoom(Player newPlayer) | IInRoomCallbacks
OnPlayerLeftRoom(Player otherPlayer) | IInRoomCallbacks
OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) | IInRoomCallbacks
OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) | IInRoomCallbacks


Photon Unity Networking 2: Member List

  • Realtime
  • ILobbyCallbacks
ILobbyCallbacks Member List

This is the complete list of members for ILobbyCallbacks, including all inherited members.

OnJoinedLobby() | ILobbyCallbacks
OnLeftLobby() | ILobbyCallbacks
OnLobbyStatisticsUpdate(List< TypedLobbyInfo > lobbyStatistics) | ILobbyCallbacks
OnRoomListUpdate(List< RoomInfo > roomList) | ILobbyCallbacks


Photon Unity Networking 2: Member List

  • Realtime
  • IMatchmakingCallbacks
IMatchmakingCallbacks Member List

This is the complete list of members for IMatchmakingCallbacks, including all inherited members.

OnCreatedRoom() | IMatchmakingCallbacks
OnCreateRoomFailed(short returnCode, string message) | IMatchmakingCallbacks
OnFriendListUpdate(List< FriendInfo > friendList) | IMatchmakingCallbacks
OnJoinedRoom() | IMatchmakingCallbacks
OnJoinRandomFailed(short returnCode, string message) | IMatchmakingCallbacks
OnJoinRoomFailed(short returnCode, string message) | IMatchmakingCallbacks
OnLeftRoom() | IMatchmakingCallbacks


Photon Unity Networking 2: Member List

  • Realtime
  • IOnEventCallback
IOnEventCallback Member List

This is the complete list of members for IOnEventCallback, including all inherited members.

OnEvent(EventData photonEvent) IOnEventCallback


Photon Unity Networking 2: Member List

  • Realtime
  • IWebRpcCallback
IWebRpcCallback Member List

This is the complete list of members for IWebRpcCallback, including all inherited members.

OnWebRpcResponse(OperationResponse response) IWebRpcCallback


Photon Unity Networking 2: Related Pages

Related Pages
Here is a list of all related documentation pages:
General Documentation | Brief overview of Photon, subscriptions, hosting options and how to start
Network Simulation GUI | Simple GUI element to control the built-in network condition simulation
Network Statistics GUI | The PhotonStatsGui is a simple GUI component to track and show network-metrics at runtime
Public API Module | The Public API module rounds up the most commonly used classes of PUN


Photon Unity Networking 2: Member List

  • Pun
  • InstantiateParameters
InstantiateParameters Member List

This is the complete list of members for InstantiateParameters, including all inherited members.

creator (defined in InstantiateParameters) | InstantiateParameters
data (defined in InstantiateParameters) | InstantiateParameters
group (defined in InstantiateParameters) | InstantiateParameters
InstantiateParameters(string prefabName, Vector3 position, Quaternion rotation, byte @group, object[] data, byte objLevelPrefix, int[] viewIDs, Player creator, int timestamp) (defined in InstantiateParameters) | InstantiateParameters
objLevelPrefix (defined in InstantiateParameters) | InstantiateParameters
position (defined in InstantiateParameters) | InstantiateParameters
prefabName (defined in InstantiateParameters) | InstantiateParameters
rotation (defined in InstantiateParameters) | InstantiateParameters
timestamp (defined in InstantiateParameters) | InstantiateParameters
viewIDs (defined in InstantiateParameters) | InstantiateParameters


Photon Unity Networking 2: Member List

  • Pun
  • PhotonMessageInfo
PhotonMessageInfo Member List

This is the complete list of members for PhotonMessageInfo, including all inherited members.

PhotonMessageInfo(Player player, int timestamp, PhotonView view) (defined in PhotonMessageInfo) | PhotonMessageInfo
photonView (defined in PhotonMessageInfo) | PhotonMessageInfo
Sender | PhotonMessageInfo
SentServerTime (defined in PhotonMessageInfo) | PhotonMessageInfo
SentServerTimestamp (defined in PhotonMessageInfo) | PhotonMessageInfo
timestamp (defined in PhotonMessageInfo) | PhotonMessageInfo
ToString() (defined in PhotonMessageInfo) | PhotonMessageInfo


Photon Unity Networking 2: Member List

  • Realtime
  • PhotonPortDefinition
PhotonPortDefinition Member List

This is the complete list of members for PhotonPortDefinition, including all inherited members.

AlternativeUdpPorts (defined in PhotonPortDefinition) | PhotonPortDefinition | static
GameServerPort | PhotonPortDefinition |
MasterServerPort | PhotonPortDefinition |
NameServerPort | PhotonPortDefinition |