EventCaching - can't find any info

Options
panthernet
edited February 2014 in DotNet
Hi, as i've understood correctly the events can be cached, but i don't quite sure how EventCaching different modes operates.
1. For example now i'm working on the room system and i want to cache player data in the room so all newly joined players will automaticaly get it from the server on join. Can it be achieved? Or i still need to manualy send data on join event?

2. I got steady flow of coordinates transfer for each player in the game. Is it possible to send events such the way that newly joined player will automaticaly get most recent coordinates package from each player? Should i use ReplaceCache value?

Btw, I haven't found any docs on this. Is there any? Thanks.

Comments

  • Tobias
    Options
    You can't find much documentation on this, sadly. It's a weak part of the docs. Sorry.
    In EventCaching, ignore all but the values with "RoomCaching".
    You can Add or AddGlobal. Usually your events get cleaned up when you leave a room. Global ones stay.

    There are different usecases how to update new users.
    1) Rare events that build on top of each other. Those need a history and should be cached. You don't want to repeat when someone joins. Placing a box and putting something in it might be an example.
    2) Frequently updated data can be sent in event and once a new client joins it will get an update sooner than later. It's not useful to cache this. Movement is an example.
    3) State-updates that don't require a history (like current weapon or clothes, or a light being turned on) can be stored in a player- or room-property. You don't want to replay all the state changed but just need the latest one. The Room and Player classes have setters for those and new player get them before any event.

    Hope this helps a bit.
  • Thanks for the info! I'll see.