v0.9.37
- remove extra debugging - fix: could not unregister if multiple users existed - fix: http(s) proxy - add example in user_config.example.json to use public proxy - maybe fix: double reg - add support for "modpacks" to viewergen - first mod is "BackgroundSound" by @Sgeo (and https://github.com/elishacloud/dxwrapper)
This commit is contained in:
@@ -91,7 +91,7 @@ class WTVClientSessionData {
|
||||
}
|
||||
|
||||
switchUserID(user_id, update_mail = true, update_ticket = true, update_favorite = true) {
|
||||
this.user_id = user_id;
|
||||
this.user_id = parseInt(user_id);
|
||||
if (user_id != null) {
|
||||
this.loadSessionData();
|
||||
if (this.isRegistered() && update_mail) this.assignMailStore();
|
||||
@@ -505,12 +505,13 @@ class WTVClientSessionData {
|
||||
|
||||
try {
|
||||
// only save if file has changed
|
||||
var json_save_data = JSON.stringify(this.session_store);
|
||||
var json_load_data = (!skip_merge) ? this.loadSessionData(true) : {};
|
||||
var sessionToStore = this.session_store;
|
||||
var json_save_data = JSON.stringify(sessionToStore);
|
||||
var json_load_data = (skip_merge) ? {} : this.loadSessionData(true);
|
||||
|
||||
var storeDir = this.getUserStoreDirectory();
|
||||
if (!this.fs.existsSync(storeDir)) this.mkdirRecursive(storeDir);
|
||||
var sessionToStore = this.session_store;
|
||||
|
||||
if (sessionToStore.password_valid) delete sessionToStore.password_valid; // do not save validity state of password login, resets when session expires
|
||||
if (json_save_data != json_load_data) this.fs.writeFileSync(storeDir + "user" + this.user_id + ".json", JSON.stringify(sessionToStore), "Utf8");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user