当前位置: 首页>>代码示例>>C++>>正文


C++ LOG_TO_CONSOLE函数代码示例

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


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

示例1: add_emote

int add_emote(char *text, int len){

	int j;
	char *id;
	actor *act=NULL;

	for(j=1;j<len;j++) if(text[j]==' ') {text[j]=0; break;}
	id=&text[j+1];
	text++;
	printf("Actor [%s] [%s]\n",text,id);
	LOCK_ACTORS_LISTS();
	for (j = 0; j < max_actors; j++){
		if (!strncasecmp(actors_list[j]->actor_name, text, strlen(text)) && 
	  	   (actors_list[j]->actor_name[strlen(text)] == ' ' ||
	    	   actors_list[j]->actor_name[strlen(text)] == '\0')){
			act = actors_list[j];
			LOG_TO_CONSOLE(c_orange1, "actor found, adding emote");
			printf("actor found\n");
			add_emote_to_actor(act->actor_id,atoi(id));
			printf("message added %s\n",id);
		}
	}
	if (!act){
		UNLOCK_ACTORS_LISTS();
		LOG_TO_CONSOLE(c_orange1, "actor not found");
		return 1;
	}
	UNLOCK_ACTORS_LISTS();
	*(id-1)=' ';
	return 1;

}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:32,代码来源:console.c

示例2: get_path_config

	//  Load the item lists from the file in players config directory
	//
	void List_Container::load(void)
	{
		loaded = true;
		saved_item_lists.clear();
		std::string fullpath = get_path_config() + std::string(filename);
		std::ifstream in(fullpath.c_str());
		if (!in)
			return;
		int revision;
		in >> revision;
		if (revision != FILE_REVISION)
		{
			LOG_ERROR("%s: %s [%s]\n", __FILE__, item_list_version_error_str, fullpath.c_str() );
			LOG_TO_CONSOLE(c_red2, item_list_version_error_str);
			return;
		}
		bool logged_error = false;
		while (!in.eof())
		{
			saved_item_lists.push_back(List());
			if (!saved_item_lists.back().read(in))
			{
				if ((saved_item_lists.back().is_valid_format()) && !logged_error)
				{
					LOG_TO_CONSOLE(c_red2, item_list_format_error);
					logged_error = true;
				}
				saved_item_lists.pop_back();
			}
		}
		in.close();
		sort_list();
		set_active(initial_active_list);
	}
开发者ID:bsmr-c-cpp,项目名称:other-life,代码行数:36,代码来源:item_lists.cpp

示例3: command_markpos

int command_markpos(char *text, int len)
{
	int map_x, map_y;
	char *ptr = text;
	char msg[512];
	const char *usage = help_cmd_markpos_str;
	
	while (isspace(*ptr))
		ptr++;
	if (sscanf(ptr, "%d,%d ", &map_x, &map_y) != 2) {
		LOG_TO_CONSOLE(c_red2, usage);
		return 1;
	}
	while (*ptr != ' ' && *ptr)
		ptr++;
	while (*ptr == ' ')
		ptr++;
	if (!*ptr) {
		LOG_TO_CONSOLE(c_red2, usage);
		return 1;
	}
	if (put_mark_on_position(map_x, map_y, ptr)) {
		safe_snprintf (msg, sizeof(msg), location_info_str, map_x, map_y, ptr);
		LOG_TO_CONSOLE(c_orange1,msg);
	} else {
		safe_snprintf (msg,sizeof(msg), invalid_location_str, map_x, map_y);
		LOG_TO_CONSOLE(c_red2,msg);
	}
	return 1;
}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:30,代码来源:console.c

示例4: new_minute_console

void new_minute_console(void){
	if(!(real_game_minute%60)){
		timestamp_chat_log();
	}
	if(time_warn_h >= 0 && (time_warn_h+real_game_minute)%60 == 0){
		char str[75];
		safe_snprintf(str, sizeof(str), time_warn_hour_str, time_warn_h);
		LOG_TO_CONSOLE(c_purple1, str);
	}
	if(time_warn_s >= 0 && (time_warn_s+real_game_minute)%180 == 30){
		char str[100];
		if (time_warn_s+real_game_minute == 30) { // sunrise
			safe_snprintf(str, sizeof(str), time_warn_sunrise_str, time_warn_s);
		}
		else { // sunset
			safe_snprintf(str, sizeof(str), time_warn_sunset_str, time_warn_s);
		}
		LOG_TO_CONSOLE(c_purple1, str);
	}
	if(time_warn_d >= 0 && (time_warn_d+real_game_minute)%360 == 0){
		char str[75];
		safe_snprintf(str, sizeof(str), time_warn_day_str, time_warn_d);
		LOG_TO_CONSOLE(c_purple1, str);
	}
}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:25,代码来源:console.c

