How to get Unique (byte)id for ClientInterestArea?

Options
KEMBL
edited October 2011 in Photon Server
Ppl! Have got one very small question! As i saw in ClientInterestArea docs
public ClientInterestArea(Peer peer, byte id, IWorld world);
where id: The id for this interest area. Unique per Photon.SocketServer.Mmo.Actor.

Does this mean "Unique per each Actor on one Account" ?

If id is 0 < x < 255, how to get it unnical for every Actor on server? What if gamers more than 255?

Comments

  • Boris
    Options
    It means that each actor (each client) can have up to 256 interest areas and that the numbers are not globally unique, just unique per actor.
    For example, each actor can have one interest area with number 1, but they are all different instances.
    If "John" moves interest area #1 he moves his own one instance, not "Jane's".
  • thx! It is clear now!
    And one more question which not clear for me from docs.

    Will event OnItemUnsubscribed triggered automaticaly on all intrest Areas which subscribed for item or not when Actor item go off the world by command:
     World.ItemCache.RemoveItem((byte)ItemType.Avatar, Avatar.Id);
    

    or needs some more operatons to trigger this OnItemUnsubscribed Event? Call UnsubscribeItem or etc?
  • Boris
    Options
    The item cache is just a look-up table for all items in a world.
    You need to dispose the item in order to trigger OnItemUnsubscribed (Item.Dispose() sends an ItemDisposedMessage into the DisposeChannel, InterestAreas receive this message and unsubscribe).
    Actor.Dispose() will also dispose all his items.