Cache Option

hi.
why the replace cache event is deprecated???
i want to send the last event of a player to the late joining players.
how can i handle this???

Comments

  • i dont know how removeFromRoomCache works.because this caching works for eventCode.so for example if we have a Event with Eventcode.PickItem and we add this to RoomCache.so how can we remove this event.because this event is saying to players that this player has been picked an item.so for removing we have to send again RaiseEvent with cachOption of removing.i dont know.can u help me in this case???it's so confusing with this caching
  • for Cleaning the Cache:

    You can also remove events from the cache with option EventCaching.RemoveFromRoomCache. In that case, the eventCode, the "sender actorNumber" and the "content" Hashtable are used as a filter. You can remove the events of a specific actor, all events with the same eventCode or with a specific content.

    i am a little bit confuesed.i can remove cache just by Eventcontent???

    for example if there is EventCache in my room with EvCode 1 and Data content "Box" "Blue" of Hashtable and ActorNr 2

    and then i use :


    Hashtable DataSend = new Hashtable();
    DataSend.Add("Box", "Blue");

    RaiseEventOptions RaiseOption = new RaiseEventOptions();
    RaiseOption.CachingOption = EventCaching.RemoveFromRoomCache;

    PhotonNetwork.RaiseEvent(50, DataSend , true, RaiseOption);

    the event must be Removed after sending this raise????
    i mean it doesn't matter if the Event code is equal to cached event or actorNr?????

    and what is this????

    RemoveFromRoomCache: this indicates that all previously cached events that match the specified "filter pattern" will be removed from the cache. The "filter pattern" is a combination of three parameters: event code, sender number and event data. You can use one, two or all three filters.

    it says its a combination.can u give me an example???
  • Aidin0181
    Aidin0181
    edited April 2018
    ok,i think the Filter pattern must be equal for cleaning the cache.the eventCode must be exact but Data can be anything and the ActorNr must be the same.Right????
    for Example i cant delete a cache (ev code 1 , data "anything" actorNr 2) with eventCode 2 , data "anything" , actorNr2) Right????
    another question is this that if i use Info.fail in plugin, this raiseEvents wont be added to room cache right????because in other case anybody could overload the room cache.
  • Aidin0181
    Aidin0181
    edited April 2018
    how this PhotonNetwork.RaiseEvent() works??

    i mean when i use it i will do nothing in my plugin and just wrote a info.continue() .so i shouldn't receive them and i wont.but the interesting thing is that when i use 2 client and send this raiseEvent from one clinet.i can receive them in another client.... i mean whhhhy????whhhhhhhhhhhhhy???
  • Aidin0181
    Aidin0181
    edited April 2018
    ok i got it. i should set The TargetActors to 0 for receiving only on server and not in other clients.these little problems are killing me. :neutral:
  • @Aidin0181
    Hi, Can you please share the code snippet.
    I would like to clear the event received from others, once I receive and execute it.
    So when I reconnect I don't want to execute the same old events.
    Is it possible with the RemoveFromRoomCache