summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-27 14:35:37 +0000
committermc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-27 14:35:37 +0000
commit99b156f4ec91f2d52fd57aa1710ae9261b8db356 (patch)
tree25c8060557acb80f95a0d1ab17f169eeff2282d4 /src
parent56514473a9d504324f3b4bf6b2e062cabd19eadd (diff)
downloadhercules-99b156f4ec91f2d52fd57aa1710ae9261b8db356.tar.gz
hercules-99b156f4ec91f2d52fd57aa1710ae9261b8db356.tar.bz2
hercules-99b156f4ec91f2d52fd57aa1710ae9261b8db356.tar.xz
hercules-99b156f4ec91f2d52fd57aa1710ae9261b8db356.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@820 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/common/showmsg.c26
-rw-r--r--src/common/showmsg.h4
-rw-r--r--src/map/map.c29
3 files changed, 29 insertions, 30 deletions
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 3488926bf..857a819bb 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -21,11 +21,9 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri
case MSG_STATUS: //Bright Green (To inform about good things)
strcpy(prefix,CL_GREEN"[Status]"CL_RESET":");
break;
-/* //Do we really need this now? [MC Cameri]
case MSG_SQL: //Bright Violet (For dumping out anything related with SQL)
strcpy(prefix,CL_MAGENTA"[SQL]"CL_RESET":");
break;
-*/
case MSG_INFORMATION: //Bright White (Variable information)
strcpy(prefix,CL_WHITE"[Info]"CL_RESET":");
break;
@@ -49,18 +47,18 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri
return 1;
}
if (!(flag == MSG_DEBUG && !SHOW_DEBUG_MSG)) {
- output = (char*)malloc(sizeof(char)*(strlen(prefix)+strlen(string)+2)); // +2: space and a \0
- if (output == NULL) {
- return 1;
-// exit(1); // Kill server? Deadly
- }
-
- strcpy(output,prefix);
- strcat(output," ");
- strcat(output,string);
- printf(output);
- fflush(stdout);
- free(output);
+ output = (char*)malloc(sizeof(char)*(strlen(prefix)+strlen(string)+2)); // prefix+string+two chars(space and \0)
+ if (output == NULL) {
+ return 1;
+// exit(1); // Kill server? Deadly
+ }
+
+ strcpy(output,prefix);
+ strcat(output," ");
+ strcat(output,string);
+ printf(output);
+ fflush(stdout);
+ free(output);
}
/*
if ((core_config.debug_output_level > -1) && (flag >= core_config.debug_output_level)) {
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 2d40255fb..0949d08e4 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -18,7 +18,7 @@
extern char tmp_output[1024];
-enum msg_type {MSG_STATUS,/* MSG_SQL, */MSG_INFORMATION,MSG_NOTICE,MSG_WARNING,MSG_DEBUG,MSG_ERROR,MSG_FATALERROR};
+enum msg_type {MSG_STATUS, MSG_SQL, MSG_INFORMATION,MSG_NOTICE,MSG_WARNING,MSG_DEBUG,MSG_ERROR,MSG_FATALERROR};
extern int _ShowMessage(const char *string, enum msg_type flag);
@@ -32,7 +32,7 @@ extern int _ShowMessage(const char *string, enum msg_type flag);
// #define DisplayStatus(string) _ShowMessage(string,MSG_STATUS)
/* MSG_SQL*/
-// #define ShowSQL(string) _ShowMessage(string,MSG_SQL)
+ #define ShowSQL(string) _ShowMessage(string,MSG_SQL)
// #define DisplaySQL(string) _ShowMessage(string,MSG_SQL)
/* MSG_INFORMATION */
diff --git a/src/map/map.c b/src/map/map.c
index cb3a3a0a9..d89bf424d 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2325,7 +2325,8 @@ int sql_config_read(char *cfgName)
fp=fopen(cfgName,"r");
if(fp==NULL){
- printf("file not found: %s\n",cfgName);
+ snprintf(tmp_output,sizeof(tmp_output),"File not found: '%s'.\n",cfgName);
+ ShowError(tmp_output);
return 1;
}
while(fgets(line,1020,fp)){
@@ -2355,19 +2356,19 @@ int sql_config_read(char *cfgName)
//Map Server SQL DB
} else if(strcmpi(w1,"map_server_ip")==0){
strcpy(map_server_ip, w2);
- printf ("set map_server_ip : %s\n",w2);
+// printf ("set map_server_ip : %s\n",w2);
} else if(strcmpi(w1,"map_server_port")==0){
map_server_port=atoi(w2);
- printf ("set map_server_port : %s\n",w2);
+// printf ("set map_server_port : %s\n",w2);
} else if(strcmpi(w1,"map_server_id")==0){
strcpy(map_server_id, w2);
- printf ("set map_server_id : %s\n",w2);
+// printf ("set map_server_id : %s\n",w2);
} else if(strcmpi(w1,"map_server_pw")==0){
strcpy(map_server_pw, w2);
- printf ("set map_server_pw : %s\n",w2);
+// printf ("set map_server_pw : %s\n",w2);
} else if(strcmpi(w1,"map_server_db")==0){
strcpy(map_server_db, w2);
- printf ("set map_server_db : %s\n",w2);
+// printf ("set map_server_db : %s\n",w2);
//Map server option to use SQL db or not
} else if(strcmpi(w1,"use_sql_db")==0){
if (strcmpi(w2,"yes")){db_use_sqldbs=0;} else if (strcmpi(w2,"no")){db_use_sqldbs=1;}
@@ -2375,25 +2376,25 @@ int sql_config_read(char *cfgName)
//Login Server SQL DB
} else if(strcmpi(w1,"login_server_ip")==0){
strcpy(login_server_ip, w2);
- printf ("set login_server_ip : %s\n",w2);
+// printf ("set login_server_ip : %s\n",w2);
} else if(strcmpi(w1,"login_server_port")==0){
login_server_port = atoi(w2);
- printf ("set login_server_port : %s\n",w2);
+// printf ("set login_server_port : %s\n",w2);
} else if(strcmpi(w1,"login_server_id")==0){
strcpy(login_server_id, w2);
- printf ("set login_server_id : %s\n",w2);
+// printf ("set login_server_id : %s\n",w2);
} else if(strcmpi(w1,"login_server_pw")==0){
strcpy(login_server_pw, w2);
- printf ("set login_server_pw : %s\n",w2);
+// printf ("set login_server_pw : %s\n",w2);
} else if(strcmpi(w1,"login_server_db")==0){
strcpy(login_server_db, w2);
- printf ("set login_server_db : %s\n",w2);
+// printf ("set login_server_db : %s\n",w2);
} else if(strcmpi(w1,"lowest_gm_level")==0){
lowest_gm_level = atoi(w2);
- printf ("set lowest_gm_level : %s\n",w2);
+// printf ("set lowest_gm_level : %s\n",w2);
} else if(strcmpi(w1,"read_gm_interval")==0){
read_gm_interval = ( atoi(w2) * 60 * 1000 ); // Minutes multiplied by 60 secs per min by 1000 milliseconds per second
- printf ("set read_gm_interval : %s\n",w2);
+// printf ("set read_gm_interval : %s\n",w2);
} else if(strcmpi(w1,"log_db")==0) {
strcpy(log_db, w2);
} else if(strcmpi(w1,"log_db_ip")==0) {
@@ -2567,7 +2568,7 @@ void map_helpscreen(int flag) {
puts("Usage: map-server [options]");
puts("Options:");
puts(CL_WHITE" Commands\t\t\tDescription"CL_RESET);
- puts("---------------------------------------------");
+ puts("-----------------------------------------------------------------------------");
puts(" --help, --h, --?, /? Displays this help screen");
puts(" --map-config <file> Load map-server configuration from <file>");
puts(" --battle-config <file> Load battle configuration from <file>");