//Mserver NETProc int mproto_ClientDispatchMessage(int fd,char* data) { int func,fieldcount; char raw[65500]; strcpy(PersonalKey, MSPERSIONALKEY); util_DecodeMessage(raw,data); util_SplitMessage(raw,SEPARATOR); if (!util_GetFunctionFromSlice(&func, &fieldcount)) { logHack(fd,HACK_GETFUNCFAIL); return -1; } if (func==MPROTO_QUE_RECV) { int checksum=0, checksumrecv; int userfdid; char ans[65500],uid[4096]; checksum += util_destring(2,uid); checksum += util_deint(3, &userfdid); checksum += util_destring(4, ans); util_deint(5, &checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } mproto_Que_Recv(fd,uid,userfdid, ans); util_DiscardMessage(); return 0; } if( func == MPROTO_MESSAGE_RECV ) { int checksum=0, checksumrecv; int userfdid; char ans[65500],uid[4096]; checksum += util_destring(2,uid); checksum += util_deint(3, &userfdid); checksum += util_destring(4, ans); util_deint(5, &checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } mproto_Message_Recv(fd,uid,userfdid, ans); util_DiscardMessage(); return 0; } if (func==MPROTO_HELLO_RECV) { util_DiscardMessage(); return 0; } if (func == MPROTO_NOTALK_RECV) { int checksum=0, checksumrecv=0; int userfdid,ntime; char uid[4096]; checksum = util_destring(2,uid); checksum += util_deint(3, &userfdid); checksum += util_deint(4, &ntime); util_deint(5, &checksumrecv); print("notalk here1 sum=%d,recv=%d\n",checksum,checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } print("notalk here2\n"); mproto_NoTalk_Recv(fd,uid,userfdid, ntime); util_DiscardMessage(); return 0; } #ifdef _GM_WARP_PLAYER // WON 传送玩家 if (func == MPROTO_WARP_RECV) { int checksum=0, checksumrecv=0; int userfdid,floor,x,y; char uid[4096]; checksum = util_destring(2,uid); checksum += util_deint(3, &userfdid); checksum += util_deint(4, &floor); checksum += util_deint(5, &x); checksum += util_deint(6, &y); util_deint(7, &checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } mproto_WARP_Recv(fd, uid, userfdid, floor, x, y); util_DiscardMessage(); return 0; } #endif #ifdef _RECAL_ASK_PLAYER // WON 要求人物资料 // 线上人物资料 if (func == MPROTO_RECALL_PLAYER_RECV) { int checksum=0, checksumrecv=0, backup_flag=0; int userfdid, char_num, date, GmCliId; char uid[4096], id[20]; checksum = util_destring(2,uid); checksum += util_deint(3, &userfdid); checksum += util_deint(4, &GmCliId); checksum += util_destring(5,id); checksum += util_deint(6, &char_num); checksum += util_deint(7, &date); checksum += util_deint(8, &backup_flag); util_deint(9, &checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } mproto_RECALL_ASK_PLAYER_Recv(fd, uid, userfdid, GmCliId, id, char_num, date, backup_flag); util_DiscardMessage(); return 0; } // 备份人物资料 if (func == MPROTO_RECALL_BACKUP_RECV) { int checksum=0, checksumrecv=0; int userfdid, char_num, date, GmCliId, backup_flag; char uid[4096], id[20], char_data[1024]; checksum = util_destring(2, uid); checksum += util_deint(3, &userfdid); checksum += util_deint(4, &GmCliId); checksum += util_destring(5,id); checksum += util_deint(6, &char_num); checksum += util_deint(7, &date); checksum += util_destring(8, char_data); checksum += util_deint(9, &backup_flag); util_deint(10, &checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } mproto_RECALL_BACKUP_PLAYER_Recv(fd, uid, userfdid, GmCliId, id, char_num, date, char_data, backup_flag); util_DiscardMessage(); return 0; } #endif if( func == MPROTO_WAEIKICK_RECV ) { int checksum=0, checksumrecv=0, userfdid; char uid[4096]; checksum = util_destring(2,uid); checksum += util_deint(3, &userfdid); util_deint(4, &checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } mproto_WaeiKick_Recv( fd, uid, userfdid); util_DiscardMessage(); return 0; } if( func == MPROTO_JAIL_RECV ) { int checksum=0, checksumrecv=0, userfdid; char uid[4096]; checksum = util_destring(2,uid); checksum += util_deint(3, &userfdid); util_deint(4, &checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } mproto_Jail_Recv( fd, uid, userfdid); util_DiscardMessage(); return 0; } if (func == MPROTO_GMTALK_RECV) { int checksum=0,checksumrecv=0; int ntime; char uid[4096],data[65530]; checksum = util_destring(2,uid); checksum += util_deint(3,&ntime); checksum += util_destring(4,data); util_deint(5,&checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } mproto_GMTalk_Recv(fd,uid,ntime,data); util_DiscardMessage(); return 0; } #ifdef _RECAL_SERVER_OFF // WON MSERVER 关闭 GS if (func == MPROTO_RECALL_SERVER_OFF_RECV) { int checksum=0,checksumrecv=0; char msg[10]; struct tm *newtime; time_t long_time; int MIN=0, HOUR=0, SEC=0; time( &long_time ); newtime = localtime( &long_time ); HOUR=newtime->tm_hour; MIN=newtime->tm_min; SEC=newtime->tm_sec; checksum = util_destring(2,msg); util_deint(3,&checksumrecv); if (checksum!=checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } // 关机 if( strcmp(msg, "OFF") == 0){ print("\n\n\n\n\n GM server shoutdown GS !! (%d:%d:%d)\n\n\n\n\n", HOUR, MIN, SEC); system( "~/gmsvstop.sh" ); } util_DiscardMessage(); return 0; } #endif util_DiscardMessage(); return 0; }
int lssproto_ServerDispatchMessage(int fd, char *encoded) { int func; char raw[1024 * 64]; util_DecodeMessage(raw, encoded); if(!util_SplitMessage(raw, SEPARATOR)) { print("\nDME1:package=%s\n", raw); return -1; } if(!util_GetFunctionFromSlice(&func)) { logHack(fd, HACK_GETFUNCFAIL); return -1; } print("RECEIVED - %d\n", func); if(func == LSSPROTO_W_RECV) { int checksum = 0, checksumrecv; int x; int y; char direction[1024 * 64]; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_destring(4, direction); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_W_recv(fd, x, y, direction); util_DiscardMessage(); return 0; } if(func == LSSPROTO_W2_RECV) { int checksumrecv; int x; int y; char direction[1024 * 64]; int checksum = util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_destring(4, direction); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_W2_recv(fd, x, y, direction); util_DiscardMessage(); return 0; } if(func == LSSPROTO_EV_RECV) { int checksum = 0, checksumrecv; int event; int seqno; int x; int y; int dir; checksum += util_deint(2, &event); checksum += util_deint(3, &seqno); checksum += util_deint(4, &x); checksum += util_deint(5, &y); checksum += util_deint(6, &dir); util_deint(7, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_EV_recv(fd, event, seqno, x, y, dir); util_DiscardMessage(); return 0; } if(func == LSSPROTO_DU_RECV) { int checksum = 0, checksumrecv; int x; int y; checksum += util_deint(2, &x); checksum += util_deint(3, &y); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_DU_recv(fd, x, y); util_DiscardMessage(); return 0; } if(func == LSSPROTO_EO_RECV) { int checksum = 0, checksumrecv; int dummy; checksum += util_deint(2, &dummy); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_EO_recv(fd, dummy); util_DiscardMessage(); return 0; } if(func == LSSPROTO_BU_RECV) { int checksum = 0, checksumrecv; int dummy; checksum += util_deint(2, &dummy); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_BU_recv(fd, dummy); util_DiscardMessage(); return 0; } if(func == LSSPROTO_JB_RECV) { int checksum = 0, checksumrecv; int x; int y; checksum += util_deint(2, &x); checksum += util_deint(3, &y); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_JB_recv(fd, x, y); util_DiscardMessage(); return 0; } if(func == LSSPROTO_LB_RECV) { int checksum = 0, checksumrecv; int x; int y; checksum += util_deint(2, &x); checksum += util_deint(3, &y); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_LB_recv(fd, x, y); util_DiscardMessage(); return 0; } if(func == LSSPROTO_B_RECV) { int checksum = 0, checksumrecv; char command[1024 * 64]; checksum += util_destring(2, command); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_B_recv(fd, command); util_DiscardMessage(); return 0; } if(func == LSSPROTO_SKD_RECV) { int checksum = 0, checksumrecv; int dir; int index; checksum += util_deint(2, &dir); checksum += util_deint(3, &index); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_SKD_recv(fd, dir, index); util_DiscardMessage(); return 0; } if(func == LSSPROTO_ID_RECV) { int checksum = 0, checksumrecv; int x; int y; int haveitemindex; int toindex; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &haveitemindex); checksum += util_deint(5, &toindex); util_deint(6, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_ID_recv(fd, x, y, haveitemindex, toindex); util_DiscardMessage(); return 0; } if(func == LSSPROTO_PI_RECV) { int checksum = 0, checksumrecv; int x; int y; int dir; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &dir); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_PI_recv(fd, x, y, dir); util_DiscardMessage(); return 0; } if(func == LSSPROTO_DI_RECV) { int checksum = 0, checksumrecv; int x; int y; int itemindex; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &itemindex); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_DI_recv(fd, x, y, itemindex); util_DiscardMessage(); return 0; } if(func == LSSPROTO_DG_RECV) { int checksum = 0, checksumrecv; int x; int y; int amount; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &amount); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_DG_recv(fd, x, y, amount); util_DiscardMessage(); return 0; } if(func == LSSPROTO_DP_RECV) { int checksum = 0, checksumrecv; int x; int y; int petindex; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &petindex); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_DP_recv(fd, x, y, petindex); util_DiscardMessage(); return 0; } if(func == LSSPROTO_MI_RECV) { int checksum = 0, checksumrecv; int fromindex; int toindex; checksum += util_deint(2, &fromindex); checksum += util_deint(3, &toindex); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_MI_recv(fd, fromindex, toindex); util_DiscardMessage(); return 0; } if(func == LSSPROTO_MSG_RECV) { int checksum = 0, checksumrecv; int index; char message[1024 * 64]; int color; checksum += util_deint(2, &index); checksum += util_destring(3, message); checksum += util_deint(4, &color); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_MSG_recv(fd, index, message, color); util_DiscardMessage(); return 0; } if(func == LSSPROTO_PMSG_RECV) { int checksum = 0, checksumrecv; int index; int petindex; int itemindex; char message[1024 * 64]; int color; checksum += util_deint(2, &index); checksum += util_deint(3, &petindex); checksum += util_deint(4, &itemindex); checksum += util_destring(5, message); checksum += util_deint(6, &color); util_deint(7, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_PMSG_recv(fd, index, petindex, itemindex, message, color); util_DiscardMessage(); return 0; } if(func == LSSPROTO_AB_RECV) { int checksum = 0, checksumrecv; util_deint(2, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_AB_recv(fd); util_DiscardMessage(); return 0; } if(func == LSSPROTO_DAB_RECV) { int checksum = 0, checksumrecv; int index; checksum += util_deint(2, &index); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_DAB_recv(fd, index); util_DiscardMessage(); return 0; } if(func == LSSPROTO_AAB_RECV) { int checksum = 0, checksumrecv; int x; int y; checksum += util_deint(2, &x); checksum += util_deint(3, &y); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_AAB_recv(fd, x, y); util_DiscardMessage(); return 0; } if(func == LSSPROTO_L_RECV) { int checksum = 0, checksumrecv; int dir; checksum += util_deint(2, &dir); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_L_recv(fd, dir); util_DiscardMessage(); return 0; } if(func == LSSPROTO_TK_RECV) { int checksum = 0, checksumrecv; int x; int y; char message[1024 * 64]; int color; int area; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_destring(4, message); checksum += util_deint(5, &color); checksum += util_deint(6, &area); util_deint(7, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_TK_recv(fd, x, y, message, color, area); util_DiscardMessage(); return 0; } if(func == LSSPROTO_M_RECV) { int checksum = 0, checksumrecv; int fl; int x1; int y1; int x2; int y2; checksum += util_deint(2, &fl); checksum += util_deint(3, &x1); checksum += util_deint(4, &y1); checksum += util_deint(5, &x2); checksum += util_deint(6, &y2); util_deint(7, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_M_recv(fd, fl, x1, y1, x2, y2); util_DiscardMessage(); return 0; } if(func == LSSPROTO_C_RECV) { int checksumrecv; int index; int checksum = util_deint(2, &index); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_C_recv(fd, index); util_DiscardMessage(); return 0; } if(func == LSSPROTO_S_RECV) { int checksum = 0, checksumrecv; char category[1024 * 64]; checksum += util_destring(2, category); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_S_recv(fd, category); util_DiscardMessage(); return 0; } if(func == LSSPROTO_FS_RECV) { int checksum = 0, checksumrecv; int flg; checksum += util_deint(2, &flg); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_FS_recv(fd, flg); util_DiscardMessage(); return 0; } if(func == LSSPROTO_HL_RECV) { int checksum = 0, checksumrecv; int flg; checksum += util_deint(2, &flg); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_HL_recv(fd, flg); util_DiscardMessage(); return 0; } if(func == LSSPROTO_PR_RECV) { int checksum = 0, checksumrecv; int x; int y; int request; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &request); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_PR_recv(fd, x, y, request); util_DiscardMessage(); return 0; } if(func == LSSPROTO_KS_RECV) { int checksum = 0, checksumrecv; int petarray; checksum += util_deint(2, &petarray); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_KS_recv(fd, petarray); util_DiscardMessage(); return 0; } #ifdef _STANDBYPET if(func == LSSPROTO_SPET_RECV) { int checksum = 0, checksumrecv; int standbypet; checksum += util_deint(2, &standbypet); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_SPET_recv(fd, standbypet); util_DiscardMessage(); return 0; } #endif if(func == LSSPROTO_AC_RECV) { int checksum = 0, checksumrecv; int x; int y; int actionno; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &actionno); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_AC_recv(fd, x, y, actionno); util_DiscardMessage(); return 0; } if(func == LSSPROTO_MU_RECV) { int checksum = 0, checksumrecv; int x; int y; int array; int toindex; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &array); checksum += util_deint(5, &toindex); util_deint(6, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_MU_recv(fd, x, y, array, toindex); util_DiscardMessage(); return 0; } if(func == LSSPROTO_PS_RECV) { int checksum = 0, checksumrecv; int havepetindex; int havepetskill; int toindex; char data[1024 * 64]; checksum += util_deint(2, &havepetindex); checksum += util_deint(3, &havepetskill); checksum += util_deint(4, &toindex); checksum += util_destring(5, data); util_deint(6, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_PS_recv(fd, havepetindex, havepetskill, toindex, data); util_DiscardMessage(); return 0; } if(func == LSSPROTO_ST_RECV) { int checksum = 0, checksumrecv; int titleindex; checksum += util_deint(2, &titleindex); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_ST_recv(fd, titleindex); util_DiscardMessage(); return 0; } if(func == LSSPROTO_DT_RECV) { int checksum = 0, checksumrecv; int titleindex; checksum += util_deint(2, &titleindex); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_DT_recv(fd, titleindex); util_DiscardMessage(); return 0; } if(func == LSSPROTO_FT_RECV) { int checksum = 0, checksumrecv; char data[1024 * 64]; checksum += util_destring(2, data); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_FT_recv(fd, data); util_DiscardMessage(); return 0; } if(func == LSSPROTO_SKUP_RECV) { int checksum = 0, checksumrecv; int skillid; checksum += util_deint(2, &skillid); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_SKUP_recv(fd, skillid); util_DiscardMessage(); return 0; } if(func == LSSPROTO_KN_RECV) { int checksum = 0, checksumrecv; int havepetindex; char data[1024 * 64]; checksum += util_deint(2, &havepetindex); checksum += util_destring(3, data); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_KN_recv(fd, havepetindex, data); util_DiscardMessage(); return 0; } if(func == LSSPROTO_WN_RECV) { int checksum = 0, checksumrecv; int x; int y; int seqno; int objindex; int select; char data[1024 * 64]; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &seqno); checksum += util_deint(5, &objindex); checksum += util_deint(6, &select); checksum += util_destring(7, data); util_deint(8, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_WN_recv(fd, x, y, seqno, objindex, select, data); util_DiscardMessage(); return 0; } if(func == LSSPROTO_SP_RECV) { int checksum = 0, checksumrecv; int x; int y; int dir; checksum += util_deint(2, &x); checksum += util_deint(3, &y); checksum += util_deint(4, &dir); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_SP_recv(fd, x, y, dir); util_DiscardMessage(); return 0; } if(func == LSSPROTO_CLIENTLOGIN_RECV) { int checksum = 0, checksumrecv; char cdkey[CDKEYLEN]; char passwd[PASSWDLEN]; strcpy(PersonalKey, getPublicKey()); checksum += util_destring(2, cdkey); checksum += util_destring(3, passwd); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_ClientLogin_recv(fd, cdkey, passwd); util_DiscardMessage(); return 0; } if(func == LSSPROTO_CREATENEWCHAR_RECV) { int checksum = 0, checksumrecv; int dataplacenum; char charname[CHARNAMELEN];; int imgno; int faceimgno; int vital; int str; int tgh; int dex; int earth; int water; int fire; int wind; int hometown; checksum += util_deint(2, &dataplacenum); checksum += util_destring(3, charname); checksum += util_deint(4, &imgno); checksum += util_deint(5, &faceimgno); checksum += util_deint(6, &vital); checksum += util_deint(7, &str); checksum += util_deint(8, &tgh); checksum += util_deint(9, &dex); checksum += util_deint(10, &earth); checksum += util_deint(11, &water); checksum += util_deint(12, &fire); checksum += util_deint(13, &wind); checksum += util_deint(14, &hometown); util_deint(15, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_CreateNewChar_recv(fd, dataplacenum, charname, imgno, faceimgno, vital, str, tgh, dex, earth, water, fire, wind, hometown); util_DiscardMessage(); return 0; } if(func == LSSPROTO_CHARDELETE_RECV) { int checksum = 0, checksumrecv; char charname[CHARNAMELEN];; checksum += util_destring(2, charname); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_CharDelete_recv(fd, charname); util_DiscardMessage(); return 0; } if(func == LSSPROTO_CHARLOGIN_RECV) { int checksumrecv; char charname[CHARNAMELEN]; int checksum = util_destring(2, charname); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_CharLogin_recv(fd, charname); util_DiscardMessage(); return 0; } if(func == LSSPROTO_CHARLIST_RECV) { int checksumrecv; util_deint(2, &checksumrecv); if(0 != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_CharList_recv(fd); util_DiscardMessage(); return 0; } if(func == LSSPROTO_CHARLOGOUT_RECV) { int checksumrecv; int Flg = 1; util_deint(2, &checksumrecv); if(0 != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_CharLogout_recv(fd, Flg); util_DiscardMessage(); return 0; } if(func == LSSPROTO_PROCGET_RECV) { int checksumrecv; strcpy(PersonalKey, getPublicKey()); util_deint(2, &checksumrecv); if(0 != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_ProcGet_recv(fd); util_DiscardMessage(); return 0; } if(func == LSSPROTO_PLAYERNUMGET_RECV) { int checksum = 0, checksumrecv; util_deint(2, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_PlayerNumGet_recv(fd); util_DiscardMessage(); return 0; } if(func == LSSPROTO_ECHO_RECV) { int checksum = 0, checksumrecv; char test[1024 * 64]; checksum += util_destring(2, test); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_Echo_recv(fd, test); util_DiscardMessage(); return 0; } if(func == LSSPROTO_SHUTDOWN_RECV) { int checksum = 0, checksumrecv; char passwd[1024 * 64]; int min; checksum += util_destring(2, passwd); checksum += util_deint(3, &min); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_Shutdown_recv(fd, passwd, min); util_DiscardMessage(); return 0; } if(func == LSSPROTO_TD_RECV) { int checksum = 0, checksumrecv; char message[1024 * 64]; checksum += util_destring(2, message); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_TD_recv(fd, message); util_DiscardMessage(); return 0; } if(func == LSSPROTO_FM_RECV) { int checksum = 0, checksumrecv; char message[1024 * 64]; checksum += util_destring(2, message); util_deint(3, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_FM_recv(fd, message); util_DiscardMessage(); return 0; } if(func == LSSPROTO_PETST_RECV) { int checksum = 0, checksumrecv; int nPet; int sPet; checksum += util_deint(2, &nPet); checksum += util_deint(3, &sPet); util_deint(4, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_PETST_recv(fd, nPet, sPet); util_DiscardMessage(); return 0; } #ifdef _CHECK_GAMESPEED if (func==LSSPROTO_CS_RECV) { char buffer[2]; buffer[0] = '\0'; lssproto_CS_recv( fd ); util_DiscardMessage(); return 0; } #endif #ifdef _MIND_ICON if(func == LSSPROTO_MA_RECV) { int checksum = 0, checksumrecv; int nMind; int x, y; checksum += util_deint(2, &nMind); checksum += util_deint(3, &x); checksum += util_deint(4, &y); util_deint(5, &checksumrecv); if(checksum != checksumrecv) { util_DiscardMessage(); logHack(fd, HACK_CHECKSUMERROR); return -1; } lssproto_MA_recv(fd, x, y, nMind); util_DiscardMessage(); return 0; } #endif #ifdef _OUTOFBATTLESKILL // (不可开) Syu ADD 非战斗时技能Protocol if(func==LSSPROTO_BATTLESKILL_RECV){ int checksum = 0, checksumrecv; int iNum; checksum += util_deint( 2, &iNum); util_deint( 3, &checksumrecv); if(checksum!=checksumrecv){ util_DiscardMessage(); logHack( fd, HACK_CHECKSUMERROR); return -1; } lssproto_BATTLESKILL_recv(fd, iNum); util_DiscardMessage(); return 0; } #endif printf("\n无法找到客户端接口=%d\n", func); util_DiscardMessage(); logHack(fd, HACK_NOTDISPATCHED); return -1; }