Ability to Work with Arbitrary Synchronizable Data
Starting from API V8PreviewV7, it became possible to work with arbitrary data. This data is operational and synchronized between terminals for plugins with a specific moduleId.
AddOrUpdateCustomData - add/update data by key. There is a limit on the size of data, the number of keys, and the length of the key that can be written by plugins. The key length is no more than 512 characters. The value length is no more than 32768 characters. The number of keys that a plugin can write is no more than 1024.
TryGetCustomData - retrieve data by key. If there is no data for such a key, null will be returned.
TryRemoveCustomData - remove data by key. If the data was not found, false will be returned.
ClearCustomData - remove all keys written by the plugin.
GetAllCustomData - get all data for the plugin.
Automatic data cleaning is provided, which occurs when the cash shift is closed. If the data has not been used for some time (3 days by default, controlled by the option in config.xml - customDataObsolescenceDuration), the plugin will be notified about this by subscribing to BeforeCustomDataClear. In the notification, the plugin receives a dictionary of key-data pairs that it has not accessed for a long time. In response, the plugin must return the keys it wants to keep. If the plugin does not subscribe to the notification, the “old” data will be deleted. The update of the last access to the data is influenced by the following calls: AddOrUpdateCustomData, TryGetCustomData, GetAllCustomData.