git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@569 54d463be-8e91-2dee-dedb-b68131a5f0ec

This commit is contained in:
mc_cameri 2004-12-15 00:06:02 +00:00
parent d79477081d
commit 29877fbc83
7 changed files with 31 additions and 13 deletions

View File

@ -1,5 +1,7 @@
Date Added Date Added
12/14 12/14
* Changed "Map-server can't connect to char-server" message to reduce output spamming and set it to
display only once [MC Cameri]
* Added a busy animation for npc loading [MC Cameri] * Added a busy animation for npc loading [MC Cameri]
* Replaced the way map loading was displayed into a progress-like way [MC Cameri] * Replaced the way map loading was displayed into a progress-like way [MC Cameri]
* Fixed some typos in _ShowMessage() [MC Cameri] * Fixed some typos in _ShowMessage() [MC Cameri]

View File

@ -104,7 +104,7 @@ static void display_title(void)
printf("\033[37;44m (=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)\033[K\033[0m\n\n"); // reset color printf("\033[37;44m (=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)\033[K\033[0m\n\n"); // reset color
if ((revision = get_svn_revision(".svn\\entries"))>0) { if ((revision = get_svn_revision(".svn\\entries"))>0) {
snprintf(tmp_output,sizeof(tmp_output),"SVN Revision: %d.\n",revision); snprintf(tmp_output,sizeof(tmp_output),"SVN Revision: '"CL_WHITE"%d"CL_RESET"'.\n",revision);
ShowInfo(tmp_output); ShowInfo(tmp_output);
} }
} }

View File

@ -115,7 +115,7 @@ static int recv_to_fifo(int fd)
// printf("%s has logged off your server.\n",RFIFOP(fd,6)); // Removed [Valaris] // printf("%s has logged off your server.\n",RFIFOP(fd,6)); // Removed [Valaris]
// else if (fd != 8) // [Valaris] // else if (fd != 8) // [Valaris]
printf("set eof : connection #%d\n", fd); // printf("set eof : connection #%d\n", fd);
session[fd]->eof=1; session[fd]->eof=1;
} }
return 0; return 0;
@ -149,7 +149,7 @@ static int send_from_fifo(int fd)
session[fd]->wdata_size=0; session[fd]->wdata_size=0;
} }
} else if (errno != EAGAIN) { } else if (errno != EAGAIN) {
printf("set eof :%d\n",fd); // printf("set eof :%d\n",fd);
session[fd]->eof=1; session[fd]->eof=1;
} }
return 0; return 0;

View File

