Photon.Pun.Demo.PunBasics.Launcher Class Reference

Launch manager. Connect, join a random room or create one if none or all full. More...

Inheritance diagram for Photon.Pun.Demo.PunBasics.Launcher:
Photon.Pun.MonoBehaviourPunCallbacks Photon.Pun.MonoBehaviourPun Photon.Realtime.IConnectionCallbacks Photon.Realtime.IMatchmakingCallbacks Photon.Realtime.IInRoomCallbacks Photon.Realtime.ILobbyCallbacks Photon.Realtime.IWebRpcCallback Photon.Realtime.IErrorInfoCallback

Public Member Functions

void Connect ()
 Start the connection process. More...
 
override void OnConnectedToMaster ()
 Called after the connection to the master is established and authenticated More...
 
override void OnJoinRandomFailed (short returnCode, string message)
 Called when a JoinRandom() call failed. The parameter provides ErrorCode and message. More...
 
override void OnDisconnected (DisconnectCause cause)
 Called after disconnecting from the Photon server. More...
 
override void OnJoinedRoom ()
 Called when entering a room (by creating or joining it). Called on all clients (including the Master Client). More...
 
- Public Member Functions inherited from Photon.Pun.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 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...
 

Additional Inherited Members

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

Detailed Description

Launch manager. Connect, join a random room or create one if none or all full.

Member Function Documentation

◆ Connect()

void Photon.Pun.Demo.PunBasics.Launcher.Connect ( )

Start the connection process.

  • If already connected, we attempt joining a random room
  • if not yet connected, Connect this application instance to Photon Cloud Network

◆ OnConnectedToMaster()

override void Photon.Pun.Demo.PunBasics.Launcher.OnConnectedToMaster ( )
virtual

Called after the connection to the master is established and authenticated

Reimplemented from Photon.Pun.MonoBehaviourPunCallbacks.

◆ OnDisconnected()

override void Photon.Pun.Demo.PunBasics.Launcher.OnDisconnected ( DisconnectCause  cause)
virtual

Called after disconnecting from the Photon server.

Reimplemented from Photon.Pun.MonoBehaviourPunCallbacks.

◆ OnJoinedRoom()

override void Photon.Pun.Demo.PunBasics.Launcher.OnJoinedRoom ( )
virtual

Called when entering a room (by creating or joining it). Called on all clients (including the Master Client).

This method is commonly used to instantiate player characters. If a match has to be started "actively", you can call an PunRPC triggered by a user's button-press or a timer.

When this is called, you can usually already access the existing players in the room via PhotonNetwork.PlayerList. Also, all custom properties should be already available as Room.customProperties. Check Room..PlayerCount to find out if enough players are in the room to start playing.

Reimplemented from Photon.Pun.MonoBehaviourPunCallbacks.

◆ OnJoinRandomFailed()

override void Photon.Pun.Demo.PunBasics.Launcher.OnJoinRandomFailed ( short  returnCode,
string  message 
)
virtual

Called when a JoinRandom() call failed. The parameter provides ErrorCode and message.

Most likely all rooms are full or no rooms are available.

Reimplemented from Photon.Pun.MonoBehaviourPunCallbacks.


The documentation for this class was generated from the following file:
  • 3rd-Party/Photon/PhotonUnityNetworking/Demos/PunBasics-Tutorial/Scripts/Launcher.cs