diff --git a/zefie_wtvp_minisrv/ServiceDeps/viewergen/BackgroundSound.zip b/zefie_wtvp_minisrv/ServiceDeps/viewergen/BackgroundSound.zip
new file mode 100644
index 00000000..af9ce202
Binary files /dev/null and b/zefie_wtvp_minisrv/ServiceDeps/viewergen/BackgroundSound.zip differ
diff --git a/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/index.js b/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/index.js
index 3ffe4ade..fb7647d7 100644
--- a/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/index.js
+++ b/zefie_wtvp_minisrv/ServiceVault/http_pc/viewergen/index.js
@@ -30,6 +30,15 @@ var viewer_stock_md5s = {
"WebTVIntel--2.5-HE.exe": "64edab977ec19a663c5842176bec306a"
}
+var modpacks = {
+ 0: {
+ "name": "Background Sound",
+ "description": "Enables the Viewer to continue playing sound when it is not the currently active window.",
+ "file": "BackgroundSound.zip",
+ "default": true
+ }
+}
+
var patch_defaults = {
"start_url": "client:GoToConn",
@@ -336,7 +345,6 @@ if (request_headers.query.viewer &&
var viewer_file = viewers[request_headers.query.viewer];
var needs_hacktv_mini = (viewer_file === "WebTVIntel--2.5-HE.exe") ? true : false
- console.log('needs_hacktv_mini', needs_hacktv_mini)
if (!viewer_file) {
errpage = wtvshared.doErrorPage("500", null, socket.minisrv_pc_mode)
headers = errpage[0];
@@ -346,7 +354,7 @@ if (request_headers.query.viewer &&
var viewer_data = zlib.gunzipSync(viewer_gz_data);
var viewer_md5 = crypto.createHash('md5').update(viewer_data).digest("hex");
if (viewer_md5 != viewer_stock_md5s[viewer_file]) {
- console.log(viewer_file, "md5sum error. expected:", viewer_stock_md5s[viewer_file], ", got:", viewer_md5)
+ console.error(viewer_file, "md5sum error. expected:", viewer_stock_md5s[viewer_file], ", got:", viewer_md5)
errpage = wtvshared.doErrorPage("500", null, socket.minisrv_pc_mode)
headers = errpage[0];
data = errpage[1];
@@ -411,6 +419,26 @@ Content-Disposition: attachment; filename="${viewer_file.replace(".exe", ".zip")
});
}
}
+
+ var embed_modpacks = [];
+ Object.keys(request_headers.query).forEach((k) => {
+ if (k.substring(0, 8) === "modpack_") {
+ embed_modpacks.push(parseInt(k.substring(8)));
+ }
+ });
+
+ if (embed_modpacks.length > 0) {
+ Object.keys(embed_modpacks).forEach((k) => {
+ var modpack_file = viewergen_resource_dir + modpacks[k].file;
+ if (fs.existsSync(modpack_file)) {
+ var modpack_zip = new AdmZip(modpack_file);
+ var zipEntries = modpack_zip.getEntries();
+ zipEntries.forEach(function (zipEntry) {
+ zip.addFile(zipEntry.entryName, zipEntry.getData());
+ });
+ }
+ });
+ }
}
data = zip.toBuffer();
}
@@ -505,8 +533,8 @@ Welcome to the zefie minisrv v${minisrv_config.version} PC Services
SSID:
-
-
+
+ Viewer clients should use SSIDs starting with 91,
unless you are intentionally trying to spoof a box.
@@ -542,11 +570,20 @@ although certain advanced server operators may use these flags
to determine what your "box" can do, and as such, may offer
features that do not work in the Viewer, especially older ones
- Let the server choose the SSID (Ignores SSID above)
+ Let the server choose the SSID (Ignores SSID above)
Only include Viewer EXE, not ROM files or Logos (Advanced Users Only)
diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup.js b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup.js
index 0f1a96cb..6adbe548 100644
--- a/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup.js
+++ b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/cSetup.js
@@ -67,11 +67,11 @@ hspace="0" vspace="0" fontsize="large" noscroll>
function doConnect() {
- // if (document.connect.machine.value == "${minisrv_config.services['wtv-1800'].host}" && document.connect.port.value == "${minisrv_config.services['wtv-1800'].port}") {
-// alert("You are already here!");
- // } else {
+ if (document.connect.machine.value == "${minisrv_config.services['wtv-1800'].host}" && document.connect.port.value == "${minisrv_config.services['wtv-1800'].port}") {
+ alert("You are already here!");
+ } else {
document.connect.submit();
-// }
+ }
}
function setOther() {
@@ -103,7 +103,7 @@ hspace="0" vspace="0" fontsize="large" noscroll>
document.message.msg.value='Default WebTV Production IP/Port. Can be used to check your routing setup.'
break;
case "wni-int":
- document.connect.machine.value="192.168.11.8"
+ document.connect.machine.value="10.0.128.1"
document.connect.port.value="1615"
document.message.msg.value='Default WebTV Internal IP/Port. Can be used to check your routing setup.'
break;
diff --git a/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/unregister.js b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/unregister.js
index f3c5b41f..f5776b92 100644
--- a/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/unregister.js
+++ b/zefie_wtvp_minisrv/ServiceVault/wtv-tricks/unregister.js
@@ -11,7 +11,7 @@ if (!session_data.getSessionData("registered")) {
} else if (session_data.user_id !== 0) {
headers += "\nwtv-noback-all: wtv-";
headers += "\nwtv-expire-all: wtv-";
- var redirect = [5, "wtv-tricks:/tricks"];
+ var redirect = [5, "client:relogin?"];
var message = "Error: You must be the primary user to unregister this box.";
} else if (request_headers.query.confirm_unregister) {
if (session_data.unregisterBox()) {
diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js
index 55e35fb3..4c1308eb 100644
--- a/zefie_wtvp_minisrv/app.js
+++ b/zefie_wtvp_minisrv/app.js
@@ -879,7 +879,8 @@ async function doHTTPProxy(socket, request_headers) {
method: request_data.method,
followAllRedirects: true,
headers: {
- "User-Agent": request_headers["User-Agent"] || "WebTV"
+ "User-Agent": request_headers["User-Agent"] || "WebTV",
+ "Connection": "Keep-Alive"
}
}
@@ -1005,7 +1006,7 @@ function stripHeaders(headers_obj, whitelist) {
var whitelisted_headers = new Array();
var out_headers = new Array();
out_headers.Response = headers_obj.Response;
- out_headers['wtv-connection-close'] = headers_obj['wtv-connection-close'];
+ if (headers_obj['wtv-connection-close']) out_headers['wtv-connection-close'] = headers_obj['wtv-connection-close'];
// compare regardless of case
Object.keys(whitelist).forEach(function (k) {
diff --git a/zefie_wtvp_minisrv/includes/WTVClientSessionData.js b/zefie_wtvp_minisrv/includes/WTVClientSessionData.js
index 50103ffa..a0475369 100644
--- a/zefie_wtvp_minisrv/includes/WTVClientSessionData.js
+++ b/zefie_wtvp_minisrv/includes/WTVClientSessionData.js
@@ -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;
diff --git a/zefie_wtvp_minisrv/includes/WTVRegister.js b/zefie_wtvp_minisrv/includes/WTVRegister.js
index f447e283..6b23aa16 100644
--- a/zefie_wtvp_minisrv/includes/WTVRegister.js
+++ b/zefie_wtvp_minisrv/includes/WTVRegister.js
@@ -44,8 +44,7 @@ class WTVRegister {
// check against user accounts
directory = (directory) ? directory : this.session_store_dir + this.path.sep + "accounts";
-
- console.log(directory)
+
if (this.fs.existsSync(directory)) {
this.fs.readdirSync(directory).forEach(file => {
if (self.fs.lstatSync(directory + self.path.sep + file).isDirectory() && !return_val) {
diff --git a/zefie_wtvp_minisrv/package.json b/zefie_wtvp_minisrv/package.json
index efefe9cc..271b5d1e 100644
--- a/zefie_wtvp_minisrv/package.json
+++ b/zefie_wtvp_minisrv/package.json
@@ -1,6 +1,6 @@
{
"name": "zefie_wtvp_minisrv",
- "version": "0.9.36",
+ "version": "0.9.37",
"description": "WebTV Service (WTVP) Emulation Server",
"main": "app.js",
"homepage": "https://github.com/zefie/zefie_wtvp_minisrv",
diff --git a/zefie_wtvp_minisrv/user_config.example.json b/zefie_wtvp_minisrv/user_config.example.json
index f36d2700..652fad08 100644
--- a/zefie_wtvp_minisrv/user_config.example.json
+++ b/zefie_wtvp_minisrv/user_config.example.json
@@ -118,7 +118,19 @@
"username": "mylocaluser",
"password": "mylocalpass"
}
+ },
+ // the following uses zefie's public proxy with webone for web surfing and image scaling
+ "services": {
+ "http": {
+ "host": "51.222.164.146",
+ "nobind": true
+ },
+ "https": {
+ "host": "51.222.164.146",
+ "nobind": true
+ }
}
+ // end zefie's public proxy
},
"favorites": {
"folder_templates": {