From 0e628dcfe81a8067def049d0bfaafdcefbd1a847 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Thu, 13 Jan 2011 09:34:49 +0000 Subject: * Reformatting and minor cleanups to console-plugin related code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14664 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/char.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'src/char_sql') diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 1c190c72e..fd012e419 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -3458,29 +3458,19 @@ int parse_char(int fd) } // Console Command Parser [Wizputer] -int parse_console(char* buf) +int parse_console(const char* command) { - char command[256]; + ShowNotice("Console command: %s\n", command); - memset(command, 0, sizeof(command)); - - sscanf(buf, "%[^\n]", command); - - //login_log("Console command :%s\n", command); - - if( strcmpi("shutdown", command) == 0 || - strcmpi("exit", command) == 0 || - strcmpi("quit", command) == 0 || - strcmpi("end", command) == 0 ) + if( strcmpi("shutdown", command) == 0 || strcmpi("exit", command) == 0 || strcmpi("quit", command) == 0 || strcmpi("end", command) == 0 ) runflag = 0; - else if( strcmpi("alive", command) == 0 || - strcmpi("status", command) == 0 ) + else if( strcmpi("alive", command) == 0 || strcmpi("status", command) == 0 ) ShowInfo(CL_CYAN"Console: "CL_BOLD"I'm Alive."CL_RESET"\n"); - else if( strcmpi("help", command) == 0 ){ - ShowInfo(CL_BOLD"Help of commands:"CL_RESET"\n"); - ShowInfo(" To shutdown the server:\n"); - ShowInfo(" 'shutdown|exit|qui|end'\n"); - ShowInfo(" To know if server is alive:\n"); + else if( strcmpi("help", command) == 0 ) + { + ShowInfo("To shutdown the server:\n"); + ShowInfo(" 'shutdown|exit|quit|end'\n"); + ShowInfo("To know if server is alive:\n"); ShowInfo(" 'alive|status'\n"); } -- cgit v1.2.3-70-g09d2