From 595e499b55c840ca944826cdb643aba2547db640 Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Wed, 1 Apr 2026 14:33:25 -0400 Subject: [PATCH 1/7] af2026 hotfix 2 --- client/script.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/script.js b/client/script.js index 1456257e..9141b2ff 100644 --- a/client/script.js +++ b/client/script.js @@ -1286,7 +1286,10 @@ $(function () { "You are too young to use MultiplayerPiano.net. Users must be 13 years of age or older to use the platform. Please read our updated Terms of Service.", ); + if (age < 0) throw new Error("The Terminator"); + localStorage.age = age; + localStorage.dob = year; closeModal(); gClient.start(); } catch (err) { @@ -1304,6 +1307,15 @@ $(function () { }); gClient.emit("status", "Verifying age..."); + + (() => { + if (!localStorage.age) return; + const year = parseInt(localStorage.dob); + console.log(year); + console.log(isNaN(year)); + if (!isNaN(year)) $("#age input[name=year]").val(year); + })(); + openModal("#age"); $("#room-settings").append( @@ -1377,10 +1389,13 @@ $(function () { spoop(); }, Math.random() * 36e5); + // this is causing the sound selector to break for some people + /* gSoundSelector.addPacks([ "https://hri7566.github.io/Dog/", "https://hri7566.github.io/RobloxDeathSound/", ]); + */ })(); // Show moderator buttons From e6d2cb3025d8c518d412aae6919ce4619f488c9c Mon Sep 17 00:00:00 2001 From: Daniel-176 Date: Mon, 6 Apr 2026 22:24:15 -0300 Subject: [PATCH 2/7] name previews on the user set modal --- client/index.html | 17 +++++++++---- client/screen.css | 20 +++++++++++++++- client/script.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 5 deletions(-) diff --git a/client/index.html b/client/index.html index 5b94c745..9b00c7e2 100644 --- a/client/index.html +++ b/client/index.html @@ -166,9 +166,12 @@

Important Notice

-

In accordance with our updated Terms of Service, MultiplayerPiano.net is implementing a mandatory Age Verification Protocol (AVP) effective immediately. Our Trust & Safety team now requires all users to confirm their date of birth before connecting to our servers.

+

In accordance with our updated Terms of Service, MultiplayerPiano.net is implementing a mandatory Age + Verification Protocol (AVP) effective immediately. Our Trust & Safety team now requires all users to confirm + their date of birth before connecting to our servers.

- The MultiplayerPiano.net Trust & Safety Team

-

+

Read more...

@@ -195,7 +198,13 @@

Important Notice

-

+

+
BOT
+
aeiou
+
+

+

@@ -293,4 +302,4 @@

Important Notice

- + \ No newline at end of file diff --git a/client/screen.css b/client/screen.css index 9b5038a5..4fa39753 100644 --- a/client/screen.css +++ b/client/screen.css @@ -99,6 +99,20 @@ table { max-width: 100%; } +.name-preview { + font-size: 16px; + padding: 4px; + margin: 2px; + border-radius: 2px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + min-width: 50px; + text-align: center; + cursor: pointer; + min-height: 15px; + line-height: 15px; +} + #names .name.me:after { content: "Me"; position: absolute; @@ -996,6 +1010,10 @@ input[type="range"]:hover { -o-transition: all .25s; } +.dialog#rename { + height: 110px; +} + #language { height: 50px; } @@ -1748,4 +1766,4 @@ code { left: 90%; -webkit-animation-delay: 3s, 1.5s; animation-delay: 3s, 1.5s -} +} \ No newline at end of file diff --git a/client/script.js b/client/script.js index 9141b2ff..a50c1b14 100644 --- a/client/script.js +++ b/client/script.js @@ -1411,6 +1411,7 @@ $(function () { document.getElementById("motd-text").innerHTML = msg.motd; openModal("#motd"); $(document).on("keydown", modalHandleEsc); + updatePreview(msg.u) var user_interact = function (evt) { if ( (evt.path || (evt.composedPath && evt.composedPath())).includes( @@ -1437,6 +1438,63 @@ $(function () { var participantTouchhandler; //declare this outside of the smaller functions so it can be used below and setup later + // Handle Preview + function updatePreview(userObject) { + var previewDiv = document.querySelector("#namediv-preview") + var previewTag = document.querySelector("#nametag-preview") + var previewName = document.querySelector("#nametext-preview") + + if(!userObject.name && !userObject.color) return; + + previewName.innerText = userObject.name; + previewDiv.style["background-color"] = userObject.color; + + if(userObject.tag) { + switch (typeof userObject.tag) { + case "object": + if(!userObject.tag.text || !userObject.tag.color) return; + previewTag.innerText = userObject.tag.text; + previewTag["background-color"] = userObject.tag.color; + break; + case "string": + previewTag.innerText = userObject.tag; + previewTag["background-color"] = tagColor(userObject.tag) + break; + default: + previewTag.style.display = "none"; //don't render because userobject is broken or there's just nothing there + break; + } + } else { + previewTag.style.display = "none"; + } + } + + //event handlers for preview + (function () { + const nameInput = document.querySelector("#rename input[name=name]"); + const colorInput = document.querySelector("#rename input[name=color]"); + + nameInput?.addEventListener("input", (v) => { + const target = v.target; + + updatePreview({ + name: target.value, + color: colorInput.value, + tag: gClient.user.tag || null + }); + }); + + colorInput?.addEventListener("input", (v) => { + const target = v.target; + + updatePreview({ + name: nameInput.value, + color: target.value, + tag: gClient.user.tag || null + }); + }) + })(); + // Handle changes to participants (function () { function setupParticipantDivs(part) { @@ -1674,6 +1732,9 @@ $(function () { if (shouldHideUser(part)) return; var name = part.name || ""; var color = part.color || "#777"; + if(part.id == gClient.user.id) { + updatePreview(part) + } setupParticipantDivs(part); $(part.cursorDiv).find(".name .nametext").text(name); $(part.cursorDiv).find(".name").css("background-color", color); From a6e8277a4d66ddce07f55ea310009c11e2bf7c91 Mon Sep 17 00:00:00 2001 From: Daniel-176 Date: Wed, 8 Apr 2026 23:21:50 -0300 Subject: [PATCH 3/7] highlight mention for other users --- client/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/script.js b/client/script.js index a50c1b14..3673767c 100644 --- a/client/script.js +++ b/client/script.js @@ -3890,7 +3890,7 @@ $(function () { ); } return `${nick}`; - } else return `@${nick}`; + } else return `${nick}`; } else return match; }, ); From 38cacfe1ef9fd29c96e16f8c6ec2da310c87be6a Mon Sep 17 00:00:00 2001 From: Daniel-176 Date: Wed, 8 Apr 2026 23:44:21 -0300 Subject: [PATCH 4/7] improve name preview css + add preview on .name-preview::after --- client/screen.css | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/client/screen.css b/client/screen.css index 4fa39753..65c498aa 100644 --- a/client/screen.css +++ b/client/screen.css @@ -87,7 +87,7 @@ table { float: left; position: relative; padding: 4px; - margin: 2px; + margin: auto; border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; @@ -100,19 +100,28 @@ table { } .name-preview { - font-size: 16px; + font-size: 12px; padding: 4px; margin: 2px; border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; min-width: 50px; + width: fit-content; text-align: center; cursor: pointer; min-height: 15px; line-height: 15px; } +.name-preview::after { + content: "Preview"; + position: absolute; + top: 1px; + font-size: 10px; + left: 45%; +} + #names .name.me:after { content: "Me"; position: absolute; From e9a61c8cdab067ee330eabbaf53f48678afddb87 Mon Sep 17 00:00:00 2001 From: Daniel-176 Date: Thu, 9 Apr 2026 00:13:51 -0300 Subject: [PATCH 5/7] add random hex button + hex input. auto-validate it --- client/index.html | 3 +++ client/screen.css | 22 +++++++++++++++++--- client/script.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/client/index.html b/client/index.html index 9b00c7e2..a82b535f 100644 --- a/client/index.html +++ b/client/index.html @@ -206,6 +206,9 @@

Important Notice

+


+ +

diff --git a/client/screen.css b/client/screen.css index 65c498aa..af53b232 100644 --- a/client/screen.css +++ b/client/screen.css @@ -87,7 +87,7 @@ table { float: left; position: relative; padding: 4px; - margin: auto; + margin: 2px; border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; @@ -102,7 +102,7 @@ table { .name-preview { font-size: 12px; padding: 4px; - margin: 2px; + margin: auto; border-radius: 2px; -webkit-border-radius: 2px; -moz-border-radius: 2px; @@ -1020,7 +1020,23 @@ input[type="range"]:hover { } .dialog#rename { - height: 110px; + height: 113px; +} + +.rename-hex { + width: 60px; +} + +.rename-random, .rename-hex { + background: #333; + color: white; + border: 1px solid #fff; + border-radius: 2px; +} + +.rename-hex.wrong { + border: 1px solid #fff; + color: red; } #language { diff --git a/client/script.js b/client/script.js index 3673767c..332ff95c 100644 --- a/client/script.js +++ b/client/script.js @@ -1444,9 +1444,16 @@ $(function () { var previewTag = document.querySelector("#nametag-preview") var previewName = document.querySelector("#nametext-preview") + const nameInput = document.querySelector("#rename input[name=name]"); + const colorInput = document.querySelector("#rename input[name=color]"); + const hexInput = document.querySelector("#rename input[name=hexColor]"); + if(!userObject.name && !userObject.color) return; previewName.innerText = userObject.name; + nameInput.value = userObject.name; + hexInput.value = userObject.color; + colorInput.value = userObject.color; previewDiv.style["background-color"] = userObject.color; if(userObject.tag) { @@ -1471,8 +1478,52 @@ $(function () { //event handlers for preview (function () { + function isValidHex(hex) { + if (typeof hex !== 'string' || hex[0] !== '#' || (hex.length !== 4 && hex.length !== 7)) { + return false; + } + const validChars = '0123456789abcdefABCDEF'; + for (let i = 1; i < hex.length; i++) { + if (validChars.indexOf(hex[i]) === -1) { + return false; + } + } + return true; + } + const nameInput = document.querySelector("#rename input[name=name]"); const colorInput = document.querySelector("#rename input[name=color]"); + const hexInput = document.querySelector("#rename input[name=hexColor]"); + const randomHexBtn = document.querySelector("#rename button[id=rename-random-color]"); + + randomHexBtn.addEventListener("click", () => { + const randomColor = '#' + Math.floor(Math.random() * 16777215).toString(16).padStart(6, '0'); + + hexInput.value = randomColor; + + updatePreview({ + name: nameInput.value, + color: hexInput.value, + tag: gClient.user.tag || null + }); + }) + + hexInput?.addEventListener("input", (v) => { + const target = v.target; + + if(!isValidHex(target.value)) { + hexInput.classList.add("wrong") + return; + } else { + hexInput.classList.remove("wrong") + } + + updatePreview({ + name: nameInput.value, + color: target.value, + tag: gClient.user.tag || null + }); + }); nameInput?.addEventListener("input", (v) => { const target = v.target; From 765d6f448162bdfcc8ea5f9cae985a52ef79f669 Mon Sep 17 00:00:00 2001 From: Daniel-176 Date: Thu, 9 Apr 2026 00:18:04 -0300 Subject: [PATCH 6/7] update preview on user set click --- client/script.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/script.js b/client/script.js index 332ff95c..4c5c515e 100644 --- a/client/script.js +++ b/client/script.js @@ -2643,6 +2643,11 @@ $(function () { var id = target.participantId; if (id == gClient.participantId) { openModal("#rename", "input[name=name]"); + updatePreview({ + name: gClient.user.name, + color: gClient.user.color, + tag: gClient.user.tag || null + }) setTimeout(function () { $("#rename input[name=name]").val( gClient.ppl[gClient.participantId].name, From 1fe6e53c3ceab4f577fd3f0708b1093e2096144f Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 9 Apr 2026 22:28:22 -0300 Subject: [PATCH 7/7] remove mention highlight since its an update for name preview --- client/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/script.js b/client/script.js index 4c5c515e..ff14e5da 100644 --- a/client/script.js +++ b/client/script.js @@ -3946,7 +3946,7 @@ $(function () { ); } return `${nick}`; - } else return `${nick}`; + } else return `@${nick}`; } else return match; }, );