Photon Unity Networking 2: IWebRpcCallback Interface Reference

Photon Unity Networking 2

IWebRpcCallback Interface Reference

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

Inherited by WebRpcCallbacksContainer.

Public Member Functions

void OnWebRpcResponse (OperationResponse response)
 Called by PUN when the response to a WebRPC is available. See PhotonNetwork.WebRPC. 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, use the LoadBalancingClient.WebRpcCallbackTargets and Add() the instance. To stop getting callbacks, Remove() the instance.

Member Function Documentation

void OnWebRpcResponse ( OperationResponse  response)

Called by PUN when the response to a WebRPC is available. See PhotonNetwork.WebRPC.

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)

Online Documentation  -  Dashboard  -  Support Forum Exit Games GmbH