update wtv-tricks system

- Info now shows Guest Mode or Subscriber Info
- Implemented wtv-tricks:/unregister
- Implemented wtv-tricks:/register
- Show correct link in wtv-tricks:/tricks based on Guest Mode status
This commit is contained in:
zefie
2021-08-07 20:16:54 -04:00
parent a91076c9b3
commit 2b36ace012
6 changed files with 126 additions and 1 deletions

View File

@@ -197,6 +197,19 @@ class WTVClientSessionData {
}
unregisterBox() {
try {
if (this.fs.lstatSync(this.session_storage + this.path.sep + this.ssid + ".json")) {
return this.fs.unlinkSync(this.session_storage + this.path.sep + this.ssid + ".json");
this.session_store = {};
}
} catch (e) {
// Don't log error 'file not found', it just means the client isn't registered yet
if (e.code != "ENOENT") console.error(" # Error deleting session data for", this.filterSSID(this.ssid), e);
return false;
}
}
hasCap(cap) {
if (this.capabilities) {
return this.capabilities[cap] || false;