?? saacproto_serv.c
字號:
saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}/*552 : <LI><a name="DBGetEntryByRankS"><font color=blue>servertoclient DBGetEntryByRank( string result , string list , string table, int msgid, int msgid2 );</font></a><BR>553 : DBGetEntryByRank及瑛絆[554 : <dl>555 : <dt>string result556 : <dd>557 : <dt>string list558 : <dd>"RANK,KEY,SCORE,INFO|RANK,KEY,SCORE,INFO|...."<BR>559 : RANK反賜匏匹丐月[KEY反公及賜匏卞卅勻化中月旦戊失毛手勻化中月560 : 平□[SCORE反幫醒襖匹旦戊失匹丐月[561 : [<br>562 : "1,RINGO,123465,data1|2,HOGE,4567,data2|2,FUCK,4567,data3"<BR>563 : 仇及 分午}2匏反2諦中月仇午卞卅月[564 : <dt>string table565 : <dd> □皮伙 566 : <dt>int msgid, int msgid2567 : <dd>568 : </dl>569 : 570 : */void saacproto_DBGetEntryByRank_send( int fd,char* result,char* list,char* table,int msgid,int msgid2 ){ saacproto_CreateHeader( saacproto.work , "DBGetEntryByRank" ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( result ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( list ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}/*583 : <LI><a name="DBGetEntryByCountS"><font color=blue>servertoclient DBGetEntryByCount( string result , string list , string table, int count_start, int msgid, int msgid2 );</font></a><BR>584 : DBGetEntryByCount 及瑛絆[585 : <dl>586 : <dt>string result587 : <dd>SUCCESSFUL/FAILED588 : <dt>string list589 : <dd>請 伉旦玄[1巨件玄伉丐兇曰 "INDEX,RANK,KEY,SCORE,INFO" 及4蜊及樹 590 : 及賺匹丐曰}公木互蜊醒坌 "|" 匹勾卅互月[蜊醒互0及樺寧反591 : 塢 儂 [592 : <dt>int num593 : <dd>中仁勾午曰分允井[1卅日1蜊[2卅日2蜊[594 : <dt>int msgid ,msgid2595 : <dd>丟永本□斥ID. 596 : </dL>597 : */void saacproto_DBGetEntryByCount_send( int fd,char* result,char* list,char* table,int count_start,int msgid,int msgid2 ){ saacproto_CreateHeader( saacproto.work , "DBGetEntryByCount" ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( result ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( list ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( table ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( count_start ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( msgid2 ) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}/*611 : <LI><a name="Broadcast"><font color=blue>servertoclient Broadcast( string id, string charname, string message );</font></a><BR>612 : Broadcast及失市它件玄扔□田□井日必□丞扔□田□尺及霜耨迕613 : <dl>614 : <dt>string id615 : <dd>user ID616 : <dt>string charname617 : <dd>character name618 : <dt>string message619 : <dd>丟永本□斥620 : <dt>int flag621 : <dd>1卞允月午}憤坌卞卞反 霜今木卅中[622 : </dl>623 : */void saacproto_Broadcast_send( int fd,char* id,char* charname,char* message ){ saacproto_CreateHeader( saacproto.work , "Broadcast" ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( message ) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}/*642 : <LI><a name="Message"><font color=blue>servertoclient Message( string id_from, string charname_from, string id_to, string charname_to, string message , int option , int mesgid );</font></a><BR>643 : 失市它件玄扔□田□井日必□丞扔□田□卞丟永本□斥毛霜耨允月[644 : <dl>645 : <dt>string id_from646 : <dd>from ID647 : <dt>string charname_from648 : <dd>from character name649 : <dt>string id_to650 : <dd>to ID651 : <dt>string charname_to652 : <dd>to character name653 : <dt>string message654 : <dd>丟永本□斥及 655 : <dt>int option656 : <dd>左皿撲亦件(曉及楮醒毛輔寰)657 : <dt>int mesgid658 : <dd>丟永本□斥ID 失市它件玄扔□田□及棟 迕659 : </dl>660 : */void saacproto_Message_send( int fd,char* id_from,char* charname_from,char* id_to,char* charname_to,char* message,int option,int mesgid ){ saacproto_CreateHeader( saacproto.work , "Message" ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id_from ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname_from ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( id_to ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( charname_to ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_string( message ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( option ) ,saacproto.workbufsize ); saacproto_strcatsafe( saacproto.work , saacproto_mkstr_int( mesgid ) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}void saacproto_SetServerLogFiles( char *r , char *w ){ saacproto_strcpysafe( saacproto_writelogfilename , w , sizeof(saacproto_writelogfilename )); saacproto_strcpysafe( saacproto_readlogfilename , r , sizeof(saacproto_readlogfilename ));}int saacproto_InitServer( int (*writefunc)(int,char*,int) , int worksiz ){ int i; if( (void*)writefunc == NULL){saacproto.write_func = saacproto_default_write_wrap;} else {saacproto.write_func = writefunc;} saacproto_AllocateCommonWork(worksiz); saacproto_stringwrapper = (char**)calloc( 1,sizeof(char*) * MAXLSRPCARGS); if(saacproto_stringwrapper ==NULL)return -1; memset( saacproto_stringwrapper , 0, sizeof(char*)*MAXLSRPCARGS); for(i=0;i<MAXLSRPCARGS;i++){ saacproto_stringwrapper[i] = (char*)calloc( 1, worksiz ); if( saacproto_stringwrapper[i] == NULL){ for(i=0;i<MAXLSRPCARGS;i++){free( saacproto_stringwrapper[i]);return -1;} } } saacproto.ret_work = (char*)calloc( 1,sizeof( worksiz )); if( saacproto.ret_work == NULL ){ return -1; } return 0;}void saacproto_CleanupServer( void ){ int i; free( saacproto.work ); free( saacproto.arraywork); free( saacproto.escapework ); free( saacproto.val_str); free( saacproto.token_list ); for(i=0;i<MAXLSRPCARGS;i++){free( saacproto_stringwrapper[i]);} free( saacproto_stringwrapper ); free( saacproto.ret_work );}/************************************************************ * CoolFish: Family 2001/5/18 ***********************************************************/// 成立家族void saacproto_ACAddFM_send(int fd, char *result, int fmindex, int index, int charfdid){ saacproto_CreateHeader(saacproto.work , "ACAddFM"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(fmindex) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(index) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charfdid) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 加入家族void saacproto_ACJoinFM_send(int fd, char *result, int recv, int charfdid){ saacproto_CreateHeader(saacproto.work , "ACJoinFM"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(recv) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charfdid) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 退出家族void saacproto_ACLeaveFM_send(int fd, char *result, int resultflag, int charfdid){ saacproto_CreateHeader(saacproto.work , "ACLeaveFM"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(resultflag) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charfdid) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 解散家族void saacproto_ACDelFM_send(int fd, char *result, int charfdid){ saacproto_CreateHeader(saacproto.work , "ACDelFM"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charfdid) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 列出家族列表void saacproto_ACShowFMList_send(int fd, char *result, int num, char *data){ saacproto_CreateHeader(saacproto.work , "ACShowFMList"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(num) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(data) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 列出成員列表void saacproto_ACShowMemberList_send(int fd, char *result, int index, int num, int acceptflag, int fmjoinnum, char *data){ saacproto_CreateHeader(saacproto.work , "ACShowMemberList"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(index) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(num) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(acceptflag) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(fmjoinnum) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(data) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 列出家族詳細資料 void saacproto_ACFMDetail_send(int fd, char *result, char *data, int charfdid){ saacproto_CreateHeader(saacproto.work , "ACFMDetail"); 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(charfdid) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 族長審核成員加入家族void saacproto_ACMemberJoinFM_send(int fd, char *result, int charfdid){ saacproto_CreateHeader(saacproto.work , "ACMemberJoinFM"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charfdid) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 族長審核成員離開家族void saacproto_ACMemberLeaveFM_send(int fd, char *result, int charfdid){ saacproto_CreateHeader(saacproto.work , "ACMemberLeaveFM"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charfdid) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 加入家族之玩家login#ifdef _PERSONAL_FAME // Arminius: 家族個人聲望void saacproto_ACFMCharLogin_send(int fd, char *result, int index, int floor, int fmpopular, int joinflag, int fmsetupflag, int flag, int charindex, int charfame, int charfdid )#elsevoid saacproto_ACFMCharLogin_send(int fd, char *result, int index, int floor, int fmpopular, int joinflag, int fmsetupflag, int flag, int charindex, int charfdid)#endif{ saacproto_CreateHeader(saacproto.work , "ACFMCharLogin"); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_string(result) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(index) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(floor) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(fmpopular) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(joinflag) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(fmsetupflag) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(flag) ,saacproto.workbufsize ); saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charindex) ,saacproto.workbufsize );#ifdef _PERSONAL_FAME // Arminius: 家族個人聲望 saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charfame) ,saacproto.workbufsize );#endif saacproto_strcatsafe(saacproto.work , saacproto_mkstr_int(charfdid) ,saacproto.workbufsize ); saacproto_Send( fd , saacproto.work );}// 加入家族之玩家logoutvoid saacproto_ACFMCharLogout_send(int fd, char *result, int charfdid){ saacproto_CreateHeader(saacproto.work ,
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -