mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
This allows for more secure and stable transmission on Linux, but you might see some improvements on Windows too. Code lies in (confusingly) lib/src. nudge.c should be compiled to lib/nudge.[dll/so] and be linked against netutil.c. There's some horribly hacky code in nudge.c to assemble pickled data, but it's probably the fastest way that's still safe. Signed-off-by: Mloc-Argent <colmohici@gmail.com>
29 lines
805 B
Plaintext
29 lines
805 B
Plaintext
/proc/send2irc(var/channel, var/msg)
|
|
if(config.use_irc_bot && config.irc_bot_host)
|
|
if(config.use_lib_nudge)
|
|
var/nudge_lib
|
|
if(world.system_type == MS_WINDOWS)
|
|
nudge_lib = "lib\\nudge.dll"
|
|
else
|
|
nudge_lib = "lib/nudge.so"
|
|
|
|
call(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[msg]")
|
|
else
|
|
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]")
|
|
return
|
|
|
|
/proc/send2mainirc(var/msg)
|
|
if(config.main_irc)
|
|
send2irc(config.main_irc, msg)
|
|
return
|
|
|
|
/proc/send2adminirc(var/msg)
|
|
if(config.admin_irc)
|
|
send2irc(config.admin_irc, msg)
|
|
return
|
|
|
|
|
|
/hook/startup/proc/ircNotify()
|
|
send2mainirc("Server starting up on [config.server? "byond://[config.server]" : "byond://[world.address]:[world.port]"]")
|
|
return 1
|