From 4e561ef88a80dd650e2e18099ca9c3da59f374fc Mon Sep 17 00:00:00 2001
From: gimmickCellar <121449764+gimmickCellar@users.noreply.github.com>
Date: Sat, 11 Jul 2026 14:59:50 +0000
Subject: [PATCH 1/4] add backrnd support for world redirects
---
backend/pages/world_props.js | 3 ++-
frontend/templates/configure.html | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/backend/pages/world_props.js b/backend/pages/world_props.js
index d5be7303..45d3feab 100644
--- a/backend/pages/world_props.js
+++ b/backend/pages/world_props.js
@@ -41,7 +41,8 @@ module.exports.GET = async function(req, write, server, ctx) {
showCursor: world.feature.showCursor,
colorText: world.feature.colorText,
colorCell: world.feature.colorCell,
- quickErase: world.feature.quickErase
+ quickErase: world.feature.quickErase,
+ redirect: world.feature.redirect
},
theme: {
bg: world.theme.bg,
diff --git a/frontend/templates/configure.html b/frontend/templates/configure.html
index a33422f2..716fd831 100644
--- a/frontend/templates/configure.html
+++ b/frontend/templates/configure.html
@@ -820,6 +820,14 @@
+
+
Redirect
+
+
+ Where to redirect (leave blank for no redirect):
+
+
+
From 618074d20f53dc2b803d63a7c152aa13decd7d2d Mon Sep 17 00:00:00 2001
From: gimmickCellar <121449764+gimmickCellar@users.noreply.github.com>
Date: Sat, 11 Jul 2026 16:06:00 +0000
Subject: [PATCH 2/4] implemented redirect on frontend/fix backend
---
backend/pages/accounts/configure.js | 13 +++++++++++++
backend/pages/yourworld.js | 1 +
backend/subsystems/world_mgr.js | 13 ++++++++++---
frontend/templates/yourworld.html | 1 +
4 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/backend/pages/accounts/configure.js b/backend/pages/accounts/configure.js
index 60f44b29..c36f1c06 100644
--- a/backend/pages/accounts/configure.js
+++ b/backend/pages/accounts/configure.js
@@ -258,6 +258,7 @@ module.exports.GET = async function(req, write, server, ctx, params) {
color_cell: world.feature.colorCell,
quick_erase: world.feature.quickErase,
show_cursor: world.feature.showCursor,
+ redirect_value: world.feature.redirect,
color,
cursor_color,
@@ -536,6 +537,9 @@ module.exports.POST = async function(req, write, server, ctx) {
if(modifyWorldProp(world, "feature/memberTilesAddRemove", Boolean(membertiles_addremove))) {
featureUpdates.push({type: "memberTilesAddRemove", value: Boolean(membertiles_addremove)});
}
+ if(modifyWorldProp(world, "feature/redirect", redirect)) {
+ featureUpdates.push({type: "redirect", value: redirect});
+ }
var no_anon_chat = post_data.no_anon_chat == "1";
if(modifyWorldProp(world, "opts/noAnonChat", no_anon_chat)) {
featureUpdates.push({type: "noAnonChat", value: no_anon_chat});
@@ -785,6 +789,15 @@ module.exports.POST = async function(req, write, server, ctx) {
modifyWorldProp(world, "opts/desc", "");
}
+ if(post_data.redirect_value) {
+ var redir = post_data.redirect_value;
+ if(typeof redir != "string") redir = "";
+ redir = redir.trim().replace(/\r|\n/g, "");
+ modifyWorldProp(world, "feature/redirect", redir);
+ } else {
+ modifyWorldProp(world, "feature/redirect", "");
+ }
+
if(post_data.priv_note) {
var pnote = post_data.priv_note;
if(typeof pnote != "string") pnote = "";
diff --git a/backend/pages/yourworld.js b/backend/pages/yourworld.js
index 09961e3a..eb0845a4 100644
--- a/backend/pages/yourworld.js
+++ b/backend/pages/yourworld.js
@@ -108,6 +108,7 @@ module.exports.GET = async function(req, write, server, ctx, params) {
},
worldModel: {
feature_membertiles_addremove: world.feature.memberTilesAddRemove,
+ redirect: world.feature.redirect,
writability: world.writability,
feature_url_link: world.feature.urlLink,
feature_go_to_coord: world.feature.goToCoord,
diff --git a/backend/subsystems/world_mgr.js b/backend/subsystems/world_mgr.js
index 47bfe011..a2d5e69b 100644
--- a/backend/subsystems/world_mgr.js
+++ b/backend/subsystems/world_mgr.js
@@ -93,7 +93,8 @@ var world_default_props = {
color_palette_enabled: false,
color_palette: null,
bg_color_palette_enabled: false,
- bg_color_palette: null
+ bg_color_palette: null,
+ redirect: ""
};
function validateWorldname(name) {
@@ -129,6 +130,7 @@ async function insertWorld(name) {
var writability = 0;
var readability = 0;
var properties = JSON.stringify({});
+ var redirect = "";
var rw = await db.run(`
INSERT INTO world (id, name, owner_id, created_at, feature_go_to_coord, feature_membertiles_addremove, feature_paste,
@@ -198,7 +200,8 @@ function makeWorldObject() {
showCursor: 0,
colorText: 0,
colorCell: 0,
- quickErase: 0
+ quickErase: 0,
+ redirect: "",
},
theme: {
bg: "",
@@ -327,6 +330,7 @@ function loadWorldIntoObject(world, wobj) {
wobj.feature.colorText = getAndProcWorldProp(wprops, "color_text");
wobj.feature.colorCell = getAndProcWorldProp(wprops, "color_cell");
wobj.feature.quickErase = getAndProcWorldProp(wprops, "quick_erase");
+ wobj.feature.redirect = getAndProcWorldProp(wprops, "redirect");
wobj.theme.bg = world.custom_bg;
wobj.theme.cursor = world.custom_cursor;
@@ -497,6 +501,7 @@ async function commitWorld(world) {
"feature/colorText",
"feature/colorCell",
"feature/quickErase",
+ "feature/redirect",
"theme/menu",
"theme/publicText",
"theme/memberText",
@@ -535,6 +540,7 @@ async function commitWorld(world) {
color_text: world.feature.colorText,
color_cell: world.feature.colorCell,
quick_erase: world.feature.quickErase,
+ redirect: world.feature.redirect,
custom_menu_color: world.theme.menu,
custom_public_text_color: world.theme.publicText,
custom_member_text_color: world.theme.memberText,
@@ -586,7 +592,8 @@ async function commitWorld(world) {
"theme/guestCursor",
"theme/color",
"theme/tileOwner",
- "theme/tileMember"
+ "theme/tileMember",
+ "feature/redirect",
];
var cols = {
diff --git a/frontend/templates/yourworld.html b/frontend/templates/yourworld.html
index ea7605db..a6f44e37 100644
--- a/frontend/templates/yourworld.html
+++ b/frontend/templates/yourworld.html
@@ -55,6 +55,7 @@ Loading...
From 9a40f47baba4ad19e3b741061234694f1888a529 Mon Sep 17 00:00:00 2001
From: gimmickCellar <121449764+gimmickCellar@users.noreply.github.com>
Date: Sat, 11 Jul 2026 16:16:12 +0000
Subject: [PATCH 3/4] actually fix backend this time (accidental undefined
whoops)
---
backend/pages/accounts/configure.js | 3 ---
backend/subsystems/world_mgr.js | 3 +--
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/backend/pages/accounts/configure.js b/backend/pages/accounts/configure.js
index c36f1c06..2ad738f1 100644
--- a/backend/pages/accounts/configure.js
+++ b/backend/pages/accounts/configure.js
@@ -537,9 +537,6 @@ module.exports.POST = async function(req, write, server, ctx) {
if(modifyWorldProp(world, "feature/memberTilesAddRemove", Boolean(membertiles_addremove))) {
featureUpdates.push({type: "memberTilesAddRemove", value: Boolean(membertiles_addremove)});
}
- if(modifyWorldProp(world, "feature/redirect", redirect)) {
- featureUpdates.push({type: "redirect", value: redirect});
- }
var no_anon_chat = post_data.no_anon_chat == "1";
if(modifyWorldProp(world, "opts/noAnonChat", no_anon_chat)) {
featureUpdates.push({type: "noAnonChat", value: no_anon_chat});
diff --git a/backend/subsystems/world_mgr.js b/backend/subsystems/world_mgr.js
index a2d5e69b..408df387 100644
--- a/backend/subsystems/world_mgr.js
+++ b/backend/subsystems/world_mgr.js
@@ -592,8 +592,7 @@ async function commitWorld(world) {
"theme/guestCursor",
"theme/color",
"theme/tileOwner",
- "theme/tileMember",
- "feature/redirect",
+ "theme/tileMember"
];
var cols = {
From 760c246171f12c1f4a8bdac339b8c40e7d3b5b9d Mon Sep 17 00:00:00 2001
From: gimmickCellar <121449764+gimmickCellar@users.noreply.github.com>
Date: Sat, 11 Jul 2026 20:27:03 +0000
Subject: [PATCH 4/4] add confirmation prompt, @ossftw
---
frontend/templates/yourworld.html | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/frontend/templates/yourworld.html b/frontend/templates/yourworld.html
index a6f44e37..e03b779e 100644
--- a/frontend/templates/yourworld.html
+++ b/frontend/templates/yourworld.html
@@ -55,7 +55,11 @@ Loading...