- update: app.js: add really long timeout for closing missed sockets - update: app.js: fix for minibrowser connectivity - update: app.js: enhance security - update: wtv-home:/home: fix wtv-needs-upgrade -> wtv-need-upgrade - update: wtv-head-waiter:/login-stage-two: do not send wtv-settings:/get to minibrowser - update: wtv-1800:/preregister: Disconnect and clean up all previous sockets for the connecting SSID when hitting preregister. Also re-create wtvsec_login. - 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
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
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; |