Remove cached RaiseEvent
Options
Hi,
I have a chat code that use events to send messages to other players so I want them to be cached so if a player join the room can read the messages previously sent but also I want to limit the number of messages to be cached. Is there any example of how to use
And MessaggeToRemove is stored when the number of message is == 0 and I call RemoveMessageFromCache() when the messages are > to X value, the thing is that it is removing all the events not the one that I want to be removed.
Thanks.
I have a chat code that use events to send messages to other players so I want them to be cached so if a player join the room can read the messages previously sent but also I want to limit the number of messages to be cached. Is there any example of how to use
EventCaching.RemoveFromRoomCache;
so far what I do is if the number of messages is > than X then I do this: public void RemoveMessageFromCache()
{
byte evCode = 0;
bool reliable = true;
RaiseEventOptions ro = new RaiseEventOptions();
ro.Receivers = ReceiverGroup.All;
ro.CachingOption = EventCaching.RemoveFromRoomCache;
PhotonNetwork.RaiseEvent(evCode, MessaggeToRemove, reliable, ro);
}
And MessaggeToRemove is stored when the number of message is == 0 and I call RemoveMessageFromCache() when the messages are > to X value, the thing is that it is removing all the events not the one that I want to be removed.
Thanks.
0
Comments
-
Okay, I guess I have to use a Hashtable to remove specific events from the same eventcode.0