summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/chrif.c14
-rw-r--r--src/map/clif.c8
-rw-r--r--src/map/guild.c4
-rw-r--r--src/map/itemdb.c9
-rw-r--r--src/map/map.c44
-rw-r--r--src/map/mob.c3
-rw-r--r--src/map/npc.c9
-rw-r--r--src/map/pc.c17
-rw-r--r--src/map/skill.c6
9 files changed, 83 insertions, 31 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 3d3f7d233..81c6744c2 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -23,6 +23,7 @@
#include "npc.h"
#include "pc.h"
#include "nullpo.h"
+#include "showmsg.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -244,13 +245,16 @@ int chrif_connectack(int fd)
printf("Connected to char-server failed %d.\n", RFIFOB(fd,2));
exit(1);
}
- printf("Connected to char-server (connection #%d).\n", fd);
+ sprintf(tmp_output,"Successfully connected to Char-Server (Connection #%d).\n",fd);
+ ShowStatus(tmp_output);
chrif_state = 1;
chrif_sendmap(fd);
- printf("chrif: OnCharIfInit event done. (%d events)\n", npc_event_doall("OnCharIfInit"));
- printf("chrif: OnInterIfInit event done. (%d events)\n", npc_event_doall("OnInterIfInit"));
+ sprintf(tmp_output,"Event '"CL_WHITE"OnCharIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnCharIfInit"));
+ ShowStatus(tmp_output);
+ sprintf(tmp_output,"Event '"CL_WHITE"OnInterIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInit"));
+ ShowStatus(tmp_output);
// <Agit> Run Event [AgitInit]
// printf("NPC_Event:[OnAgitInit] do (%d) events (Agit Initialize).\n", npc_event_doall("OnAgitInit"));
@@ -856,8 +860,8 @@ int chrif_chardisconnect(struct map_session_data *sd)
*/
int chrif_recvgmaccounts(int fd)
{
- printf("From login-server: receiving of %d GM accounts information.\n", pc_read_gm_account(fd));
-
+ sprintf(tmp_output,"From login-server: receiving information of '"CL_WHITE"%d"CL_RESET"' GM accounts.\n", pc_read_gm_account(fd));
+ ShowInfo(tmp_output);
return 0;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index 7e4605807..1f7130676 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -24,6 +24,7 @@
#include "../common/malloc.h"
#include "../common/version.h"
#include "../common/nullpo.h"
+#include "../common/showmsg.h"
#include "map.h"
#include "chrif.h"
@@ -10107,15 +10108,16 @@ static int clif_parse(int fd) {
if (chrif_isconnect())
clif_quitsave(fd, sd);
if (sd->status.name != NULL)
- printf("Player [%s] has logged off your server.\n", sd->status.name); // Player logout display [Valaris]
+ sprintf(tmp_output,"%sCharacter '"CL_WHITE"%s"CL_RESET"' logged off.\n", (pc_isGM(sd))?"GM ":"",sd->status.name); // Player logout display [Valaris]
else
- printf("Player with account [%d] has logged off your server.\n", sd->bl.id); // Player logout display [Yor]
+ sprintf(tmp_output,"%sCharacter with Account ID '"CL_WHITE"%d"CL_RESET"' logged off.\n", (pc_isGM(sd))?"GM ":"", sd->bl.id); // Player logout display [Yor]
} else if (sd) { // not authentified! (refused by char-server or disconnect before to be authentified)
- printf("Player with account [%d] has logged off your server (not auth account).\n", sd->bl.id); // Player logout display [Yor]
+ sprintf(tmp_output,"Player not authenticated with Account ID '"CL_WHITE"%d"CL_RESET"' logged off.\n", sd->bl.id); // Player logout display [Yor]
if (chrif_isconnect())
clif_quitsave(fd, sd);
sd = 0;
}
+ ShowInfo(tmp_output);
close(fd);
if (sd) // 追加
map_deliddb(&sd->bl); // 追加
diff --git a/src/map/guild.c b/src/map/guild.c
index 2937940c3..ec2a636b9 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -18,6 +18,7 @@
#include "intif.h"
#include "clif.h"
#include "skill.h"
+#include "showmsg.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -127,7 +128,8 @@ static int guild_read_castledb(void)
ln++;
}
fclose(fp);
- printf("read db/castle_db.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/castle_db.txt");
+ ShowStatus(tmp_output);
return 0;
}
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index cd915b92e..38795547e 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -552,7 +552,8 @@ static int itemdb_read_itemnametable(void)
p++;
}
free(buf);
- printf("read data\\idnum2itemdisplaynametable.txt done.\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","data\\idnum2itemdisplaynametable.txt");
+ ShowStatus(tmp_output);
return 0;
}
@@ -587,7 +588,8 @@ static int itemdb_read_cardillustnametable(void)
p++;
}
free(buf);
- printf("read data\\num2cardillustnametable.txt done.\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","data\\num2cardillustnametable.txt");
+ ShowStatus(tmp_output);
return 0;
}
@@ -631,7 +633,8 @@ static int itemdb_read_noequip(void)
}
fclose(fp);
- printf("read db/item_noequip.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_noequip.txt");
+ ShowStatus(tmp_output);
return 0;
}
#ifndef TXT_ONLY
diff --git a/src/map/map.c b/src/map/map.c
index 282d2795b..c00845158 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -104,6 +104,8 @@ static int online_timer(int,unsigned int,int,int);
int CHECK_INTERVAL = 3600000; // [Valaris]
int check_online_timer=0; // [Valaris]
+static int pos = 0;
+
#endif /* not TXT_ONLY */
#define USE_AFM
@@ -1588,16 +1590,26 @@ static int map_readmap(int m,char *fn, char *alias) {
int x,y,xs,ys;
struct gat_1cell {float high[4]; int type;} *p=NULL;
int wh;
+ int i;
+ int e = 0;
+
size_t size;
-
+ char progress[21] = " ";
// read & convert fn
gat=grfio_read(fn);
if(gat==NULL)
return -1;
-
- printf("\rLoading Maps [%d/%d]: %-50s ",m,map_num,fn);
- fflush(stdout);
-
+ //printf("\rLoading Maps [%d/%d]: %-50s ",m,map_num,fn);
+ if (map_num) { //avoid map-server crashing if there are 0 maps
+ printf("\r");
+ ShowStatus("Progress: ");
+ i=m*20/420;
+ printf("[");
+ for (e=0;e<i;e++) progress[e] = '#';
+ printf(progress);
+ printf("] Working: [");
+ fflush(stdout);
+ }
map[m].m=m;
xs=map[m].xs=*(int*)(gat+6);
ys=map[m].ys=*(int*)(gat+10);
@@ -1645,8 +1657,12 @@ static int map_readmap(int m,char *fn, char *alias) {
*------------------------------------------
*/
int map_readallmap(void) {
+ ShowStatus("Loading Maps...\n");
int i,maps_removed=0;
char fn[256];
+ char c = '-';
+ time_t last_time = time(0);
+ int busy = 0;
#ifdef USE_AFM
FILE *afm_file;
#endif
@@ -1681,16 +1697,28 @@ int map_readallmap(void) {
if(map_readmap(i,fn, p) == -1) {
map_delmap(map[i].name);
maps_removed++;
+ } else {
+ if (last_time != time(0)) {
+ last_time = time(0);
+ switch(busy) {
+ case 0: c='\\'; busy++; break;
+ case 1: c='|'; busy++; break;
+ case 2: c='/'; busy++; break;
+ case 3: c='-'; busy=0;
+ }
+ }
+ printf("%c]",c);
+ fflush(stdout);
}
}
}
free(waterlist);
printf("\r");
- snprintf(tmp_output,sizeof(tmp_output),"Maps Loaded: \033[1;29m%d\033[0;0m %50s\n",map_num,"");
+ snprintf(tmp_output,sizeof(tmp_output),"Successfully loaded '"CL_WHITE"%d"CL_RESET"' maps.%50s\n",map_num,"");
ShowInfo(tmp_output);
if (maps_removed) {
- snprintf(tmp_output,sizeof(tmp_output),"Maps Removed: %d\n",maps_removed);
+ snprintf(tmp_output,sizeof(tmp_output),"Maps Removed: '"CL_WHITE"%d"CL_RESET"'\n",maps_removed);
ShowNotice(tmp_output);
}
return 0;
@@ -2386,13 +2414,13 @@ int do_init(int argc, char *argv[]) {
do_init_itemdb();
do_init_mob(); // npcの初期化時内でmob_spawnして、mob_dbを参照するのでinit_npcより先
do_init_script();
- do_init_npc();
do_init_pc();
do_init_party();
do_init_guild();
do_init_storage();
do_init_skill();
do_init_pet();
+ do_init_npc();
#ifndef TXT_ONLY /* mail system [Valaris] */
if(battle_config.mail_system)
diff --git a/src/map/mob.c b/src/map/mob.c
index a7516c784..a057d12e1 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3959,7 +3959,8 @@ static int mob_readdb_mobavail(void)
ln++;
}
fclose(fp);
- printf("read db/mob_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/mob_avail.txt");
+ ShowStatus(tmp_output);
return 0;
}
diff --git a/src/map/npc.c b/src/map/npc.c
index 294058f64..8f4716ca2 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2219,6 +2219,7 @@ void ev_release(struct dbn *db, int which)
*/
int do_init_npc(void)
{
+ ShowStatus("Loading NPCs...\n");
struct npc_src_list *nsl;
FILE *fp;
char line[1024];
@@ -2297,8 +2298,14 @@ int do_init_npc(void)
// printf("\rLoading NPCs [%d]: %-54s",npc_id-START_NPC_NUM,nsl->name);
// fflush(stdout);
}
- printf("\rNPCs Loaded: %d [Warps:%d Shops:%d Scripts:%d Mobs:%d]\n",
+ printf("\r");
+ sprintf(tmp_output,"Done loading '"CL_WHITE"%d"CL_RESET"' NPCs:\n\t-'"
+ CL_WHITE"%d"CL_RESET"' Warps\n\t-'"
+ CL_WHITE"%d"CL_RESET"' Shops\n\t-'"
+ CL_WHITE"%d"CL_RESET"' Scripts\n\t-'"
+ CL_WHITE"%d"CL_RESET"' Mobs\n",
npc_id-START_NPC_NUM,npc_warp,npc_shop,npc_script,npc_mob);
+ ShowInfo(tmp_output);
add_timer_func_list(npc_walktimer,"npc_walktimer"); // [Valaris]
add_timer_func_list(npc_event_timer,"npc_event_timer");
diff --git a/src/map/pc.c b/src/map/pc.c
index 3cb78e65a..7c5a8c077 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -826,13 +826,15 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
pc_calcstatus(sd,1);
if (pc_isGM(sd))
- printf("Connection accepted: character '%s' (account: %d; GM level %d).\n", sd->status.name, sd->status.account_id, pc_isGM(sd));
+ sprintf(tmp_output,"GM Character '"CL_WHITE"%s"CL_RESET"' logged in. (Acc. ID: '"CL_WHITE"%d"CL_RESET"', GM Level '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id, pc_isGM(sd));
else
- printf("Connection accepted: Character '%s' (account: %d).\n", sd->status.name, sd->status.account_id);
-
+ sprintf(tmp_output,"Character '"CL_WHITE"%s"CL_RESET"' logged in. (Account ID: '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id);
+ ShowInfo(tmp_output);
//printf("pc: OnPCLogin event done. (%d events)\n", npc_event_doall("OnPCLogin") );
- if (npc_name2id("PCLoginEvent"))
+ if (npc_name2id("PCLoginEvent")) {
run_script(npc_name2id("PCLoginEvent")->u.scr.script,0,sd->bl.id,npc_name2id("PCLoginEvent")->bl.id); // PCLoginNPC
+ ShowStatus("Event '\033[1;29mPCLoginEvent\033[0;0m' executed.\n");
+ }
// Send friends list
clif_friends_list_send(sd);
@@ -857,8 +859,8 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
fclose(fp);
}
else if(battle_config.error_log) {
- sprintf(buf, "%s not found\n", motd_txt);
- ShowWarning (buf);
+ sprintf(tmp_output, "In function pc_atuhok() -> File '"CL_WHITE"%s"CL_RESET"' not found.\n", motd_txt);
+ ShowWarning(tmp_output);
}
}
@@ -7808,7 +7810,8 @@ int pc_readdb(void)
break;
}
fclose(fp);
- printf("read db/job_db2-2.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/job_db2-2.txt");
+ ShowStatus(tmp_output);
// スキルツリ?
memset(skill_tree,0,sizeof(skill_tree));
diff --git a/src/map/skill.c b/src/map/skill.c
index 3cdc4a8f4..3a0d02c8d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11531,7 +11531,8 @@ int skill_readdb(void)
skill_db[i].blewcount[k]=(split2[k])? atoi(split2[k]):atoi(split2[0]);
}
fclose(fp);
- printf("read db/skill_db.txt done\n");
+ sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/skill_db.txt");
+ ShowStatus(tmp_output);
fp=fopen("db/skill_require_db.txt","r");
if(fp==NULL){
@@ -11670,7 +11671,8 @@ int skill_readdb(void)
skill_db[i].amount[9]=atoi(split[29]);
}
fclose(fp);
- printf("read db/skill_require_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);
/* キャスティングデ?タベ?ス */
fp=fopen("db/skill_cast_db.txt","r");