//GM踢人 void mproto_WaeiKick_Recv(int fd,char* uid,int userfdid) { int fd_charaindex; int clifd=getfdFromFdid(userfdid); if (clifd == -1) return; if (uid == NULL ) return; fd_charaindex = CONNECT_getCharaindex(clifd); if (!CHAR_CHECKINDEX(fd_charaindex)) return; CHAR_talkToCli( fd_charaindex, -1, "由於捣乱,被GM踢除", CHAR_COLORYELLOW); CHAR_CHAT_DEBUG_gmkick( -1, CHAR_getChar( fd_charaindex, CHAR_CDKEY)); }
void mproto_WARP_Recv(int fd,char* uid,int userfdid,int floor, int x, int y) { int fd_charaindex; int clifd=getfdFromFdid(userfdid); print("clifd =%d\n",clifd); if (clifd == -1) return ; if (uid == NULL ) return ; fd_charaindex=CONNECT_getCharaindex(clifd); if (!CHAR_CHECKINDEX(fd_charaindex)) return; CHAR_warpToSpecificPoint(fd_charaindex, floor, x, y); }
//GM禁言 void mproto_NoTalk_Recv(int fd,char* uid,int userfdid,int nTime) { int fd_charaindex; int clifd=getfdFromFdid(userfdid); print("clifd =%d\n",clifd); if (clifd == -1) return ; if (uid == NULL ) return ; fd_charaindex=CONNECT_getCharaindex(clifd); if (!CHAR_CHECKINDEX(fd_charaindex)) return; CHAR_setInt( fd_charaindex,CHAR_SILENT, nTime ); CHAR_setWorkInt( fd_charaindex, CHAR_WORKLOGINTIME, (int)NowTime.tv_sec ); CHAR_talkToCli( fd_charaindex, -1, "由於捣乱,被GM禁言10到30分钟", CHAR_COLORYELLOW); CHAR_setWorkInt(fd_charaindex, CHAR_WORKTALKCOUNT, 0 ); }
//GM回覆问题 void mproto_Que_Recv(int fd,char* uid,int userfdid,char* ans) { int fd_charaindex; char sGM[256]; int clifd=getfdFromFdid(userfdid); if (clifd == -1) return ; if (ans == NULL || uid==NULL) return; sprintf(sGM,"GM[%s]为你解答如下:",uid); fd_charaindex = CONNECT_getCharaindex( clifd ); if (!CHAR_CHECKINDEX(fd_charaindex)) return; CHAR_talkToCli(fd_charaindex, -1, sGM, CHAR_COLORYELLOW); CHAR_talkToCli(fd_charaindex, -1, ans, CHAR_COLORWHITE); return; }
//GM讯息 void mproto_Message_Recv(int fd,char* uid,int userfdid,char* ans) { int fd_charaindex; char sGM[256]; int clifd=getfdFromFdid(userfdid); if (clifd == -1) return ; if (ans == NULL || uid==NULL) return; if( !strcmp( uid, "无") ) { sprintf( sGM, "%s", ans); }else{ sprintf( sGM, "GM[%s]讯息:%s", uid, ans); } fd_charaindex = CONNECT_getCharaindex( clifd ); if (!CHAR_CHECKINDEX(fd_charaindex)) return; CHAR_talkToCli(fd_charaindex, -1, sGM, CHAR_COLORRED); return; }
void NPC_Duelranking_PrintRanking( char *data, int count_start, int fdid, int msgid2) { char message[1024]; char buf[2048]; int i; int cnt = 0; int button = 0; int fd = getfdFromFdid( fdid); if( fd == -1 ) return; message[0] = '\0'; snprintf( message, sizeof( message), " 世界的强者们\n\n" " Rank DuelPoint Lv Name\n\n" ); for( i = 1; ; i ++ ) { char rankdata[256]; char cdandname[64]; char charaname[32]; char rank[16]; char score[64]; char msgbuf[512]; char cdkey[32]; char lv[16]; char hosi[6]; if( !getStringFromIndexWithDelim( data, "|", i, rankdata, sizeof( rankdata))) { break; } if( !getStringFromIndexWithDelim( rankdata, ",", 2, rank, sizeof( rank)) ){ continue; } if( !getStringFromIndexWithDelim( rankdata, ",", 3, cdandname, sizeof( cdandname)) ){ continue; } makeStringFromEscaped( cdandname); if( !getStringFromIndexWithDelim( cdandname, "_", 1, cdkey, sizeof( cdkey)) ){ continue; } if( !getStringFromIndexWithDelim( cdandname, "_", 2, charaname, sizeof( charaname)) ){ continue; } if( !getStringFromIndexWithDelim( rankdata, ",", 4, score, sizeof( score)) ){ continue; } if( !getStringFromIndexWithDelim( rankdata, ",", 5, lv, sizeof( lv)) ){ lv[0] = '\0'; } { char *mycdkey = CHAR_getChar( CONNECT_getCharaindex(fd), CHAR_CDKEY); char *myname = CHAR_getChar( CONNECT_getCharaindex(fd), CHAR_NAME); char engnum[4][3] = { "st","nd","rd","th"}; int dsprank = atoi(rank); if( dsprank > 3) dsprank = 3; if( mycdkey != NULL && myname != NULL && strcmp( cdkey, mycdkey) == 0 && strcmp( charaname, myname) == 0 ) { strcpy( hosi, "★"); }else { strcpy( hosi, " "); } snprintf( msgbuf, sizeof( msgbuf), "%s %5d%s %10s %3s %s\n", hosi, atoi(rank)+1, engnum[dsprank], score, lv, charaname ); } strcatsafe( message, sizeof( message), msgbuf); cnt ++; } if( cnt == 0 ) { strcpy( message, "\n 没有其他的资料了。"); button = WINDOW_BUTTONTYPE_PREV|WINDOW_BUTTONTYPE_OK; }else if( cnt < NPC_DUELRANKING_WINDOWLINENUM ) { if( count_start >= NPC_DUELRANKING_WINDOWLINENUM) { button = WINDOW_BUTTONTYPE_OK | WINDOW_BUTTONTYPE_PREV; }else { button = WINDOW_BUTTONTYPE_OK; } }else if( count_start == 0 ) { button = WINDOW_BUTTONTYPE_NEXT|WINDOW_BUTTONTYPE_OK; }else { button = WINDOW_BUTTONTYPE_NEXT|WINDOW_BUTTONTYPE_PREV|WINDOW_BUTTONTYPE_OK; } lssproto_WN_send( fd, WINDOW_MESSAGETYPE_WIDEMESSAGEANDLINEINPUT, button, CHAR_WINDOWTYPE_DUELRANKING_TOPRANKING, msgid2, makeEscapeString( message, buf, sizeof(buf))); if( cnt == 0 ) { CHAR_setWorkInt( CONNECT_getCharaindex(fd), CHAR_WORKSHOPRELEVANT, -1); }else { CHAR_setWorkInt( CONNECT_getCharaindex(fd), CHAR_WORKSHOPRELEVANT, count_start); } }