summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-01-13 09:34:49 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-01-13 09:34:49 +0000
commit0e628dcfe81a8067def049d0bfaafdcefbd1a847 (patch)
treeaba2b649e943a585f93efa3e40414745512cacb8 /src/login/login.c
parent2552c703729fb2b01123da59fa22f40b82e9282a (diff)
downloadhercules-0e628dcfe81a8067def049d0bfaafdcefbd1a847.tar.gz
hercules-0e628dcfe81a8067def049d0bfaafdcefbd1a847.tar.bz2
hercules-0e628dcfe81a8067def049d0bfaafdcefbd1a847.tar.xz
hercules-0e628dcfe81a8067def049d0bfaafdcefbd1a847.zip
* 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
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 0876f3fb2..1bce63900 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -323,31 +323,19 @@ int login_lan_config_read(const char *lancfgName)
//-----------------------
// 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);
-
- ShowInfo("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");
+ 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("To know if server is alive:\n");
ShowInfo(" 'alive|status'\n");
}