From 3adaf8788b65a84ec4266c6621d30679a95f546d Mon Sep 17 00:00:00 2001 From: ultramage Date: Sun, 6 Jan 2008 14:19:26 +0000 Subject: Modified showmsg code to not attach a timestamp to MSG_NONE-type messages, generated by ShowMessage(). It now works exactly like printf(). Removed/replaced all printf calls in the code. Added a new flag to setting 'console_silent', for filtering debug messages. Silenced the "Broken pipe found" and "Server running in debug mode" messages. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12020 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 102 +++++++++++++++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index e5bed56a6..67a0d235b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -1828,16 +1828,16 @@ const char* script_print_line( const char *p, const char *mark, int line ) int i; if( p == NULL || !p[0] ) return NULL; if( line < 0 ) - printf("*% 5d : ", -line); + ShowMessage("*% 5d : ", -line); else - printf(" % 5d : ", line); + ShowMessage(" % 5d : ", line); for(i=0;p[i] && p[i] != '\n';i++){ if(p + i != mark) - printf("%c",p[i]); + ShowMessage("%c",p[i]); else - printf("\'%c\'",p[i]); + ShowMessage("\'%c\'",p[i]); } - printf("\n"); + ShowMessage("\n"); return p+i+(p[i] == '\n' ? 1 : 0); } @@ -1861,9 +1861,9 @@ void script_error(const char *src,const char *file,int start_line, const char *e p=lineend+1; } - printf("\a\n"); - printf("script error on %s line %d\n", file, line); - printf(" %s\n", error_msg); + ShowMessage("\a\n"); + ShowMessage("script error on %s line %d\n", file, line); + ShowMessage(" %s\n", error_msg); for(j = 0; j < 5; j++ ) { script_print_line( linestart[j], NULL, line + j - 5); } @@ -2017,63 +2017,63 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o #ifdef DEBUG_DISP for(i=0;istack->stack_data[i].type){ case C_INT: - printf(" int(%d)",st->stack->stack_data[i].u.num); + ShowMessage(" int(%d)",st->stack->stack_data[i].u.num); break; case C_NAME: - printf(" name(%s)",str_buf+str_data[st->stack->stack_data[i].u.num & 0xffffff].str); + ShowMessage(" name(%s)",str_buf+str_data[st->stack->stack_data[i].u.num & 0xffffff].str); break; case C_ARG: - printf(" arg"); + ShowMessage(" arg"); break; case C_POS: - printf(" pos(%d)",st->stack->stack_data[i].u.num); + ShowMessage(" pos(%d)",st->stack->stack_data[i].u.num); break; case C_STR: - printf(" str(%s)",st->stack->stack_data[i].u.str); + ShowMessage(" str(%s)",st->stack->stack_data[i].u.str); break; case C_CONSTSTR: - printf(" cstr(%s)",st->stack->stack_data[i].u.str); + ShowMessage(" cstr(%s)",st->stack->stack_data[i].u.str); break; default: - printf(" etc(%d,%d)",st->stack->stack_data[i].type,st->stack->stack_data[i].u.num); + ShowMessage(" etc(%d,%d)",st->stack->stack_data[i].type,st->stack->stack_data[i].u.num); } } - printf("\n"); + ShowMessage("\n"); } #endif if(str_data[func].type!=C_FUNC ){ - ShowMessage ("run_func: '"CL_WHITE"%s"CL_RESET"' (type %d) is not function and command!\n", str_buf+str_data[func].str, str_data[func].type); + ShowError("run_func: '"CL_WHITE"%s"CL_RESET"' (type %d) is not function and command!\n", str_buf+str_data[func].str, str_data[func].type); // st->stack->sp=0; st->state=END; script_reportsrc(st); @@ -9112,7 +9112,7 @@ BUILDIN_FUNC(flagemblem) if(g_id < 0) return 0; -// printf("Script.c: [FlagEmblem] GuildID=%d, Emblem=%d.\n", g->guild_id, g->emblem_id); +// ShowMessage("Script.c: [FlagEmblem] GuildID=%d, Emblem=%d.\n", g->guild_id, g->emblem_id); ((struct npc_data *)map_id2bl(st->oid))->u.scr.guild_id = g_id; return 0; } -- cgit v1.2.3-60-g2f50