From d49f578e63b6aae893d5e55503e5178ec5d7f89d Mon Sep 17 00:00:00 2001 From: Juror #9 <64419198+Jurorno9@users.noreply.github.com> Date: Sun, 18 Jan 2026 00:25:07 -0500 Subject: [PATCH 1/7] added warning menu for self demotions --- build/scripts/commands/staff.js | 134 ++++++++++++++++++-------------- src/commands/staff.ts | 10 ++- 2 files changed, 85 insertions(+), 59 deletions(-) diff --git a/build/scripts/commands/staff.js b/build/scripts/commands/staff.js index 3f191b7e..bd5ed38e 100644 --- a/build/scripts/commands/staff.js +++ b/build/scripts/commands/staff.js @@ -276,6 +276,7 @@ exports.commands = (0, commands_1.commandList)({ requirements: [commands_1.Req.moderate("player")], handler: function (_a) { return __awaiter(this, arguments, void 0, function (_b) { + var _this = this; var _c = _b.args, rank = _c.rank, player = _c.player, outputSuccess = _b.outputSuccess, f = _b.f, sender = _b.sender; return __generator(this, function (_d) { switch (_d.label) { @@ -286,11 +287,28 @@ exports.commands = (0, commands_1.commandList)({ (0, commands_1.fail)(f(templateObject_16 || (templateObject_16 = __makeTemplateObject(["Rank ", " is immutable."], ["Rank ", " is immutable."])), rank)); if (player.immutable() && !config_1.Mode.localDebug) (0, commands_1.fail)(f(templateObject_17 || (templateObject_17 = __makeTemplateObject(["Player ", " is immutable."], ["Player ", " is immutable."])), player)); + if (player == sender && rank.level < sender.rank.level) { + menus_1.Menu.menu("Self Demotion Warning", "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!", ["[green]No, Go Back", "[red]Yes, Demote"], sender).then(function (res) { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(res == "[red]Yes, Demote")) return [3 /*break*/, 2]; + return [4 /*yield*/, player.setRank(rank)]; + case 1: + _a.sent(); + (0, utils_1.logAction)("".concat(sender, " demoted themselves to ").concat(rank)); + outputSuccess(f(templateObject_18 || (templateObject_18 = __makeTemplateObject(["You have set your own ranke to ", ""], ["You have set your own ranke to ", ""])), rank)); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); }); + } return [4 /*yield*/, player.setRank(rank)]; case 1: _d.sent(); (0, utils_1.logAction)("set rank to ".concat(rank.name, " for"), sender, player); - outputSuccess(f(templateObject_18 || (templateObject_18 = __makeTemplateObject(["Set rank of player ", " to ", ""], ["Set rank of player ", " to ", ""])), player, rank)); + outputSuccess(f(templateObject_19 || (templateObject_19 = __makeTemplateObject(["Set rank of player ", " to ", ""], ["Set rank of player ", " to ", ""])), player, rank)); return [2 /*return*/]; } }); @@ -309,12 +327,12 @@ exports.commands = (0, commands_1.commandList)({ switch (_d.label) { case 0: if (!sender.hasPerm("admin") && !flag.assignableByModerators) - (0, commands_1.fail)(f(templateObject_19 || (templateObject_19 = __makeTemplateObject(["You do not have permission to change the value of role flag ", ""], ["You do not have permission to change the value of role flag ", ""])), flag)); + (0, commands_1.fail)(f(templateObject_20 || (templateObject_20 = __makeTemplateObject(["You do not have permission to change the value of role flag ", ""], ["You do not have permission to change the value of role flag ", ""])), flag)); return [4 /*yield*/, player.setFlag(flag, value)]; case 1: _d.sent(); (0, utils_1.logAction)("set roleflag ".concat(flag.name, " to ").concat(value, " for"), sender, player); - outputSuccess(f(templateObject_20 || (templateObject_20 = __makeTemplateObject(["Set role flag ", " of player ", " to ", ""], ["Set role flag ", " of player ", " to ", ""])), flag, player, value)); + outputSuccess(f(templateObject_21 || (templateObject_21 = __makeTemplateObject(["Set role flag ", " of player ", " to ", ""], ["Set role flag ", " of player ", " to ", ""])), flag, player, value)); return [2 /*return*/]; } }); @@ -331,7 +349,7 @@ exports.commands = (0, commands_1.commandList)({ var Ohnos = allCommands["ohno"].data; //this is not ideal... TODO commit omega shenanigans var numOhnos = Ohnos.amount(); Ohnos.killAll(); - output(f(templateObject_21 || (templateObject_21 = __makeTemplateObject(["[orange]You massacred ", " helpless ohno crawlers."], ["[orange]You massacred ", " helpless ohno crawlers."])), numOhnos)); + output(f(templateObject_22 || (templateObject_22 = __makeTemplateObject(["[orange]You massacred ", " helpless ohno crawlers."], ["[orange]You massacred ", " helpless ohno crawlers."])), numOhnos)); } }, stop_offline: { @@ -352,7 +370,7 @@ exports.commands = (0, commands_1.commandList)({ return [4 /*yield*/, fishP.stop(sender, time)]; case 1: _a.sent(); - outputSuccess(f(templateObject_22 || (templateObject_22 = __makeTemplateObject(["Player ", " was marked for ", "."], ["Player ", " was marked for ", "."])), option, (0, utils_1.formatTime)(time))); + outputSuccess(f(templateObject_23 || (templateObject_23 = __makeTemplateObject(["Player ", " was marked for ", "."], ["Player ", " was marked for ", "."])), option, (0, utils_1.formatTime)(time))); return [3 /*break*/, 3]; case 2: outputFail("You do not have permission to stop this player."); @@ -377,7 +395,7 @@ exports.commands = (0, commands_1.commandList)({ _h.sent(); return [3 /*break*/, 3]; case 2: - outputFail(f(templateObject_23 || (templateObject_23 = __makeTemplateObject(["Unknown UUID ", ""], ["Unknown UUID ", ""])), args.name)); + outputFail(f(templateObject_24 || (templateObject_24 = __makeTemplateObject(["Unknown UUID ", ""], ["Unknown UUID ", ""])), args.name)); _h.label = 3; case 3: return [2 /*return*/]; case 4: @@ -484,7 +502,7 @@ exports.commands = (0, commands_1.commandList)({ case 0: maxPlayers = 300; if (!(args.name && globals_1.uuidPattern.test(args.name))) return [3 /*break*/, 2]; - info = (_c = admins.getInfoOptional(args.name)) !== null && _c !== void 0 ? _c : (0, commands_1.fail)(f(templateObject_24 || (templateObject_24 = __makeTemplateObject(["Unknown UUID ", ""], ["Unknown UUID ", ""])), args.name)); + info = (_c = admins.getInfoOptional(args.name)) !== null && _c !== void 0 ? _c : (0, commands_1.fail)(f(templateObject_25 || (templateObject_25 = __makeTemplateObject(["Unknown UUID ", ""], ["Unknown UUID ", ""])), args.name)); return [4 /*yield*/, mute(info)]; case 1: _d.sent(); @@ -550,7 +568,7 @@ exports.commands = (0, commands_1.commandList)({ }).join("\n")); } else { - output(f(templateObject_25 || (templateObject_25 = __makeTemplateObject(["[yellow]No history was found for player ", "."], ["[yellow]No history was found for player ", "."])), args.player)); + output(f(templateObject_26 || (templateObject_26 = __makeTemplateObject(["[yellow]No history was found for player ", "."], ["[yellow]No history was found for player ", "."])), args.player)); } } }, @@ -578,7 +596,7 @@ exports.commands = (0, commands_1.commandList)({ if (!Number.isSafeInteger(args.wave)) (0, commands_1.fail)("Wave must be an integer."); Vars.state.wave = args.wave; - outputSuccess(f(templateObject_26 || (templateObject_26 = __makeTemplateObject(["Set wave to ", ""], ["Set wave to ", ""])), Vars.state.wave)); + outputSuccess(f(templateObject_27 || (templateObject_27 = __makeTemplateObject(["Set wave to ", ""], ["Set wave to ", ""])), Vars.state.wave)); } }, label: { @@ -602,7 +620,7 @@ exports.commands = (0, commands_1.commandList)({ timeRemaining--; } }, 0, 1, args.time)); - outputSuccess(f(templateObject_27 || (templateObject_27 = __makeTemplateObject(["Placed label \"", "\" for ", " seconds."], ["Placed label \"", "\" for ", " seconds."])), args.message, timeRemaining)); + outputSuccess(f(templateObject_28 || (templateObject_28 = __makeTemplateObject(["Placed label \"", "\" for ", " seconds."], ["Placed label \"", "\" for ", " seconds."])), args.message, timeRemaining)); } }, labelsticky: { @@ -620,7 +638,7 @@ exports.commands = (0, commands_1.commandList)({ timeRemaining -= 5; } }, 0, 5, Math.ceil(args.time / 5))); - outputSuccess(f(templateObject_28 || (templateObject_28 = __makeTemplateObject(["Placed label \"", "\" for ", " seconds."], ["Placed label \"", "\" for ", " seconds."])), args.message, timeRemaining)); + outputSuccess(f(templateObject_29 || (templateObject_29 = __makeTemplateObject(["Placed label \"", "\" for ", " seconds."], ["Placed label \"", "\" for ", " seconds."])), args.message, timeRemaining)); } }, clearlabels: { @@ -645,7 +663,7 @@ exports.commands = (0, commands_1.commandList)({ case 0: return [4 /*yield*/, args.player.setFlag("member", args.value)]; case 1: _c.sent(); - outputSuccess(f(templateObject_29 || (templateObject_29 = __makeTemplateObject(["Set membership status of player ", " to ", "."], ["Set membership status of player ", " to ", "."])), args.player, args.value)); + outputSuccess(f(templateObject_30 || (templateObject_30 = __makeTemplateObject(["Set membership status of player ", " to ", "."], ["Set membership status of player ", " to ", "."])), args.player, args.value)); return [2 /*return*/]; } }); @@ -662,7 +680,7 @@ exports.commands = (0, commands_1.commandList)({ var rule = (_b = config_1.rules[args.rule - 1]) !== null && _b !== void 0 ? _b : (0, commands_1.fail)("The rule you requested does not exist."); if (args.target) { args.target.sendMessage("A staff member wants to remind you of the following rule:\n" + rule); - outputSuccess(f(templateObject_30 || (templateObject_30 = __makeTemplateObject(["Reminded ", " of rule ", ""], ["Reminded ", " of rule ", ""])), args.target, args.rule)); + outputSuccess(f(templateObject_31 || (templateObject_31 = __makeTemplateObject(["Reminded ", " of rule ", ""], ["Reminded ", " of rule ", ""])), args.target, args.rule)); } else { Call.sendMessage("A staff member wants to remind everyone of the following rule:\n" + rule); @@ -696,14 +714,14 @@ exports.commands = (0, commands_1.commandList)({ api.ban({ ip: ip, uuid: uuid }); Log.info("".concat(uuid, "/").concat(ip, " was banned.")); (0, utils_1.logAction)("banned", sender, data); - outputSuccess(f(templateObject_31 || (templateObject_31 = __makeTemplateObject(["Banned player ", " (", "/", ")"], ["Banned player ", " (", "/", ")"])), (0, funcs_1.escapeStringColorsClient)(data.lastName), uuid, ip)); + outputSuccess(f(templateObject_32 || (templateObject_32 = __makeTemplateObject(["Banned player ", " (", "/", ")"], ["Banned player ", " (", "/", ")"])), (0, funcs_1.escapeStringColorsClient)(data.lastName), uuid, ip)); //TODO add way to specify whether to activate or escape color tags } else { api.ban({ uuid: uuid }); Log.info("".concat(uuid, " was banned.")); (0, utils_1.logAction)("banned", sender, uuid); - outputSuccess(f(templateObject_32 || (templateObject_32 = __makeTemplateObject(["Banned player ", ". [yellow]Unable to determine IP.[]"], ["Banned player ", ". [yellow]Unable to determine IP.[]"])), uuid)); + outputSuccess(f(templateObject_33 || (templateObject_33 = __makeTemplateObject(["Banned player ", ". [yellow]Unable to determine IP.[]"], ["Banned player ", ". [yellow]Unable to determine IP.[]"])), uuid)); } (0, utils_1.updateBans)(function (player) { return "[scarlet]Player [yellow]".concat(player.name, "[scarlet] has been whacked by ").concat(sender.prefixedName, "."); }); return [2 /*return*/]; @@ -721,10 +739,10 @@ exports.commands = (0, commands_1.commandList)({ (0, utils_1.logAction)("banned ".concat(ip), sender); alreadyBanned = admins.banPlayerIP(ip); if (alreadyBanned) { - outputSuccess(f(templateObject_33 || (templateObject_33 = __makeTemplateObject(["IP ", " is already banned. Ban was synced to other servers."], ["IP ", " is already banned. Ban was synced to other servers."])), ip)); + outputSuccess(f(templateObject_34 || (templateObject_34 = __makeTemplateObject(["IP ", " is already banned. Ban was synced to other servers."], ["IP ", " is already banned. Ban was synced to other servers."])), ip)); } else { - outputSuccess(f(templateObject_34 || (templateObject_34 = __makeTemplateObject(["IP ", " has been banned. Ban was synced to other servers."], ["IP ", " has been banned. Ban was synced to other servers."])), ip)); + outputSuccess(f(templateObject_35 || (templateObject_35 = __makeTemplateObject(["IP ", " has been banned. Ban was synced to other servers."], ["IP ", " has been banned. Ban was synced to other servers."])), ip)); } (0, utils_1.updateBans)(function (player) { return "[scarlet]Player [yellow]".concat(player.name, "[scarlet] has been whacked by ").concat(sender.prefixedName, "."); }); return [2 /*return*/]; @@ -743,7 +761,7 @@ exports.commands = (0, commands_1.commandList)({ api.ban({ ip: option.ip(), uuid: option.uuid() }); Log.info("".concat(option.ip(), "/").concat(option.uuid(), " was banned.")); (0, utils_1.logAction)("banned", sender, option.getInfo()); - outputSuccess(f(templateObject_35 || (templateObject_35 = __makeTemplateObject(["Banned player ", "."], ["Banned player ", "."])), option)); + outputSuccess(f(templateObject_36 || (templateObject_36 = __makeTemplateObject(["Banned player ", "."], ["Banned player ", "."])), option)); (0, utils_1.updateBans)(function (player) { return "[scarlet]Player [yellow]".concat(player.name, "[scarlet] has been whacked by ").concat(sender.prefixedName, "."); }); return [2 /*return*/]; } @@ -761,10 +779,10 @@ exports.commands = (0, commands_1.commandList)({ var unit = args.player.unit(); if (unit) { unit.kill(); - outputSuccess(f(templateObject_36 || (templateObject_36 = __makeTemplateObject(["Killed the unit of player ", "."], ["Killed the unit of player ", "."])), args.player)); + outputSuccess(f(templateObject_37 || (templateObject_37 = __makeTemplateObject(["Killed the unit of player ", "."], ["Killed the unit of player ", "."])), args.player)); } else { - outputFail(f(templateObject_37 || (templateObject_37 = __makeTemplateObject(["Player ", " does not have a unit."], ["Player ", " does not have a unit."])), args.player)); + outputFail(f(templateObject_38 || (templateObject_38 = __makeTemplateObject(["Player ", " does not have a unit."], ["Player ", " does not have a unit."])), args.player)); } } }, @@ -789,12 +807,12 @@ exports.commands = (0, commands_1.commandList)({ u.kill(); i_1++; }); - outputSuccess(f(templateObject_38 || (templateObject_38 = __makeTemplateObject(["Killed ", " units on ", "."], ["Killed ", " units on ", "."])), i_1, team)); + outputSuccess(f(templateObject_39 || (templateObject_39 = __makeTemplateObject(["Killed ", " units on ", "."], ["Killed ", " units on ", "."])), i_1, team)); } else { before = team.data().units.size; team.data().units.each(function (u) { return u.kill(); }); - outputSuccess(f(templateObject_39 || (templateObject_39 = __makeTemplateObject(["Killed ", " units on ", "."], ["Killed ", " units on ", "."])), before, team)); + outputSuccess(f(templateObject_40 || (templateObject_40 = __makeTemplateObject(["Killed ", " units on ", "."], ["Killed ", " units on ", "."])), before, team)); } return [3 /*break*/, 4]; case 2: return [4 /*yield*/, menus_1.Menu.confirmDangerous(sender, "This will kill [scarlet]every single ".concat(unit ? unit.localizedName : "unit", "[]."), { confirmText: "[orange]Kill all units[]" })]; @@ -806,12 +824,12 @@ exports.commands = (0, commands_1.commandList)({ u.kill(); i_2++; }); - outputSuccess(f(templateObject_40 || (templateObject_40 = __makeTemplateObject(["Killed ", " units."], ["Killed ", " units."])), i_2)); + outputSuccess(f(templateObject_41 || (templateObject_41 = __makeTemplateObject(["Killed ", " units."], ["Killed ", " units."])), i_2)); } else { before = Groups.unit.size(); Groups.unit.each(function (u) { return u.kill(); }); - outputSuccess(f(templateObject_41 || (templateObject_41 = __makeTemplateObject(["Killed ", " units."], ["Killed ", " units."])), before)); + outputSuccess(f(templateObject_42 || (templateObject_42 = __makeTemplateObject(["Killed ", " units."], ["Killed ", " units."])), before)); } _d.label = 4; case 4: return [2 /*return*/]; @@ -837,14 +855,14 @@ exports.commands = (0, commands_1.commandList)({ _c.sent(); count = team.data().buildings.size; team.data().buildings.each(function (b) { return !(b.block instanceof CoreBlock); }, function (b) { return b.tile.remove(); }); - outputSuccess(f(templateObject_42 || (templateObject_42 = __makeTemplateObject(["Killed ", " buildings on ", "."], ["Killed ", " buildings on ", "."])), count, team)); + outputSuccess(f(templateObject_43 || (templateObject_43 = __makeTemplateObject(["Killed ", " buildings on ", "."], ["Killed ", " buildings on ", "."])), count, team)); return [3 /*break*/, 4]; case 2: return [4 /*yield*/, menus_1.Menu.confirmDangerous(sender, "This will kill [scarlet]every building[] except cores.", { confirmText: "[orange]Kill buildings[]" })]; case 3: _c.sent(); count = Groups.build.size(); Groups.build.each(function (b) { return !(b.block instanceof CoreBlock); }, function (b) { return b.tile.remove(); }); - outputSuccess(f(templateObject_43 || (templateObject_43 = __makeTemplateObject(["Killed ", " buildings."], ["Killed ", " buildings."])), count)); + outputSuccess(f(templateObject_44 || (templateObject_44 = __makeTemplateObject(["Killed ", " buildings."], ["Killed ", " buildings."])), count)); _c.label = 4; case 4: return [2 /*return*/]; } @@ -860,7 +878,7 @@ exports.commands = (0, commands_1.commandList)({ handler: function (_a) { var args = _a.args, outputSuccess = _a.outputSuccess, f = _a.f; args.player.forceRespawn(); - outputSuccess(f(templateObject_44 || (templateObject_44 = __makeTemplateObject(["Respawned player ", "."], ["Respawned player ", "."])), args.player)); + outputSuccess(f(templateObject_45 || (templateObject_45 = __makeTemplateObject(["Respawned player ", "."], ["Respawned player ", "."])), args.player)); } }, stealunit: { @@ -871,7 +889,7 @@ exports.commands = (0, commands_1.commandList)({ handler: function (_a) { var _b; var sender = _a.sender, _c = _a.args, target = _c.target, _d = _c.newcontroller, newcontroller = _d === void 0 ? sender : _d, outputSuccess = _a.outputSuccess, f = _a.f; - var unit = (_b = target.unit()) !== null && _b !== void 0 ? _b : (0, commands_1.fail)(f(templateObject_45 || (templateObject_45 = __makeTemplateObject(["Targeted player ", " is not in a unit."], ["Targeted player ", " is not in a unit."])), target)); + var unit = (_b = target.unit()) !== null && _b !== void 0 ? _b : (0, commands_1.fail)(f(templateObject_46 || (templateObject_46 = __makeTemplateObject(["Targeted player ", " is not in a unit."], ["Targeted player ", " is not in a unit."])), target)); if (target.team() !== newcontroller.team()) { if (!sender.hasPerm("changeTeamExternal")) { if (!sender.hasPerm("changeTeam")) @@ -882,11 +900,11 @@ exports.commands = (0, commands_1.commandList)({ target.forceRespawn(); newcontroller.unit(unit); if (newcontroller == sender) { - outputSuccess(f(templateObject_46 || (templateObject_46 = __makeTemplateObject(["Commandeered the unit of player ", "."], ["Commandeered the unit of player ", "."])), target)); + outputSuccess(f(templateObject_47 || (templateObject_47 = __makeTemplateObject(["Commandeered the unit of player ", "."], ["Commandeered the unit of player ", "."])), target)); } else { - outputSuccess(f(templateObject_47 || (templateObject_47 = __makeTemplateObject(["Transferred player ", " into the unit of ", "."], ["Transferred player ", " into the unit of ", "."])), newcontroller, target)); - newcontroller.sendMessage(f(templateObject_48 || (templateObject_48 = __makeTemplateObject(["[green]You were transferred to the unit of player ", " by ", "."], ["[green]You were transferred to the unit of player ", " by ", "."])), target, sender)('[green]')); + outputSuccess(f(templateObject_48 || (templateObject_48 = __makeTemplateObject(["Transferred player ", " into the unit of ", "."], ["Transferred player ", " into the unit of ", "."])), newcontroller, target)); + newcontroller.sendMessage(f(templateObject_49 || (templateObject_49 = __makeTemplateObject(["[green]You were transferred to the unit of player ", " by ", "."], ["[green]You were transferred to the unit of player ", " by ", "."])), target, sender)('[green]')); } } }, @@ -909,9 +927,9 @@ exports.commands = (0, commands_1.commandList)({ var names = args.showColors ? info.names.map(funcs_1.escapeStringColorsClient).toString(", ") : __spreadArray([], __read(new Set(info.names.map(function (n) { return Strings.stripColors(n); }).toArray())), false).join(", "); - output(f(templateObject_49 || (templateObject_49 = __makeTemplateObject(["[accent]Info for player ", " [gray](", ") (#", ")\n\t[accent]Rank: ", "\n\t[accent]Role flags: ", "\n\t[accent]Stopped: ", "\n\t[accent]marked: ", "\n\t[accent]muted: ", "\n\t[accent]autoflagged: ", "\n\t[accent]VPN detected: ", "\n\t[accent]times joined / kicked: ", "/", "\n\t[accent]First joined: ", "\n\t[accent]Names used: [[", "]"], ["\\\n[accent]Info for player ", " [gray](", ") (#", ")\n\t[accent]Rank: ", "\n\t[accent]Role flags: ", "\n\t[accent]Stopped: ", "\n\t[accent]marked: ", "\n\t[accent]muted: ", "\n\t[accent]autoflagged: ", "\n\t[accent]VPN detected: ", "\n\t[accent]times joined / kicked: ", "/", "\n\t[accent]First joined: ", "\n\t[accent]Names used: [[", "]"])), args.target, (0, funcs_1.escapeStringColorsClient)(args.target.name), args.target.player.id.toString(), args.target.rank, Array.from(args.target.flags).map(function (f) { return f.coloredName(); }).join(" "), f.boolBad(!args.target.hasPerm("play")), args.target.marked() ? "until ".concat((0, utils_1.formatTimeRelative)(args.target.unmarkTime)) : "[green]false", f.boolBad(args.target.muted), f.boolBad(args.target.autoflagged), f.boolBad(args.target.ipDetectedVpn), info.timesJoined, info.timesKicked, args.target.firstJoined < 1 ? "unknown" : (0, utils_1.formatTimeRelative)(args.target.firstJoined), names)); + output(f(templateObject_50 || (templateObject_50 = __makeTemplateObject(["[accent]Info for player ", " [gray](", ") (#", ")\n\t[accent]Rank: ", "\n\t[accent]Role flags: ", "\n\t[accent]Stopped: ", "\n\t[accent]marked: ", "\n\t[accent]muted: ", "\n\t[accent]autoflagged: ", "\n\t[accent]VPN detected: ", "\n\t[accent]times joined / kicked: ", "/", "\n\t[accent]First joined: ", "\n\t[accent]Names used: [[", "]"], ["\\\n[accent]Info for player ", " [gray](", ") (#", ")\n\t[accent]Rank: ", "\n\t[accent]Role flags: ", "\n\t[accent]Stopped: ", "\n\t[accent]marked: ", "\n\t[accent]muted: ", "\n\t[accent]autoflagged: ", "\n\t[accent]VPN detected: ", "\n\t[accent]times joined / kicked: ", "/", "\n\t[accent]First joined: ", "\n\t[accent]Names used: [[", "]"])), args.target, (0, funcs_1.escapeStringColorsClient)(args.target.name), args.target.player.id.toString(), args.target.rank, Array.from(args.target.flags).map(function (f) { return f.coloredName(); }).join(" "), f.boolBad(!args.target.hasPerm("play")), args.target.marked() ? "until ".concat((0, utils_1.formatTimeRelative)(args.target.unmarkTime)) : "[green]false", f.boolBad(args.target.muted), f.boolBad(args.target.autoflagged), f.boolBad(args.target.ipDetectedVpn), info.timesJoined, info.timesKicked, args.target.firstJoined < 1 ? "unknown" : (0, utils_1.formatTimeRelative)(args.target.firstJoined), names)); if (sender.hasPerm("viewUUIDs")) - output(f(templateObject_50 || (templateObject_50 = __makeTemplateObject(["\t[#FFAAAA]UUID: ", "\n\t[#FFAAAA]IP: ", ""], ["\\\n\t[#FFAAAA]UUID: ", "\n\t[#FFAAAA]IP: ", ""])), args.target.uuid, args.target.ip())); + output(f(templateObject_51 || (templateObject_51 = __makeTemplateObject(["\t[#FFAAAA]UUID: ", "\n\t[#FFAAAA]IP: ", ""], ["\\\n\t[#FFAAAA]UUID: ", "\n\t[#FFAAAA]IP: ", ""])), args.target.uuid, args.target.ip())); } }, spawn: { @@ -938,7 +956,7 @@ exports.commands = (0, commands_1.commandList)({ } if (!config_1.Gamemode.sandbox() && args.effects !== 'paper') (0, utils_1.logAction)("spawned unit ".concat(args.type.name).concat(count == 1 ? '' : " x".concat(count), " at ").concat(Math.round(x / 8), ", ").concat(Math.round(y / 8)) + (args.effects ? "with ".concat(args.effects, " effects") : ''), sender); - outputSuccess(f(templateObject_51 || (templateObject_51 = __makeTemplateObject(["Spawned unit ", " at (", ", ", ")"], ["Spawned unit ", " at (", ", ", ")"])), args.type, Math.round(x / 8), Math.round(y / 8))); + outputSuccess(f(templateObject_52 || (templateObject_52 = __makeTemplateObject(["Spawned unit ", " at (", ", ", ")"], ["Spawned unit ", " at (", ", ", ")"])), args.type, Math.round(x / 8), Math.round(y / 8))); } }, setblock: { @@ -951,9 +969,9 @@ exports.commands = (0, commands_1.commandList)({ var team = (_b = args.team) !== null && _b !== void 0 ? _b : sender.team(); var tile = Vars.world.tile(args.x, args.y); if (args.rotation != null && (args.rotation < 0 || args.rotation > 3)) - (0, commands_1.fail)(f(templateObject_52 || (templateObject_52 = __makeTemplateObject(["Invalid rotation ", ""], ["Invalid rotation ", ""])), args.rotation)); + (0, commands_1.fail)(f(templateObject_53 || (templateObject_53 = __makeTemplateObject(["Invalid rotation ", ""], ["Invalid rotation ", ""])), args.rotation)); if (tile == null) - (0, commands_1.fail)(f(templateObject_53 || (templateObject_53 = __makeTemplateObject(["Position (", ", ", ") is out of bounds."], ["Position (", ", ", ") is out of bounds."])), args.x, args.y)); + (0, commands_1.fail)(f(templateObject_54 || (templateObject_54 = __makeTemplateObject(["Position (", ", ", ") is out of bounds."], ["Position (", ", ", ") is out of bounds."])), args.x, args.y)); tile.setNet(args.block, team, (_c = args.rotation) !== null && _c !== void 0 ? _c : 0); (0, utils_1.addToTileHistory)({ pos: "".concat(args.x, ",").concat(args.y), @@ -963,7 +981,7 @@ exports.commands = (0, commands_1.commandList)({ }); if (!config_1.Gamemode.sandbox()) (0, utils_1.logAction)("set block to ".concat(args.block.localizedName, " at ").concat(args.x, ",").concat(args.y), sender); - outputSuccess(f(templateObject_54 || (templateObject_54 = __makeTemplateObject(["Set block at ", ", ", " to ", ""], ["Set block at ", ", ", " to ", ""])), args.x, args.y, args.block)); + outputSuccess(f(templateObject_55 || (templateObject_55 = __makeTemplateObject(["Set block at ", ", ", " to ", ""], ["Set block at ", ", ", " to ", ""])), args.x, args.y, args.block)); } }, setblockr: { @@ -978,9 +996,9 @@ exports.commands = (0, commands_1.commandList)({ var team = (_b = args.team) !== null && _b !== void 0 ? _b : sender.team(); var tile = Vars.world.tile(x, y); if (args.rotation != null && (args.rotation < 0 || args.rotation > 3)) - (0, commands_1.fail)(f(templateObject_55 || (templateObject_55 = __makeTemplateObject(["Invalid rotation ", ""], ["Invalid rotation ", ""])), args.rotation)); + (0, commands_1.fail)(f(templateObject_56 || (templateObject_56 = __makeTemplateObject(["Invalid rotation ", ""], ["Invalid rotation ", ""])), args.rotation)); if (tile == null) - (0, commands_1.fail)(f(templateObject_56 || (templateObject_56 = __makeTemplateObject(["Position (", ", ", ") is out of bounds."], ["Position (", ", ", ") is out of bounds."])), x, y)); + (0, commands_1.fail)(f(templateObject_57 || (templateObject_57 = __makeTemplateObject(["Position (", ", ", ") is out of bounds."], ["Position (", ", ", ") is out of bounds."])), x, y)); tile.setNet(args.block, team, (_c = args.rotation) !== null && _c !== void 0 ? _c : 0); (0, utils_1.addToTileHistory)({ pos: "".concat(x, ",").concat(y), @@ -990,7 +1008,7 @@ exports.commands = (0, commands_1.commandList)({ }); if (!config_1.Gamemode.sandbox()) (0, utils_1.logAction)("set block to ".concat(args.block.localizedName, " at ").concat(x, ",").concat(y), sender); - outputSuccess(f(templateObject_57 || (templateObject_57 = __makeTemplateObject(["Set block at ", ", ", " to ", ""], ["Set block at ", ", ", " to ", ""])), x, y, args.block)); + outputSuccess(f(templateObject_58 || (templateObject_58 = __makeTemplateObject(["Set block at ", ", ", " to ", ""], ["Set block at ", ", ", " to ", ""])), x, y, args.block)); }, handler: function (_a) { var args = _a.args, outputSuccess = _a.outputSuccess, handleTaps = _a.handleTaps, currentTapMode = _a.currentTapMode, f = _a.f; @@ -1000,7 +1018,7 @@ exports.commands = (0, commands_1.commandList)({ outputSuccess("setblockr enabled.\n[scarlet]Be careful, you have the midas touch now![] Turn it off by running /setblockr again."); } else { - outputSuccess(f(templateObject_58 || (templateObject_58 = __makeTemplateObject(["Changed setblockr's block to ", ""], ["Changed setblockr's block to ", ""])), args.block)); + outputSuccess(f(templateObject_59 || (templateObject_59 = __makeTemplateObject(["Changed setblockr's block to ", ""], ["Changed setblockr's block to ", ""])), args.block)); } } else { @@ -1029,7 +1047,7 @@ exports.commands = (0, commands_1.commandList)({ }); if (!config_1.Gamemode.sandbox()) (0, utils_1.logAction)("exterminated ".concat(numKilled, " units"), sender); - outputSuccess(f(templateObject_59 || (templateObject_59 = __makeTemplateObject(["Exterminated ", " units."], ["Exterminated ", " units."])), numKilled)); + outputSuccess(f(templateObject_60 || (templateObject_60 = __makeTemplateObject(["Exterminated ", " units."], ["Exterminated ", " units."])), numKilled)); } }, js: { @@ -1119,7 +1137,7 @@ exports.commands = (0, commands_1.commandList)({ (0, commands_1.fail)("Invalid chat strictness level: valid levels are \"chat\", \"strict\""); player.chatStrictness = value; (0, utils_1.logAction)("set chat strictness to ".concat(value, " for"), sender, player); - outputSuccess(f(templateObject_60 || (templateObject_60 = __makeTemplateObject(["Set chat strictness for player ", " to \"", "\"."], ["Set chat strictness for player ", " to \"", "\"."])), player, value)); + outputSuccess(f(templateObject_61 || (templateObject_61 = __makeTemplateObject(["Set chat strictness for player ", " to \"", "\"."], ["Set chat strictness for player ", " to \"", "\"."])), player, value)); } }, emanate: (0, commands_1.command)(function () { @@ -1224,29 +1242,29 @@ exports.commands = (0, commands_1.commandList)({ fishP = players_1.FishPlayer.getById(input); info = admins.getInfoOptional(input); if (fishP == null && info == null) - (0, commands_1.fail)(f(templateObject_61 || (templateObject_61 = __makeTemplateObject(["No stored data matched uuid ", "."], ["No stored data matched uuid ", "."])), input)); + (0, commands_1.fail)(f(templateObject_62 || (templateObject_62 = __makeTemplateObject(["No stored data matched uuid ", "."], ["No stored data matched uuid ", "."])), input)); else if (fishP == null && info) - output(f(templateObject_62 || (templateObject_62 = __makeTemplateObject(["[accent]Found player info (but no fish player data) for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nFound player info (but no fish player data) for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), input, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); + output(f(templateObject_63 || (templateObject_63 = __makeTemplateObject(["[accent]Found player info (but no fish player data) for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nFound player info (but no fish player data) for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), input, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); else if (fishP && info) - output(f(templateObject_63 || (templateObject_63 = __makeTemplateObject(["[accent]Found fish player data for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nFound fish player data for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), input, fishP.name, (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); + output(f(templateObject_64 || (templateObject_64 = __makeTemplateObject(["[accent]Found fish player data for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nFound fish player data for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), input, fishP.name, (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); else - (0, commands_1.fail)(f(templateObject_64 || (templateObject_64 = __makeTemplateObject(["Super weird edge case: found fish player data but no player info for uuid ", "."], ["Super weird edge case: found fish player data but no player info for uuid ", "."])), input)); + (0, commands_1.fail)(f(templateObject_65 || (templateObject_65 = __makeTemplateObject(["Super weird edge case: found fish player data but no player info for uuid ", "."], ["Super weird edge case: found fish player data but no player info for uuid ", "."])), input)); return [3 /*break*/, 5]; case 1: if (!globals_1.ipPattern.test(input)) return [3 /*break*/, 2]; matches = admins.findByIPs(input); if (matches.isEmpty()) - (0, commands_1.fail)(f(templateObject_65 || (templateObject_65 = __makeTemplateObject(["No stored data matched IP ", ""], ["No stored data matched IP ", ""])), input)); - output(f(templateObject_66 || (templateObject_66 = __makeTemplateObject(["[accent]Found ", " match", " for search \"", "\"."], ["[accent]Found ", " match", " for search \"", "\"."])), matches.size, matches.size == 1 ? "" : "es", input)); - matches.each(function (info) { return output(f(templateObject_67 || (templateObject_67 = __makeTemplateObject(["[accent]Player with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nPlayer with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), info.id, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); }); + (0, commands_1.fail)(f(templateObject_66 || (templateObject_66 = __makeTemplateObject(["No stored data matched IP ", ""], ["No stored data matched IP ", ""])), input)); + output(f(templateObject_67 || (templateObject_67 = __makeTemplateObject(["[accent]Found ", " match", " for search \"", "\"."], ["[accent]Found ", " match", " for search \"", "\"."])), matches.size, matches.size == 1 ? "" : "es", input)); + matches.each(function (info) { return output(f(templateObject_68 || (templateObject_68 = __makeTemplateObject(["[accent]Player with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nPlayer with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), info.id, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); }); return [3 /*break*/, 5]; case 2: matches_1 = Vars.netServer.admins.searchNames(input); if (matches_1.isEmpty()) - (0, commands_1.fail)(f(templateObject_68 || (templateObject_68 = __makeTemplateObject(["No stored data matched name ", ""], ["No stored data matched name ", ""])), input)); - output(f(templateObject_69 || (templateObject_69 = __makeTemplateObject(["[accent]Found ", " match", " for search \"", "\"."], ["[accent]Found ", " match", " for search \"", "\"."])), matches_1.size, matches_1.size == 1 ? "" : "es", input)); + (0, commands_1.fail)(f(templateObject_69 || (templateObject_69 = __makeTemplateObject(["No stored data matched name ", ""], ["No stored data matched name ", ""])), input)); + output(f(templateObject_70 || (templateObject_70 = __makeTemplateObject(["[accent]Found ", " match", " for search \"", "\"."], ["[accent]Found ", " match", " for search \"", "\"."])), matches_1.size, matches_1.size == 1 ? "" : "es", input)); displayMatches = function () { - matches_1.each(function (info) { return output(f(templateObject_70 || (templateObject_70 = __makeTemplateObject(["[accent]Player with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nPlayer with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), info.id, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); }); + matches_1.each(function (info) { return output(f(templateObject_71 || (templateObject_71 = __makeTemplateObject(["[accent]Player with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nPlayer with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), info.id, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); }); }; if (!(matches_1.size > 20)) return [3 /*break*/, 4]; return [4 /*yield*/, menus_1.Menu.confirm(sender, "Are you sure you want to view all ".concat(matches_1.size, " matches?"))]; @@ -1292,13 +1310,13 @@ exports.commands = (0, commands_1.commandList)({ var _b, _c, _d; var args = _a.args, sender = _a.sender, f = _a.f, outputSuccess = _a.outputSuccess; if ((_b = args.player) === null || _b === void 0 ? void 0 : _b.hasPerm("blockTrolling")) - (0, commands_1.fail)(f(templateObject_71 || (templateObject_71 = __makeTemplateObject(["Player ", " is insufficiently trollable."], ["Player ", " is insufficiently trollable."])), args.player)); + (0, commands_1.fail)(f(templateObject_72 || (templateObject_72 = __makeTemplateObject(["Player ", " is insufficiently trollable."], ["Player ", " is insufficiently trollable."])), args.player)); if (args.player && !sender.canModerate(args.player, false)) (0, commands_1.fail)("You do not have permission to perform moderation actions on this player."); var target = (_c = args.player) !== null && _c !== void 0 ? _c : sender; var unit = target.unit(); if (!unit || unit.dead) - (0, commands_1.fail)(f(templateObject_72 || (templateObject_72 = __makeTemplateObject(["", "'s unit is dead."], ["", "'s unit is dead."])), target)); + (0, commands_1.fail)(f(templateObject_73 || (templateObject_73 = __makeTemplateObject(["", "'s unit is dead."], ["", "'s unit is dead."])), target)); var ticks = ((_d = args.duration) !== null && _d !== void 0 ? _d : 1e12) / 1000 * 60; (0, utils_1.applyEffectMode)(args.mode, unit, ticks); outputSuccess("".concat(args.mode === "clear" ? "Cleared" : "Applied", " effects.")); @@ -1313,9 +1331,9 @@ exports.commands = (0, commands_1.commandList)({ handler: function (_a) { var _b; var _c = _a.args, team = _c.team, item = _c.item, amount = _c.amount, sender = _a.sender, outputSuccess = _a.outputSuccess, f = _a.f; - var core = (_b = team.data().cores.firstOpt()) !== null && _b !== void 0 ? _b : (0, commands_1.fail)(f(templateObject_73 || (templateObject_73 = __makeTemplateObject(["Team ", " has no cores."], ["Team ", " has no cores."])), team)); + var core = (_b = team.data().cores.firstOpt()) !== null && _b !== void 0 ? _b : (0, commands_1.fail)(f(templateObject_74 || (templateObject_74 = __makeTemplateObject(["Team ", " has no cores."], ["Team ", " has no cores."])), team)); core.items.add(item, amount); - outputSuccess(f(templateObject_74 || (templateObject_74 = __makeTemplateObject(["Gave ", " ", " to ", "."], ["Gave ", " ", " to ", "."])), amount, item, team)); + outputSuccess(f(templateObject_75 || (templateObject_75 = __makeTemplateObject(["Gave ", " ", " to ", "."], ["Gave ", " ", " to ", "."])), amount, item, team)); if (!config_1.Gamemode.sandbox()) (0, utils_1.logAction)("gave ".concat(amount, " ").concat(item.name, " to ").concat(team.name), sender); } @@ -1353,4 +1371,4 @@ exports.commands = (0, commands_1.commandList)({ } } }); -var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47, templateObject_48, templateObject_49, templateObject_50, templateObject_51, templateObject_52, templateObject_53, templateObject_54, templateObject_55, templateObject_56, templateObject_57, templateObject_58, templateObject_59, templateObject_60, templateObject_61, templateObject_62, templateObject_63, templateObject_64, templateObject_65, templateObject_66, templateObject_67, templateObject_68, templateObject_69, templateObject_70, templateObject_71, templateObject_72, templateObject_73, templateObject_74; +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47, templateObject_48, templateObject_49, templateObject_50, templateObject_51, templateObject_52, templateObject_53, templateObject_54, templateObject_55, templateObject_56, templateObject_57, templateObject_58, templateObject_59, templateObject_60, templateObject_61, templateObject_62, templateObject_63, templateObject_64, templateObject_65, templateObject_66, templateObject_67, templateObject_68, templateObject_69, templateObject_70, templateObject_71, templateObject_72, templateObject_73, templateObject_74, templateObject_75; diff --git a/src/commands/staff.ts b/src/commands/staff.ts index f0c55bcc..1c64d318 100644 --- a/src/commands/staff.ts +++ b/src/commands/staff.ts @@ -145,7 +145,15 @@ export const commands = commandList({ fail(f`You do not have permission to promote players to rank ${rank}, because your current rank is ${sender.rank}`); if(rank == Rank.pi && !Mode.localDebug) fail(f`Rank ${rank} is immutable.`); if(player.immutable() && !Mode.localDebug) fail(f`Player ${player} is immutable.`); - + if(player == sender && rank.level < sender.rank.level){ + Menu.menu("Self Demotion Warning", "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!", ["[green]No, Go Back", "[red]Yes, Demote"], sender).then(async (res) => { + if(res == "[red]Yes, Demote"){ + await player.setRank(rank); + logAction(`${sender} demoted themselves to ${rank}`); + outputSuccess(f`You have set your own ranke to ${rank}`); + } + }) + } await player.setRank(rank); logAction(`set rank to ${rank.name} for`, sender, player); outputSuccess(f`Set rank of player ${player} to ${rank}`); From 2c5cace9edb64c6fcb6baa3ef0aff065e8fb7272 Mon Sep 17 00:00:00 2001 From: Juror #9 <64419198+Jurorno9@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:22:13 -0500 Subject: [PATCH 2/7] else if if else elif ifelse else if fi if esle --- build/scripts/commands/staff.js | 41 +++++++++++++++++---------------- src/commands/staff.ts | 9 ++++---- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/build/scripts/commands/staff.js b/build/scripts/commands/staff.js index bd5ed38e..4bd2fda2 100644 --- a/build/scripts/commands/staff.js +++ b/build/scripts/commands/staff.js @@ -287,29 +287,30 @@ exports.commands = (0, commands_1.commandList)({ (0, commands_1.fail)(f(templateObject_16 || (templateObject_16 = __makeTemplateObject(["Rank ", " is immutable."], ["Rank ", " is immutable."])), rank)); if (player.immutable() && !config_1.Mode.localDebug) (0, commands_1.fail)(f(templateObject_17 || (templateObject_17 = __makeTemplateObject(["Player ", " is immutable."], ["Player ", " is immutable."])), player)); - if (player == sender && rank.level < sender.rank.level) { - menus_1.Menu.menu("Self Demotion Warning", "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!", ["[green]No, Go Back", "[red]Yes, Demote"], sender).then(function (res) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(res == "[red]Yes, Demote")) return [3 /*break*/, 2]; - return [4 /*yield*/, player.setRank(rank)]; - case 1: - _a.sent(); - (0, utils_1.logAction)("".concat(sender, " demoted themselves to ").concat(rank)); - outputSuccess(f(templateObject_18 || (templateObject_18 = __makeTemplateObject(["You have set your own ranke to ", ""], ["You have set your own ranke to ", ""])), rank)); - _a.label = 2; - case 2: return [2 /*return*/]; - } - }); - }); }); - } - return [4 /*yield*/, player.setRank(rank)]; - case 1: + if (!(player == sender && rank.level < sender.rank.level)) return [3 /*break*/, 1]; + menus_1.Menu.menu("Self Demotion Warning", "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!", ["[green]No, Go Back", "[red]Yes, Demote"], sender).then(function (res) { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(res == "[red]Yes, Demote")) return [3 /*break*/, 2]; + return [4 /*yield*/, player.setRank(rank)]; + case 1: + _a.sent(); + (0, utils_1.logAction)("".concat(sender, " demoted themselves to ").concat(rank)); + outputSuccess(f(templateObject_18 || (templateObject_18 = __makeTemplateObject(["You have set your own rank to ", ""], ["You have set your own rank to ", ""])), rank)); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); }); + return [3 /*break*/, 3]; + case 1: return [4 /*yield*/, player.setRank(rank)]; + case 2: _d.sent(); (0, utils_1.logAction)("set rank to ".concat(rank.name, " for"), sender, player); outputSuccess(f(templateObject_19 || (templateObject_19 = __makeTemplateObject(["Set rank of player ", " to ", ""], ["Set rank of player ", " to ", ""])), player, rank)); - return [2 /*return*/]; + _d.label = 3; + case 3: return [2 /*return*/]; } }); }); diff --git a/src/commands/staff.ts b/src/commands/staff.ts index 1c64d318..022c6df0 100644 --- a/src/commands/staff.ts +++ b/src/commands/staff.ts @@ -150,13 +150,14 @@ export const commands = commandList({ if(res == "[red]Yes, Demote"){ await player.setRank(rank); logAction(`${sender} demoted themselves to ${rank}`); - outputSuccess(f`You have set your own ranke to ${rank}`); + outputSuccess(f`You have set your own rank to ${rank}`); } }) + } else { + await player.setRank(rank); + logAction(`set rank to ${rank.name} for`, sender, player); + outputSuccess(f`Set rank of player ${player} to ${rank}`); } - await player.setRank(rank); - logAction(`set rank to ${rank.name} for`, sender, player); - outputSuccess(f`Set rank of player ${player} to ${rank}`); } }, From 3f5553033880ff8bb9f15c730bc6515c0599c9d9 Mon Sep 17 00:00:00 2001 From: Juror #9 <64419198+Jurorno9@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:55:51 -0500 Subject: [PATCH 3/7] confirmed, I am dangerous --- build/scripts/commands/staff.js | 2 +- src/commands/staff.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/scripts/commands/staff.js b/build/scripts/commands/staff.js index 4bd2fda2..517294c6 100644 --- a/build/scripts/commands/staff.js +++ b/build/scripts/commands/staff.js @@ -288,7 +288,7 @@ exports.commands = (0, commands_1.commandList)({ if (player.immutable() && !config_1.Mode.localDebug) (0, commands_1.fail)(f(templateObject_17 || (templateObject_17 = __makeTemplateObject(["Player ", " is immutable."], ["Player ", " is immutable."])), player)); if (!(player == sender && rank.level < sender.rank.level)) return [3 /*break*/, 1]; - menus_1.Menu.menu("Self Demotion Warning", "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!", ["[green]No, Go Back", "[red]Yes, Demote"], sender).then(function (res) { return __awaiter(_this, void 0, void 0, function () { + menus_1.Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!").then(function (res) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: diff --git a/src/commands/staff.ts b/src/commands/staff.ts index 022c6df0..3f4e0104 100644 --- a/src/commands/staff.ts +++ b/src/commands/staff.ts @@ -146,7 +146,7 @@ export const commands = commandList({ if(rank == Rank.pi && !Mode.localDebug) fail(f`Rank ${rank} is immutable.`); if(player.immutable() && !Mode.localDebug) fail(f`Player ${player} is immutable.`); if(player == sender && rank.level < sender.rank.level){ - Menu.menu("Self Demotion Warning", "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!", ["[green]No, Go Back", "[red]Yes, Demote"], sender).then(async (res) => { + Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!").then(async (res) => { if(res == "[red]Yes, Demote"){ await player.setRank(rank); logAction(`${sender} demoted themselves to ${rank}`); From 7ee6d155608801751974ac12514ef24a9088e46e Mon Sep 17 00:00:00 2001 From: Juror #9 <64419198+Jurorno9@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:59:46 -0500 Subject: [PATCH 4/7] Confirmed and dangerous --- build/scripts/commands/staff.js | 10 ++++------ src/commands/staff.ts | 7 ++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/build/scripts/commands/staff.js b/build/scripts/commands/staff.js index 517294c6..aec4c917 100644 --- a/build/scripts/commands/staff.js +++ b/build/scripts/commands/staff.js @@ -288,18 +288,16 @@ exports.commands = (0, commands_1.commandList)({ if (player.immutable() && !config_1.Mode.localDebug) (0, commands_1.fail)(f(templateObject_17 || (templateObject_17 = __makeTemplateObject(["Player ", " is immutable."], ["Player ", " is immutable."])), player)); if (!(player == sender && rank.level < sender.rank.level)) return [3 /*break*/, 1]; - menus_1.Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!").then(function (res) { return __awaiter(_this, void 0, void 0, function () { + menus_1.Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!") + .then(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: - if (!(res == "[red]Yes, Demote")) return [3 /*break*/, 2]; - return [4 /*yield*/, player.setRank(rank)]; + case 0: return [4 /*yield*/, player.setRank(rank)]; case 1: _a.sent(); (0, utils_1.logAction)("".concat(sender, " demoted themselves to ").concat(rank)); outputSuccess(f(templateObject_18 || (templateObject_18 = __makeTemplateObject(["You have set your own rank to ", ""], ["You have set your own rank to ", ""])), rank)); - _a.label = 2; - case 2: return [2 /*return*/]; + return [2 /*return*/]; } }); }); }); diff --git a/src/commands/staff.ts b/src/commands/staff.ts index 3f4e0104..bb7eeb1b 100644 --- a/src/commands/staff.ts +++ b/src/commands/staff.ts @@ -146,12 +146,13 @@ export const commands = commandList({ if(rank == Rank.pi && !Mode.localDebug) fail(f`Rank ${rank} is immutable.`); if(player.immutable() && !Mode.localDebug) fail(f`Player ${player} is immutable.`); if(player == sender && rank.level < sender.rank.level){ - Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!").then(async (res) => { - if(res == "[red]Yes, Demote"){ + Menu.confirmDangerous( + sender, +"[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!") + .then( async () => { await player.setRank(rank); logAction(`${sender} demoted themselves to ${rank}`); outputSuccess(f`You have set your own rank to ${rank}`); - } }) } else { await player.setRank(rank); From 3d03a5cd13276a71e369cb80c3258cd97491425e Mon Sep 17 00:00:00 2001 From: Juror #9 <64419198+Jurorno9@users.noreply.github.com> Date: Mon, 19 Jan 2026 23:01:53 -0500 Subject: [PATCH 5/7] fmt --- src/commands/staff.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/staff.ts b/src/commands/staff.ts index bb7eeb1b..00b9599d 100644 --- a/src/commands/staff.ts +++ b/src/commands/staff.ts @@ -148,7 +148,7 @@ export const commands = commandList({ if(player == sender && rank.level < sender.rank.level){ Menu.confirmDangerous( sender, -"[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!") + "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!") .then( async () => { await player.setRank(rank); logAction(`${sender} demoted themselves to ${rank}`); From 9f98e67ea4597b14691672ce5ee1c9b2ecc554d8 Mon Sep 17 00:00:00 2001 From: Juror #9 <64419198+Jurorno9@users.noreply.github.com> Date: Mon, 19 Jan 2026 23:04:58 -0500 Subject: [PATCH 6/7] acutally confirmed and actually dangerous --- build/scripts/commands/staff.js | 142 ++++++++++++++------------------ src/commands/staff.ts | 11 +-- 2 files changed, 67 insertions(+), 86 deletions(-) diff --git a/build/scripts/commands/staff.js b/build/scripts/commands/staff.js index aec4c917..99042ec6 100644 --- a/build/scripts/commands/staff.js +++ b/build/scripts/commands/staff.js @@ -276,7 +276,6 @@ exports.commands = (0, commands_1.commandList)({ requirements: [commands_1.Req.moderate("player")], handler: function (_a) { return __awaiter(this, arguments, void 0, function (_b) { - var _this = this; var _c = _b.args, rank = _c.rank, player = _c.player, outputSuccess = _b.outputSuccess, f = _b.f, sender = _b.sender; return __generator(this, function (_d) { switch (_d.label) { @@ -287,28 +286,15 @@ exports.commands = (0, commands_1.commandList)({ (0, commands_1.fail)(f(templateObject_16 || (templateObject_16 = __makeTemplateObject(["Rank ", " is immutable."], ["Rank ", " is immutable."])), rank)); if (player.immutable() && !config_1.Mode.localDebug) (0, commands_1.fail)(f(templateObject_17 || (templateObject_17 = __makeTemplateObject(["Player ", " is immutable."], ["Player ", " is immutable."])), player)); - if (!(player == sender && rank.level < sender.rank.level)) return [3 /*break*/, 1]; - menus_1.Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!") - .then(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, player.setRank(rank)]; - case 1: - _a.sent(); - (0, utils_1.logAction)("".concat(sender, " demoted themselves to ").concat(rank)); - outputSuccess(f(templateObject_18 || (templateObject_18 = __makeTemplateObject(["You have set your own rank to ", ""], ["You have set your own rank to ", ""])), rank)); - return [2 /*return*/]; - } - }); - }); }); - return [3 /*break*/, 3]; - case 1: return [4 /*yield*/, player.setRank(rank)]; - case 2: + if (player == sender && rank.level < sender.rank.level) { + menus_1.Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!"); + } + return [4 /*yield*/, player.setRank(rank)]; + case 1: _d.sent(); (0, utils_1.logAction)("set rank to ".concat(rank.name, " for"), sender, player); - outputSuccess(f(templateObject_19 || (templateObject_19 = __makeTemplateObject(["Set rank of player ", " to ", ""], ["Set rank of player ", " to ", ""])), player, rank)); - _d.label = 3; - case 3: return [2 /*return*/]; + outputSuccess(f(templateObject_18 || (templateObject_18 = __makeTemplateObject(["Set rank of player ", " to ", ""], ["Set rank of player ", " to ", ""])), player, rank)); + return [2 /*return*/]; } }); }); @@ -326,12 +312,12 @@ exports.commands = (0, commands_1.commandList)({ switch (_d.label) { case 0: if (!sender.hasPerm("admin") && !flag.assignableByModerators) - (0, commands_1.fail)(f(templateObject_20 || (templateObject_20 = __makeTemplateObject(["You do not have permission to change the value of role flag ", ""], ["You do not have permission to change the value of role flag ", ""])), flag)); + (0, commands_1.fail)(f(templateObject_19 || (templateObject_19 = __makeTemplateObject(["You do not have permission to change the value of role flag ", ""], ["You do not have permission to change the value of role flag ", ""])), flag)); return [4 /*yield*/, player.setFlag(flag, value)]; case 1: _d.sent(); (0, utils_1.logAction)("set roleflag ".concat(flag.name, " to ").concat(value, " for"), sender, player); - outputSuccess(f(templateObject_21 || (templateObject_21 = __makeTemplateObject(["Set role flag ", " of player ", " to ", ""], ["Set role flag ", " of player ", " to ", ""])), flag, player, value)); + outputSuccess(f(templateObject_20 || (templateObject_20 = __makeTemplateObject(["Set role flag ", " of player ", " to ", ""], ["Set role flag ", " of player ", " to ", ""])), flag, player, value)); return [2 /*return*/]; } }); @@ -348,7 +334,7 @@ exports.commands = (0, commands_1.commandList)({ var Ohnos = allCommands["ohno"].data; //this is not ideal... TODO commit omega shenanigans var numOhnos = Ohnos.amount(); Ohnos.killAll(); - output(f(templateObject_22 || (templateObject_22 = __makeTemplateObject(["[orange]You massacred ", " helpless ohno crawlers."], ["[orange]You massacred ", " helpless ohno crawlers."])), numOhnos)); + output(f(templateObject_21 || (templateObject_21 = __makeTemplateObject(["[orange]You massacred ", " helpless ohno crawlers."], ["[orange]You massacred ", " helpless ohno crawlers."])), numOhnos)); } }, stop_offline: { @@ -369,7 +355,7 @@ exports.commands = (0, commands_1.commandList)({ return [4 /*yield*/, fishP.stop(sender, time)]; case 1: _a.sent(); - outputSuccess(f(templateObject_23 || (templateObject_23 = __makeTemplateObject(["Player ", " was marked for ", "."], ["Player ", " was marked for ", "."])), option, (0, utils_1.formatTime)(time))); + outputSuccess(f(templateObject_22 || (templateObject_22 = __makeTemplateObject(["Player ", " was marked for ", "."], ["Player ", " was marked for ", "."])), option, (0, utils_1.formatTime)(time))); return [3 /*break*/, 3]; case 2: outputFail("You do not have permission to stop this player."); @@ -394,7 +380,7 @@ exports.commands = (0, commands_1.commandList)({ _h.sent(); return [3 /*break*/, 3]; case 2: - outputFail(f(templateObject_24 || (templateObject_24 = __makeTemplateObject(["Unknown UUID ", ""], ["Unknown UUID ", ""])), args.name)); + outputFail(f(templateObject_23 || (templateObject_23 = __makeTemplateObject(["Unknown UUID ", ""], ["Unknown UUID ", ""])), args.name)); _h.label = 3; case 3: return [2 /*return*/]; case 4: @@ -501,7 +487,7 @@ exports.commands = (0, commands_1.commandList)({ case 0: maxPlayers = 300; if (!(args.name && globals_1.uuidPattern.test(args.name))) return [3 /*break*/, 2]; - info = (_c = admins.getInfoOptional(args.name)) !== null && _c !== void 0 ? _c : (0, commands_1.fail)(f(templateObject_25 || (templateObject_25 = __makeTemplateObject(["Unknown UUID ", ""], ["Unknown UUID ", ""])), args.name)); + info = (_c = admins.getInfoOptional(args.name)) !== null && _c !== void 0 ? _c : (0, commands_1.fail)(f(templateObject_24 || (templateObject_24 = __makeTemplateObject(["Unknown UUID ", ""], ["Unknown UUID ", ""])), args.name)); return [4 /*yield*/, mute(info)]; case 1: _d.sent(); @@ -567,7 +553,7 @@ exports.commands = (0, commands_1.commandList)({ }).join("\n")); } else { - output(f(templateObject_26 || (templateObject_26 = __makeTemplateObject(["[yellow]No history was found for player ", "."], ["[yellow]No history was found for player ", "."])), args.player)); + output(f(templateObject_25 || (templateObject_25 = __makeTemplateObject(["[yellow]No history was found for player ", "."], ["[yellow]No history was found for player ", "."])), args.player)); } } }, @@ -595,7 +581,7 @@ exports.commands = (0, commands_1.commandList)({ if (!Number.isSafeInteger(args.wave)) (0, commands_1.fail)("Wave must be an integer."); Vars.state.wave = args.wave; - outputSuccess(f(templateObject_27 || (templateObject_27 = __makeTemplateObject(["Set wave to ", ""], ["Set wave to ", ""])), Vars.state.wave)); + outputSuccess(f(templateObject_26 || (templateObject_26 = __makeTemplateObject(["Set wave to ", ""], ["Set wave to ", ""])), Vars.state.wave)); } }, label: { @@ -619,7 +605,7 @@ exports.commands = (0, commands_1.commandList)({ timeRemaining--; } }, 0, 1, args.time)); - outputSuccess(f(templateObject_28 || (templateObject_28 = __makeTemplateObject(["Placed label \"", "\" for ", " seconds."], ["Placed label \"", "\" for ", " seconds."])), args.message, timeRemaining)); + outputSuccess(f(templateObject_27 || (templateObject_27 = __makeTemplateObject(["Placed label \"", "\" for ", " seconds."], ["Placed label \"", "\" for ", " seconds."])), args.message, timeRemaining)); } }, labelsticky: { @@ -637,7 +623,7 @@ exports.commands = (0, commands_1.commandList)({ timeRemaining -= 5; } }, 0, 5, Math.ceil(args.time / 5))); - outputSuccess(f(templateObject_29 || (templateObject_29 = __makeTemplateObject(["Placed label \"", "\" for ", " seconds."], ["Placed label \"", "\" for ", " seconds."])), args.message, timeRemaining)); + outputSuccess(f(templateObject_28 || (templateObject_28 = __makeTemplateObject(["Placed label \"", "\" for ", " seconds."], ["Placed label \"", "\" for ", " seconds."])), args.message, timeRemaining)); } }, clearlabels: { @@ -662,7 +648,7 @@ exports.commands = (0, commands_1.commandList)({ case 0: return [4 /*yield*/, args.player.setFlag("member", args.value)]; case 1: _c.sent(); - outputSuccess(f(templateObject_30 || (templateObject_30 = __makeTemplateObject(["Set membership status of player ", " to ", "."], ["Set membership status of player ", " to ", "."])), args.player, args.value)); + outputSuccess(f(templateObject_29 || (templateObject_29 = __makeTemplateObject(["Set membership status of player ", " to ", "."], ["Set membership status of player ", " to ", "."])), args.player, args.value)); return [2 /*return*/]; } }); @@ -679,7 +665,7 @@ exports.commands = (0, commands_1.commandList)({ var rule = (_b = config_1.rules[args.rule - 1]) !== null && _b !== void 0 ? _b : (0, commands_1.fail)("The rule you requested does not exist."); if (args.target) { args.target.sendMessage("A staff member wants to remind you of the following rule:\n" + rule); - outputSuccess(f(templateObject_31 || (templateObject_31 = __makeTemplateObject(["Reminded ", " of rule ", ""], ["Reminded ", " of rule ", ""])), args.target, args.rule)); + outputSuccess(f(templateObject_30 || (templateObject_30 = __makeTemplateObject(["Reminded ", " of rule ", ""], ["Reminded ", " of rule ", ""])), args.target, args.rule)); } else { Call.sendMessage("A staff member wants to remind everyone of the following rule:\n" + rule); @@ -713,14 +699,14 @@ exports.commands = (0, commands_1.commandList)({ api.ban({ ip: ip, uuid: uuid }); Log.info("".concat(uuid, "/").concat(ip, " was banned.")); (0, utils_1.logAction)("banned", sender, data); - outputSuccess(f(templateObject_32 || (templateObject_32 = __makeTemplateObject(["Banned player ", " (", "/", ")"], ["Banned player ", " (", "/", ")"])), (0, funcs_1.escapeStringColorsClient)(data.lastName), uuid, ip)); + outputSuccess(f(templateObject_31 || (templateObject_31 = __makeTemplateObject(["Banned player ", " (", "/", ")"], ["Banned player ", " (", "/", ")"])), (0, funcs_1.escapeStringColorsClient)(data.lastName), uuid, ip)); //TODO add way to specify whether to activate or escape color tags } else { api.ban({ uuid: uuid }); Log.info("".concat(uuid, " was banned.")); (0, utils_1.logAction)("banned", sender, uuid); - outputSuccess(f(templateObject_33 || (templateObject_33 = __makeTemplateObject(["Banned player ", ". [yellow]Unable to determine IP.[]"], ["Banned player ", ". [yellow]Unable to determine IP.[]"])), uuid)); + outputSuccess(f(templateObject_32 || (templateObject_32 = __makeTemplateObject(["Banned player ", ". [yellow]Unable to determine IP.[]"], ["Banned player ", ". [yellow]Unable to determine IP.[]"])), uuid)); } (0, utils_1.updateBans)(function (player) { return "[scarlet]Player [yellow]".concat(player.name, "[scarlet] has been whacked by ").concat(sender.prefixedName, "."); }); return [2 /*return*/]; @@ -738,10 +724,10 @@ exports.commands = (0, commands_1.commandList)({ (0, utils_1.logAction)("banned ".concat(ip), sender); alreadyBanned = admins.banPlayerIP(ip); if (alreadyBanned) { - outputSuccess(f(templateObject_34 || (templateObject_34 = __makeTemplateObject(["IP ", " is already banned. Ban was synced to other servers."], ["IP ", " is already banned. Ban was synced to other servers."])), ip)); + outputSuccess(f(templateObject_33 || (templateObject_33 = __makeTemplateObject(["IP ", " is already banned. Ban was synced to other servers."], ["IP ", " is already banned. Ban was synced to other servers."])), ip)); } else { - outputSuccess(f(templateObject_35 || (templateObject_35 = __makeTemplateObject(["IP ", " has been banned. Ban was synced to other servers."], ["IP ", " has been banned. Ban was synced to other servers."])), ip)); + outputSuccess(f(templateObject_34 || (templateObject_34 = __makeTemplateObject(["IP ", " has been banned. Ban was synced to other servers."], ["IP ", " has been banned. Ban was synced to other servers."])), ip)); } (0, utils_1.updateBans)(function (player) { return "[scarlet]Player [yellow]".concat(player.name, "[scarlet] has been whacked by ").concat(sender.prefixedName, "."); }); return [2 /*return*/]; @@ -760,7 +746,7 @@ exports.commands = (0, commands_1.commandList)({ api.ban({ ip: option.ip(), uuid: option.uuid() }); Log.info("".concat(option.ip(), "/").concat(option.uuid(), " was banned.")); (0, utils_1.logAction)("banned", sender, option.getInfo()); - outputSuccess(f(templateObject_36 || (templateObject_36 = __makeTemplateObject(["Banned player ", "."], ["Banned player ", "."])), option)); + outputSuccess(f(templateObject_35 || (templateObject_35 = __makeTemplateObject(["Banned player ", "."], ["Banned player ", "."])), option)); (0, utils_1.updateBans)(function (player) { return "[scarlet]Player [yellow]".concat(player.name, "[scarlet] has been whacked by ").concat(sender.prefixedName, "."); }); return [2 /*return*/]; } @@ -778,10 +764,10 @@ exports.commands = (0, commands_1.commandList)({ var unit = args.player.unit(); if (unit) { unit.kill(); - outputSuccess(f(templateObject_37 || (templateObject_37 = __makeTemplateObject(["Killed the unit of player ", "."], ["Killed the unit of player ", "."])), args.player)); + outputSuccess(f(templateObject_36 || (templateObject_36 = __makeTemplateObject(["Killed the unit of player ", "."], ["Killed the unit of player ", "."])), args.player)); } else { - outputFail(f(templateObject_38 || (templateObject_38 = __makeTemplateObject(["Player ", " does not have a unit."], ["Player ", " does not have a unit."])), args.player)); + outputFail(f(templateObject_37 || (templateObject_37 = __makeTemplateObject(["Player ", " does not have a unit."], ["Player ", " does not have a unit."])), args.player)); } } }, @@ -806,12 +792,12 @@ exports.commands = (0, commands_1.commandList)({ u.kill(); i_1++; }); - outputSuccess(f(templateObject_39 || (templateObject_39 = __makeTemplateObject(["Killed ", " units on ", "."], ["Killed ", " units on ", "."])), i_1, team)); + outputSuccess(f(templateObject_38 || (templateObject_38 = __makeTemplateObject(["Killed ", " units on ", "."], ["Killed ", " units on ", "."])), i_1, team)); } else { before = team.data().units.size; team.data().units.each(function (u) { return u.kill(); }); - outputSuccess(f(templateObject_40 || (templateObject_40 = __makeTemplateObject(["Killed ", " units on ", "."], ["Killed ", " units on ", "."])), before, team)); + outputSuccess(f(templateObject_39 || (templateObject_39 = __makeTemplateObject(["Killed ", " units on ", "."], ["Killed ", " units on ", "."])), before, team)); } return [3 /*break*/, 4]; case 2: return [4 /*yield*/, menus_1.Menu.confirmDangerous(sender, "This will kill [scarlet]every single ".concat(unit ? unit.localizedName : "unit", "[]."), { confirmText: "[orange]Kill all units[]" })]; @@ -823,12 +809,12 @@ exports.commands = (0, commands_1.commandList)({ u.kill(); i_2++; }); - outputSuccess(f(templateObject_41 || (templateObject_41 = __makeTemplateObject(["Killed ", " units."], ["Killed ", " units."])), i_2)); + outputSuccess(f(templateObject_40 || (templateObject_40 = __makeTemplateObject(["Killed ", " units."], ["Killed ", " units."])), i_2)); } else { before = Groups.unit.size(); Groups.unit.each(function (u) { return u.kill(); }); - outputSuccess(f(templateObject_42 || (templateObject_42 = __makeTemplateObject(["Killed ", " units."], ["Killed ", " units."])), before)); + outputSuccess(f(templateObject_41 || (templateObject_41 = __makeTemplateObject(["Killed ", " units."], ["Killed ", " units."])), before)); } _d.label = 4; case 4: return [2 /*return*/]; @@ -854,14 +840,14 @@ exports.commands = (0, commands_1.commandList)({ _c.sent(); count = team.data().buildings.size; team.data().buildings.each(function (b) { return !(b.block instanceof CoreBlock); }, function (b) { return b.tile.remove(); }); - outputSuccess(f(templateObject_43 || (templateObject_43 = __makeTemplateObject(["Killed ", " buildings on ", "."], ["Killed ", " buildings on ", "."])), count, team)); + outputSuccess(f(templateObject_42 || (templateObject_42 = __makeTemplateObject(["Killed ", " buildings on ", "."], ["Killed ", " buildings on ", "."])), count, team)); return [3 /*break*/, 4]; case 2: return [4 /*yield*/, menus_1.Menu.confirmDangerous(sender, "This will kill [scarlet]every building[] except cores.", { confirmText: "[orange]Kill buildings[]" })]; case 3: _c.sent(); count = Groups.build.size(); Groups.build.each(function (b) { return !(b.block instanceof CoreBlock); }, function (b) { return b.tile.remove(); }); - outputSuccess(f(templateObject_44 || (templateObject_44 = __makeTemplateObject(["Killed ", " buildings."], ["Killed ", " buildings."])), count)); + outputSuccess(f(templateObject_43 || (templateObject_43 = __makeTemplateObject(["Killed ", " buildings."], ["Killed ", " buildings."])), count)); _c.label = 4; case 4: return [2 /*return*/]; } @@ -877,7 +863,7 @@ exports.commands = (0, commands_1.commandList)({ handler: function (_a) { var args = _a.args, outputSuccess = _a.outputSuccess, f = _a.f; args.player.forceRespawn(); - outputSuccess(f(templateObject_45 || (templateObject_45 = __makeTemplateObject(["Respawned player ", "."], ["Respawned player ", "."])), args.player)); + outputSuccess(f(templateObject_44 || (templateObject_44 = __makeTemplateObject(["Respawned player ", "."], ["Respawned player ", "."])), args.player)); } }, stealunit: { @@ -888,7 +874,7 @@ exports.commands = (0, commands_1.commandList)({ handler: function (_a) { var _b; var sender = _a.sender, _c = _a.args, target = _c.target, _d = _c.newcontroller, newcontroller = _d === void 0 ? sender : _d, outputSuccess = _a.outputSuccess, f = _a.f; - var unit = (_b = target.unit()) !== null && _b !== void 0 ? _b : (0, commands_1.fail)(f(templateObject_46 || (templateObject_46 = __makeTemplateObject(["Targeted player ", " is not in a unit."], ["Targeted player ", " is not in a unit."])), target)); + var unit = (_b = target.unit()) !== null && _b !== void 0 ? _b : (0, commands_1.fail)(f(templateObject_45 || (templateObject_45 = __makeTemplateObject(["Targeted player ", " is not in a unit."], ["Targeted player ", " is not in a unit."])), target)); if (target.team() !== newcontroller.team()) { if (!sender.hasPerm("changeTeamExternal")) { if (!sender.hasPerm("changeTeam")) @@ -899,11 +885,11 @@ exports.commands = (0, commands_1.commandList)({ target.forceRespawn(); newcontroller.unit(unit); if (newcontroller == sender) { - outputSuccess(f(templateObject_47 || (templateObject_47 = __makeTemplateObject(["Commandeered the unit of player ", "."], ["Commandeered the unit of player ", "."])), target)); + outputSuccess(f(templateObject_46 || (templateObject_46 = __makeTemplateObject(["Commandeered the unit of player ", "."], ["Commandeered the unit of player ", "."])), target)); } else { - outputSuccess(f(templateObject_48 || (templateObject_48 = __makeTemplateObject(["Transferred player ", " into the unit of ", "."], ["Transferred player ", " into the unit of ", "."])), newcontroller, target)); - newcontroller.sendMessage(f(templateObject_49 || (templateObject_49 = __makeTemplateObject(["[green]You were transferred to the unit of player ", " by ", "."], ["[green]You were transferred to the unit of player ", " by ", "."])), target, sender)('[green]')); + outputSuccess(f(templateObject_47 || (templateObject_47 = __makeTemplateObject(["Transferred player ", " into the unit of ", "."], ["Transferred player ", " into the unit of ", "."])), newcontroller, target)); + newcontroller.sendMessage(f(templateObject_48 || (templateObject_48 = __makeTemplateObject(["[green]You were transferred to the unit of player ", " by ", "."], ["[green]You were transferred to the unit of player ", " by ", "."])), target, sender)('[green]')); } } }, @@ -926,9 +912,9 @@ exports.commands = (0, commands_1.commandList)({ var names = args.showColors ? info.names.map(funcs_1.escapeStringColorsClient).toString(", ") : __spreadArray([], __read(new Set(info.names.map(function (n) { return Strings.stripColors(n); }).toArray())), false).join(", "); - output(f(templateObject_50 || (templateObject_50 = __makeTemplateObject(["[accent]Info for player ", " [gray](", ") (#", ")\n\t[accent]Rank: ", "\n\t[accent]Role flags: ", "\n\t[accent]Stopped: ", "\n\t[accent]marked: ", "\n\t[accent]muted: ", "\n\t[accent]autoflagged: ", "\n\t[accent]VPN detected: ", "\n\t[accent]times joined / kicked: ", "/", "\n\t[accent]First joined: ", "\n\t[accent]Names used: [[", "]"], ["\\\n[accent]Info for player ", " [gray](", ") (#", ")\n\t[accent]Rank: ", "\n\t[accent]Role flags: ", "\n\t[accent]Stopped: ", "\n\t[accent]marked: ", "\n\t[accent]muted: ", "\n\t[accent]autoflagged: ", "\n\t[accent]VPN detected: ", "\n\t[accent]times joined / kicked: ", "/", "\n\t[accent]First joined: ", "\n\t[accent]Names used: [[", "]"])), args.target, (0, funcs_1.escapeStringColorsClient)(args.target.name), args.target.player.id.toString(), args.target.rank, Array.from(args.target.flags).map(function (f) { return f.coloredName(); }).join(" "), f.boolBad(!args.target.hasPerm("play")), args.target.marked() ? "until ".concat((0, utils_1.formatTimeRelative)(args.target.unmarkTime)) : "[green]false", f.boolBad(args.target.muted), f.boolBad(args.target.autoflagged), f.boolBad(args.target.ipDetectedVpn), info.timesJoined, info.timesKicked, args.target.firstJoined < 1 ? "unknown" : (0, utils_1.formatTimeRelative)(args.target.firstJoined), names)); + output(f(templateObject_49 || (templateObject_49 = __makeTemplateObject(["[accent]Info for player ", " [gray](", ") (#", ")\n\t[accent]Rank: ", "\n\t[accent]Role flags: ", "\n\t[accent]Stopped: ", "\n\t[accent]marked: ", "\n\t[accent]muted: ", "\n\t[accent]autoflagged: ", "\n\t[accent]VPN detected: ", "\n\t[accent]times joined / kicked: ", "/", "\n\t[accent]First joined: ", "\n\t[accent]Names used: [[", "]"], ["\\\n[accent]Info for player ", " [gray](", ") (#", ")\n\t[accent]Rank: ", "\n\t[accent]Role flags: ", "\n\t[accent]Stopped: ", "\n\t[accent]marked: ", "\n\t[accent]muted: ", "\n\t[accent]autoflagged: ", "\n\t[accent]VPN detected: ", "\n\t[accent]times joined / kicked: ", "/", "\n\t[accent]First joined: ", "\n\t[accent]Names used: [[", "]"])), args.target, (0, funcs_1.escapeStringColorsClient)(args.target.name), args.target.player.id.toString(), args.target.rank, Array.from(args.target.flags).map(function (f) { return f.coloredName(); }).join(" "), f.boolBad(!args.target.hasPerm("play")), args.target.marked() ? "until ".concat((0, utils_1.formatTimeRelative)(args.target.unmarkTime)) : "[green]false", f.boolBad(args.target.muted), f.boolBad(args.target.autoflagged), f.boolBad(args.target.ipDetectedVpn), info.timesJoined, info.timesKicked, args.target.firstJoined < 1 ? "unknown" : (0, utils_1.formatTimeRelative)(args.target.firstJoined), names)); if (sender.hasPerm("viewUUIDs")) - output(f(templateObject_51 || (templateObject_51 = __makeTemplateObject(["\t[#FFAAAA]UUID: ", "\n\t[#FFAAAA]IP: ", ""], ["\\\n\t[#FFAAAA]UUID: ", "\n\t[#FFAAAA]IP: ", ""])), args.target.uuid, args.target.ip())); + output(f(templateObject_50 || (templateObject_50 = __makeTemplateObject(["\t[#FFAAAA]UUID: ", "\n\t[#FFAAAA]IP: ", ""], ["\\\n\t[#FFAAAA]UUID: ", "\n\t[#FFAAAA]IP: ", ""])), args.target.uuid, args.target.ip())); } }, spawn: { @@ -955,7 +941,7 @@ exports.commands = (0, commands_1.commandList)({ } if (!config_1.Gamemode.sandbox() && args.effects !== 'paper') (0, utils_1.logAction)("spawned unit ".concat(args.type.name).concat(count == 1 ? '' : " x".concat(count), " at ").concat(Math.round(x / 8), ", ").concat(Math.round(y / 8)) + (args.effects ? "with ".concat(args.effects, " effects") : ''), sender); - outputSuccess(f(templateObject_52 || (templateObject_52 = __makeTemplateObject(["Spawned unit ", " at (", ", ", ")"], ["Spawned unit ", " at (", ", ", ")"])), args.type, Math.round(x / 8), Math.round(y / 8))); + outputSuccess(f(templateObject_51 || (templateObject_51 = __makeTemplateObject(["Spawned unit ", " at (", ", ", ")"], ["Spawned unit ", " at (", ", ", ")"])), args.type, Math.round(x / 8), Math.round(y / 8))); } }, setblock: { @@ -968,9 +954,9 @@ exports.commands = (0, commands_1.commandList)({ var team = (_b = args.team) !== null && _b !== void 0 ? _b : sender.team(); var tile = Vars.world.tile(args.x, args.y); if (args.rotation != null && (args.rotation < 0 || args.rotation > 3)) - (0, commands_1.fail)(f(templateObject_53 || (templateObject_53 = __makeTemplateObject(["Invalid rotation ", ""], ["Invalid rotation ", ""])), args.rotation)); + (0, commands_1.fail)(f(templateObject_52 || (templateObject_52 = __makeTemplateObject(["Invalid rotation ", ""], ["Invalid rotation ", ""])), args.rotation)); if (tile == null) - (0, commands_1.fail)(f(templateObject_54 || (templateObject_54 = __makeTemplateObject(["Position (", ", ", ") is out of bounds."], ["Position (", ", ", ") is out of bounds."])), args.x, args.y)); + (0, commands_1.fail)(f(templateObject_53 || (templateObject_53 = __makeTemplateObject(["Position (", ", ", ") is out of bounds."], ["Position (", ", ", ") is out of bounds."])), args.x, args.y)); tile.setNet(args.block, team, (_c = args.rotation) !== null && _c !== void 0 ? _c : 0); (0, utils_1.addToTileHistory)({ pos: "".concat(args.x, ",").concat(args.y), @@ -980,7 +966,7 @@ exports.commands = (0, commands_1.commandList)({ }); if (!config_1.Gamemode.sandbox()) (0, utils_1.logAction)("set block to ".concat(args.block.localizedName, " at ").concat(args.x, ",").concat(args.y), sender); - outputSuccess(f(templateObject_55 || (templateObject_55 = __makeTemplateObject(["Set block at ", ", ", " to ", ""], ["Set block at ", ", ", " to ", ""])), args.x, args.y, args.block)); + outputSuccess(f(templateObject_54 || (templateObject_54 = __makeTemplateObject(["Set block at ", ", ", " to ", ""], ["Set block at ", ", ", " to ", ""])), args.x, args.y, args.block)); } }, setblockr: { @@ -995,9 +981,9 @@ exports.commands = (0, commands_1.commandList)({ var team = (_b = args.team) !== null && _b !== void 0 ? _b : sender.team(); var tile = Vars.world.tile(x, y); if (args.rotation != null && (args.rotation < 0 || args.rotation > 3)) - (0, commands_1.fail)(f(templateObject_56 || (templateObject_56 = __makeTemplateObject(["Invalid rotation ", ""], ["Invalid rotation ", ""])), args.rotation)); + (0, commands_1.fail)(f(templateObject_55 || (templateObject_55 = __makeTemplateObject(["Invalid rotation ", ""], ["Invalid rotation ", ""])), args.rotation)); if (tile == null) - (0, commands_1.fail)(f(templateObject_57 || (templateObject_57 = __makeTemplateObject(["Position (", ", ", ") is out of bounds."], ["Position (", ", ", ") is out of bounds."])), x, y)); + (0, commands_1.fail)(f(templateObject_56 || (templateObject_56 = __makeTemplateObject(["Position (", ", ", ") is out of bounds."], ["Position (", ", ", ") is out of bounds."])), x, y)); tile.setNet(args.block, team, (_c = args.rotation) !== null && _c !== void 0 ? _c : 0); (0, utils_1.addToTileHistory)({ pos: "".concat(x, ",").concat(y), @@ -1007,7 +993,7 @@ exports.commands = (0, commands_1.commandList)({ }); if (!config_1.Gamemode.sandbox()) (0, utils_1.logAction)("set block to ".concat(args.block.localizedName, " at ").concat(x, ",").concat(y), sender); - outputSuccess(f(templateObject_58 || (templateObject_58 = __makeTemplateObject(["Set block at ", ", ", " to ", ""], ["Set block at ", ", ", " to ", ""])), x, y, args.block)); + outputSuccess(f(templateObject_57 || (templateObject_57 = __makeTemplateObject(["Set block at ", ", ", " to ", ""], ["Set block at ", ", ", " to ", ""])), x, y, args.block)); }, handler: function (_a) { var args = _a.args, outputSuccess = _a.outputSuccess, handleTaps = _a.handleTaps, currentTapMode = _a.currentTapMode, f = _a.f; @@ -1017,7 +1003,7 @@ exports.commands = (0, commands_1.commandList)({ outputSuccess("setblockr enabled.\n[scarlet]Be careful, you have the midas touch now![] Turn it off by running /setblockr again."); } else { - outputSuccess(f(templateObject_59 || (templateObject_59 = __makeTemplateObject(["Changed setblockr's block to ", ""], ["Changed setblockr's block to ", ""])), args.block)); + outputSuccess(f(templateObject_58 || (templateObject_58 = __makeTemplateObject(["Changed setblockr's block to ", ""], ["Changed setblockr's block to ", ""])), args.block)); } } else { @@ -1046,7 +1032,7 @@ exports.commands = (0, commands_1.commandList)({ }); if (!config_1.Gamemode.sandbox()) (0, utils_1.logAction)("exterminated ".concat(numKilled, " units"), sender); - outputSuccess(f(templateObject_60 || (templateObject_60 = __makeTemplateObject(["Exterminated ", " units."], ["Exterminated ", " units."])), numKilled)); + outputSuccess(f(templateObject_59 || (templateObject_59 = __makeTemplateObject(["Exterminated ", " units."], ["Exterminated ", " units."])), numKilled)); } }, js: { @@ -1136,7 +1122,7 @@ exports.commands = (0, commands_1.commandList)({ (0, commands_1.fail)("Invalid chat strictness level: valid levels are \"chat\", \"strict\""); player.chatStrictness = value; (0, utils_1.logAction)("set chat strictness to ".concat(value, " for"), sender, player); - outputSuccess(f(templateObject_61 || (templateObject_61 = __makeTemplateObject(["Set chat strictness for player ", " to \"", "\"."], ["Set chat strictness for player ", " to \"", "\"."])), player, value)); + outputSuccess(f(templateObject_60 || (templateObject_60 = __makeTemplateObject(["Set chat strictness for player ", " to \"", "\"."], ["Set chat strictness for player ", " to \"", "\"."])), player, value)); } }, emanate: (0, commands_1.command)(function () { @@ -1241,29 +1227,29 @@ exports.commands = (0, commands_1.commandList)({ fishP = players_1.FishPlayer.getById(input); info = admins.getInfoOptional(input); if (fishP == null && info == null) - (0, commands_1.fail)(f(templateObject_62 || (templateObject_62 = __makeTemplateObject(["No stored data matched uuid ", "."], ["No stored data matched uuid ", "."])), input)); + (0, commands_1.fail)(f(templateObject_61 || (templateObject_61 = __makeTemplateObject(["No stored data matched uuid ", "."], ["No stored data matched uuid ", "."])), input)); else if (fishP == null && info) - output(f(templateObject_63 || (templateObject_63 = __makeTemplateObject(["[accent]Found player info (but no fish player data) for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nFound player info (but no fish player data) for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), input, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); + output(f(templateObject_62 || (templateObject_62 = __makeTemplateObject(["[accent]Found player info (but no fish player data) for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nFound player info (but no fish player data) for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), input, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); else if (fishP && info) - output(f(templateObject_64 || (templateObject_64 = __makeTemplateObject(["[accent]Found fish player data for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nFound fish player data for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), input, fishP.name, (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); + output(f(templateObject_63 || (templateObject_63 = __makeTemplateObject(["[accent]Found fish player data for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nFound fish player data for uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), input, fishP.name, (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); else - (0, commands_1.fail)(f(templateObject_65 || (templateObject_65 = __makeTemplateObject(["Super weird edge case: found fish player data but no player info for uuid ", "."], ["Super weird edge case: found fish player data but no player info for uuid ", "."])), input)); + (0, commands_1.fail)(f(templateObject_64 || (templateObject_64 = __makeTemplateObject(["Super weird edge case: found fish player data but no player info for uuid ", "."], ["Super weird edge case: found fish player data but no player info for uuid ", "."])), input)); return [3 /*break*/, 5]; case 1: if (!globals_1.ipPattern.test(input)) return [3 /*break*/, 2]; matches = admins.findByIPs(input); if (matches.isEmpty()) - (0, commands_1.fail)(f(templateObject_66 || (templateObject_66 = __makeTemplateObject(["No stored data matched IP ", ""], ["No stored data matched IP ", ""])), input)); - output(f(templateObject_67 || (templateObject_67 = __makeTemplateObject(["[accent]Found ", " match", " for search \"", "\"."], ["[accent]Found ", " match", " for search \"", "\"."])), matches.size, matches.size == 1 ? "" : "es", input)); - matches.each(function (info) { return output(f(templateObject_68 || (templateObject_68 = __makeTemplateObject(["[accent]Player with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nPlayer with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), info.id, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); }); + (0, commands_1.fail)(f(templateObject_65 || (templateObject_65 = __makeTemplateObject(["No stored data matched IP ", ""], ["No stored data matched IP ", ""])), input)); + output(f(templateObject_66 || (templateObject_66 = __makeTemplateObject(["[accent]Found ", " match", " for search \"", "\"."], ["[accent]Found ", " match", " for search \"", "\"."])), matches.size, matches.size == 1 ? "" : "es", input)); + matches.each(function (info) { return output(f(templateObject_67 || (templateObject_67 = __makeTemplateObject(["[accent]Player with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nPlayer with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), info.id, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); }); return [3 /*break*/, 5]; case 2: matches_1 = Vars.netServer.admins.searchNames(input); if (matches_1.isEmpty()) - (0, commands_1.fail)(f(templateObject_69 || (templateObject_69 = __makeTemplateObject(["No stored data matched name ", ""], ["No stored data matched name ", ""])), input)); - output(f(templateObject_70 || (templateObject_70 = __makeTemplateObject(["[accent]Found ", " match", " for search \"", "\"."], ["[accent]Found ", " match", " for search \"", "\"."])), matches_1.size, matches_1.size == 1 ? "" : "es", input)); + (0, commands_1.fail)(f(templateObject_68 || (templateObject_68 = __makeTemplateObject(["No stored data matched name ", ""], ["No stored data matched name ", ""])), input)); + output(f(templateObject_69 || (templateObject_69 = __makeTemplateObject(["[accent]Found ", " match", " for search \"", "\"."], ["[accent]Found ", " match", " for search \"", "\"."])), matches_1.size, matches_1.size == 1 ? "" : "es", input)); displayMatches = function () { - matches_1.each(function (info) { return output(f(templateObject_71 || (templateObject_71 = __makeTemplateObject(["[accent]Player with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nPlayer with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), info.id, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); }); + matches_1.each(function (info) { return output(f(templateObject_70 || (templateObject_70 = __makeTemplateObject(["[accent]Player with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""], ["[accent]\\\nPlayer with uuid ", "\nLast name used: \"", "\" [gray](", ")[] [[", "]\nIPs used: ", ""])), info.id, info.plainLastName(), (0, funcs_1.escapeStringColorsClient)(info.lastName), info.names.map(funcs_1.escapeStringColorsClient).items.join(", "), info.ips.map(function (i) { return "[blue]".concat(i, "[]"); }).toString(", "))); }); }; if (!(matches_1.size > 20)) return [3 /*break*/, 4]; return [4 /*yield*/, menus_1.Menu.confirm(sender, "Are you sure you want to view all ".concat(matches_1.size, " matches?"))]; @@ -1309,13 +1295,13 @@ exports.commands = (0, commands_1.commandList)({ var _b, _c, _d; var args = _a.args, sender = _a.sender, f = _a.f, outputSuccess = _a.outputSuccess; if ((_b = args.player) === null || _b === void 0 ? void 0 : _b.hasPerm("blockTrolling")) - (0, commands_1.fail)(f(templateObject_72 || (templateObject_72 = __makeTemplateObject(["Player ", " is insufficiently trollable."], ["Player ", " is insufficiently trollable."])), args.player)); + (0, commands_1.fail)(f(templateObject_71 || (templateObject_71 = __makeTemplateObject(["Player ", " is insufficiently trollable."], ["Player ", " is insufficiently trollable."])), args.player)); if (args.player && !sender.canModerate(args.player, false)) (0, commands_1.fail)("You do not have permission to perform moderation actions on this player."); var target = (_c = args.player) !== null && _c !== void 0 ? _c : sender; var unit = target.unit(); if (!unit || unit.dead) - (0, commands_1.fail)(f(templateObject_73 || (templateObject_73 = __makeTemplateObject(["", "'s unit is dead."], ["", "'s unit is dead."])), target)); + (0, commands_1.fail)(f(templateObject_72 || (templateObject_72 = __makeTemplateObject(["", "'s unit is dead."], ["", "'s unit is dead."])), target)); var ticks = ((_d = args.duration) !== null && _d !== void 0 ? _d : 1e12) / 1000 * 60; (0, utils_1.applyEffectMode)(args.mode, unit, ticks); outputSuccess("".concat(args.mode === "clear" ? "Cleared" : "Applied", " effects.")); @@ -1330,9 +1316,9 @@ exports.commands = (0, commands_1.commandList)({ handler: function (_a) { var _b; var _c = _a.args, team = _c.team, item = _c.item, amount = _c.amount, sender = _a.sender, outputSuccess = _a.outputSuccess, f = _a.f; - var core = (_b = team.data().cores.firstOpt()) !== null && _b !== void 0 ? _b : (0, commands_1.fail)(f(templateObject_74 || (templateObject_74 = __makeTemplateObject(["Team ", " has no cores."], ["Team ", " has no cores."])), team)); + var core = (_b = team.data().cores.firstOpt()) !== null && _b !== void 0 ? _b : (0, commands_1.fail)(f(templateObject_73 || (templateObject_73 = __makeTemplateObject(["Team ", " has no cores."], ["Team ", " has no cores."])), team)); core.items.add(item, amount); - outputSuccess(f(templateObject_75 || (templateObject_75 = __makeTemplateObject(["Gave ", " ", " to ", "."], ["Gave ", " ", " to ", "."])), amount, item, team)); + outputSuccess(f(templateObject_74 || (templateObject_74 = __makeTemplateObject(["Gave ", " ", " to ", "."], ["Gave ", " ", " to ", "."])), amount, item, team)); if (!config_1.Gamemode.sandbox()) (0, utils_1.logAction)("gave ".concat(amount, " ").concat(item.name, " to ").concat(team.name), sender); } @@ -1370,4 +1356,4 @@ exports.commands = (0, commands_1.commandList)({ } } }); -var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47, templateObject_48, templateObject_49, templateObject_50, templateObject_51, templateObject_52, templateObject_53, templateObject_54, templateObject_55, templateObject_56, templateObject_57, templateObject_58, templateObject_59, templateObject_60, templateObject_61, templateObject_62, templateObject_63, templateObject_64, templateObject_65, templateObject_66, templateObject_67, templateObject_68, templateObject_69, templateObject_70, templateObject_71, templateObject_72, templateObject_73, templateObject_74, templateObject_75; +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47, templateObject_48, templateObject_49, templateObject_50, templateObject_51, templateObject_52, templateObject_53, templateObject_54, templateObject_55, templateObject_56, templateObject_57, templateObject_58, templateObject_59, templateObject_60, templateObject_61, templateObject_62, templateObject_63, templateObject_64, templateObject_65, templateObject_66, templateObject_67, templateObject_68, templateObject_69, templateObject_70, templateObject_71, templateObject_72, templateObject_73, templateObject_74; diff --git a/src/commands/staff.ts b/src/commands/staff.ts index 00b9599d..246caf08 100644 --- a/src/commands/staff.ts +++ b/src/commands/staff.ts @@ -148,17 +148,12 @@ export const commands = commandList({ if(player == sender && rank.level < sender.rank.level){ Menu.confirmDangerous( sender, - "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!") - .then( async () => { - await player.setRank(rank); - logAction(`${sender} demoted themselves to ${rank}`); - outputSuccess(f`You have set your own rank to ${rank}`); - }) - } else { + "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!" + ); + } await player.setRank(rank); logAction(`set rank to ${rank.name} for`, sender, player); outputSuccess(f`Set rank of player ${player} to ${rank}`); - } } }, From 87fc93f9dd0dee988ab8aafb006df21e64935cec Mon Sep 17 00:00:00 2001 From: Juror #9 <64419198+Jurorno9@users.noreply.github.com> Date: Mon, 19 Jan 2026 23:14:47 -0500 Subject: [PATCH 7/7] fr confirmed and fr dangerous --- build/scripts/commands/staff.js | 10 ++++++---- src/commands/staff.ts | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build/scripts/commands/staff.js b/build/scripts/commands/staff.js index 99042ec6..730f1740 100644 --- a/build/scripts/commands/staff.js +++ b/build/scripts/commands/staff.js @@ -286,11 +286,13 @@ exports.commands = (0, commands_1.commandList)({ (0, commands_1.fail)(f(templateObject_16 || (templateObject_16 = __makeTemplateObject(["Rank ", " is immutable."], ["Rank ", " is immutable."])), rank)); if (player.immutable() && !config_1.Mode.localDebug) (0, commands_1.fail)(f(templateObject_17 || (templateObject_17 = __makeTemplateObject(["Player ", " is immutable."], ["Player ", " is immutable."])), player)); - if (player == sender && rank.level < sender.rank.level) { - menus_1.Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!"); - } - return [4 /*yield*/, player.setRank(rank)]; + if (!(player == sender && rank.level < sender.rank.level)) return [3 /*break*/, 2]; + return [4 /*yield*/, menus_1.Menu.confirmDangerous(sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!")]; case 1: + _d.sent(); + _d.label = 2; + case 2: return [4 /*yield*/, player.setRank(rank)]; + case 3: _d.sent(); (0, utils_1.logAction)("set rank to ".concat(rank.name, " for"), sender, player); outputSuccess(f(templateObject_18 || (templateObject_18 = __makeTemplateObject(["Set rank of player ", " to ", ""], ["Set rank of player ", " to ", ""])), player, rank)); diff --git a/src/commands/staff.ts b/src/commands/staff.ts index 246caf08..ebeb1982 100644 --- a/src/commands/staff.ts +++ b/src/commands/staff.ts @@ -146,14 +146,14 @@ export const commands = commandList({ if(rank == Rank.pi && !Mode.localDebug) fail(f`Rank ${rank} is immutable.`); if(player.immutable() && !Mode.localDebug) fail(f`Player ${player} is immutable.`); if(player == sender && rank.level < sender.rank.level){ - Menu.confirmDangerous( + await Menu.confirmDangerous( sender, "[red] ARE YOU SURE YOU WANT TO SELF DEMOTE. THIS ACTION CANNOT BE UNDONE!" ); } - await player.setRank(rank); - logAction(`set rank to ${rank.name} for`, sender, player); - outputSuccess(f`Set rank of player ${player} to ${rank}`); + await player.setRank(rank); + logAction(`set rank to ${rank.name} for`, sender, player); + outputSuccess(f`Set rank of player ${player} to ${rank}`); } },