From 1cb948322272a8700168b373d0f004d11642a1e2 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Sat, 6 Sep 2003 08:30:10 +0000 Subject: [PATCH] Added /EVAL operator command, used to evaluate any valid JS expression and send back result (or exception). --- exec/ircd.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/exec/ircd.js b/exec/ircd.js index 04441b1157..1ec82ec7f7 100644 --- a/exec/ircd.js +++ b/exec/ircd.js @@ -2264,6 +2264,18 @@ function IRCClient_registered_commands(command, cmdline) { break; } break; + case "EVAL": /* Evaluate a JavaScript expression */ + if (!(this.mode&USERMODE_OPER)) { + this.numeric481(); + break; + } + cmd.shift(); + try { + this.server_notice("Result: " + eval(cmd.toString())); + } catch(e) { + this.server_notice("!" + e); + } + break; case "INFO": this.numeric("371", ":" + VERSION + " Copyright 2003 Randy Sommerfeld."); this.numeric("371", ":" + system.version_notice + " " + system.copyright + "."); -- GitLab