MMO Framework - Filter events from/to interest system

Options
syrka
edited February 2013 in Photon Server
Hi,

i try to find a solution, how to filter the receivers of a event from item.EventChannel.Publish(message). I found no solution yet :x

Have anyone a idea?

Comments

  • chvetsov
    Options
    Hi, syrka.

    If I understand correctly, you have many subscribers of item.EventChannel. And your wish is filter some subscribers from receiving messages. if it is so. Then there is two ways:
    - do not subscribe
    - do not handle. i mean, it is normal way to handle in subscriber only what you need.
  • ehm, its possible to have more than one EventChannel?

    i use the basic mmo demo setup. I send position updates and local chat over the interest system. Now i want to filter somehow only the chat messages, but i don't know where.
  • dreamora
    Options
    Use 1 IA per purpose and you will not have the problem. with that I mean: you should not mix the interest area for position handling and the one for chat messages. Its not like they are likely never to be of the same range anyway unless you want to invite spamers. For guild - team chats you will need to handle the chat this way anyway actually.
  • chvetsov
    Options
    syrka wrote:
    ehm, its possible to have more than one EventChannel?

    i use the basic mmo demo setup. I send position updates and local chat over the interest system. Now i want to filter somehow only the chat messages, but i don't know where.

    Of course you can have more. You can extend current functionality or change it completly
  • my chat is working now :D

    now i'm interested in the eventchannel thing ^^

    in the mmo demo, you use one interest area and one item, if i want use a 2nd eventchannel, how do i add this? (basic steps)
  • chvetsov
    Options
    you need to add channel to item, add logic to send events to this channel
    and add logic to subscribe handlers to this channel. if you are ok with current logic you can just add your code to ClientIterestArea::OnSubscribeItem, if you are not take a look on IterestArea.ReceiveItemSnapshot
    and of course do not forget to read documentation for this sample