summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/grfio.c4
-rw-r--r--src/map/itemdb.c14
-rw-r--r--src/map/map.c16
-rw-r--r--src/map/mob.c13
-rw-r--r--src/map/npc.c7
-rw-r--r--src/map/pc.c25
-rw-r--r--src/map/pet.c4
-rw-r--r--src/map/skill.c18
8 files changed, 68 insertions, 33 deletions
diff --git a/src/common/grfio.c b/src/common/grfio.c
index ff01b6e76..2ba701632 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -30,6 +30,7 @@
#include "utils.h"
#include "grfio.h"
#include "mmo.h"
+#include "showmsg.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -923,7 +924,8 @@ void grfio_init(char *fname)
}
fclose(data_conf);
- printf("read %s done\n",fname);
+ sprintf(tmp_output,"Done reading GRF File: '\033[1;29m%s\033[0;0m'.\n",fname);
+ ShowStatus(tmp_output);
} // end of reading grf-files.txt
hashinit(); // hash table initialization
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index a225cff83..cd915b92e 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -12,6 +12,7 @@
#include "itemdb.h"
#include "script.h"
#include "pc.h"
+#include "showmsg.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -383,7 +384,8 @@ static int itemdb_readdb(void)
id->equip_script = parse_script(p,lines);
}
fclose(fp);
- printf("read %s done (count=%d)\n",filename[i],ln);
+ sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",ln,filename[i]);
+ ShowStatus(tmp_output);
}
return 0;
}
@@ -458,7 +460,8 @@ static int itemdb_read_randomitem()
ln++;
}
fclose(fp);
- printf("read %s done (count=%d)\n",fn,*pc);
+ sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",*pc,fn);
+ ShowStatus(tmp_output);
}
return 0;
@@ -507,7 +510,8 @@ static int itemdb_read_itemavail(void)
ln++;
}
fclose(fp);
- printf("read db/item_avail.txt done (count=%d)\n",ln);
+ sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",ln,"db/item_avail.txt");
+ ShowStatus(tmp_output);
return 0;
}
@@ -774,8 +778,8 @@ static int itemdb_read_sqldb(void)
{
printf("Database server error (retrieving rows from %s): %s\n", item_db_db, mysql_error(&mmysql_handle));
}
-
- printf("read %s done (count = %lu)\n", item_db_db, (unsigned long) mysql_num_rows(sql_res));
+ sprintf(tmp_output,"Done reading '\033[1;29m%lu\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",(unsigned long) mysql_num_rows(sql_res),item_db_db);
+ ShowStatus(tmp_output);
}
else
{
diff --git a/src/map/map.c b/src/map/map.c
index 502230033..282d2795b 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1208,7 +1208,9 @@ void map_removenpc(void) {
}
}
}
- printf("%d NPCs removed.\n",n);
+
+ sprintf(tmp_output,"Successfully removed and freed from memory '\033[1;29m%d\033[0;0m' NPCs.\n",n);
+ ShowStatus(tmp_output);
}
/*==========================================
@@ -2181,16 +2183,14 @@ static int cleanup_sub(struct block_list *bl, va_list ap) {
*/
void do_final(void) {
int map_id, i;
-
+ ShowStatus("Terminating.\n");
for (map_id = 0; map_id < map_num;map_id++) {
if(map[map_id].m)
map_foreachinarea(cleanup_sub, map_id, 0, 0, map[map_id].xs, map[map_id].ys, 0, 0);
}
-
#ifndef TXT_ONLY
chrif_char_reset_offline();
#endif
-
for (i = 0; i < fd_max; i++)
delete_session(i);
@@ -2209,14 +2209,16 @@ void do_final(void) {
if(map[i].block_count) free(map[i].block_count);
if(map[i].block_mob_count) free(map[i].block_mob_count);
}
+
do_final_script();
do_final_itemdb();
do_final_storage();
- do_final_guild();
+ do_final_guild();
#ifndef TXT_ONLY
map_sql_close();
#endif /* not TXT_ONLY */
+ ShowStatus("Successfully terminated.");
}
void map_helpscreen(int flag) {
@@ -2418,7 +2420,9 @@ int do_init(int argc, char *argv[]) {
if (imalive_on)
add_timer_interval(gettick()+10, imalive_timer,0,0,imalive_time*1000);
- printf("The map-server is \033[1;32mready\033[0m (Server is listening on the port %d).\n\n", map_port);
+ sprintf(tmp_output,"Server is '\033[1;32mready\033[0m' and listening on port '\033[1;29m%d\033[0;0m'.\n\n", map_port);
+ ShowStatus(tmp_output);
+
ticks = gettick();
diff --git a/src/map/mob.c b/src/map/mob.c
index e802e9228..0c9bbc734 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -21,6 +21,7 @@
#include "party.h"
#include "npc.h"
#include "log.h"
+#include "showmsg.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -3889,7 +3890,8 @@ static int mob_readdb(void)
mob_db[class].clothes_color=0; //Add for player monster dye - Valaris
}
fclose(fp);
- printf("read %s done\n",filename[i]);
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n",filename[i]);
+ ShowStatus(tmp_output);
}
return 0;
}
@@ -4001,7 +4003,8 @@ static int mob_read_randommonster(void)
mob_db[class].summonper[i]=per;
}
fclose(fp);
- printf("read %s done\n",mobfile[i]);
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n",mobfile[i]);
+ ShowStatus(tmp_output);
}
return 0;
}
@@ -4153,7 +4156,8 @@ static int mob_readskilldb(void)
mob_db[mob_id].maxskill=i+1;
}
fclose(fp);
- printf("read %s done\n",filename[x]);
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n",filename[x]);
+ ShowStatus(tmp_output);
}
return 0;
}
@@ -4308,7 +4312,8 @@ static int mob_read_sqldb(void)
mob_db[class].head_buttom=0;
}
mysql_free_result(sql_res);
- printf("read %s done (count=%d)\n",mob_db_db,ln);
+ sprintf(tmp_output,"Done reading '\033[1;29m%lu\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",ln,mob_db_db);
+ ShowStatus(tmp_output);
}
return 0;
}
diff --git a/src/map/npc.c b/src/map/npc.c
index e71fb050b..294058f64 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -21,6 +21,7 @@
#include "pet.h"
#include "battle.h"
#include "skill.h"
+#include "showmsg.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -433,8 +434,10 @@ int npc_event_do_clock(int tid,unsigned int tick,int id,int data)
*/
int npc_event_do_oninit(void)
{
- int c = npc_event_doall("OnInit");
- printf("npc: OnInit Event done. (%d npc)\n",c);
+// int c = npc_event_doall("OnInit");
+ sprintf(tmp_output,"Event '\033[1;29mOnInit\033[0;0m' executed with '\033[1"
+ ";29m%d\033[0;0m' NPCs.\n",npc_event_doall("OnInit"));
+ ShowStatus(tmp_output);
add_timer_interval(gettick()+100,
npc_event_do_clock,0,0,1000);
diff --git a/src/map/pc.c b/src/map/pc.c
index 6b4e4d7a6..7f6b2cb1f 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7706,7 +7706,8 @@ int pc_readdb(void)
break;
}
fclose(fp);
- printf("read db/exp.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/exp.txt");
+ ShowStatus(tmp_output);
// JOB補正?値1
fp=fopen("db/job_db1.txt","r");
@@ -7740,7 +7741,8 @@ int pc_readdb(void)
break;
}
fclose(fp);
- printf("read db/job_db1.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/job_db1.txt");
+ ShowStatus(tmp_output);
// JOBボ?ナス
fp=fopen("db/job_db2.txt","r");
@@ -7768,7 +7770,8 @@ int pc_readdb(void)
break;
}
fclose(fp);
- printf("read db/job_db2.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/job_db2.txt");
+ ShowStatus(tmp_output);
// JOBボ?ナス2 ?生職用
fp=fopen("db/job_db2-2.txt","r");
@@ -7833,7 +7836,8 @@ int pc_readdb(void)
}
}
fclose(fp);
- printf("read db/skill_tree.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/skill_tree.txt");
+ ShowStatus(tmp_output);
// ?性修正テ?ブル
for(i=0;i<4;i++)
@@ -7879,7 +7883,8 @@ int pc_readdb(void)
}
}
fclose(fp);
- printf("read db/attr_fix.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/attr_fix.txt");
+ ShowStatus(tmp_output);
// サイズ補正テ?ブル
for(i=0;i<3;i++)
@@ -7908,7 +7913,8 @@ int pc_readdb(void)
i++;
}
fclose(fp);
- printf("read db/size_fix.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/size_fix.txt");
+ ShowStatus(tmp_output);
// 精?デ?タテ?ブル
for(i=0;i<5;i++){
@@ -7944,7 +7950,8 @@ int pc_readdb(void)
i++;
}
fclose(fp); //Lupus. close this file!!!
- printf("read db/refine_db.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/refine_db.txt");
+ ShowStatus(tmp_output);
return 0;
}
@@ -7985,7 +7992,9 @@ static void pc_statpointdb(void)
buf_stat = (char *) malloc (end + 1);
l = fread(buf_stat,1,end,stp);
fclose(stp);
- printf("read db/statpoint.txt done (size=%d)\n",l);
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/statpoint.txt");
+ ShowStatus(tmp_output);
+// printf("read db/statpoint.txt done (size=%d)\n",l);
for(i=0;i<255;i++) {
j=0;
diff --git a/src/map/pet.c b/src/map/pet.c
index 6026b1ebf..878c0aea5 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -20,6 +20,7 @@
#include "npc.h"
#include "script.h"
#include "skill.h"
+#include "showmsg.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -1622,7 +1623,8 @@ int read_petdb()
j++;
}
fclose(fp);
- printf("read %s done (count=%d)\n",filename[i],j);
+ sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' pets in '\033[1;29m%s\033[0;0m'.\n",j,filename[i]);
+ ShowStatus(tmp_output);
}
return 0;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index fbff7e339..83382ef70 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11668,7 +11668,8 @@ int skill_readdb(void)
skill_db[i].upkeep_time2[k]=(split2[k])? atoi(split2[k]):atoi(split2[0]);
}
fclose(fp);
- printf("read db/skill_cast_db.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/skill_cast_db.txt");
+ ShowStatus(tmp_output);
/* 製造系スキルデ?タベ?ス */
memset(skill_produce_db,0,sizeof(skill_produce_db));
@@ -11711,7 +11712,8 @@ int skill_readdb(void)
break;
}
fclose(fp);
- printf("read %s done (count=%d)\n",filename[m],k);
+ sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",k,filename[m]);
+ ShowStatus(tmp_output);
}
memset(skill_arrow_db,0,sizeof(skill_arrow_db));
@@ -11749,7 +11751,8 @@ int skill_readdb(void)
break;
}
fclose(fp);
- printf("read db/create_arrow_db.txt done (count=%d)\n",k);
+ sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",k,"db/create_arrow_db.txt");
+ ShowStatus(tmp_output);
memset(skill_abra_db,0,sizeof(skill_abra_db));
fp=fopen("db/abra_db.txt","r");
@@ -11782,7 +11785,8 @@ int skill_readdb(void)
break;
}
fclose(fp);
- printf("read db/abra_db.txt done (count=%d)\n",k);
+ sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",k,"db/abra_db.txt");
+ ShowStatus(tmp_output);
fp=fopen("db/skill_castnodex_db.txt","r");
if(fp==NULL){
@@ -11816,7 +11820,8 @@ int skill_readdb(void)
skill_db[i].castnodex[k]=(split2[k])? atoi(split2[k]):atoi(split2[0]);
}
fclose(fp);
- printf("read db/skill_castnodex_db.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/skill_castnodex_db.txt");
+ ShowStatus(tmp_output);
fp=fopen("db/skill_nocast_db.txt","r");
if(fp==NULL){
@@ -11845,7 +11850,8 @@ int skill_readdb(void)
k++;
}
fclose(fp);
- printf("read db/skill_nocast_db done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/skill_nocast_db");
+ ShowStatus(tmp_output);
return 0;
}