Code:Cache

From Warlords Wiki
Jump to: navigation, search

The cache is where permanent values should be stored. Values should be loaded from the cache during the init event, and should be stored to it during the cache event. Note that the cache event runs synchronously, so doing any large operations during it has the potential to majorly slow down the server. Try to avoid this.

The preferred way of using the cache is to have some global variables, then, on the cache event, store those to cache. During the init event, you would load these back. It is advised to check if a loaded value is Unit, and give it a default value if so.