Send event with SendEvent methode problem

Options
syrka
edited January 2013 in Photon Server
Hello all,

my question is: do the SendEvent methode always send a event to the peer that called the SendEvent?

I use a dictionary of all connected clients, remove the sender of the of the Event from the dictionary and add the receivers with eventData.SendTo(receiverlist,sendparameter)

Any ideas?

Comments

  • ok, i solved it - i take the list of all peers and call the sendevent in all peers, exept mine peer. is this the right way? :idea:
  • Tobias
    Options
    The way is correct. This is also what we do in Rooms.
    You can optimize the sending by not calling individual sends but by providing a list of target players that excludes you. This way, serialization is done less often.
  • Tobias wrote:
    You can optimize the sending by not calling individual sends but by providing a list of target players that excludes you.

    mhh, i have tried this :idea: if i dont remove the eventsender from the the receiverlist, the sender get the event twice, if remove him, i got still one event.

    this happends, if i use eventData.SendTo :?:
  • ok, found my mistake *facepalm*

    didn't know that eventData.SendTo already send the event. i called SendEvent after it, that was the reason.
  • Tobias
    Options
    :lol:
    Glad you found it.