From adf40686a636bfe95357c3affe011a2514bfbf52 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sun, 7 May 2017 18:08:10 +0100 Subject: Updated command that they are more compatible with developerslv chan bots --- agni.c | 4 ++-- cmd_ping.c | 2 +- cmd_uptime.c | 2 +- config_cmds.h | 11 +++++++---- version.h | 4 ++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/agni.c b/agni.c index 46457f6..e0055be 100644 --- a/agni.c +++ b/agni.c @@ -574,7 +574,7 @@ int th_event_manager(void *data) tbl_qcmd *qtbl = NULL; //create execution table - etbl = tbl_exec_list_c(10); + etbl = tbl_exec_list_c(30); if (etbl == NULL) { PERM(); @@ -611,7 +611,7 @@ int th_event_manager(void *data) tbl_exec_print_tbl(etbl, TBL_PF_EXEC_ALL); //create command table - qtbl = tbl_qcmd_c(10);//well 10 should be ok right? + qtbl = tbl_qcmd_c(30);//well 30 should be ok right? //config mq printf("Start event thread\n"); diff --git a/cmd_ping.c b/cmd_ping.c index 5bd6d84..469c616 100644 --- a/cmd_ping.c +++ b/cmd_ping.c @@ -7,7 +7,7 @@ void *cmd_ping(void *data) printf("PONG\n"); - ret = alloc_new_str("PONG"); + ret = alloc_new_str("ping "); return ret; } \ No newline at end of file diff --git a/cmd_uptime.c b/cmd_uptime.c index 285aec1..6a9c963 100644 --- a/cmd_uptime.c +++ b/cmd_uptime.c @@ -26,7 +26,7 @@ void *cmd_uptime(void *data) i2 = d2; printf("Days %d Hours %d Minutes %d\n",i1/(3600*24),i1/(3600)%24, (i1/60)%60); - snprintf(buf, buf_size,"Days %d Hours %d Minutes %d\n",i1/(3600*24),i1/(3600)%24, (i1/60)%60); + snprintf(buf, buf_size,"%dd %dh %dm\n",i1/(3600*24),i1/(3600)%24, (i1/60)%60); ret = alloc_new_str(buf); diff --git a/config_cmds.h b/config_cmds.h index 8488cc0..2fc20a5 100644 --- a/config_cmds.h +++ b/config_cmds.h @@ -18,15 +18,18 @@ typedef struct single_cmd_def #include "cmd_cmd.h" #include "cmd_sha1.h" + +//some commands have aliases for compat with some developerslv bots +//nothing else comaptible will be added, as its not about "standarts" single_cmd_def confgi_cmd_list[] = { {"DATE",cmd_date}, - {"UPTIME",cmd_uptime}, - {"VERSION",cmd_version}, - {"PING",cmd_ping}, + {"UPTIME",cmd_uptime}, {"!uptime",cmd_uptime}, + {"VERSION",cmd_version}, {"!version",cmd_version}, + {"PING",cmd_ping}, {"!ping",cmd_ping}, {"LOADAVG",cmd_loadavg}, {"RUSE",cmd_rusage}, - {"CMD",cmd_cmd}, + {"CMD",cmd_cmd}, {"!echo",cmd_cmd}, {"SHA1",cmd_sha1}, {NULL,NULL} }; diff --git a/version.h b/version.h index b5a65ab..9379667 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #ifndef __VERSION_H #define __VERSION_H -#define VERSION_DATE "Sun May 7 16:28:02 BST 2017" -#define VERSION_COMMIT "417edbc Added new commands CMD,SHA1. Added support of params for commands. Fixed some bugs with uninitialised buffers" +#define VERSION_DATE "Sun May 7 18:06:02 BST 2017" +#define VERSION_COMMIT "910c194 Forgot add Makefile changes" #endif -- cgit v1.2.3