diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index d10effb..9357084 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7084,7 +7084,7 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd) nullpo_retv(sd); if(battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 1){ - tmw_CheckChatSpam(sd, NULL); + tmw_CheckTradeSpam(sd); trade_traderequest(sd,RFIFOL(sd->fd,2)); } else clif_skill_fail(sd,1,0,0); @@ -8339,9 +8339,18 @@ static void (*clif_parse_func_table[0x220])() = { static int clif_parse(int fd) { int packet_len = 0, cmd=0; struct map_session_data *sd=NULL; - + sd = session[fd]->session_data; + if (!sd || (sd && !sd->state.auth)) { + if (RFIFOREST(fd) < 2) { // too small a packet disconnect + session[fd]->eof = 1; + } + if (RFIFOW(fd,0) != 0x72) { // first packet not auth, disconnect + session[fd]->eof = 1; + } + } + // �ڑ������Ă��̂Ō��n�� if (!chrif_isconnect() || session[fd]->eof) { // char�I�Ɍq����ĂȂ��Ԃ͐ڑ��֎~ (!chrif_isconnect()) if (sd && sd->state.auth) { @@ -8433,7 +8442,7 @@ static int clif_parse(int fd) { } else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified) printf("\nAccount ID %d.\n", sd->bl.id); - if ((fp = fopen(packet_txt, "a")) == NULL) { + if ((fp = fopen_(packet_txt, "a")) == NULL) { printf("clif.c: cant write [%s] !!! data is lost !!!\n", packet_txt); return 1; } else { @@ -8454,7 +8463,7 @@ static int clif_parse(int fd) { fprintf(fp, "%02X ", RFIFOB(fd,i)); } fprintf(fp, "\n\n"); - fclose(fp); + fclose_(fp); } } #endif |