Adds a C library alternative to the ircbot nudge script.

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>
This commit is contained in:
Mloc-Argent
2014-03-04 10:08:17 +00:00
parent 4ddd799359
commit 49890421f8
10 changed files with 233 additions and 2 deletions

View File

@@ -1,6 +1,15 @@
/proc/send2irc(var/channel, var/msg)
if(config.use_irc_bot && config.irc_bot_host)
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]")
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)