mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Configuration Controller (#7857)
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
/proc/send2irc(var/channel, var/msg)
|
||||
return // VOREStation Edit - Can't exploit shell if we never call shell!
|
||||
/* Unreachable with above VOREStation Edit
|
||||
if (config.use_irc_bot)
|
||||
if (config.use_node_bot)
|
||||
shell("node bridge.js -h \"[config.irc_bot_host]\" -p \"[config.irc_bot_port]\" -c \"[channel]\" -m \"[escape_shell_arg(msg)]\"")
|
||||
if (CONFIG_GET(flag/use_irc_bot)) // CHOMPEdit
|
||||
if (CONFIG_GET(flag/use_node_bot)) // CHOMPEdit
|
||||
shell("node bridge.js -h \"[CONFIG_GET(string/irc_bot_host)]\" -p \"[CONFIG_GET(number/irc_bot_port)]\" -c \"[channel]\" -m \"[escape_shell_arg(msg)]\"") // CHOMPEdit
|
||||
else
|
||||
if (config.irc_bot_host)
|
||||
if(config.irc_bot_export)
|
||||
if (CONFIG_GET(string/irc_bot_host)) // CHOMPEdit
|
||||
if(CONFIG_GET(flag/irc_bot_export)) // CHOMPEdit
|
||||
spawn(-1) // spawn here prevents hanging in the case that the bot isn't reachable
|
||||
world.Export("http://[config.irc_bot_host]:45678?[list2params(list(pwd=config.comms_password, chan=channel, mesg=msg))]")
|
||||
world.Export("http://[CONFIG_GET(string/irc_bot_host)]:45678?[list2params(list(pwd=CONFIG_GET(string/comms_password), chan=channel, mesg=msg))]") // CHOMPEdit
|
||||
else
|
||||
if(config.use_lib_nudge)
|
||||
if(CONFIG_GET(flag/use_lib_nudge)) // CHOMPEdit
|
||||
var/nudge_lib
|
||||
if(world.system_type == MS_WINDOWS)
|
||||
nudge_lib = "lib\\nudge.dll"
|
||||
@@ -18,24 +18,24 @@
|
||||
nudge_lib = "lib/nudge.so"
|
||||
|
||||
spawn(0)
|
||||
call_ext(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[escape_shell_arg(msg)]") // CHOMPEdit
|
||||
LIBCALL(nudge_lib, "nudge")("[CONFIG_GET(string/comms_password)]","[CONFIG_GET(string/irc_bot_host)]","[channel]","[escape_shell_arg(msg)]") // CHOMPEdit
|
||||
else
|
||||
spawn(0)
|
||||
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [escape_shell_arg(msg)]")
|
||||
ext_python("ircbot_message.py", "[CONFIG_GET(string/comms_password)] [CONFIG_GET(string/irc_bot_host)] [channel] [escape_shell_arg(msg)]") // CHOMPEdit
|
||||
return
|
||||
*/
|
||||
|
||||
/proc/send2mainirc(var/msg)
|
||||
if(config.main_irc)
|
||||
send2irc(config.main_irc, msg)
|
||||
if(CONFIG_GET(string/main_irc)) // CHOMPEdit
|
||||
send2irc(CONFIG_GET(string/main_irc), msg) // CHOMPEdit
|
||||
return
|
||||
|
||||
/proc/send2adminirc(var/msg)
|
||||
if(config.admin_irc)
|
||||
send2irc(config.admin_irc, msg)
|
||||
if(CONFIG_GET(string/admin_irc)) // CHOMPEdit
|
||||
send2irc(CONFIG_GET(string/admin_irc), msg) // CHOMPEdit
|
||||
return
|
||||
|
||||
|
||||
/hook/startup/proc/ircNotify()
|
||||
send2mainirc("Server starting up on byond://[config.serverurl ? config.serverurl : (config.server ? config.server : "[world.address]:[world.port]")]")
|
||||
send2mainirc("Server starting up on byond://[CONFIG_GET(string/serverurl) ? CONFIG_GET(string/serverurl) : (CONFIG_GET(string/server) ? CONFIG_GET(string/server) : "[world.address]:[world.port]")]") // CHOMPEdit
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user