summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorcodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-24 22:23:34 +0000
committercodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-24 22:23:34 +0000
commit7f7c0c4e31a17c9ae854f9460ccd34b4b5698f90 (patch)
tree5d3a0c05d31a63e1c623b2f367110684d7b6bd58 /src/char_sql
parent2147c872e095f32b81433fbdd54a98763180d5ee (diff)
downloadhercules-7f7c0c4e31a17c9ae854f9460ccd34b4b5698f90.tar.gz
hercules-7f7c0c4e31a17c9ae854f9460ccd34b4b5698f90.tar.bz2
hercules-7f7c0c4e31a17c9ae854f9460ccd34b4b5698f90.tar.xz
hercules-7f7c0c4e31a17c9ae854f9460ccd34b4b5698f90.zip
- Updated to most of jA's 1067
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@351 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 2d54d21ce..571495a31 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1976,6 +1976,7 @@ int lan_ip_check(unsigned char *p){
int parse_char(int fd) {
int i, ch = 0;
char email[40];
+ unsigned short cmd;
struct char_session_data *sd;
unsigned char *p = (unsigned char *) &session[fd]->client_addr.sin_addr;
@@ -1992,10 +1993,29 @@ int parse_char(int fd) {
sd = session[fd]->session_data;
while(RFIFOREST(fd) >= 2) {
-// if (RFIFOW(fd, 0) < 30000)
-// printf("parse_char : %d %d %x\n", fd, RFIFOREST(fd), RFIFOW(fd, 0));
+ 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 encryption ragexe correspondence
if (RFIFOREST(fd) < 19)
return 0;