From 9221b88e96f2e45daac0d3ad2843160a4525297c Mon Sep 17 00:00:00 2001 From: crutchy Date: Thu, 19 May 2016 08:29:02 +1000 Subject: [PATCH] whatever i changed --- exec_freenode.txt | 38 ++++++++++++------------- scripts/sneak/data_client.php | 13 +++++---- scripts/sneak/data_server.php | 46 ++++++++++++++++++++++++++++++- scripts/sneak/mods/mod_sneak_test | 8 +++--- 4 files changed, 75 insertions(+), 30 deletions(-) diff --git a/exec_freenode.txt b/exec_freenode.txt index e85e91e..9d1949c 100644 --- a/exec_freenode.txt +++ b/exec_freenode.txt @@ -4,38 +4,38 @@ include ./scripts/quit.php include ./scripts/part.php include ./scripts/join.php -include ./scripts/admin.php -include ./scripts/help.php -include ./scripts/privmsg.php -include ./scripts/seen.php -include ./scripts/tell.php +#include ./scripts/admin.php +#include ./scripts/help.php +#include ./scripts/privmsg.php +#include ./scripts/seen.php +#include ./scripts/tell.php include ./scripts/sed.php include ./scripts/title.php -include ./scripts/welcome.php -include ./scripts/karma.php -include ./scripts/convert.php -include ./scripts/definitions.php -include ./scripts/link.php -include ./scripts/google.php +#include ./scripts/welcome.php +#include ./scripts/karma.php +#include ./scripts/convert.php +#include ./scripts/definitions.php +#include ./scripts/link.php +#include ./scripts/google.php include ./scripts/time.php include ./scripts/weather.php include ./scripts/location.php include ./scripts/translate.php include ./scripts/japanese.php include ./scripts/jisho2.php -include ./scripts/users.php +#include ./scripts/users.php include ./scripts/rps.php -help ./scripts +#help ./scripts init ./scripts -~calc|5|0|1|1|||||/usr/bin/units -t %%trailing%% -help ~calc|syntax: ~calc -help ~calc|evaluates math expression +#~calc|5|0|1|1|||||/usr/bin/units -t %%trailing%% +#help ~calc|syntax: ~calc +#help ~calc|evaluates math expression -include ./scripts/ruby/currency.rb +#include ./scripts/ruby/currency.rb -include ./scripts/sneak/sneak_server.php -startup ./scripts/sneak/sneak_server.php +#include ./scripts/sneak/sneak_server.php +#startup ./scripts/sneak/sneak_server.php diff --git a/scripts/sneak/data_client.php b/scripts/sneak/data_client.php index e5796fb..6090602 100644 --- a/scripts/sneak/data_client.php +++ b/scripts/sneak/data_client.php @@ -39,12 +39,13 @@ } stream_set_blocking($socket,0); -$unpacked=array(); -$unpacked["dest"]=$dest; -$unpacked["nick"]=$nick; -$unpacked["user"]=$user; -$unpacked["hostname"]=$hostname; -$unpacked["trailing"]=$trailing; +$unpacked=array( + "dest"=>$dest, + "nick"=>$nick, + "user"=>$user, + "hostname"=>$hostname, + "trailing"=>$trailing); + $data=base64_encode(serialize($unpacked)); fputs($socket,$data."\n"); $t=microtime(True); diff --git a/scripts/sneak/data_server.php b/scripts/sneak/data_server.php index 34a9b62..3d89f6d 100644 --- a/scripts/sneak/data_server.php +++ b/scripts/sneak/data_server.php @@ -140,6 +140,38 @@ function server_msg_handler(&$server_data,&$server,&$clients,&$connections,$clie unset_bucket(SERVER_BUCKET_INDEX); } break; + case "test": + if (count($parts)==0) + { + privmsg("error: missing test mod action"); + } + privmsg("test mode"); + define("TEST_MODE","1"); + $action=array_shift($parts); + $server_data=array( + "irc_server"=>$server, + "listen_port"=>50000, + "dest"=>$dest, + "app_data_updated"=>False, + "app_data"=>array(), + "server_admin"=>$hostname); + $server=Null; + $clients=array(); + $connections=array(); + $unpacked=array( + "dest"=>$dest, + "nick"=>$nick, + "user"=>"", + "hostname"=>$hostname, + "trailing"=>implode(" ",$parts)); + $response=array(); + $response["msg"]=array(); + load_mod($server_data,$server,$clients,$connections,0,$unpacked,$response,$parts,$action); + for ($i=0;$i