v0.9.6
- update: add initial wtv-capability-flags decoding, as well as wtv-tricks:/info demonstration - update: rename classes - minor update: quirky 'Special Thanks' in each custom class. - minor update: notice about Initial Shared Key and multiple minisrvs - update: wtv-music:/demo/index: update wtv-star image paths - update: app.js: fix unencrypted post - update: app.js: improve buffering and cleanup in attempt to fix occasional 'double-up' bug - update: info.js: remove debug dump of capabilities - Update: add test.js, syntax-testing script for `npm test` - Update: wtv-chat:/home experimental nick change page thanks to MattMan (chat still giving issues on real boxes, works in Viewer) - Update: README.md: Add ways to support the project
This commit is contained in:
37
zefie_wtvp_minisrv/WTVClientSessionData.js
Normal file
37
zefie_wtvp_minisrv/WTVClientSessionData.js
Normal file
@@ -0,0 +1,37 @@
|
||||
class WTVClientSessionData {
|
||||
|
||||
/***********************************\
|
||||
|* Special Thanks to: *|
|
||||
|* No one *|
|
||||
|* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *|
|
||||
|* There is literally nothing *|
|
||||
|* special about this class *|
|
||||
\***********************************/
|
||||
|
||||
data_store = null;
|
||||
|
||||
constructor() {
|
||||
this.data_store = new Array();
|
||||
}
|
||||
|
||||
get(key = null) {
|
||||
if (typeof (this.data_store) === 'undefined') return null;
|
||||
else if (key === null) return this.data_store;
|
||||
else if (this.data_store[key]) return this.data_store[key];
|
||||
else return null;
|
||||
}
|
||||
|
||||
set(key, value) {
|
||||
if (key === null) throw ("ClientSessionData.set(): invalid key provided");
|
||||
if (typeof (this.data_store) === 'undefined') this.data_store = new Array();
|
||||
this.data_store[key] = value;
|
||||
}
|
||||
|
||||
delete(key) {
|
||||
if (key === null) throw ("ClientSessionData.delete(): invalid key provided");
|
||||
delete this.data_store[key];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports = WTVClientSessionData;
|
||||
Reference in New Issue
Block a user