Removefromroomcache not working :(

Options
Hi,

I use RaiseEvent and I add these to room cache and later I want to remove specified events but this is not working..
Can you help me why?

//Raisevent add to cache:
RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.All, CachingOption = EventCaching.AddToRoomCacheGlobal };

        byte evCode = 0;
        bool reliable = true;
        Hashtable DataSend = new Hashtable();
        DataSend.Add("mitcsinal", "rendelestfelvesz");
        DataSend.Add("playername", playerName);   
        DataSend.Add("time", PhotonNetwork.time); 
        
        PhotonNetwork.RaiseEvent(evCode, DataSend, reliable, raiseEventOptions);


I get event in Onevent:
mitcsinal=rendelestfelvesz
playername= qQC3wEOU95eDFw8UuBjb0O1o20G2
time = 1506285.793

So it's working fine.
Later I want this event remove from room cache:
 Debug.Log("Want to remove:" + jelenlegifeladat.kihivta + " and " + jelenlegifeladat.time);
        byte evCode = 0;
        bool reliable = true;
        Hashtable DataSend = new Hashtable();
        DataSend.Add("mitcsinal", "rendelestfelvesz");
        DataSend.Add("playername", jelenlegifeladat.kihivta); //this is same this event playerName
        DataSend.Add("time", jelenlegifeladat.time); //this is same this event time

        PhotonNetwork.RaiseEvent(evCode, DataSend, reliable, new RaiseEventOptions()
        {
            CachingOption = EventCaching.RemoveFromRoomCache
        });


Debuglog: "Want to remove:qQC3wEOU95eDFw8UuBjb0O1o20G2 and 1506285.793"

So hash table content is good, I think everything good, but don't remove from room cache.
(I connect with other mobile phone, and getting all event...)
Why? How can I remove this event?

Thank you very much,
Adrian

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @vadrian0,

    Thank you for choosing Photon!

    I did a quick test and it worked for me.
    Maybe try removing the "time" key/value as a filter when removing the event, as a test first.
    Debug.Log("Want to remove:" + jelenlegifeladat.kihivta + " and " + jelenlegifeladat.time);
            byte evCode = 0;
            bool reliable = true;
            Hashtable DataSend = new Hashtable();
            DataSend.Add("mitcsinal", "rendelestfelvesz");
            DataSend.Add("playername", jelenlegifeladat.kihivta); //this is same this event playerName
            PhotonNetwork.RaiseEvent(evCode, DataSend, reliable, new RaiseEventOptions()
            {
                CachingOption = EventCaching.RemoveFromRoomCache
            });