Globally Notification/Event

Vikash
Vikash
edited December 2018 in Photon Server
Hello team,
Please provide a solution for sending notifications/events to all the users connected to the server irrespective of their rooms or lobby.

Thanks
Ram

Comments

  • Hi, @Vikash

    Enumerate all rooms and take from there all active actors. From an active actor, you may get a peer and send a message

    best,
    ilya
  • Actually the question is regarding photon self hosted server plugin. Please specify how can we access room list on server side plugin. We just need to send notification to any active actor connected to our photon server irrespective of room or lobby.
  • hi, @Vikash

    form plugin you are not able to access all rooms. but from the plugin factory, you may access all plugins and from the plugin, you may access all actors.
    Your factory created once per plugin version. so it may serve like singleton in your case.

    best,
    ilya
  • Hi, @Ilya

    can we send notification one room player to another room player or lobby player using plugin factory and plugin?

    Plz help me with sample code for sending notification

    Thanks


  • chvetsov
    chvetsov mod
    edited January 2019
    Hi, @Vikash

    You may send messages from one client to another inside same room by setting actorId. Also by setting actorId you may send event to speciefic actor(s) using BroadcastEvent method.

    how to use them you may find in the documentation
    Plugins:
    https://doc.photonengine.com/en-us/server/current/plugins/manual

    UPDATE:
    Client docs
    https://doc.photonengine.com/en-us/realtime/current/getting-started/quick-start#sendevents

    there is no built-in way to send something between players in different rooms and different servers. You should use extra communication channel to achieve this

    best,
    ilya