diff options
author | codemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-24 22:23:56 +0000 |
---|---|---|
committer | codemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-24 22:23:56 +0000 |
commit | f622539b5865e948eff27f7dd5bc84dbe1d088d6 (patch) | |
tree | f08b2b5379679c82cde622d20bbd61b00a892c93 /src/char/char.c | |
parent | 7f7c0c4e31a17c9ae854f9460ccd34b4b5698f90 (diff) | |
download | hercules-f622539b5865e948eff27f7dd5bc84dbe1d088d6.tar.gz hercules-f622539b5865e948eff27f7dd5bc84dbe1d088d6.tar.bz2 hercules-f622539b5865e948eff27f7dd5bc84dbe1d088d6.tar.xz hercules-f622539b5865e948eff27f7dd5bc84dbe1d088d6.zip |
- Updated to most of jA's 1067
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@352 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/char/char.c b/src/char/char.c index 5a3995be8..7ad959bd8 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2498,6 +2498,7 @@ int lan_ip_check(unsigned char *p){ int parse_char(int fd) { int i, ch; + unsigned short cmd; char email[40]; struct char_session_data *sd; unsigned char *p = (unsigned char *) &session[fd]->client_addr.sin_addr; @@ -2515,10 +2516,29 @@ int parse_char(int fd) { sd = session[fd]->session_data; while (RFIFOREST(fd) >= 2) { -// if (RFIFOW(fd,0) < 30000) -// printf("parse_char: connection #%d, packet: 0x%x (with being read: %d bytes).\n", fd, RFIFOW(fd,0), RFIFOREST(fd)); + cmd = RFIFOW(fd,0); + // crc32のスキップ用 + if( sd==NULL && // 未ログインor管理パケット + RFIFOREST(fd)>=4 && // 最低バイト数制限 & 0x7530,0x7532管理パケ除去 + RFIFOREST(fd)<=21 && // 最大バイト数制限 & サーバーログイン除去 + cmd!=0x20b && // md5通知パケット除去 + (RFIFOREST(fd)<6 || RFIFOW(fd,4)==0x65) ){ // 次に何かパケットが来てるなら、接続でないとだめ + RFIFOSKIP(fd,4); + cmd = RFIFOW(fd,0); + printf("parse_char : %d crc32 skipped\n",fd); + if(RFIFOREST(fd)==0) + return 0; + } - switch(RFIFOW(fd,0)) { +// if(cmd<30000 && cmd!=0x187) +// printf("parse_char : %d %d %d\n",fd,RFIFOREST(fd),cmd); + + // 不正パケットの処理 +// if (sd == NULL && cmd != 0x65 && cmd != 0x20b && cmd != 0x187 && +// cmd != 0x2af8 && cmd != 0x7530 && cmd != 0x7532) +// cmd = 0xffff; // パケットダンプを表示させる + + switch(cmd){ case 0x20b: //20040622暗号化ragexe対応 if (RFIFOREST(fd) < 19) return 0; |