How to setup a masterclient?
Options
Hello,
if i want to use a unity client as masterclient, how do i setup this kind of environment? I dont know how to start
Another questions are:
(didn't find it anywhere): how do i send rpc's to the the masterclient (PhotonTarget.MasterClient?) and is a rpc to the masterclient recived by the other clients (they ignor them only?)
how do i call custom operations from a unity client?
if i want to use a unity client as masterclient, how do i setup this kind of environment? I dont know how to start
Another questions are:
(didn't find it anywhere): how do i send rpc's to the the masterclient (PhotonTarget.MasterClient?) and is a rpc to the masterclient recived by the other clients (they ignor them only?)
how do i call custom operations from a unity client?
0
Comments
-
Thats correct, you send RPCs to him through the MasterClient PhotonTarget and no the others will not get it, the photonserver explicitely only sends it to him.
As for custom ops: You would have to implement them in the NetworkingPeer as well as in the LoadBalancing project on the photon server (not the cut down one that comes with the AS download but the real photon 3 server)0 -
dreamora wrote:Thats correct, you send RPCs to him through the MasterClient PhotonTarget and no the others will not get it, the photonserver explicitely only sends it to him.dreamora wrote:As for custom ops: You would have to implement them in the NetworkingPeer as well as in the LoadBalancing project on the photon server (not the cut down one that comes with the AS download but the real photon 3 server)0
-
The master client is simply the active player with the lowest actornumber of a room. So it is setup automatically and "master" switches, if the current one leaves the game.
Just to be sure: The master is not the same as the server. You can call RPCs on the master client but can't call custom operations on it. Any operations are handled by the server exclusively.
To implement new, custom operations in the Photon Unity Networking plugin, you could extend the NetworkingPeer.cs. The method OpCreateGame in it is already using the custom operation feature of the client library, so you have a blueprint for this. Also, you can check out the docs in the DevNet: Custom Operations.0