Photon -- cached events cache event

Source: Internet
Author: User

 

Cached events cache event usually, the operation   Raiseevent   Sends your event to anyone else, currently in the same room. cached events are... Cached... And will be sent to joining (new) players when they arrive. Normally, the operation Raiseevent Send your events to other players in the current game room. cache events are cached and will be sent to new players. Use Case: position updates are sent 10 times a second, so joining players will get your position quickly. your player's nick name, color and clothing don't need ten updates per second. once sent, it wocould be nice to "remember" and update new players when they arrive. this is what cached events do. use Case: location update is sent 10 times per second, so the added players will soon get your location. You do not need to update your nickname, color, or clothes 10 times per second. Once sent, it is happy to remember and update new players. This is what cache events do. Cached events can be modified and removed as needed. Also, they are sorted for delivery. See below. cache events can be modified and deleted as needed, and they are sorted. Disclause disclaimer cached events are a feature of the lite application and lite loby application of photon 3. they are not supported by the MMO application or if you start from scratch. cache events are lite and loby features that are not supported by MMO and your own applications. Cache Control Events are cached per actor and per event code. This way, every player can send event   "Myprofile"   (A.k. a. (byte) 0) and set some values. Events are cached for each player and each event Code Each player can send events. "Myprofile" And set some values. Per event, the cache can be updated and replaced or simply removed. Each event, this cache can be updated, replaced, or removed. Updating an event is done by merging new content into the previusly cached one. the newer event's data hashtable will update (key by key) any existing value. updating an event is to incorporate a new content into the cache, and the data of this new event will update the existing value. Photon 3 allows you to send null as value in HashTables (and several other places), so to get rid of a key in a cached event: send the same event, assign null to the key you want deleted and merge the event. photon3 allows you to send null as a value to send this event. The null value will delete the existing event cache with the same key. Ordered delivery ordered delivery Cached events are sent to players when they join, which means they make up the fist few events they get inside a room. when a player joins, the cache event will be sent, which means that when they enter the room, they will get all events new players get cached events, grouped by player, sorted by ascending actor number. this gives you all cached events of Player 1 before you get other player's events. new players get cache events, which are sorted by player numbers. You will get the cache of Player 1 before getting players. Per (sending) player, cached events are ordered by ascending eventcode. no matter if event 10 was sent before event 1, if it's coming from the cache, event 1 will precede event 10 (and 2 and so on ). for each player, the event cache is sorted by Event code. Whether event 10 is sent before event 1 or not, event 1 is placed before event 10. This shoshould give you all control about the order you need. you can even cache stuff like "map" or "Match rules" this way: Put them in the event with lowest number and new players know this first. this will give you all the control commands you need. You can even cache maps and matching rules and place them in events so that new players can know them immediately.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.