示例5: show_astro_details

static void show_astro_details(void)
{
	if (last_astro_message_len && last_astro_message!=NULL)
	{
		LOG_TO_CONSOLE(c_green2, stone_name);
		LOG_TO_CONSOLE(c_grey1, last_astro_message);
	}
}
开发者ID:xaphier,项目名称:Eternal-Lands,代码行数:8,代码来源:astrology.c

示例6: command_ignore

int command_ignore(char *text, int len)
{
	char name[MAX_USERNAME_LENGTH];
	int i;
	Uint8 ch='\0';
	int result;

	while (isspace(*text))
		text++;

	for (i = 0; i < MAX_USERNAME_LENGTH - 1; i++)
	{
		ch = text[i];
		if (ch == ' ' || ch == '\0')
		{
			ch = '\0';
			break;
		}
		name[i] = ch;
	}
	name[i] = '\0';

	if (i >= MAX_USERNAME_LENGTH - 1 && text[i] != '\0') // This is the max chrs of name but isn't a null terminator
	{
		char str[100];
		safe_snprintf (str, sizeof(str), "%s %s", name_too_long, not_added_to_ignores);
		LOG_TO_CONSOLE (c_red1, str);
		return 1;
	}
	if (i < 3)
	{
		char str[100];
		safe_snprintf (str, sizeof(str), "%s %s", name_too_short, not_added_to_ignores);
		LOG_TO_CONSOLE (c_red1, name_too_short);
		return 1;
	}

	result = add_to_ignore_list (name, save_ignores);
	if (result == -1)
	{
		char str[100];
		safe_snprintf (str, sizeof(str), already_ignoring, name);
		LOG_TO_CONSOLE (c_red1, str);
		return 1;
	}
	if(result == -2)
	{
		LOG_TO_CONSOLE (c_red1, ignore_list_full);
	}
	else
	{
		char str[100];
		safe_snprintf (str, sizeof(str), added_to_ignores, name);
		LOG_TO_CONSOLE (c_green1, str);
	}
	return 1;
}
开发者ID:alberich,项目名称:Eternal-Lands,代码行数:57,代码来源:console.c

示例7: print_emotes

int print_emotes(char *text, int len){

	hash_entry *he;;
	LOG_TO_CONSOLE(c_orange1,"EMOTES");
	LOG_TO_CONSOLE(c_orange1,"--------------------");
	hash_start_iterator(emote_cmds);
	while((he=hash_get_next(emote_cmds)))
		LOG_TO_CONSOLE(c_orange1,((emote_dict *)he->item)->command);
	return 1;
}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:10,代码来源:console.c

示例8: add_buddy

void add_buddy (const char *name, int type, int len)
{
	int i, found = 0;
	char message[35];

	add_name_to_tablist(name);
	// Check if the buddy already exists
	for (i = 0; i < MAX_BUDDY; i++)
	{
		if(strncasecmp(buddy_list[i].name, name, len) == 0){
			//this name is already in our list
			if(buddy_list[i].type != type){
				//colour change, not a new entry
				if(buddy_log_notice == 1){
					if(buddy_list[i].type == 0xFE){//logging on
						safe_snprintf (message, sizeof(message), buddy_logon_str, len, name);
						LOG_TO_CONSOLE (c_green1, message);
						flash_icon(tt_buddy, 5);
					}else if(type == 0xFE){//logging off
						safe_snprintf (message, sizeof(message), buddy_logoff_str, len, name);
						LOG_TO_CONSOLE (c_green1, message);
						flash_icon(tt_buddy, 5);
					}//else it's just a normal colour change
				}
				buddy_list[i].type=type;
			}
			found = 1;
			break;
		}
	}
	if (found != 1) {
		// find empty space
		for (i = 0; i < MAX_BUDDY; i++)
		{
			if (buddy_list[i].type == 0xff)
			{
				// found then add buddy
				buddy_list[i].type = type;
				safe_snprintf (buddy_list[i].name, sizeof(buddy_list[i].name), "%.*s", len, name);
				// write optional online message
				if ((buddy_log_notice == 1) && (type != 0xFE))
				{
					safe_snprintf (message, sizeof(message), buddy_online_str, len, name);
					LOG_TO_CONSOLE (c_green1, message);
					flash_icon(tt_buddy, 5);
				}
				break;
			}
		}
	}
	set_scrollbar_len();
}
开发者ID:pjbroad,项目名称:other-life,代码行数:52,代码来源:buddy.c