@ -245,9 +245,10 @@ int chrif_connectack(int fd)
printf("Connected to char-server failed %d.\n", RFIFOB(fd,2)); printf("Connected to char-server failed %d.\n", RFIFOB(fd,2));
exit(1); exit(1);
} }
sprintf(tmp_output,"Successfully connected to Char-Server (Connection #%d).\n",fd); sprintf(tmp_output,"Successfully connected to Char Server (Connection: '"CL_WHITE"%d"CL_RESET"').\n",fd);
ShowStatus(tmp_output); ShowStatus(tmp_output);
chrif_state = 1; chrif_state = 1;
chrif_connected=1;
chrif_sendmap(fd); chrif_sendmap(fd);
@ -862,6 +863,7 @@ int chrif_recvgmaccounts(int fd)
{ {
sprintf(tmp_output,"From login-server: receiving information of '"CL_WHITE"%d"CL_RESET"' GM accounts.\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); ShowInfo(tmp_output);
memset(tmp_output,'\0',sizeof(tmp_output));
return 0; return 0;
} }
@ -977,12 +979,15 @@ int chrif_char_online(struct map_session_data *sd)
int chrif_parse(int fd) int chrif_parse(int fd)
{ {
int packet_len, cmd; int packet_len, cmd;
// only char-server can have an access to here. // only char-server can have an access to here.
// so, if it isn't the char-server, we disconnect the session (fd != char_fd). // so, if it isn't the char-server, we disconnect the session (fd != char_fd).
if (fd != char_fd || session[fd]->eof) { if (fd != char_fd || session[fd]->eof) {
if (fd == char_fd) { if (fd == char_fd) {
printf("Map-server can't connect to char-server (connection #%d).\n", fd); if (chrif_connected == 1) {
sprintf(tmp_output,"Map Server disconnected from Char Server.\n\n");
ShowWarning(tmp_output);
chrif_connected=0;
}
char_fd = -1; char_fd = -1;
// check_connect_char_server(0, 0, 0, 0); // check_connect_char_server(0, 0, 0, 0);
} }
@ -1077,14 +1082,19 @@ int send_users_tochar(int tid, unsigned int tick, int id, int data) {
*------------------------------------------ *------------------------------------------
*/ */
int check_connect_char_server(int tid, unsigned int tick, int id, int data) { int check_connect_char_server(int tid, unsigned int tick, int id, int data) {
static int displayed = 0;
if (char_fd <= 0 || session[char_fd] == NULL) { if (char_fd <= 0 || session[char_fd] == NULL) {
printf("Attempt to connect to char-server...\n"); if (!displayed) {
ShowStatus("Attempting to connect to Char Server. Please wait.\n");
displayed = 1;
}
chrif_state = 0; chrif_state = 0;
char_fd = make_connection(char_ip, char_port); char_fd = make_connection(char_ip, char_port);
session[char_fd]->func_parse = chrif_parse; session[char_fd]->func_parse = chrif_parse;
realloc_fifo(char_fd, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK); realloc_fifo(char_fd, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK);
chrif_connect(char_fd); chrif_connect(char_fd);
chrif_connected = chrif_isconnect();
#ifndef TXT_ONLY #ifndef TXT_ONLY
srvinfo = 0; srvinfo = 0;
} else { } else {
@ -1094,7 +1104,7 @@ int check_connect_char_server(int tid, unsigned int tick, int id, int data) {
} }
#endif /* not TXT_ONLY */ #endif /* not TXT_ONLY */
} }
if (chrif_isconnect()) displayed = 0;
return 0; return 0;
} }

View File

@ -9,6 +9,8 @@ void chrif_setport(int);
int chrif_isconnect(void); int chrif_isconnect(void);
int chrif_connected;
int chrif_authreq(struct map_session_data *); int chrif_authreq(struct map_session_data *);
int chrif_save(struct map_session_data*); int chrif_save(struct map_session_data*);
int chrif_charselectreq(struct map_session_data *); int chrif_charselectreq(struct map_session_data *);

View File

@ -1880,7 +1880,7 @@ int map_config_read(char *cfgName) {
char_ip_set_ = 1; char_ip_set_ = 1;
h = gethostbyname (w2); h = gethostbyname (w2);
if(h != NULL) { if(h != NULL) {
snprintf(tmp_output,sizeof(tmp_output),"Character server IP address : %s -> %d.%d.%d.%d\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); snprintf(tmp_output,sizeof(tmp_output),"Char Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%d.%d.%d.%d"CL_RESET"'.\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
ShowInfo(tmp_output); ShowInfo(tmp_output);
sprintf(w2,"%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); sprintf(w2,"%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
} }
@ -1891,7 +1891,8 @@ int map_config_read(char *cfgName) {
map_ip_set_ = 1; map_ip_set_ = 1;
h = gethostbyname (w2); h = gethostbyname (w2);
if (h != NULL) { if (h != NULL) {
printf("Map server IP address : %s -> %d.%d.%d.%d\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); snprintf(tmp_output,sizeof(tmp_output),"Map Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%d.%d.%d.%d"CL_RESET"'.\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
ShowInfo(tmp_output);
sprintf(w2, "%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); sprintf(w2, "%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]);
} }
clif_setip(w2); clif_setip(w2);
@ -1927,8 +1928,10 @@ int map_config_read(char *cfgName) {
} else if (strcmpi(w1, "import") == 0) { } else if (strcmpi(w1, "import") == 0) {
map_config_read(w2); map_config_read(w2);
} else if (strcmpi(w1, "console") == 0) { } else if (strcmpi(w1, "console") == 0) {
if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 ) if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 ) {
console = 1; console = 1;
ShowNotice("Console Commands is enabled.\n");
}
} else if(strcmpi(w1,"imalive_on")==0){ //Added by Mugendai for I'm Alive mod } else if(strcmpi(w1,"imalive_on")==0){ //Added by Mugendai for I'm Alive mod
imalive_on = atoi(w2); //Added by Mugendai for I'm Alive mod imalive_on = atoi(w2); //Added by Mugendai for I'm Alive mod
} else if(strcmpi(w1,"imalive_time")==0){ //Added by Mugendai for I'm Alive mod } else if(strcmpi(w1,"imalive_time")==0){ //Added by Mugendai for I'm Alive mod
@ -2286,6 +2289,7 @@ void map_versionscreen(int flag) {
*------------------------------------------------------ *------------------------------------------------------
*/ */
int do_init(int argc, char *argv[]) { int do_init(int argc, char *argv[]) {
chrif_connected = 0;
int i; int i;
FILE *data_conf; FILE *data_conf;
char line[1024], w1[1024], w2[1024]; char line[1024], w1[1024], w2[1024];

View File

@ -2314,12 +2314,12 @@ int do_init_npc(void)
// fflush(stdout); // fflush(stdout);
} }
printf("\r"); printf("\r");
sprintf(tmp_output,"Done loading '"CL_WHITE"%d"CL_RESET"' NPCs:\n\t-'" sprintf(tmp_output,"Done loading '"CL_WHITE"%d"CL_RESET"' NPCs:%30s\n\t-'"
CL_WHITE"%d"CL_RESET"' Warps\n\t-'" CL_WHITE"%d"CL_RESET"' Warps\n\t-'"
CL_WHITE"%d"CL_RESET"' Shops\n\t-'" CL_WHITE"%d"CL_RESET"' Shops\n\t-'"
CL_WHITE"%d"CL_RESET"' Scripts\n\t-'" CL_WHITE"%d"CL_RESET"' Scripts\n\t-'"
CL_WHITE"%d"CL_RESET"' Mobs\n", CL_WHITE"%d"CL_RESET"' Mobs\n",
npc_id-START_NPC_NUM,npc_warp,npc_shop,npc_script,npc_mob); npc_id-START_NPC_NUM,"",npc_warp,npc_shop,npc_script,npc_mob);
ShowInfo(tmp_output); ShowInfo(tmp_output);
add_timer_func_list(npc_walktimer,"npc_walktimer"); // [Valaris] add_timer_func_list(npc_walktimer,"npc_walktimer"); // [Valaris]