Where should my client send event to?

zhuchunzhuchun
edited April 25 in Photon Server
Hi, I'm trying to make am authoritative game as a Plugin, since game-logic is on the server-side, it's not necessary to send events to everyone, right? But It doesn't make sense to send his/her event to the master client, then where should it be sent?

Comments

  • Hi @zhuchun,

    You can send events to anyone or to none.
    You can choose whatever target from client side and the plugin can just stop the event from reaching that target by calling info.Cancel() to silently skip forwarding/relaying the events.
    You can also choose to identify the server/plugin as a special target, try Actor Number 0 (didn't test it and not sure if it works) or you can set an interest group that no client is subscribed to.
  • zhuchunzhuchun
    edited April 26
    JohnTube said:

    Hi @zhuchun,

    You can send events to anyone or to none.
    You can choose whatever target from client side and the plugin can just stop the event from reaching that target by calling info.Cancel() to silently skip forwarding/relaying the events.
    You can also choose to identify the server/plugin as a special target, try Actor Number 0 (didn't test it and not sure if it works) or you can set an interest group that no client is subscribed to.

    Thank you! The first one is simple & easy :D

    Will try and update soon

    UPDATE:
    Send to ActorNr==0 and info.Cancel() both work.
Sign In or Register to comment.