名片系统修复

2021-07-09 15:22:07  阅读 19970 次 评论 0 条

早期的石器时代名片系统是有bug的,下面是修复代码


打开 addressbook.c 搜索ADDRESSBOOK_sendAddressbookTable

将下面这段函数替换了就OK了。

C
BOOL ADDRESSBOOK_sendAddressbookTable( int cindex ){int stringlen=0;int i;if( !CHAR_CHECKINDEX( cindex ) )return FALSE;for( i=0 ; i<ADDRESSBOOK_MAX ; i++){
  ADDRESSBOOK_entry *ae;
  ae = CHAR_getAddressbookEntry( cindex , i );
  if( ae && ae->use ){
   char tmp[CHARNAMELEN+32];
   char charname_escaped[CHARNAMELEN*2];
   makeEscapeString( ae->charname, charname_escaped ,
         sizeof(charname_escaped  ));
   /*  银迕白仿弘|  蟆|伊矛伙|仿奶白|白仿弘   */
   snprintf( tmp , sizeof( tmp ),
       "%d|%s|%d|%d|%d|%d|%d||" ,
       ae->use,
       charname_escaped , ae->level , 
       ae->duelpoint,ae->online,ae->graphicsno,
       ae->transmigration);
   strcpysafe  ( ADDRESSBOOK_returnstring + stringlen ,
        sizeof(ADDRESSBOOK_returnstring) - stringlen,
        tmp );
   stringlen += strlen( tmp );
   if( stringlen >= sizeof(ADDRESSBOOK_returnstring) ) {
    break;
   }
  }else{
   /*银匀化卅中犯□正手冲徇及心匹霜月  */
   char    tmp[32];
   snprintf( tmp , sizeof( tmp ), "||||||||"  );
   strcpysafe  ( ADDRESSBOOK_returnstring + stringlen ,
        sizeof(ADDRESSBOOK_returnstring) - stringlen,
        tmp );
   stringlen += strlen( tmp );
   if( stringlen >= sizeof(ADDRESSBOOK_returnstring)) {
    break;
   }
  }}dchop( ADDRESSBOOK_returnstring, "|" );{
  int fd;
  fd = getfdFromCharaIndex( cindex );
  if( fd == -1 ) return FALSE;
  lssproto_AB_send( fd, ADDRESSBOOK_returnstring );}return TRUE;}



本文地址:https://stoneagem.com.cn/shiqi3357.html
版权声明:本文为原创文章,版权归 网站编辑 所有,欢迎分享本文,转载请保留出处!

评论已关闭!