您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ClientName函数代码示例

51自学网 2021-06-01 20:11:24
  C++
这篇教程C++ ClientName函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ClientName函数的典型用法代码示例。如果您正苦于以下问题:C++ ClientName函数的具体用法?C++ ClientName怎么用?C++ ClientName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ClientName函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: FindClientByName

/*=======================================================================================================================================FindClientByName=======================================================================================================================================*/int FindClientByName(char *name) {	int i;	char buf[MAX_INFO_STRING];	static int maxclients;	if (!maxclients) {		maxclients = trap_Cvar_VariableIntegerValue("sv_maxclients");	}	for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {		ClientName(i, buf, sizeof(buf));		if (!Q_stricmp(buf, name)) {			return i;		}	}	for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {		ClientName(i, buf, sizeof(buf));		if (stristr(buf, name)) {			return i;		}	}	return -1;}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:32,


示例2: FindEnemyByName

/*=======================================================================================================================================FindEnemyByName=======================================================================================================================================*/int FindEnemyByName(bot_state_t *bs, char *name) {	int i;	char buf[MAX_INFO_STRING];	static int maxclients;	if (!maxclients) {		maxclients = trap_Cvar_VariableIntegerValue("sv_maxclients");	}	for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {		if (BotSameTeam(bs, i)) {			continue;		}		ClientName(i, buf, sizeof(buf));		if (!Q_stricmp(buf, name)) {			return i;		}	}	for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {		if (BotSameTeam(bs, i)) {			continue;		}		ClientName(i, buf, sizeof(buf));		if (stristr(buf, name)) {			return i;		}	}	return -1;}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:40,


示例3: server

Bridge::Bridge(ulen num_clients) : server(*this),   clients(DoReserve,num_clients),   masters(DoReserve,num_clients+1),   msem("Bridge"),   mutex("Bridge"),   running(false) {  masters.append_fill(server,ServerName());  for(ulen i=0; i<num_clients ;i++)    {     Client *client=clients.append_fill(*this,i+1);     masters.append_fill(*client,ClientName(i+1).str);    }  drop_rate=0;  drop_den=1;  to_server_format.prefix=11;  to_server_format.max_data=1100;  to_server_format.suffix=10;  to_client_format.prefix=13;  to_client_format.max_data=1000;  to_client_format.suffix=15; }
开发者ID:SergeyStrukov,项目名称:CCore-2-99,代码行数:28,


示例4: BotSetTeamMateCTFPreference

/*==================BotGetTeamMateCTFPreference==================*/void BotSetTeamMateCTFPreference(bot_state_t *bs, int teammate, int preference) {    char teammatename[MAX_NETNAME];    ctftaskpreferences[teammate].preference = preference;    ClientName(teammate, teammatename, sizeof(teammatename));    strcpy(ctftaskpreferences[teammate].name, teammatename);}
开发者ID:UberGames,项目名称:RPG-X2-rpgxEF,代码行数:12,


示例5: BotAddressedToBot

