From 77a609758bb80bac9497d2e3988550f8be578407 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 23 Feb 2026 02:03:20 +0100 Subject: Initial commit --- .../Resources/Assets/tools/rightsCalculator.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ReferenceClientProxyImplementation/Resources/Assets/tools/rightsCalculator.js (limited to 'ReferenceClientProxyImplementation/Resources/Assets/tools/rightsCalculator.js') diff --git a/ReferenceClientProxyImplementation/Resources/Assets/tools/rightsCalculator.js b/ReferenceClientProxyImplementation/Resources/Assets/tools/rightsCalculator.js new file mode 100644 index 0000000..c324891 --- /dev/null +++ b/ReferenceClientProxyImplementation/Resources/Assets/tools/rightsCalculator.js @@ -0,0 +1,17 @@ +String.prototype.replaceAt = function (index, replacement) { + return this.substring(0, index) + replacement + this.substring(index + 1); +} + +var legacyRights = 0n; +var modernRights = '0'.repeat(document.getElementsByTagName("input").length); +var configRights = {}; + +function calculate(a) { + console.log(a) + legacyRights += a.checked ? (1n << BigInt(a.value)) : -(1n << BigInt(a.value)) + modernRights = modernRights.replaceAt(a.value, a.checked ? '1' : '0') + configRights[a.name] = a.checked + document.getElementById("legacyRights").innerText = "Legacy rights (fosscord-server-ts): " + legacyRights + document.getElementById("modernRights").innerText = "User rights: " + modernRights + document.getElementById("configRights").value = JSON.stringify(configRights, null, 4) +} \ No newline at end of file -- cgit 1.5.1