Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
custom:javascript:lib:userprops.js [2019/01/07 23:12] – created digital man | custom:javascript:lib:userprops.js [2019/08/14 00:30] (current) – [userprops.js] typo digital man | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== userprops.js ====== | ====== userprops.js ====== | ||
- | FIXME | + | |
+ | So you're a Synchronet JavaScript module author or modder and you've got some per-user values that you would like to store persistently (in a file). This is where the User Properties ('' | ||
+ | |||
+ | This library manages the '' | ||
+ | |||
+ | These files are automatically cleaned-up by Synchronet when a user account number is assigned to a new user. | ||
+ | |||
+ | ===== Usage ===== | ||
+ | |||
+ | The '' | ||
+ | |||
+ | <code javascript> | ||
+ | var userprops = load({}, " | ||
+ | </ | ||
+ | |||
+ | This creates a new library object (called '' | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | You can then call these methods like so: | ||
+ | |||
+ | <code javascript> | ||
+ | var userprops = load({}, " | ||
+ | var list = userprops.get(" | ||
+ | list.push(" | ||
+ | userprops.set(" | ||
+ | </ | ||
+ | |||
+ | ==== usernum ==== | ||
+ | |||
+ | By default, these methods operate on the '' | ||
+ | |||
+ | ==== get ==== | ||
+ | |||
+ | The '' | ||
+ | * the entire property file associated with the specified user and return an // | ||
+ | * the specified '' | ||
+ | * a specific property '' | ||
+ | |||
+ | |||
+ | === Types === | ||
+ | |||
+ | To have precise control over the data-types read from a user's property file, you will need to '' | ||
+ | |||
+ | ==== set ==== | ||
+ | |||
+ | The '' | ||
+ | * the entire property file associated with the specified user | ||
+ | * the specified '' | ||
+ | * a specific property '' | ||
+ | |||
+ | This method returns '' | ||
===== See Also ===== | ===== See Also ===== | ||
* [[: | * [[: |