本文整理汇总了C++中NPC_Util_GetStrFromStrWithDelim函数的典型用法代码示例。如果您正苦于以下问题:C++ NPC_Util_GetStrFromStrWithDelim函数的具体用法?C++ NPC_Util_GetStrFromStrWithDelim怎么用?C++ NPC_Util_GetStrFromStrWithDelim使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NPC_Util_GetStrFromStrWithDelim函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NPC_FmLetterInit
/*********************************
* 賡渝質
*********************************/
BOOL NPC_FmLetterInit( int meindex )
{
char argstr1[NPC_UTIL_GETARGSTR_BUFSIZE];
char *argstr;
char buf[1024];
//int i;
//char secondToken[1024];
// Robin test
// print(" fmleter_Init ");
argstr = NPC_Util_GetArgStr( meindex, argstr1, sizeof( argstr1));
if( NPC_Util_GetStrFromStrWithDelim( argstr, "conff", buf, sizeof( buf))
== NULL )
{
print( "fmletter:沒有指定設定的檔案 。\n");
return FALSE;
}
/* 賡渝凜卞澀爛犯□正毛民尼永弁仄化支月 */
if( !NPC_FmLetter_readData( meindex, -1, TRUE) ) {
return FALSE;
}
CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_TYPEWINDOWMAN );
return TRUE;
}
示例2: strlen
/*------------------------------------------------------------------------
* 婁醒井日丟永本□斥毛潸 允月
*----------------------------------------------------------------------*/
static char *NPC_Sysinfo_GetMsg( int meindex, char *msgindexstr,
char *out,int outlen, int num )
{
char argstr1[NPC_UTIL_GETARGSTR_BUFSIZE];
char *argstr;
char *work;
char *buff;
char *cret = NULL;
int worklen;
worklen = strlen( msgindexstr)+3;
work = (char *)calloc( 1, worklen * sizeof( char));
buff = (char *)calloc( 1, outlen * sizeof( char));
argstr = NPC_Util_GetArgStr( meindex, argstr1, sizeof( argstr1));
snprintf( work, worklen, "%s%d", msgindexstr, num);
if( NPC_Util_GetStrFromStrWithDelim( argstr, work,
buff, outlen) != NULL )
{
strcpy( out, buff);
cret = out;
}
free( work);
free( buff);
return( cret);
}
示例3: NPC_LuckyDisp
void NPC_LuckyDisp(int meindex,int talker)
{
char argstr1[NPC_UTIL_GETARGSTR_BUFSIZE];
char *argstr;
char buf[16];
char token[1024];
char buf2[512];
int i = 1;
/*--ÀßÄê¥Õ¥¡¥¤¥ë¤ò ¤ß ¤ß--*/
if((argstr = NPC_Util_GetArgStr( meindex, argstr1, sizeof( argstr1)))== NULL) {
print("NPC_Savepoint.c Init: GetArgStrErr");
return;
}
/*--±¿¤ò¸«¤ë--*/
sprintf( buf, "luck%d", CHAR_getInt( talker, CHAR_LUCK));
NPC_Util_GetStrFromStrWithDelim( argstr, buf, buf2, sizeof( buf2));
while(getStringFromIndexWithDelim( buf2, ",", i, token, sizeof( token))
!= FALSE)
{
i++;
}
i--;
i = rand()%i + 1;
/*--¥é¥ó¥À¥à¤Ç¥á¥Ã¥»¡¼¥¸¤ò ¼¨¤µ¤»¤ë--*/
getStringFromIndexWithDelim( buf2,",", i, token, sizeof( token));
NPC_LuckyMan_selectWindow( meindex, talker, 1, token);
}
示例4: NPC_WarpPointGet
/*
*��������ëGET���£�
*/
void NPC_WarpPointGet(int meindex,int talker,int *fl,int *x,int *y,int judge)
{
char argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
char *strbuf[2] = {"WinWarp","LoseWarp"};
char buf[64];
char buf2[32];
/*--ɬ�ð����̻�ë �� ��--*/
if(NPC_Util_GetArgStr( meindex, argstr, sizeof(argstr))==NULL){
print("NPC_janken Init: GetArgStrErr");
return ;
}
/*--��������� --*/
NPC_Util_GetStrFromStrWithDelim( argstr, strbuf[judge], buf, sizeof( buf));
getStringFromIndexWithDelim(buf,",",1,buf2,sizeof(buf2));
*fl=atoi(buf2);
getStringFromIndexWithDelim(buf,",",2,buf2,sizeof(buf2));
*x=atoi(buf2);
getStringFromIndexWithDelim(buf,",",3,buf2,sizeof(buf2));
*y=atoi(buf2);
}
示例5: NPC_QuizItemFullCheck
BOOL NPC_QuizItemFullCheck(int meindex,int talker)
{
int i;
int itemindex;
char argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
char buf2[32];
for( i = CHAR_STARTITEMARRAY ; i < CHAR_MAXITEMHAVE ; i++ ) {
itemindex = CHAR_getItemIndex( talker , i );
if( !ITEM_CHECKINDEX( itemindex) ) {
return TRUE;
}
}
if(NPC_Util_GetArgStr( meindex, argstr, sizeof( argstr)) == NULL)
{
print("GetArgstrErr:Quiz %s",CHAR_getChar( meindex, CHAR_NAME));
}
if(NPC_Util_GetStrFromStrWithDelim( argstr,"EntryItem", buf2, sizeof( buf2)) != NULL)
{
if(NPC_EntryItemCheck( talker, buf2) == FALSE) {
NPC_Quiz_selectWindow( meindex, talker, 3);
return FALSE;
} else {
return TRUE;
}
}
return FALSE;
}
示例6: NPC_PetSkillShopInit
BOOL NPC_PetSkillShopInit( int meindex )
{
char argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
char msg[256];
CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_TYPESTONESHOP );
if(NPC_Util_GetArgStr( meindex, argstr, sizeof(argstr))==NULL){
print("GetArgStrErr");
return FALSE;
}
if( NPC_Util_GetStrFromStrWithDelim( argstr, "pet_skill", msg, sizeof( msg)) != NULL){
char buf[256], filename[256];
int k=1, skillID, skillarray;
while( getStringFromIndexWithDelim( msg, ",", k, buf, sizeof( buf) ) ){
k++;
skillID=atoi(buf);
skillarray = PETSKILL_getPetskillArray( skillID);
if( PETSKILL_CHECKINDEX( skillarray) == FALSE ) continue;
if( PETSKILL_getInt( skillarray, PETSKILL_ILLEGAL) == 1){
if( NPC_Util_CheckAssignArgFile( meindex, filename) != NULL ){
print("PetSkillShop illegal skill:[%d-%s] ->file:%s",
skillID,
PETSKILL_getChar( skillarray, PETSKILL_NAME),
filename );
}
}
}
}else{
return FALSE;
}
return TRUE;
}
示例7: NPC_BusSetPoint
/**************************************
* �ݼ�����ë����������
**************************************/
static int NPC_BusSetPoint( int meindex, char *argstr)
{
char buf[4096];
char buf2[256];
char buf3[256];
int ret;
char routetostring[64];
snprintf( routetostring, sizeof( routetostring), "routeto%d",
CHAR_getWorkInt( meindex, NPC_WORK_CURRENTROUTE));
if( NPC_Util_GetStrFromStrWithDelim( argstr, routetostring,buf, sizeof(buf))
== NULL )
{
print( "npcbus:nothing route \n");
return FALSE;
}
ret = getStringFromIndexWithDelim( buf, ";",
CHAR_getWorkInt( meindex, NPC_WORK_ROUTEPOINT),
buf2, sizeof(buf2));
if( ret == FALSE ) return FALSE;
ret = getStringFromIndexWithDelim( buf2, ",", 1,
buf3, sizeof(buf3));
if( ret == FALSE) return FALSE;
CHAR_setWorkInt( meindex, NPC_WORK_ROUTETOX, atoi( buf3));
ret = getStringFromIndexWithDelim( buf2, ",", 2,
buf3, sizeof(buf3));
if( ret == FALSE) return FALSE;
CHAR_setWorkInt( meindex, NPC_WORK_ROUTETOY, atoi( buf3));
return TRUE;
}
示例8: NPC_RidermanInit
BOOL NPC_RidermanInit( int meindex )
{
char argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
char buf[1024];
//int i;
//char secondToken[1024];
// Robin test
// print(" riderman_Init ");
NPC_Util_GetArgStr( meindex, argstr, sizeof( argstr));
if( NPC_Util_GetStrFromStrWithDelim( argstr, "conff", buf, sizeof( buf))== NULL )
{
print( "riderman:没有指定设定的档案 。\n");
return FALSE;
}
/* 赓渝凛卞涩烂犯□正毛民尼永弁仄化支月 */
if( !NPC_Riderman_readData( meindex, -1, TRUE) ) {
return FALSE;
}
CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_TYPEWINDOWMAN );
return TRUE;
}
示例9: NPC_ActionTalked
/*********************************
* �ƾ�����ľ���ݼ���
*********************************/
void NPC_ActionTalked( int meindex , int talkerindex , char *szMes ,
int color )
{
char argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
char buf[64];
/* �����������帲�ƻ����� ɱ���� */
if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
return;
}
/* ��������� ���� */
if( !NPC_Util_charIsInFrontOfChar( talkerindex, meindex, 1 )) return;
NPC_Util_GetArgStr( meindex, argstr, sizeof( argstr));
if( NPC_Util_GetStrFromStrWithDelim( argstr,
"normal",
buf, sizeof( buf))
!= NULL )
{
CHAR_talkToCli( talkerindex, meindex ,buf ,
CHAR_getWorkInt( meindex, CHAR_WORK_MSGCOLOR ));
}
}
示例10: NPC_WindowmanInit
/*********************************
* ½é´ü½è
*********************************/
BOOL NPC_WindowmanInit( int meindex )
{
char argstr1[NPC_UTIL_GETARGSTR_BUFSIZE];
char *argstr;
char buf[1024];
//int i;
//char secondToken[1024];
argstr = NPC_Util_GetArgStr( meindex, argstr1, sizeof( argstr1));
if( NPC_Util_GetStrFromStrWithDelim( argstr, "conff", buf, sizeof( buf))
== NULL )
{
print( "windowman:¨S¦³«ü©w³]©wªºÀÉ®× ¡C\n");
return FALSE;
}
/* ½é´ü»þ¤ËÀßÄê¥Ç¡¼¥¿¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤ä¤ë */
if( !NPC_Windowman_readData( meindex, -1, TRUE) ) {
return FALSE;
}
CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_TYPEWINDOWMAN );
return TRUE;
}
示例11: NPC_LuckyDisp
void NPC_LuckyDisp(int meindex,int talker)
{
char argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
char buf[16];
char token[1024];
char buf2[512];
int i = 1;
/*--ɬÀð×ÑëÄÌ»ïë ÐÄ ÐÄ--*/
if(NPC_Util_GetArgStr( meindex, argstr, sizeof( argstr)) == NULL) {
print("NPC_Savepoint.c Init: GetArgStrErr");
return;
}
/*--ÞÑëÎÔÂ--*/
sprintf( buf, "luck%d", CHAR_getInt( talker, CHAR_LUCK));
NPC_Util_GetStrFromStrWithDelim( argstr, buf, buf2, sizeof( buf2));
while(getStringFromIndexWithDelim( buf2, ",", i, token, sizeof( token))
!= FALSE)
{
i++;
}
i--;
i = rand()%i + 1;
/*--·Â¼þĸةƥ¶ªÓÀ±¾¡õ³âë Ô÷½ñÁùÔÂ--*/
getStringFromIndexWithDelim( buf2,",", i, token, sizeof( token));
NPC_LuckyMan_selectWindow( meindex, talker, 1, token);
}
示例12: VipShop_GetMenuStr
BOOL VipShop_GetMenuStr( int meindex, int toindex, char *npcarg, char *token,int index )
{
char buf1[1024], buf2[32], buf3[36];
BOOL FINDS=FALSE;
int talkNo=index*7+1;
if( npcarg == NULL ) return FALSE;
sprintf( token, "你当前的积分是:%d %d/%d页\n",sasql_ampoint(CHAR_getUseID(toindex),0,0), index+1, page);
while( getStringFromIndexWithDelim( npcarg,"}",talkNo, buf1, sizeof( buf1)) != FALSE ) {
talkNo++;
memset( buf2, 0, sizeof( buf2));
if( NPC_Util_GetStrFromStrWithDelim( buf1, "MenuStr", buf2, sizeof( buf2)) == NULL )
continue;
FINDS = TRUE;
sprintf( buf3, " %s", buf2);
if(strlen(buf3)<10)
strcat( buf3, " \n");
else
strcat( buf3, "\n");
strcat( token, buf3);
if(talkNo>(index*7+8))return FINDS;
}
return FINDS;
}
示例13: NPC_BusCheckDeniedItem
/**************************************
* ϶�ý�ľ��ʧ�� ةë �Ȼ����¾�������������
* �Ȼ������շֻ�
**************************************/
static BOOL NPC_BusCheckDeniedItem( int meindex, int charaindex, char *argstr)
{
char buf[1024];
BOOL found = TRUE;
if( NPC_Util_GetStrFromStrWithDelim( argstr, "denieditem", buf, sizeof( buf))
!= NULL )
{
int i;
int ret;
for( i = 1; ; i ++) {
int itemid;
char buf2[64];
int j;
ret = getStringFromIndexWithDelim( buf, ",", i, buf2, sizeof(buf2));
if( ret == FALSE ) break;
itemid = atoi( buf2);
for( j = 0; j < CHAR_MAXITEMHAVE; j ++) {
int itemindex = CHAR_getItemIndex( charaindex, j);
if( ITEM_CHECKINDEX( itemindex)) {
if( ITEM_getInt( itemindex, ITEM_ID) == itemid) {
found = FALSE;
break;
}
}
}
}
}
return found;
}
示例14: NPC_FreePetSkillShopInit
BOOL NPC_FreePetSkillShopInit( int meindex )
{
char npcarg[NPC_UTIL_GETARGSTR_BUFSIZE];
char msg[256];
CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_FREESKILLSHOP );
CHAR_setWorkInt( meindex, CHAR_WORK_SKILLSELECT, 0);
if(NPC_Util_GetArgStr( meindex, npcarg, sizeof(npcarg))==NULL){
print("GetArgStrErr NO arg !!");
return FALSE;
}
if( NPC_Util_GetStrFromStrWithDelim( npcarg, "pet_skill", msg, sizeof( msg)) != NULL){
char buf[256], filename[256];
int k=1, skillID, skillarray;
while( getStringFromIndexWithDelim( msg, ",", k, buf, sizeof( buf) ) ){
k++;
skillID=atoi(buf);
skillarray = PETSKILL_getPetskillArray( skillID);
if( PETSKILL_CHECKINDEX( skillarray) == FALSE ) continue;
if( PETSKILL_getInt( skillarray, PETSKILL_ILLEGAL) == 1){
if( NPC_Util_CheckAssignArgFile( meindex, filename) != NULL ){
print("\n宠物技能不规范:[%d-%s] ->文件:%s\n",
skillID,
PETSKILL_getChar( skillarray, PETSKILL_NAME),
filename );
}
}
}
}else{
return FALSE;
}
return TRUE;
}
示例15: NPC_AirSetPoint
/**************************************
* 戚及樺赭毛本永玄允月
**************************************/
static int NPC_AirSetPoint( int meindex, char *argstr)
{
char buf[4096];
char buf2[256];
char buf3[256];
int floor,warpx,warpy;
int ret;
char routetostring[64];
snprintf( routetostring, sizeof( routetostring), "routeto%d",
CHAR_getWorkInt( meindex, NPC_WORK_CURRENTROUTE));
if( NPC_Util_GetStrFromStrWithDelim( argstr, routetostring,buf, sizeof(buf))
== NULL )
{
print( "npcair:nothing route \n");
return FALSE;
}
ret = getStringFromIndexWithDelim( buf, ";",
CHAR_getWorkInt( meindex, NPC_WORK_ROUTEPOINT),
buf2, sizeof(buf2));
if( ret == FALSE ) return FALSE;
// Arminius: add floor
ret = getStringFromIndexWithDelim( buf2, ",", 1,
buf3, sizeof(buf3));
if( ret == FALSE) return FALSE;
floor = atoi(buf3);
ret = getStringFromIndexWithDelim( buf2, ",", 2,
buf3, sizeof(buf3));
if( ret == FALSE) return FALSE;
CHAR_setWorkInt( meindex, NPC_WORK_ROUTETOX, atoi( buf3));
warpx = atoi(buf3);
ret = getStringFromIndexWithDelim( buf2, ",", 3,
buf3, sizeof(buf3));
if( ret == FALSE) return FALSE;
CHAR_setWorkInt( meindex, NPC_WORK_ROUTETOY, atoi( buf3));
warpy = atoi(buf3);
if (floor!=CHAR_getInt(meindex, CHAR_FLOOR)) {
int i;
CHAR_warpToSpecificPoint(meindex, floor, warpx, warpy);
for( i = 1; i < CHAR_PARTYMAX; i ++ ) {
int toindex = CHAR_getWorkInt( meindex, i + CHAR_WORKPARTYINDEX1);
if( CHAR_CHECKINDEX(toindex) ) {
CHAR_warpToSpecificPoint(toindex, floor, warpx, warpy);
}
}
CHAR_setWorkInt( meindex, NPC_WORK_ROUTETOX, warpx);
CHAR_setWorkInt( meindex, NPC_WORK_ROUTETOY, warpy);
}
return TRUE;
}