/* output by ../../bin/lsgen.perl 0.41 ( 1998 May) * made Thu Feb 17 17:30:27 2000 * user ringo * host indy * file /opt/ringo/chsa/src/saac/./saacproto_serv.c * util ./saacproto_util.c , ./saacproto_util.h * src /opt/ringo/chsa/src/saac/../../doc/saacproto.html */ #define _SAACPROTOSERV_C_ #include "version.h" #include "saacproto_serv.h" #include "main.h" #ifdef _RECAL_BACKUP_PLAYER // WON 回溯功能 #include "recv.h" #endif #ifdef _DEATH_FAMILY_GM_COMMAND // WON ADD 家族战GM指令 #include "acfamily.h" #endif // Nuke : This 'fd' is not a socket, it's the index of structure connect int saacproto_ServerDispatchMessage( int fd , char *encoded, char *debugfun) { unsigned int msgid; char funcname[1024]; saacproto_splitString( encoded ); saacproto_GetMessageInfo(&msgid , funcname ,sizeof(funcname), saacproto.token_list ); if( strcmp( funcname , "ACServerLogin" ) == 0 ){ char* servername; char* serverpas; servername = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); serverpas = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); saacproto_ACServerLogin_recv( fd,servername,serverpas); return 0; } if( strcmp( funcname , "ACServerLogout" ) == 0 ){ saacproto_ACServerLogout_recv( fd); return 0; } if( strcmp( funcname , "ACCharList" ) == 0 ){ char* id; char* pas; int mesgid; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); pas = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); mesgid = saacproto_demkstr_int( saacproto.token_list[4] ); saacproto_ACCharList_recv( fd,id,pas,mesgid); return 0; } if( strcmp( funcname , "ACCharLoad" ) == 0 ){ char* id; char* pas; char* charname; int lock; char* opt; int mesgid; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); pas = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); charname = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); lock = saacproto_demkstr_int( saacproto.token_list[5] ); opt = saacproto_wrapStringAddr( saacproto_stringwrapper[5] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[6] )); mesgid = saacproto_demkstr_int( saacproto.token_list[7] ); saacproto_ACCharLoad_recv( fd,id,pas,charname,lock,opt,mesgid); return 0; } #ifdef _RELOGIN if( strcmp( funcname , "ACCharLoadII" ) == 0 ){ char* id; char* pas; char* charname; int lock; char* opt; int mesgid; int gs1; int gs2; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); pas = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); charname = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); lock = saacproto_demkstr_int( saacproto.token_list[5] ); opt = saacproto_wrapStringAddr( saacproto_stringwrapper[5] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[6] )); mesgid = saacproto_demkstr_int( saacproto.token_list[7] ); gs1 = saacproto_demkstr_int( saacproto.token_list[8] ); gs2 = saacproto_demkstr_int( saacproto.token_list[9] ); saacproto_ACCharLoadII_recv( fd,id,pas,charname,lock,opt,mesgid,gs1,gs2); return 0; } #endif if( strcmp( funcname , "ACCharSave" ) == 0 ){ char* id; char* charname; char* opt; char* charinfo; int unlock; int mesgid; #ifdef _NewSave int charindex; #endif id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); charname = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); opt = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); charinfo = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); unlock = saacproto_demkstr_int( saacproto.token_list[6] ); mesgid = saacproto_demkstr_int( saacproto.token_list[7] ); #ifdef _NewSave charindex = saacproto_demkstr_int( saacproto.token_list[8] ); saacproto_ACCharSave_recv( fd,id,charname,opt,charinfo,unlock,mesgid,charindex); #else saacproto_ACCharSave_recv( fd,id,charname,opt,charinfo,unlock,mesgid); #endif return 0; } #ifdef _RELOGIN if( strcmp( funcname , "ACCharSaveII" ) == 0 ){ char* id; char* charname; char* opt; char* charinfo; int unlock; int mesgid; int charindex; int gs1; int gs2; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); charname = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); opt = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); charinfo = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); unlock = saacproto_demkstr_int( saacproto.token_list[6] ); mesgid = saacproto_demkstr_int( saacproto.token_list[7] ); charindex = saacproto_demkstr_int( saacproto.token_list[8] ); charindex = saacproto_demkstr_int( saacproto.token_list[9] ); charindex = saacproto_demkstr_int( saacproto.token_list[10] ); // saacproto_ACCharSaveII_recv( fd,id,charname,opt,charinfo,unlock,mesgid,charindex,gs1,gs2); saacproto_ACCharSaveII_recv( fd,id,charname,opt,charinfo,unlock,mesgid,charindex); return 0; } #endif if( strcmp( funcname , "ACCharDelete" ) == 0 ){ char* id; char* passwd; char* charname; char* option; int mesgid; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); passwd = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); charname = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); option = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); mesgid = saacproto_demkstr_int( saacproto.token_list[6] ); saacproto_ACCharDelete_recv( fd,id,passwd,charname,option,mesgid); return 0; } if( strcmp( funcname , "ACLock" ) == 0 ){ char* id; int lock; int mesgid; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); lock = saacproto_demkstr_int( saacproto.token_list[3] ); mesgid = saacproto_demkstr_int( saacproto.token_list[4] ); saacproto_ACLock_recv( fd,id,lock,mesgid); return 0; } #ifdef _WAEI_KICK if( strcmp( funcname , "ACKick" ) == 0 ){ char* id; //欲踢的帐号 int flg; //事件flg int clifd; //GM id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); clifd = saacproto_demkstr_int( saacproto.token_list[3] ); flg = saacproto_demkstr_int( saacproto.token_list[4] ); saacproto_ACKick_recv( fd, id, flg, clifd); return 0; } #endif #ifdef _NEW_PLAYERGOLD if( strcmp( funcname , "LoadNEWPlayer" ) == 0 ){ char* filename; //欲踢的帐号 int charaindex; charaindex = saacproto_demkstr_int( saacproto.token_list[2] ); filename = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); saacproto_LoadNEWPlayer_recv( fd, charaindex, filename); return 0; } #endif #ifdef _DEATH_CONTEND if( strcmp( funcname , "PKLISTGETDATA" ) == 0 ){ int start=-1, count; start = saacproto_demkstr_int( saacproto.token_list[2] ); count = saacproto_demkstr_int( saacproto.token_list[3] ); saacproto_PKLISTGETDATA_recv( fd, start, count); return 0; } if( strcmp( funcname , "PKLISTUPDATE" ) == 0 ){ char *mecdkey, *tocdkey; int menum, tonum, winer, flg; mecdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); tocdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); menum = saacproto_demkstr_int( saacproto.token_list[4] ); tonum = saacproto_demkstr_int( saacproto.token_list[5] ); winer = saacproto_demkstr_int( saacproto.token_list[6] ); flg = saacproto_demkstr_int( saacproto.token_list[7] ); saacproto_PKLISTUPDATE_recv( fd, menum, mecdkey, tonum, tocdkey, winer, flg); return 0; } if( strcmp( funcname , "PKLISTCHARTS" ) == 0 ){ int type, flg; //要求资讯 type = saacproto_demkstr_int( saacproto.token_list[2] ); flg = saacproto_demkstr_int( saacproto.token_list[3] ); saacproto_PKLISTCHARTS_recv( fd, type, flg); return 0; } #endif #ifdef _PAUCTION_MAN if( strcmp( funcname , "AUCTIONADDITEM" ) == 0 ){ int ItemId=-1; char *name; char *data; int flg, ret; name = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); ItemId = saacproto_demkstr_int( saacproto.token_list[4] ); ret = saacproto_demkstr_int( saacproto.token_list[5] ); flg = saacproto_demkstr_int( saacproto.token_list[6] ); saacproto_ACItemAuction_recv( fd, name, data, ItemId, ret, flg); return 0; } #endif if( strcmp( funcname , "ACUCheck" ) == 0 ){ char* mem_id; int status; mem_id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); status = saacproto_demkstr_int( saacproto.token_list[3] ); saacproto_ACUCheck_recv( fd,mem_id,status); return 0; } if( strcmp( funcname , "DBUpdateEntryString" ) == 0 ){ char* table; char* key; char* value; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); key = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); value = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); msgid = saacproto_demkstr_int( saacproto.token_list[5] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[6] ); saacproto_DBUpdateEntryString_recv( fd,table,key,value,msgid,msgid2); return 0; } if( strcmp( funcname , "DBDeleteEntryString" ) == 0 ){ char* table; char* key; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); key = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); msgid = saacproto_demkstr_int( saacproto.token_list[4] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_DBDeleteEntryString_recv( fd,table,key,msgid,msgid2); return 0; } if( strcmp( funcname , "DBGetEntryString" ) == 0 ){ char* table; char* key; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); key = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); msgid = saacproto_demkstr_int( saacproto.token_list[4] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_DBGetEntryString_recv( fd,table,key,msgid,msgid2); return 0; } if( strcmp( funcname , "DBUpdateEntryInt" ) == 0 ){ char* table; char* key; int value; char* info; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); key = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); value = saacproto_demkstr_int( saacproto.token_list[4] ); info = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); msgid = saacproto_demkstr_int( saacproto.token_list[6] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[7] ); saacproto_DBUpdateEntryInt_recv( fd,table,key,value,info,msgid,msgid2); return 0; } if( strcmp( funcname , "DBGetEntryRank" ) == 0 ){ char* table; char* key; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); key = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); msgid = saacproto_demkstr_int( saacproto.token_list[4] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_DBGetEntryRank_recv( fd,table,key,msgid,msgid2); return 0; } #ifdef _ALLDOMAN // Syu ADD 排行榜NPC if ( strcmp( funcname , "UpdataStele" ) == 0 ) { char *cdkey; char *name; char *title; int level; int trns; int time; int floor; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); name = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); title = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); level = saacproto_demkstr_int( saacproto.token_list[5] ); trns = saacproto_demkstr_int( saacproto.token_list[6] ); time = saacproto_demkstr_int( saacproto.token_list[7] ); floor = saacproto_demkstr_int( saacproto.token_list[8] ); saacproto_UpdataStele_recv ( fd , cdkey , name , title , level , trns , time , floor) ; return 0; } #endif if( strcmp( funcname , "DBDeleteEntryInt" ) == 0 ){ char* table; char* key; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); key = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); msgid = saacproto_demkstr_int( saacproto.token_list[4] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_DBDeleteEntryInt_recv( fd,table,key,msgid,msgid2); return 0; } if( strcmp( funcname , "DBGetEntryInt" ) == 0 ){ char* table; char* key; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); key = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); msgid = saacproto_demkstr_int( saacproto.token_list[4] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_DBGetEntryInt_recv( fd,table,key,msgid,msgid2); return 0; } if( strcmp( funcname , "DBGetEntryByRank" ) == 0 ){ char* table; int rank_start; int rank_end; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); rank_start = saacproto_demkstr_int( saacproto.token_list[3] ); rank_end = saacproto_demkstr_int( saacproto.token_list[4] ); msgid = saacproto_demkstr_int( saacproto.token_list[5] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[6] ); saacproto_DBGetEntryByRank_recv( fd,table,rank_start,rank_end,msgid,msgid2); return 0; } if( strcmp( funcname , "DBGetEntryByCount" ) == 0 ){ char* table; int count_start; int num; int msgid; int msgid2; table = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); count_start = saacproto_demkstr_int( saacproto.token_list[3] ); num = saacproto_demkstr_int( saacproto.token_list[4] ); msgid = saacproto_demkstr_int( saacproto.token_list[5] ); msgid2 = saacproto_demkstr_int( saacproto.token_list[6] ); saacproto_DBGetEntryByCount_recv( fd,table,count_start,num,msgid,msgid2); return 0; } if( strcmp( funcname , "Broadcast" ) == 0 ){ char* id; char* charname; char* message; int flag; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); charname = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); message = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); flag = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_Broadcast_recv( fd,id,charname,message,flag); return 0; } if( strcmp( funcname , "Message" ) == 0 ){ char* id_from; char* charname_from; char* id_to; char* charname_to; char* message; int option; id_from = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); charname_from = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); id_to = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); charname_to = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); message = saacproto_wrapStringAddr( saacproto_stringwrapper[5] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[6] )); option = saacproto_demkstr_int( saacproto.token_list[7] ); saacproto_Message_recv( fd,id_from,charname_from,id_to,charname_to,message,option); return 0; } if( strcmp( funcname , "MessageAck" ) == 0 ){ char* id; char* charname; char* result; int mesgid; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); charname = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); result = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); mesgid = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_MessageAck_recv( fd,id,charname,result,mesgid); return 0; } if( strcmp( funcname , "MessageFlush" ) == 0 ){ char* id; char* charname; id = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); charname = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); saacproto_MessageFlush_recv( fd,id,charname); return 0; } // 成立家族 if ( strcmp( funcname, "ACAddFM") == 0){ int fmleaderlv, fmsprite, charfdid, fmleadergrano; char *fmname, *fmleadername, *fmleaderid, *petname, *petattr, *fmrule; #ifdef _PERSONAL_FAME int fame; #endif fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmleadername = saacproto_wrapStringAddr(saacproto_stringwrapper[2], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[3])); fmleaderid = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); fmleaderlv = saacproto_demkstr_int(saacproto.token_list[5]); petname = saacproto_wrapStringAddr(saacproto_stringwrapper[5], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[6])); petattr = saacproto_wrapStringAddr(saacproto_stringwrapper[6], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[7])); fmrule = saacproto_wrapStringAddr(saacproto_stringwrapper[7], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[8])); fmsprite = saacproto_demkstr_int(saacproto.token_list[9]); fmleadergrano = saacproto_demkstr_int(saacproto.token_list[10]); #ifdef _PERSONAL_FAME fame = saacproto_demkstr_int(saacproto.token_list[11]); charfdid = saacproto_demkstr_int(saacproto.token_list[12]); saacproto_ACAddFM_recv(fd, fmname, fmleadername, fmleaderid, fmleaderlv, petname, petattr, fmrule, fmsprite, fmleadergrano, fame, charfdid); #else charfdid = saacproto_demkstr_int(saacproto.token_list[11]); saacproto_ACAddFM_recv(fd, fmname, fmleadername, fmleaderid, fmleaderlv, petname, petattr, fmrule, fmsprite, fmleadergrano, charfdid); #endif return 0; } // 加入家族 if ( strcmp( funcname, "ACJoinFM") == 0){ #ifdef _PERSONAL_FAME // Arminius: 家族个人声望 int fmindex, charlv, charfdid, index, fame; #else int fmindex, charlv, charfdid, index; #endif char *fmname, *charname, *charid; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); charname = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); charid = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); charlv = saacproto_demkstr_int(saacproto.token_list[6]); index = saacproto_demkstr_int(saacproto.token_list[7]); #ifdef _PERSONAL_FAME // Arminius: 家族个人声望 fame = saacproto_demkstr_int(saacproto.token_list[8]); charfdid = saacproto_demkstr_int(saacproto.token_list[9]); saacproto_ACJoinFM_recv(fd, fmname, fmindex, charname, charid, charlv, index, fame, charfdid); #else charfdid = saacproto_demkstr_int(saacproto.token_list[8]); saacproto_ACJoinFM_recv(fd, fmname, fmindex, charname, charid, charlv, index, charfdid); #endif return 0; } // 退出家族 if ( strcmp( funcname, "ACLeaveFM") == 0){ int fmindex, charfdid, index; char *fmname, *charname, *charid; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); charname = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); charid = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); index = saacproto_demkstr_int(saacproto.token_list[6]); charfdid = saacproto_demkstr_int(saacproto.token_list[7]); saacproto_ACLeaveFM_recv(fd, fmname, fmindex, charname, charid, index, charfdid); return 0; } // 解散家族 #ifdef _LEADERFUNCHECK if ( strcmp( funcname, "ACDelFM") == 0){ int fmindex, charfdid, index; char *fmname, *charname, *charid; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); index = saacproto_demkstr_int(saacproto.token_list[4]); charname = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); charid = saacproto_wrapStringAddr(saacproto_stringwrapper[5], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[6])); charfdid = saacproto_demkstr_int(saacproto.token_list[7]); saacproto_ACDelFM_recv(fd, fmname, fmindex, index, charname, charid, charfdid); return 0; } #else if ( strcmp( funcname, "ACDelFM") == 0){ int fmindex, charfdid, index; char *fmname; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); index = saacproto_demkstr_int(saacproto.token_list[4]); charfdid = saacproto_demkstr_int(saacproto.token_list[5]); saacproto_ACDelFM_recv(fd, fmname, fmindex, index, charfdid); return 0; } #endif // 列出家族列表 if ( strcmp( funcname, "ACShowFMList") == 0){ saacproto_ACShowFMList_recv(fd); return 0; } // 列出成员列表 if ( strcmp( funcname, "ACShowMemberList") == 0){ int index; char *tmpbuf; tmpbuf = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); index = saacproto_demkstr_int(saacproto.token_list[3]); saacproto_ACShowMemberList_recv(fd, index); return 0; } // 列出家族详细资料 if ( strcmp( funcname, "ACFMDetail") == 0){ int fmindex, charfdid, index; char *fmname; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); index = saacproto_demkstr_int(saacproto.token_list[4]); charfdid = saacproto_demkstr_int(saacproto.token_list[5]); saacproto_ACFMDetail_recv(fd, fmname, fmindex, index, charfdid); return 0; } // 列出家族留言 if (strcmp( funcname, "ACFMReadMemo") == 0){ int index; char *tmpbuf; tmpbuf = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); index = saacproto_demkstr_int(saacproto.token_list[3]); saacproto_ACFMReadMemo_recv(fd, index); return 0; } // 写入家族留言 if (strcmp( funcname, "ACFMWriteMemo") == 0){ int index, fmindex; char *fmname, *data; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); data = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); index = saacproto_demkstr_int(saacproto.token_list[5]); saacproto_ACFMWriteMemo_recv(fd, fmname, fmindex, data, index); return 0; } #ifdef _DEATH_FAMILY_GM_COMMAND // WON ADD 家族战GM指令 // reload 家族资料 if ( strcmp( funcname, "ACRELOADFM") == 0){ int charindex = -1; charindex = saacproto_demkstr_int(saacproto.token_list[2]); log("\n won test 40 ==> charindex(%d)", charindex ); saacproto_ACRELOADFM_recv( fd, charindex ); return 0; } if ( strcmp( funcname, "ACShowMemberList2") == 0){ int fm1 = -1, fm2 = -1, charindex = -1, time = -1, id = -1; charindex = saacproto_demkstr_int(saacproto.token_list[2]); fm1 = saacproto_demkstr_int(saacproto.token_list[3]); fm2 = saacproto_demkstr_int(saacproto.token_list[4]); time = saacproto_demkstr_int(saacproto.token_list[5]); id = saacproto_demkstr_int(saacproto.token_list[6]); log("\n won test 40 ==> charindex(%d) fm1(%d) fm2(%d) time(%d) id(%d)", charindex, fm1, fm2, time, id ); saacproto_ACShowMemberList_2_recv(fd, charindex, fm1, fm2, time, id ); return 0; } #endif #ifdef _DEATH_FAMILY_LOGIN_CHECK // WON ADD 家族战登入检查 // 玩家login2 if ( strcmp( funcname, "ACFMCharLogin2") == 0){ int charindex = -1; char *char_id, *char_name; char_id = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); char_name = saacproto_wrapStringAddr(saacproto_stringwrapper[2], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[3])); charindex = saacproto_demkstr_int(saacproto.token_list[4]); log("\n won test 4 ==> char_id(%s) char_name(%s) charindex(%d)", char_id, char_name, charindex ); saacproto_ACFMCharLogin2_recv(fd, char_id, char_name, charindex ); return 0; } #endif // 玩家login if ( strcmp( funcname, "ACFMCharLogin") == 0){ int fmindex, charlv, charfdid; #ifdef _FM_MODIFY int gsnum; #endif char *fmname, *charname, *charid; #ifdef _FMVER21 int eventflag; #endif fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); charname = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); charid = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); charlv = saacproto_demkstr_int(saacproto.token_list[6]); #ifdef _FMVER21 eventflag = saacproto_demkstr_int(saacproto.token_list[7]); charfdid = saacproto_demkstr_int(saacproto.token_list[8]); #ifdef _FM_MODIFY gsnum = saacproto_demkstr_int(saacproto.token_list[9]); saacproto_ACFMCharLogin_recv(fd, fmname, fmindex, charname,charid, charlv, eventflag, charfdid,gsnum); #else saacproto_ACFMCharLogin_recv(fd, fmname, fmindex, charname,charid, charlv, eventflag, charfdid); #endif #else charfdid = saacproto_demkstr_int(saacproto.token_list[7]); saacproto_ACFMCharLogin_recv(fd, fmname, fmindex, charname,charid, charlv, charfdid); #endif return 0; } // 玩家logout if ( strcmp( funcname, "ACFMCharLogout") == 0){ int fmindex, charfdid, charlv, index; char *fmname, *charname, *charid; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); charname = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); charid = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); charlv = saacproto_demkstr_int(saacproto.token_list[6]); index = saacproto_demkstr_int(saacproto.token_list[7]); charfdid = saacproto_demkstr_int(saacproto.token_list[8]); saacproto_ACFMCharLogout_recv(fd, fmname, fmindex, charname, charid, charlv, index, charfdid); return 0; } // 族长审核成员加入家族、修改家族成员职位 if (strcmp( funcname, "ACMemberJoinFM") == 0){ int fmindex, charfdid, index, charindex, result; char *fmname, *charname; #ifdef _FMVER21 int meindex; #endif fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); charname = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); charindex = saacproto_demkstr_int(saacproto.token_list[5]); index = saacproto_demkstr_int(saacproto.token_list[6]); result = saacproto_demkstr_int(saacproto.token_list[7]); #ifdef _FMVER21 meindex = saacproto_demkstr_int(saacproto.token_list[8]); charfdid = saacproto_demkstr_int(saacproto.token_list[9]); saacproto_ACMemberJoinFM_recv(fd, fmname, fmindex, charname, charindex, index, result, meindex, charfdid); #else charfdid = saacproto_demkstr_int(saacproto.token_list[8]); saacproto_ACMemberJoinFM_recv(fd, fmname, fmindex, charname, charindex, index, result, charfdid); #endif return 0; } // 族长审核成员离开家族 if (strcmp( funcname, "ACMemberLeaveFM") == 0){ int fmindex, charfdid, index, charindex; char *fmname, *charname; #ifdef _FMVER21 int meindex; #endif fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); charname = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); charindex = saacproto_demkstr_int(saacproto.token_list[5]); index = saacproto_demkstr_int(saacproto.token_list[6]); #ifdef _FMVER21 meindex = saacproto_demkstr_int(saacproto.token_list[7]); charfdid = saacproto_demkstr_int(saacproto.token_list[8]); saacproto_ACMemberLeaveFM_recv(fd, fmname, fmindex, charname, charindex, index, meindex, charfdid); #else charfdid = saacproto_demkstr_int(saacproto.token_list[7]); saacproto_ACMemberLeaveFM_recv(fd, fmname, fmindex, charname, charindex, index, charfdid); #endif return 0; } // 列出家族据点 if ( strcmp( funcname, "ACFMPointList") == 0){ saacproto_ACFMPointList_recv(fd); return 0; } #ifdef _CK_ONLINE_PLAYER_COUNT // WON ADD 计算线上人数 if ( strcmp( funcname, "ACGSPCOUNT") == 0){ int playcount = 0; playcount = saacproto_demkstr_int(saacproto.token_list[2]); saacproto_GS_ACK_PLAYER_COUNT_recv( fd, playcount ); return 0; } #endif // 申请家族据点 if (strcmp( funcname, "ACSetFMPoint") == 0){ int fl, x, y, fmindex, index, fmpointindex, charfdid; char *fmname; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); index = saacproto_demkstr_int(saacproto.token_list[4]); fmpointindex = saacproto_demkstr_int(saacproto.token_list[5]); fl = saacproto_demkstr_int(saacproto.token_list[6]); x = saacproto_demkstr_int(saacproto.token_list[7]); y = saacproto_demkstr_int(saacproto.token_list[8]); charfdid = saacproto_demkstr_int(saacproto.token_list[9]); saacproto_ACSetFMPoint_recv(fd, fmname, fmindex, index, fmpointindex, fl, x, y, charfdid); return 0; } // 设定家族据点 if (strcmp( funcname, "ACFixFMPoint") == 0){ int winindex, winfmindex, loseindex, losefmindex, village; char *winfmname, *losefmname; winfmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); winfmindex = saacproto_demkstr_int(saacproto.token_list[3]); winindex = saacproto_demkstr_int(saacproto.token_list[4]); losefmname = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); losefmindex = saacproto_demkstr_int(saacproto.token_list[6]); loseindex = saacproto_demkstr_int(saacproto.token_list[7]); village= saacproto_demkstr_int(saacproto.token_list[8]); saacproto_ACFixFMPoint_recv(fd, winfmname, winfmindex, winindex, losefmname, losefmindex, loseindex, village); return 0; } // 族长对全员广播 if (strcmp( funcname, "ACFMAnnounce") == 0){ int index, fmindex, color; char *fmname, *data; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); index = saacproto_demkstr_int(saacproto.token_list[4]); data = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); color = saacproto_demkstr_int(saacproto.token_list[6]); saacproto_ACFMAnnounce_recv(fd, fmname, fmindex, index, data, color); return 0; } // 列出家族排行榜 if ( strcmp( funcname, "ACShowTopFMList") == 0){ int kindflag; char *tmpbuf; tmpbuf = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); kindflag = saacproto_demkstr_int(saacproto.token_list[3]); saacproto_ACShowTopFMList_recv(fd, kindflag); return 0; } // 修正家族资料 if (strcmp( funcname, "ACFixFMData") == 0){ int fmindex, charfdid, index, kindflag, charindex; char *fmname, *data1, *data2; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); index = saacproto_demkstr_int(saacproto.token_list[4]); kindflag = saacproto_demkstr_int(saacproto.token_list[5]); data1 = saacproto_wrapStringAddr(saacproto_stringwrapper[5], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[6])); data2 = saacproto_wrapStringAddr(saacproto_stringwrapper[6], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[7])); charindex = saacproto_demkstr_int(saacproto.token_list[8]); charfdid = saacproto_demkstr_int(saacproto.token_list[9]); saacproto_ACFixFMData_recv(fd, fmname, fmindex, index, kindflag, data1, data2, charindex, charfdid); return 0; } #ifdef _FAMILYBANKSTONELOG if (strcmp( funcname, "ACgetFMBankgold") ==0){ int fmindex, charfdid, index, charindex; char *fmname; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); index = saacproto_demkstr_int(saacproto.token_list[4]); charindex = saacproto_demkstr_int(saacproto.token_list[5]); charfdid = saacproto_demkstr_int(saacproto.token_list[6]); saacproto_ACgetFMBankgold_recv(fd, fmname, fmindex, index, charindex, charfdid); return 0; } #endif #ifdef _DEATH_FAMILY_STRUCT // WON ADD 家族战存放胜负资料 if (strcmp( funcname, "FMINITPKSTRUCT") == 0){ log("\n won test 300 ==>" ); set_fm_pk_score( "" ); // save_fm_pk_score(); return 0; } if (strcmp( funcname, "FMPKSTRUCT") == 0){ char *msg; msg = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); log("\n won test 54 ==> msg(%s)", msg ); set_fm_pk_score( msg ); // save_fm_pk_score(); return 0; } #endif // 家族PK後修正声望 if (strcmp( funcname, "ACFixFMPK") == 0){ int winindex, winfmindex, loseindex, losefmindex; char *winfmname, *losefmname; winfmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); winfmindex = saacproto_demkstr_int(saacproto.token_list[3]); winindex = saacproto_demkstr_int(saacproto.token_list[4]); losefmname = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); losefmindex = saacproto_demkstr_int(saacproto.token_list[6]); loseindex = saacproto_demkstr_int(saacproto.token_list[7]); saacproto_ACFixFMPK_recv(fd, winfmname, winfmindex, winindex, losefmname, losefmindex, loseindex); return 0; } // GM修正家族资料 if (strcmp( funcname, "ACGMFixFMData") == 0){ int index, charfdid; char *cmd, *data, *tmpbuf,*charid; tmpbuf = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); index = saacproto_demkstr_int(saacproto.token_list[3]); charid = saacproto_wrapStringAddr(saacproto_stringwrapper[3], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[4])); cmd = saacproto_wrapStringAddr(saacproto_stringwrapper[4], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[5])); data = saacproto_wrapStringAddr(saacproto_stringwrapper[5], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[6])); charfdid = saacproto_demkstr_int(saacproto.token_list[7]); saacproto_ACGMFixFMData_recv(fd, index, charid, cmd, data, charfdid); return 0; } // 取得家族资料 if (strcmp( funcname, "ACGetFMData") == 0){ int fmindex, charfdid, index, kindflag; char *fmname; fmname = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); fmindex = saacproto_demkstr_int(saacproto.token_list[3]); index = saacproto_demkstr_int(saacproto.token_list[4]); kindflag = saacproto_demkstr_int(saacproto.token_list[5]); charfdid = saacproto_demkstr_int(saacproto.token_list[6]); saacproto_ACGetFMData_recv(fd, fmname, fmindex, index, kindflag, charfdid); return 0; } // 广播踢馆人的资料 if (strcmp( funcname,"ACManorPKAck") == 0){ char *data; data = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); saacproto_ACManorPKAck_recv(fd, data); return 0; } #ifdef _CHECKFMSCHEDULE // Syu ADD 透过AC确认家族挑战排程 if (strcmp( funcname,"ACCheckSchedule") ==0) { char *data; data = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); saacproto_ACCheckSchedule_recv(fd,data); return 0; } #endif if (strcmp( funcname,"ACreLoadFmData") ==0){ int type, data; type = saacproto_demkstr_int(saacproto.token_list[2]); data = saacproto_demkstr_int(saacproto.token_list[3]); saacproto_ACreLoadFmData_recv( fd, type, data); return 0; } #ifdef _AC_SEND_FM_PK if (strcmp( funcname,"ACLoadFmPk") ==0) { int fmpks_pos; fmpks_pos = saacproto_demkstr_int(saacproto.token_list[2]); saacproto_ACLoadFmPk_recv(fd, fmpks_pos); return 0; } #ifdef _ACFMPK_LIST if (strcmp( funcname,"ACSendFmPk") ==0){ int fmpks_pos, userindex, flg; char *data; fmpks_pos = saacproto_demkstr_int(saacproto.token_list[2]); userindex = saacproto_demkstr_int(saacproto.token_list[3]); flg = saacproto_demkstr_int(saacproto.token_list[4]); data = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); saacproto_ACSendFmPk_recv( fd, fmpks_pos, userindex, flg, data); return 0; } #else if (strcmp( funcname,"ACSendFmPk") ==0){ int fmpks_pos; char *data; fmpks_pos = saacproto_demkstr_int(saacproto.token_list[2]); data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); saacproto_ACSendFmPk_recv(fd, fmpks_pos, data); return 0; } #endif #endif #ifdef _RECAL_BACKUP_PLAYER // WON 回溯功能 if (strcmp( funcname,"ACSendRecalPlayer") ==0) { char *uid, *id; int userfdid, char_num, date, GmCliId, backup_flag; uid = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); userfdid = saacproto_demkstr_int(saacproto.token_list[3]); GmCliId = saacproto_demkstr_int(saacproto.token_list[4]); id = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); char_num = saacproto_demkstr_int(saacproto.token_list[6]); date = saacproto_demkstr_int(saacproto.token_list[7]); backup_flag = saacproto_demkstr_int(saacproto.token_list[8]); saacproto_ACRecalPlayer_recv(fd, uid, userfdid, GmCliId, id, char_num, date, backup_flag); return 0; } if (strcmp( funcname,"ACSendRecalBackup") ==0) { char *uid, *id, *char_data; int userfdid, char_num, date, GmCliId, backup_flag; uid = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); userfdid = saacproto_demkstr_int(saacproto.token_list[3]); GmCliId = saacproto_demkstr_int(saacproto.token_list[4]); id = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); char_num = saacproto_demkstr_int(saacproto.token_list[6]); date = saacproto_demkstr_int(saacproto.token_list[7]); char_data = saacproto_wrapStringAddr( saacproto_stringwrapper[7] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[8] )); backup_flag = saacproto_demkstr_int(saacproto.token_list[9]); saacproto_ACRecalBackup_recv(fd, uid, userfdid, GmCliId, id, char_num, date, char_data, backup_flag); return 0; } #endif // end RECAL_ASK_PLAYER #ifdef _AUCTIONEER if (strcmp( funcname,"ACAuctionSold") == 0){ char *data; data = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); saacproto_ACAuctionSold_recv(fd, data); return 0; } #endif #ifdef _NEW_PLAYERGOLD if (strcmp( funcname,"ACNewPlayerList") == 0){ int RunType=-1, userIndex=-1; char *CdKey, *UserName; CdKey = saacproto_wrapStringAddr(saacproto_stringwrapper[1], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[2])); UserName = saacproto_wrapStringAddr(saacproto_stringwrapper[2], saacproto.workbufsize, saacproto_demkstr_string(saacproto.token_list[3])); userIndex = saacproto_demkstr_int(saacproto.token_list[4]); RunType = saacproto_demkstr_int(saacproto.token_list[5]); saacproto_ACNewPlayerList_recv( fd, CdKey, UserName, userIndex, RunType); return 0; } #endif #ifdef _DEFEND_NEWUSERS if( strcmp( funcname , "DEFENDLISTS" ) == 0 ){ char* data; int type; type = saacproto_demkstr_int(saacproto.token_list[2]); data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); saacproto_DefendList_recv( fd, type, data); return 0; } if( strcmp( funcname , "CHECKDEFENDSCORE" ) == 0 ){ char *cdkey, *name; int userindex; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); name = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); userindex = saacproto_demkstr_int(saacproto.token_list[4]); saacproto_CheckDefendScore_recv( fd, userindex, cdkey, name); return 0; } #endif #ifdef _CHAR_POOLITEM if( strcmp( funcname , "ACInsertPoolItem" ) == 0 ){ char *cdkey, *Pooldataarg; int clifdid, userindex; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); Pooldataarg = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); userindex = saacproto_demkstr_int( saacproto.token_list[4] ); clifdid = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_ACCharInsertPoolItem_recv( fd, cdkey, userindex, clifdid, Pooldataarg); return 0; } if( strcmp( funcname , "ACSavePoolItem" ) == 0 ){ char *cdkey, *Pooldataarg; int clifdid, userindex; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); Pooldataarg = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); userindex = saacproto_demkstr_int( saacproto.token_list[4] ); clifdid = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_ACCharSavePoolItem_recv( fd, cdkey, userindex, clifdid, Pooldataarg); return 0; } if( strcmp( funcname , "ACGetPoolItem" ) == 0 ){ char *cdkey; int clifdid, userindex, npcid; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); userindex = saacproto_demkstr_int( saacproto.token_list[3] ); clifdid = saacproto_demkstr_int( saacproto.token_list[4] ); npcid = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_ACCharGetPoolItem_recv( fd, cdkey, userindex, clifdid, npcid); return 0; } #endif #ifdef _CHAR_POOLPET if( strcmp( funcname , "ACInsertPoolPet" ) == 0 ){ char *cdkey, *Pooldataarg; int clifdid, userindex; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); Pooldataarg = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); userindex = saacproto_demkstr_int( saacproto.token_list[4] ); clifdid = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_ACCharInsertPoolPet_recv( fd, cdkey, userindex, clifdid, Pooldataarg); return 0; } if( strcmp( funcname , "ACSavePoolPet" ) == 0 ){ char *cdkey, *Pooldataarg; int clifdid, userindex; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); Pooldataarg = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); userindex = saacproto_demkstr_int( saacproto.token_list[4] ); clifdid = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_ACCharSavePoolPet_recv( fd, cdkey, userindex, clifdid, Pooldataarg); return 0; } if( strcmp( funcname , "ACGetPoolPet" ) == 0 ){ char *cdkey; int clifdid, userindex, npcid; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); userindex = saacproto_demkstr_int( saacproto.token_list[3] ); clifdid = saacproto_demkstr_int( saacproto.token_list[4] ); npcid = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_ACCharGetPoolPet_recv( fd, cdkey, userindex, clifdid, npcid); return 0; } #endif #ifdef _UNIVERSE_CHATROOM if( strcmp( funcname , "ACUniChatroom" ) == 0 ){ char *cdkey, *data; int clifdid, userindex; cdkey = saacproto_wrapStringAddr( saacproto_stringwrapper[1] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[2] )); data = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); userindex = saacproto_demkstr_int( saacproto.token_list[4] ); clifdid = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_ACUniChatroom_recv( fd, cdkey, data, userindex, clifdid ); return 0; } #endif #ifdef _ANGEL_SUMMON if( strcmp( funcname , "ACMissionTable" ) == 0 ){ int num; int type; char* data; //int charaindex; char* angelinfo; num = saacproto_demkstr_int( saacproto.token_list[2] ); type = saacproto_demkstr_int( saacproto.token_list[3] ); data = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); //charaindex = saacproto_demkstr_int( saacproto.token_list[5] ); angelinfo = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); saacproto_ACMissionTable_recv( fd, num, type, data, angelinfo); return 0; } #endif #ifdef _TEACHER_SYSTEM if( strcmp( funcname , "ACCheckCharacterOnLine" ) == 0 ){ int charaindex,flag; char *id; char *name; charaindex = saacproto_demkstr_int( saacproto.token_list[2] ); id = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); name = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); flag = saacproto_demkstr_int( saacproto.token_list[5] ); saacproto_ACCheckCharacterOnLine_recv(fd,charaindex,id,name,flag); return 0; } #endif #ifdef _RACEMAN if( strcmp( funcname , "ACRaceRecordandSort" ) == 0 ){ int charaindex,racetype,catchcnt,ranknum; char *id; char *name; char *code; charaindex = saacproto_demkstr_int( saacproto.token_list[2] ); code = saacproto_wrapStringAddr( saacproto_stringwrapper[2] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[3] )); id = saacproto_wrapStringAddr( saacproto_stringwrapper[3] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[4] )); name = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); racetype = saacproto_demkstr_int( saacproto.token_list[6] ); catchcnt = saacproto_demkstr_int( saacproto.token_list[7] ); //玩家目前抓多少只 ranknum = saacproto_demkstr_int( saacproto.token_list[8] ); //server要排名到几个 saacproto_ACRaceRecordandSort_recv( fd , charaindex , code , id , name , racetype , catchcnt ,ranknum ); return 0; } if( strcmp( funcname , "ACRaceRecordfmdo" ) == 0 ){ int charaindex; int fmid , bbi; char *unicode , *petname; charaindex = saacproto_demkstr_int( saacproto.token_list[2] ); fmid = saacproto_demkstr_int( saacproto.token_list[3] ); bbi = saacproto_demkstr_int( saacproto.token_list[4] ); unicode = saacproto_wrapStringAddr( saacproto_stringwrapper[4] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[5] )); petname = saacproto_wrapStringAddr( saacproto_stringwrapper[5] , saacproto.workbufsize , saacproto_demkstr_string( saacproto.token_list[6] )); saacproto_ACRaceRecordfmdo_recv( fd , charaindex , fmid , bbi , unicode , petname ); return 0; } #endif sprintf( debugfun, "%s", funcname); return -1; } void saacproto_ACServerLogin_send( int fd,char* result,char* data ) { saacproto_CreateHeader( saacproto.work , "ACServerLogin" ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( result ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( data ) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work ); } void saacproto_ACCharList_send( int fd,char* result,char* output,int id ) { saacproto_CreateHeader( saacproto.work , "ACCharList" ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( result ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( output ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( id ) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work ); } static int CharDataLens = 0; #ifdef _NewSave void saacproto_ACCharLoad_send( int fd,char* result,char* data,int id,int charindex ) #else void saacproto_ACCharLoad_send( int fd,char* result,char* data,int id ) #endif { if( strstr( result, "successful") != NULL && strlen( data) > CharDataLens ){ CharDataLens = strlen( data); //andy_log log("最大数据长度:%d\n", CharDataLens ); } saacproto_CreateHeader( saacproto.work , "ACCharLoad" ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( result ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( data ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( id ) ,saacproto.workbufsize ); #ifdef _NewSave saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( charindex ) ,saacproto.workbufsize ); #endif saacproto_Send( fd , saacproto.work ); } #ifdef _RELOGIN void saacproto_ACCharLoadII_send( int fd,char* result,char* data,int id,int charindex,int gs1,int gs2 ) { saacproto_CreateHeader( saacproto.work , "ACCharLoadII" ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( result ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( data ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( id ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( charindex ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( gs1 ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( gs2 ) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work ); } #endif /* 214 :