/*==================BotAddressedToBot==================*/int BotAddressedToBot(bot_state_t *bs, bot_match_t *match) {	char addressedto[MAX_MESSAGE_SIZE];	char netname[MAX_MESSAGE_SIZE];	//char name[MAX_MESSAGE_SIZE];	char botname[128];	int client;	//char buf[MAX_MESSAGE_SIZE];	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	client = ClientOnSameTeamFromName(bs, netname);	if (client < 0) return qfalse;		//if the message is addressed to someone	if (match->subtype & ST_ADDRESSED) {		// compare addressee with botname		trap_BotMatchVariable(match, ADDRESSEE, addressedto, sizeof(addressedto));		ClientName(bs->client, botname, 128);		// is that me?		if ( strlen(addressedto) && (stristr(botname, addressedto)) ){			return qtrue;		}		// no its not!		if( bot_developer.integer & AIDBG_CHAT){			//Com_sprintf(buf, sizeof(buf), "not addressed to me but %s", addressedto);			//trap_EA_Say(bs->client, buf);		}		return qfalse;	}	// not addressed, take it	return qtrue;}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:40,


示例6: BotChat_HitNoKill

/*==================BotChat_HitNoKill==================*/int BotChat_HitNoKill(bot_state_t *bs) {	char name[32], *weap;	float rnd;	aas_entityinfo_t entinfo;	if (bot_nochat.integer) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	if (BotNumActivePlayers() <= 1) return qfalse;	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_HITNOKILL, 0, 1);	//don't chat in teamplay	if (TeamPlayIsOn()) return qfalse;	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	//if fast chat is off	if (!bot_fastchat.integer) {		if (random() > rnd * 0.5) return qfalse;	}	if (!BotValidChatPosition(bs)) return qfalse;	//	if (BotVisibleEnemies(bs)) return qfalse;	//	BotEntityInfo(bs->enemy, &entinfo);	if (EntityIsShooting(&entinfo)) return qfalse;	//	ClientName(bs->enemy, name, sizeof(name));	weap = BotWeaponNameForMeansOfDeath(g_entities[bs->enemy].client->lasthurt_mod);	//	BotAI_BotInitialChat(bs, "hit_nokill", name, weap, NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:37,


示例7: FindHumanTeamLeader

/*==================FindHumanTeamLeader==================*/int FindHumanTeamLeader(bot_state_t *bs){    int i;    for (i = 0; i < MAX_CLIENTS; i++)    {        if ( g_entities[i].inuse )        {            // if this player is not a bot            if ( !(g_entities[i].r.svFlags & SVF_BOT) )            {                // if this player is ok with being the leader                if (!notleader[i])                {                    // if this player is on the same team                    if ( BotSameTeam(bs, i) )                    {                        ClientName(i, bs->teamleader, sizeof(bs->teamleader));                        // if not yet ordered to do anything                        if ( !BotSetLastOrderedTask(bs) )                        {                            // go on defense by default                            BotVoiceChat_Defend(bs, i, SAY_TELL);                        }                        return qtrue;                    }                }            }        }    }    return qfalse;}
开发者ID:zturtleman,项目名称:recoil,代码行数:37,


示例8: BotMatch_StopTeamLeaderShip

/*=======================================================================================================================================BotMatch_StopTeamLeaderShip=======================================================================================================================================*/void BotMatch_StopTeamLeaderShip(bot_state_t *bs, bot_match_t *match) {	int client;	char teammate[MAX_MESSAGE_SIZE];	char netname[MAX_MESSAGE_SIZE];	if (!TeamPlayIsOn()) {		return;	}	// get the team mate that stops being the team leader	trap_BotMatchVariable(match, TEAMMATE, teammate, sizeof(teammate));	// if chats for him or herself	if (match->subtype & ST_I) {		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		client = FindClientByName(netname);	}	// chats for someone else	else {		client = FindClientByName(teammate);	}	if (client >= 0) {		if (!Q_stricmp(bs->teamleader, ClientName(client, netname, sizeof(netname)))) {			bs->teamleader[0] = '/0';		}	}}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:31,


示例9: BotVoiceChat_StartLeader

/*==================BotVoiceChat_StartLeader==================*/void BotVoiceChat_StartLeader(bot_state_t *bs, int client, int mode) {	/* LQ3A */	UNREFERENCED_PARAMETER(mode);	ClientName(client, bs->teamleader, sizeof(bs->teamleader));}
开发者ID:monoknot,项目名称:loaded-q3a,代码行数:12,


示例10: BotChat_HitTalking

/*==================BotChat_HitTalking==================*/int BotChat_HitTalking(bot_state_t *bs) {	char name[32], *weap;	int lasthurt_client;	float rnd;	if (bot_nochat.integer) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	if (BotNumActivePlayers() <= 1) return qfalse;	lasthurt_client = g_entities[bs->client].client->lasthurt_client;	if (!lasthurt_client) return qfalse;	if (lasthurt_client == bs->client) return qfalse;	//	if (lasthurt_client < 0 || lasthurt_client >= MAX_CLIENTS) return qfalse;	//	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_HITTALKING, 0, 1);	//don't chat in teamplay	if (TeamPlayIsOn()) return qfalse;	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	//if fast chat is off	if (!bot_fastchat.integer) {		if (random() > rnd * 0.5) return qfalse;	}	if (!BotValidChatPosition(bs)) return qfalse;	//	ClientName(g_entities[bs->client].client->lasthurt_client, name, sizeof(name));	weap = BotWeaponNameForMeansOfDeath(g_entities[bs->client].client->lasthurt_mod);	//	BotAI_BotInitialChat(bs, "hit_talking", name, weap, NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:38,


示例11: BotChat_HitNoDeath

/*==================BotChat_HitNoDeath==================*/int BotChat_HitNoDeath( bot_state_t *bs ) {	char name[32];    const char* weap;	float rnd;	int lasthurt_client;	aas_entityinfo_t entinfo;	lasthurt_client = g_entities[bs->client].client->lasthurt_client;	if ( !lasthurt_client ) {		return qfalse;	}	if ( lasthurt_client == bs->client ) {		return qfalse;	}	//	if ( lasthurt_client < 0 || lasthurt_client >= MAX_CLIENTS ) {		return qfalse;	}	//	if ( bot_nochat.integer ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_HITNODEATH, 0, 1 );	//don't chat in teamplay	if ( TeamPlayIsOn() ) {		return qfalse;	}	//if fast chat is off	if ( !bot_fastchat.integer ) {		if ( random() > rnd * 0.5 ) {			return qfalse;		}	}	if ( !BotValidChatPosition( bs ) ) {		return qfalse;	}	//if the enemy is visible	if ( BotEntityVisible( bs->client, bs->eye, bs->viewangles, 360, bs->enemy ) ) {		return qfalse;	}	//	BotEntityInfo( bs->enemy, &entinfo );	if ( EntityIsShooting( &entinfo ) ) {		return qfalse;	}	//	ClientName( lasthurt_client, name, sizeof( name ) );	weap = BotWeaponNameForMeansOfDeath( g_entities[bs->client].client->lasthurt_mod );	//	BotAI_BotInitialChat( bs, "hit_nodeath", name, weap, NULL );	bs->lastchat_time = trap_AAS_Time();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:bibendovsky,项目名称:rtcw,代码行数:65,


示例12: BotAddressedToBot

/*==================BotAddressedToBot==================*/int BotAddressedToBot( bot_state_t *bs, bot_match_t *match ) {	char addressedto[MAX_MESSAGE_SIZE];	char netname[MAX_MESSAGE_SIZE];	char name[MAX_MESSAGE_SIZE];	char botname[128];	int client;	bot_match_t addresseematch;	trap_BotMatchVariable( match, NETNAME, netname, sizeof( netname ) );	client = ClientFromName( netname );	if ( client < 0 ) {		return qfalse;	}	if ( !BotSameTeam( bs, client ) ) {		return qfalse;	}	//if the message is addressed to someone	if ( match->subtype & ST_ADDRESSED ) {		trap_BotMatchVariable( match, ADDRESSEE, addressedto, sizeof( addressedto ) );		//the name of this bot		ClientName( bs->client, botname, 128 );		//		while ( trap_BotFindMatch( addressedto, &addresseematch, MTCONTEXT_ADDRESSEE ) ) {			if ( addresseematch.type == MSG_EVERYONE ) {				return qtrue;			} else if ( addresseematch.type == MSG_MULTIPLENAMES )     {				trap_BotMatchVariable( &addresseematch, TEAMMATE, name, sizeof( name ) );				if ( strlen( name ) ) {					if ( stristr( botname, name ) ) {						return qtrue;					}					if ( stristr( bs->subteam, name ) ) {						return qtrue;					}				}				trap_BotMatchVariable( &addresseematch, MORE, addressedto, MAX_MESSAGE_SIZE );			} else {				trap_BotMatchVariable( &addresseematch, TEAMMATE, name, MAX_MESSAGE_SIZE );				if ( strlen( name ) ) {					if ( stristr( botname, name ) ) {						return qtrue;					}					if ( stristr( bs->subteam, name ) ) {						return qtrue;					}				}				break;			}		}		//Com_sprintf(buf, sizeof(buf), "not addressed to me but %s", addressedto);		//trap_EA_Say(bs->client, buf);		return qfalse;	} else {		//make sure not everyone reacts to this message		if ( random() > (float ) 1.0 / ( NumPlayersOnSameTeam( bs ) - 1 ) ) {			return qfalse;		}	}	return qtrue;}
开发者ID:JackalFrost,项目名称:RTCW-WSGF,代码行数:65,


示例13: BotMatch_WhatIsMyCommand

/*==================BotMatch_WhatIsMyCommand==================*/void BotMatch_WhatIsMyCommand(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_NETNAME];	ClientName(bs->client, netname, sizeof(netname));	if (Q_stricmp(netname, bs->teamleader) != 0) return;	bs->forceorders = qtrue;}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:12,


示例14: BotMatch_StartTeamLeaderShip

/*=======================================================================================================================================BotMatch_StartTeamLeaderShip=======================================================================================================================================*/void BotMatch_StartTeamLeaderShip(bot_state_t *bs, bot_match_t *match) {	int client;	char teammate[MAX_MESSAGE_SIZE];	if (!TeamPlayIsOn()) {		return;	}	// if chats for him or herself	if (match->subtype & ST_I) {		// get the team mate that will be the team leader		trap_BotMatchVariable(match, NETNAME, teammate, sizeof(teammate));		strncpy(bs->teamleader, teammate, sizeof(bs->teamleader));		bs->teamleader[sizeof(bs->teamleader) - 1] = '/0';	}	// chats for someone else	else {		// get the team mate that will be the team leader		trap_BotMatchVariable(match, TEAMMATE, teammate, sizeof(teammate));		client = FindClientByName(teammate);		if (client >= 0) {			ClientName(client, bs->teamleader, sizeof(bs->teamleader));		}	}}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:30,


示例15: BotGetTeamMateCTFPreference

/*==================BotGetTeamMateCTFPreference==================*/int BotGetTeamMateCTFPreference(bot_state_t *bs, int teammate) {    char teammatename[MAX_NETNAME];    if (!ctftaskpreferences[teammate].preference) return 0;    ClientName(teammate, teammatename, sizeof(teammatename));    if (Q_stricmp(teammatename, ctftaskpreferences[teammate].name)) return 0;    return ctftaskpreferences[teammate].preference;}
开发者ID:UberGames,项目名称:RPG-X2-rpgxEF,代码行数:13,


示例16: BotVoiceChat_StopLeader

/*==================BotVoiceChat_StopLeader==================*/void BotVoiceChat_StopLeader(bot_state_t *bs, int client, int mode) {	char netname[MAX_MESSAGE_SIZE];	if (!Q_stricmp(bs->teamleader, ClientName(client, netname, sizeof(netname)))) {		bs->teamleader[0] = '/0';		notleader[client] = qtrue;	}}
开发者ID:Mixone-FinallyHere,项目名称:SmokinGuns,代码行数:13,


示例17: BotCTFOrders_BothFlagsAtBase

/*==================BotCTFOrders==================*/void BotCTFOrders_BothFlagsAtBase( bot_state_t *bs ) {	int numteammates, defenders, attackers, i;	int teammates[MAX_CLIENTS];	char name[MAX_NETNAME];//	char buf[MAX_MESSAGE_SIZE];	numteammates = BotSortTeamMatesByBaseTravelTime( bs, teammates, sizeof( teammates ) );	//different orders based on the number of team mates	switch ( numteammates ) {	case 1: break;	case 2:	{		//the one closest to the base will defend the base		ClientName( teammates[0], name, sizeof( name ) );		BotAI_BotInitialChat( bs, "cmd_defendbase", name, NULL );		BotSayTeamOrder( bs, teammates[0] );		//the other will get the flag		ClientName( teammates[1], name, sizeof( name ) );		BotAI_BotInitialChat( bs, "cmd_getflag", name, NULL );		BotSayTeamOrder( bs, teammates[1] );		break;	}	case 3:	{		//the one closest to the base will defend the base		ClientName( teammates[0], name, sizeof( name ) );		BotAI_BotInitialChat( bs, "cmd_defendbase", name, NULL );		BotSayTeamOrder( bs, teammates[0] );		//the second one closest to the base will defend the base		ClientName( teammates[1], name, sizeof( name ) );		BotAI_BotInitialChat( bs, "cmd_defendbase", name, NULL );		BotSayTeamOrder( bs, teammates[1] );		//the other will get the flag		ClientName( teammates[2], name, sizeof( name ) );		BotAI_BotInitialChat( bs, "cmd_getflag", name, NULL );		BotSayTeamOrder( bs, teammates[2] );		break;	}	default:	{		defenders = (int) ( float ) numteammates * 0.5 + 0.5;		attackers = (int) ( float ) numteammates * 0.3 + 0.5;		for ( i = 0; i < defenders; i++ ) {			//			ClientName( teammates[i], name, sizeof( name ) );			BotAI_BotInitialChat( bs, "cmd_defendbase", name, NULL );			BotSayTeamOrder( bs, teammates[i] );		}		for ( i = 0; i < attackers; i++ ) {			//			ClientName( teammates[numteammates - i - 1], name, sizeof( name ) );			BotAI_BotInitialChat( bs, "cmd_getflag", name, NULL );			BotSayTeamOrder( bs, teammates[numteammates - i - 1] );		}		//		break;	}	}}
开发者ID:bibendovsky,项目名称:rtcw,代码行数:64,


示例18: BotMatch_WhoIsTeamLeader

/*==================BotMatch_WhoIsTeamLeader==================*/void BotMatch_WhoIsTeamLeader(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	if (!TeamPlayIsOn()) return;	ClientName(bs->client, netname, sizeof(netname));	//if this bot IS the team leader	if (!Q_stricmp(netname, bs->teamleader)) {		trap_EA_SayTeam(bs->client, "I'm the team leader/n");	}}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:16,


示例19: BotCreateGroup

/*==================BotCreateGroup==================*/void BotCreateGroup(bot_state_t *bs, int *teammates, int groupsize){    char name[MAX_NETNAME], leadername[MAX_NETNAME];    int i;    // the others in the group will follow the teammates[0]    ClientName(teammates[0], leadername, sizeof(leadername));    for (i = 1; i < groupsize; i++)    {        ClientName(teammates[i], name, sizeof(name));        if (teammates[0] == bs->client)        {            BotAI_BotInitialChat(bs, "cmd_accompanyme", name, NULL);        }        else        {            BotAI_BotInitialChat(bs, "cmd_accompany", name, leadername, NULL);        }        BotSayTeamOrderAlways(bs, teammates[i]);    }}
开发者ID:zturtleman,项目名称:recoil,代码行数:26,


示例20: BotVoiceChat_WhoIsLeader

/*==================BotVoiceChat_WhoIsLeader==================*/void BotVoiceChat_WhoIsLeader(bot_state_t *bs, int client, int mode) {	char netname[MAX_MESSAGE_SIZE];	if (!TeamPlayIsOn()) return;	ClientName(bs->client, netname, sizeof(netname));	//if this bot IS the team leader	if (!Q_stricmp(netname, bs->teamleader)) {		BotAI_BotInitialChat(bs, "iamteamleader", NULL);		trap_BotEnterChat(bs->cs, 0, CHAT_TEAM);		BotVoiceChatOnly(bs, -1, VOICECHAT_STARTLEADER);	}}
开发者ID:Mixone-FinallyHere,项目名称:SmokinGuns,代码行数:18,


示例21: BotSayTeamOrder

/*==================BotSayTeamOrders==================*/void BotSayTeamOrder( bot_state_t *bs, int toclient ) {	char teamchat[MAX_MESSAGE_SIZE];	char buf[MAX_MESSAGE_SIZE];	char name[MAX_NETNAME];	//if the bot is talking to itself	if ( bs->client == toclient ) {		//don't show the message just put it in the console message queue		trap_BotGetChatMessage( bs->cs, buf, sizeof( buf ) );		ClientName( bs->client, name, sizeof( name ) );		Com_sprintf( teamchat, sizeof( teamchat ), "(%s): %s", name, buf );		trap_BotQueueConsoleMessage( bs->cs, CMS_CHAT, teamchat );	} else {		trap_BotEnterChat( bs->cs, bs->client, CHAT_TEAM );	}}
开发者ID:bibendovsky,项目名称:rtcw,代码行数:21,


示例22: BotInstructMate

void BotInstructMate(bot_state_t* bs, int client ,int goal){    char name[MAX_NETNAME];	ClientName(client, name, sizeof(name));	//G_Printf("ordering %s",name);	// cyr 20055    if( g_entities[client].r.svFlags & SVF_BOT )            BotAI_BotInitialChat(bs, "cmd_accompany", name, va("%d", goal), NULL);    else{		if(lastorderedgoal[client] == goal+1) return;	//dont bother humans with the same MSG		lastorderedgoal[client] = goal+1;        if( goal >= 0)            BotAI_BotInitialChat(bs, "cmd_accompany", name,            va("the %s",g_entities[ balloongoal[goal].entitynum ].message ), NULL);        else            BotAI_BotInitialChat(bs, "cmd_accompany", name, va("nothing, just roam"), NULL);    }    BotSayTeamOrder(bs, client);}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:19,


示例23: BotMatch_TaskPreference

/*==================BotMatch_TaskPreference==================*/void BotMatch_TaskPreference(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_NETNAME];	char teammatename[MAX_MESSAGE_SIZE];	int teammate, preference;	ClientName(bs->client, netname, sizeof(netname));	if (Q_stricmp(netname, bs->teamleader) != 0) return;	trap_BotMatchVariable(match, NETNAME, teammatename, sizeof(teammatename));	teammate = ClientFromName(teammatename);	if (teammate < 0) return;	preference = BotGetTeamMateTaskPreference(bs, teammate);	switch(match->subtype)	{		case ST_DEFENDER:		{			preference &= ~TEAMTP_ATTACKER;			preference |= TEAMTP_DEFENDER;			break;		}		case ST_ATTACKER:		{			preference &= ~TEAMTP_DEFENDER;			preference |= TEAMTP_ATTACKER;			break;		}		case ST_ROAMER:		{			preference &= ~(TEAMTP_ATTACKER|TEAMTP_DEFENDER);			break;		}	}	BotSetTeamMateTaskPreference(bs, teammate, preference);	//	EasyClientName(teammate, teammatename, sizeof(teammatename));	BotAI_BotInitialChat(bs, "keepinmind", teammatename, NULL);	trap_BotEnterChat(bs->cs, teammate, CHAT_TELL);	BotVoiceChatOnly(bs, teammate, VOICECHAT_YES);	trap_EA_Action(bs->client, ACTION_AFFIRMATIVE);}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:46,


示例24: FindHumanTeamLeader

int FindHumanTeamLeader(bot_state_t *bs) {	int i;	for (i = 0; i < MAX_CLIENTS; i++) {		if ( g_entities[i].inuse ) {			// if this player is not a bot			if ( !(g_entities[i].r.svFlags & SVF_BOT) ) {				// if this player is ok with being the leader				if (!notleader[i]) {					// if this player is on the same team					if ( BotSameTeam(bs, i) ) {						ClientName(i, bs->teamleader, sizeof(bs->teamleader));						return qtrue;					}				}			}		}	}	return qfalse;}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:21,


示例25: BotChatTest

/*==================BotChatTest==================*/void BotChatTest( bot_state_t *bs ) {	char name[32];	char *weap;	int num, i;	num = trap_BotNumInitialChats( bs->cs, "game_enter" );	for ( i = 0; i < num; i++ )	{		BotAI_BotInitialChat( bs, "game_enter",							  EasyClientName( bs->client, name, 32 ), // 0							  BotRandomOpponentName( bs ),  // 1							  "[invalid var]",          // 2							  "[invalid var]",          // 3							  BotMapTitle(),                // 4							  NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	num = trap_BotNumInitialChats( bs->cs, "game_exit" );	for ( i = 0; i < num; i++ )	{		BotAI_BotInitialChat( bs, "game_exit",							  EasyClientName( bs->client, name, 32 ), // 0							  BotRandomOpponentName( bs ),  // 1							  "[invalid var]",          // 2							  "[invalid var]",          // 3							  BotMapTitle(),                // 4							  NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	num = trap_BotNumInitialChats( bs->cs, "level_start" );	for ( i = 0; i < num; i++ )	{		BotAI_BotInitialChat( bs, "level_start",							  EasyClientName( bs->client, name, 32 ), // 0							  NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	num = trap_BotNumInitialChats( bs->cs, "level_end_victory" );	for ( i = 0; i < num; i++ )	{		BotAI_BotInitialChat( bs, "level_end_victory",							  EasyClientName( bs->client, name, 32 ), // 0							  BotRandomOpponentName( bs ), // 1							  BotFirstClientInRankings(), // 2							  BotLastClientInRankings(), // 3							  BotMapTitle(),            // 4							  NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	num = trap_BotNumInitialChats( bs->cs, "level_end_lose" );	for ( i = 0; i < num; i++ )	{		BotAI_BotInitialChat( bs, "level_end_lose",							  EasyClientName( bs->client, name, 32 ), // 0							  BotRandomOpponentName( bs ), // 1							  BotFirstClientInRankings(), // 2							  BotLastClientInRankings(), // 3							  BotMapTitle(),            // 4							  NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	num = trap_BotNumInitialChats( bs->cs, "level_end" );	for ( i = 0; i < num; i++ )	{		BotAI_BotInitialChat( bs, "level_end",							  EasyClientName( bs->client, name, 32 ), // 0							  BotRandomOpponentName( bs ), // 1							  BotFirstClientInRankings(), // 2							  BotLastClientInRankings(), // 3							  BotMapTitle(),            // 4							  NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	EasyClientName( bs->lastkilledby, name, sizeof( name ) );	num = trap_BotNumInitialChats( bs->cs, "death_drown" );	for ( i = 0; i < num; i++ )	{		//		BotAI_BotInitialChat( bs, "death_drown", name, NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	num = trap_BotNumInitialChats( bs->cs, "death_slime" );	for ( i = 0; i < num; i++ )	{		BotAI_BotInitialChat( bs, "death_slime", name, NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	num = trap_BotNumInitialChats( bs->cs, "death_lava" );	for ( i = 0; i < num; i++ )	{		BotAI_BotInitialChat( bs, "death_lava", name, NULL );		trap_BotEnterChat( bs->cs, bs->client, CHAT_ALL );	}	num = trap_BotNumInitialChats( bs->cs, "death_cratered" );//.........这里部分代码省略.........
开发者ID:chegestar,项目名称:omni-bot,代码行数:101,


示例26: BotVoiceChat_StartLeader

void BotVoiceChat_StartLeader(bot_state_t *bs, int client, int mode) {	ClientName(client, bs->teamleader, sizeof(bs->teamleader));}
开发者ID:Mixone-FinallyHere,项目名称:SmokinGuns,代码行数:3,


示例27: BotPrintTeamGoal

/*=======================================================================================================================================BotPrintTeamGoal=======================================================================================================================================*/void BotPrintTeamGoal(bot_state_t *bs) {	char netname[MAX_NETNAME];	float t;	ClientName(bs->client, netname, sizeof(netname));	t = bs->teamgoal_time - trap_AAS_Time();	switch (bs->ltgtype) {	case LTG_TEAMHELP:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna help a team mate for %1.0f secs/n", netname, t);		break;	}	case LTG_TEAMACCOMPANY:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna accompany a team mate for %1.0f secs/n", netname, t);		break;	}	case LTG_GETFLAG:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna get the flag for %1.0f secs/n", netname, t);		break;	}	case LTG_RUSHBASE:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna rush to the base for %1.0f secs/n", netname, t);		break;	}	case LTG_RETURNFLAG:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna try to return the flag for %1.0f secs/n", netname, t);		break;	}	case LTG_DEFENDKEYAREA:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna defend a key area for %1.0f secs/n", netname, t);		break;	}	case LTG_GETITEM:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna get an item for %1.0f secs/n", netname, t);		break;	}	case LTG_KILL:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna kill someone for %1.0f secs/n", netname, t);		break;	}	case LTG_CAMP:	case LTG_CAMPORDER:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna camp for %1.0f secs/n", netname, t);		break;	}	case LTG_PATROL:	{		BotAI_Print(PRT_MESSAGE, "%s: I'm gonna patrol for %1.0f secs/n", netname, t);		break;	}	default:	{		if (bs->ctfroam_time > trap_AAS_Time()) {			t = bs->ctfroam_time - trap_AAS_Time();			BotAI_Print(PRT_MESSAGE, "%s: I'm gonna roam for %1.0f secs/n", netname, t);		} else {			BotAI_Print(PRT_MESSAGE, "%s: I've got a regular goal/n", netname);		}	}	}}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:85,


示例28: BotMatch_WhatAreYouDoing

/*=======================================================================================================================================BotMatch_WhatAreYouDoing=======================================================================================================================================*/void BotMatch_WhatAreYouDoing(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	char goalname[MAX_MESSAGE_SIZE];	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	switch (bs->ltgtype) {	case LTG_TEAMHELP:	{		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		EasyClientName(bs->teammate, netname, MAX_MESSAGE_SIZE);		BotAI_BotInitialChat(bs, "helping", netname, NULL);		break;	}	case LTG_TEAMACCOMPANY:	{		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		EasyClientName(bs->teammate, netname, MAX_MESSAGE_SIZE);		BotAI_BotInitialChat(bs, "accompanying", netname, NULL);		break;	}	case LTG_DEFENDKEYAREA:	{		trap_BotGoalName(bs->teamgoal.number, goalname, sizeof(goalname));		BotAI_BotInitialChat(bs, "defending", goalname, NULL);		break;	}	case LTG_GETITEM:	{		trap_BotGoalName(bs->teamgoal.number, goalname, sizeof(goalname));		BotAI_BotInitialChat(bs, "gettingitem", goalname, NULL);		break;	}	case LTG_KILL:	{		ClientName(bs->teamgoal.entitynum, netname, sizeof(netname));		BotAI_BotInitialChat(bs, "killing", netname, NULL);		break;	}	case LTG_CAMP:	case LTG_CAMPORDER:	{		BotAI_BotInitialChat(bs, "camping", NULL);		break;	}	case LTG_PATROL:	{		BotAI_BotInitialChat(bs, "patrolling", NULL);		break;	}	case LTG_GETFLAG:	{		BotAI_BotInitialChat(bs, "capturingflag", NULL);		break;	}	case LTG_RUSHBASE:	{		BotAI_BotInitialChat(bs, "rushingbase", NULL);		break;	}	case LTG_RETURNFLAG:	{		BotAI_BotInitialChat(bs, "returningflag", NULL);		break;	}	default:	{		BotAI_BotInitialChat(bs, "roaming", NULL);		break;	}	}	// chat what the bot is doing	trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:91,



注:本文中的ClientName函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ClientNumberFromString函数代码示例
C++ ClientEntityList函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。