This class implements the Quantum interface ICommunicator and uses Photon Realtime in Unity to support sending RaiseEvent(byte, byte[], int, bool, int[]) and receiving AddEventListener(Photon.Deterministic.OnEventReceived) network messages from the Photon Cloud. More...
Inherits ICommunicator.
Public Member Functions | |
QuantumNetworkCommunicator (RealtimeClient loadBalancingClient, ShutdownConnectionOptions shutdownConnectionOptions=ShutdownConnectionOptions.Disconnect) | |
Create instance to assign to SessionRunner.Arguments.Communicator. The client object is expected to be connected to a game server (joined a room). More... | |
void | AddEventListener (OnEventReceived onEventReceived) |
Called by Quantum to subscribe to incoming messages. More... | |
void | DisposeEventObject (object obj) |
Called by Quantum to recycle incoming message objects. More... | |
void | OnDestroy () |
Called by Quantum when the simulation is shut down. Also called by the SessionRunner when shutting down. More... | |
System.Threading.Tasks.Task | OnDestroyAsync () |
Called when the SessionRunner is shutting down async. More... | |
void | RaiseEvent (Byte eventCode, byte[] message, int messageLength, Boolean reliable, Int32[] toPlayers) |
Called by Quantum to send messages. More... | |
void | Service () |
Called by Quantum to update the Realtime client. More... | |
Public Attributes | |
Int32 | ActorNumber => _realtimeClient.LocalPlayer.ActorNumber |
Returns the Photon Actor Number that this client was assigned to. More... | |
RealtimeClient | NetworkClient => _realtimeClient |
The Realtime client object which is assigned inside the constructor. More... | |
Properties | |
Boolean | IsConnected [get] |
Returns RealtimeClient.IsConnected. More... | |
Int32 | RoundTripTime [get] |
Returns the RTT measured by the Realtime client. More... | |
ShutdownConnectionOptions | ShutdownConnectionOptions [get, set] |
When this class is assigned to a Quantum session this option configures what happens to the standing online connecting when the Quantum simulation is completed. By default the connection is shutdown as well. Other options are staying in the Photon room or returning to the master server. More... | |
This class implements the Quantum interface ICommunicator and uses Photon Realtime in Unity to support sending RaiseEvent(byte, byte[], int, bool, int[]) and receiving AddEventListener(Photon.Deterministic.OnEventReceived) network messages from the Photon Cloud.
|
inline |
Create instance to assign to SessionRunner.Arguments.Communicator. The client object is expected to be connected to a game server (joined a room).
loadBalancingClient | The connected Realtime client object |
shutdownConnectionOptions | Optionally chose the shutdown behaviour |
|
inline |
Called by Quantum to recycle incoming message objects.
obj | Message object to recycle |
|
inline |
Called by Quantum to send messages.
|
inline |
Called by Quantum to subscribe to incoming messages.
|
inline |
Called by Quantum to update the Realtime client.
|
inline |
Called by Quantum when the simulation is shut down. Also called by the SessionRunner when shutting down.
|
inline |
Called when the SessionRunner is shutting down async.
RealtimeClient Quantum.QuantumNetworkCommunicator.NetworkClient => _realtimeClient |
The Realtime client object which is assigned inside the constructor.
Int32 Quantum.QuantumNetworkCommunicator.ActorNumber => _realtimeClient.LocalPlayer.ActorNumber |
Returns the Photon Actor Number that this client was assigned to.
|
getset |
When this class is assigned to a Quantum session this option configures what happens to the standing online connecting when the Quantum simulation is completed. By default the connection is shutdown as well. Other options are staying in the Photon room or returning to the master server.
|
get |
Returns RealtimeClient.IsConnected.
|
get |
Returns the RTT measured by the Realtime client.