示例9: command_calc

int command_calc(char *text, int len)
{
	double res;
	char str[100];
	int calcerr;

	res = calc_exp(text, &calcerr);
	switch (calcerr){
		case CALCERR_OK:
			if (trunc(res)==res) safe_snprintf (str,sizeof(str), "%s = %.0f",text,res);
			else safe_snprintf (str,sizeof(str), "%s = %.2f",text,res);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_SYNTAX:
			safe_snprintf (str,sizeof(str), "%s = Syntax error",text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_DIVIDE:
			safe_snprintf (str, sizeof(str),"%s = Divide by zero",text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_MEM:
			safe_snprintf (str,sizeof(str), "%s = Memory error",text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_XOPSYNTAX:
			safe_snprintf (str,sizeof(str), "%s = Bad argument for X", text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_LOPSYNTAX:
			safe_snprintf (str,sizeof(str), "%s = Bad argument for L", text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_EOPSYNTAX:
			safe_snprintf (str,sizeof(str), "%s = Bad argument for E", text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_NOPSYNTAX:
			safe_snprintf (str,sizeof(str), "%s = Bad argument for N", text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_ZOPSYNTAX:
			safe_snprintf (str,sizeof(str), "%s = Bad argument for Z", text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
		case CALCERR_QOPSYNTAX:
			safe_snprintf (str,sizeof(str), "%s = Bad argument for Q", text);
			LOG_TO_CONSOLE (c_orange1, str);
			break;
	}
	return 1;
}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:52,代码来源:console.c

示例10: LOG_TO_CONSOLE

	//	If the item_info file is missing or item_uid not enabled, show one time help
	//
	void List::help_if_needed(void)
	{
		if (shown_help)
			return;
		if (!info_available())
		{
			std::string message = "Could not load the item information file: " + item_info_filename;
			LOG_TO_CONSOLE(c_red1, message.c_str());
		}
		if (!item_uid_enabled)
			LOG_TO_CONSOLE(c_red1, "Use #item_uid (set to 1) to enable unique item information.");
		shown_help = true;
	}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:15,代码来源:item_info.cpp

示例11: command_filter

int command_filter(char *text, int len)
{
	char name[256];
	char str[100];
	int i;
	Uint8 ch = '\0';
	int result;

	while (isspace(*text))
		text++;

	for (i = 0; i < sizeof (name) - 1; i++)
	{
		ch = text[i];
		if (ch == '\0')
			break;
		name[i] = ch;
	}
	name[i] = '\0';

	if (i >= sizeof (name) - 1 && ch != '\0')
	{
		safe_snprintf (str, sizeof (str), "%s %s", word_too_long, not_added_to_filter);
		LOG_TO_CONSOLE (c_red1, str);
		return 1;
	}
	else if (i < 3)
	{
		safe_snprintf (str, sizeof (str), "%s %s", word_too_short, not_added_to_filter);
		LOG_TO_CONSOLE (c_red1, word_too_short);
		return 1;
	}

	result = add_to_filter_list (name, 1, save_ignores);
	if (result == -1)
	{
		safe_snprintf (str, sizeof (str), already_filtering, name);
		LOG_TO_CONSOLE (c_red1, str);
	}
	else if (result == -2)
	{
		LOG_TO_CONSOLE (c_red1, filter_list_full);
	}
	else
	{
		safe_snprintf (str, sizeof (str), added_to_filters, name);
		LOG_TO_CONSOLE (c_green1, str);
	}
	return 1;
}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:50,代码来源:console.c

示例12: command_glinfo

int command_glinfo (const char *text, int len)
{
	const char *my_string;
	size_t size = 8192, minlen;
	char* this_string = calloc (size, 1);

	my_string = (const char*) glGetString (GL_RENDERER);
	minlen = strlen (video_card_str) + strlen (my_string) + 3;
	if (size < minlen)
	{
		while (size < minlen) size += size;
		this_string = realloc (this_string, size);
	}
	safe_snprintf (this_string, size,"%s: %s",video_card_str, my_string);
	LOG_TO_CONSOLE (c_red2, this_string);

	my_string = (const char*) glGetString (GL_VENDOR);
	minlen = strlen (video_vendor_str) + strlen (my_string) + 3;
	if (size < minlen)
	{
		while (size < minlen) size += size;
		this_string = realloc (this_string, size);
	}
	safe_snprintf (this_string, size,"%s: %s", video_vendor_str, my_string);
	LOG_TO_CONSOLE (c_yellow3, this_string);

	my_string = (const char*) glGetString (GL_VERSION);
	minlen = strlen (opengl_version_str) + strlen (my_string) + 3;
	if (size < minlen)
	{
		while (size < minlen) size += size;
		this_string = realloc (this_string, size);
	}
	safe_snprintf (this_string, size, "%s: %s", opengl_version_str, my_string);
	LOG_TO_CONSOLE (c_yellow2, this_string);

	my_string = (const char*) glGetString (GL_EXTENSIONS);
	minlen = strlen (supported_extensions_str) + strlen (my_string) + 3;
	if (size < minlen)
	{
		while (size < minlen) size += size;
		this_string = realloc (this_string, size);
	}
	safe_snprintf (this_string, size, "%s: %s", supported_extensions_str, my_string);
	LOG_TO_CONSOLE (c_grey1, this_string);

	free (this_string);
	
	return 1;
}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:50,代码来源:console.c

示例13: command_update

int command_update(char *text, int len)
{
	if (custom_update == 0)
	{
		LOG_TO_CONSOLE(c_red1, "Custom updates disabled");
	}
	else
	{
		start_custom_update();
		LOG_TO_CONSOLE(c_green1, "Custom updates started. "
			"Use #update_status to check progress");
	}

	return 1;
}
开发者ID:Sir-Odie,项目名称:Eternal-Lands,代码行数:15,代码来源:custom_update.c

示例14: set_idle

int set_idle(char *text, int len){

	int j,x;
	char *id;
	actor *act=NULL;

	for(j=1;j<len;j++) if(text[j]==' ') {text[j]=0; break;}
	id=&text[j+1];
	x=j;
	text++;
	printf("Actor [%s] [%s]\n",text,id);
	LOCK_ACTORS_LISTS();
	for (j = 0; j < max_actors; j++){
		if (!strncasecmp(actors_list[j]->actor_name, text, strlen(text)) && 
	  	   (actors_list[j]->actor_name[strlen(text)] == ' ' ||
	    	   actors_list[j]->actor_name[strlen(text)] == '\0')){
				struct CalMixer *mixer;
			act = actors_list[j];
				mixer=CalModel_GetMixer(act->calmodel);
			LOG_TO_CONSOLE(c_orange1, "actor found, adding anims");
			printf("actor found\n");
			CalMixer_ClearCycle(mixer,act->cur_anim.anim_index, 0.0f);
			while(*id){
				int anim_id;
				double anim_wg;
				
				anim_id=atoi(id);
			id++;
				while(*id!=' '&&*id!=0) id++;
				anim_wg=atof(id);
			id++;
				while(*id!=' '&&*id!=0) id++;
				printf("setting anim %i with weight %f\n",anim_id,anim_wg);
				if(anim_wg<0) CalMixer_ClearCycle(mixer,actors_defs[act->actor_type].cal_frames[anim_id].anim_index, 0.0f);	
				else CalMixer_BlendCycle(mixer,actors_defs[act->actor_type].cal_frames[anim_id].anim_index,anim_wg, 0.1f);
			}
			printf("command added %s\n",id);
		}
	}
	if (!act){
		UNLOCK_ACTORS_LISTS();
		LOG_TO_CONSOLE(c_orange1, "actor not found");
		return 1;
	}
	UNLOCK_ACTORS_LISTS();
	text[x-1]=' ';
	return 1;
}
开发者ID:MerkeX,项目名称:Eternal-Lands,代码行数:48,代码来源:console.c

示例15: switch

// handle context menu options
//
int Hud_Timer::cm_handler(window_info *win, int option)
{
	switch (option)
	{
		case CMHT_MODE: toggle_mode(); break;
		case CMHT_RUNSTATE: toggle_running(); break;
		case CMHT_SETTIME:
			{
				if (!input)
					input = new INPUT_POPUP;
				else
					close_ipu(input);
				init_ipu(input, win->window_id, 220, -1, 4, 1, 0, set_timer_time);
				input->x = -230;
				input->y = last_base_y_start;
				display_popup_win(input, hud_timer_popup_title_str);
			}
			break;
		case CMHT_RESET: reset(); break;
		case CMHT_HELP:
			{
				const char *desc = get_option_description("view_hud_timer", INI_FILE_VAR);
				if (desc && (strlen(desc) > 0))
					LOG_TO_CONSOLE(c_green1, desc);
			}
			break;
		case CMHT_KEEPSTATE: break;
		default: return 0;
	}
	return 1;
}
开发者ID:NostreDame,项目名称:Eternal-Lands,代码行数:33,代码来源:hud_timer.cpp


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