diff options
author | TAW Dev <tawdev@taw> | 2009-07-08 11:04:59 -0400 |
---|---|---|
committer | TAW Dev <tawdev@taw> | 2009-07-08 11:04:59 -0400 |
commit | aa0bb68d762f72d8abb2b71079e98a8e27969412 (patch) | |
tree | 77e38010cc0443cc7480572e823dd13ee7ee555d /src/map/clif.c | |
parent | e9c1a79b6306783d63655eca5ddbcca0b6d825d0 (diff) | |
parent | 4673fd3ca06010e74f8223486b0f34e58c7b0a7e (diff) | |
download | tmwa-aa0bb68d762f72d8abb2b71079e98a8e27969412.tar.gz tmwa-aa0bb68d762f72d8abb2b71079e98a8e27969412.tar.bz2 tmwa-aa0bb68d762f72d8abb2b71079e98a8e27969412.tar.xz tmwa-aa0bb68d762f72d8abb2b71079e98a8e27969412.zip |
Merge branch 'master' of git://gitorious.org/tmw-eathena/mainline
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 |