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


C++ Block_Buffer::make_message方法代码示例

本文整理汇总了C++中Block_Buffer::make_message方法的典型用法代码示例。如果您正苦于以下问题:C++ Block_Buffer::make_message方法的具体用法?C++ Block_Buffer::make_message怎么用?C++ Block_Buffer::make_message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Block_Buffer的用法示例。


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

示例1: start_monitor_timer

int Chat_Monitor::start_monitor_timer(void) {
	Block_Buffer buf;
	buf.make_message(TIMER_GLOBAL_MONITOR_SELF);
	buf.finish_message();
	GLOBAL_TIMER->register_loop_handler(buf, Time_Value(30, 0), unit_);

	{
	Block_Buffer buf;
	buf.make_message(TIMER_TRIGGER_DAILY_ZERO);
	buf.finish_message();
	Time_Value timeout = next_relative_time(24, 00, 00);
	GLOBAL_TIMER->register_loop_handler(buf, Time_Value(timeout), unit_);
	}
	return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:15,代码来源:Chat_Monitor.cpp

示例2: refresh_rank_list

int Team_Arena_Controler::refresh_rank_list(role_id_t role_id) {
	Scene_Player *player = 0;

	if (role_id) {
		Team_Role_Score_Map::iterator find_it = team_role_score_map.find(role_id);
		if (find_it != team_role_score_map.end()) {
			player = SCENE_MONITOR->find_scene_player_by_role_id(role_id);
			if (player) {
				Block_Buffer buf;
				buf.make_message(20100312);
				buf.write_int32(find_it->second.rank);
				buf.finish_message();
				player->send_to_logic(buf);
			}
		}
	} else {
		level_team_role_score_map.clear();
		for (Team_Role_Score_Map::iterator it = team_role_score_map.begin(); it != team_role_score_map.end(); ++it) {
			if (it->second.score > 0) {
				int level = CONFIG_CACHE_TEAM->arena_multi_level(it->second.score);
				level_team_role_score_map[level].push_back(&it->second);
				it->second.change = false;
			}
		}


		for (Level_Team_Role_Score_Map::iterator it = level_team_role_score_map.begin(); it != level_team_role_score_map.end(); ++it) {
			std::sort(it->second.begin(), it->second.end(), Team_Role_Score_Greater());

			int i = 1;
			for (Team_Role_Score_Vec::iterator r_it = it->second.begin(); r_it != it->second.end(); ++r_it, ++i) {
				if ((**r_it).rank != i) {
					player = SCENE_MONITOR->find_scene_player_by_role_id((*r_it)->role_id);
					if (player) {
						Block_Buffer buf;
						buf.make_message(20100312);
						buf.write_int32(i);
						buf.finish_message();
						player->send_to_logic(buf);
					}
				}
				(**r_it).rank = i;
			}
		}
	}

	return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:48,代码来源:Team_Arena_Controler.cpp

示例3: save_data

void Answer_Manager::save_data(Block_Buffer& buf_) {
	Block_Buffer buf;
	buf.make_message(MONGO_SAVE_ANSWER_INFO);
	buf.copy(&buf_);
	buf.finish_message();
	DB_MANAGER->push_data_block(buf, 0);
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:7,代码来源:Answer_Manager.cpp

示例4: start_monitor_timer

int Record_Monitor::start_monitor_timer(void) {
	Block_Buffer buf;
	buf.make_message(TIMER_GLOBAL_MONITOR_SELF);
	buf.finish_message();
	GLOBAL_TIMER->register_loop_handler(buf, Time_Value(Time_Value::ONE_MINUTE_IN_SECS, 0), unit_);
	return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:7,代码来源:Record_Monitor.cpp

示例5: stop

void Daemon_Record::stop(void) {
	if (is_server_running()) {
		Block_Buffer buf;
		buf.make_message(SERVER_INNER_SELF_CLOSE);
		buf.finish_message();
		RECORD_MONITOR->push_async_buff(buf);
	}
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:8,代码来源:Daemon_Record.cpp

示例6: send_err_to_client

int Chat_Player::send_err_to_client(int error_id, int source) {
	Block_Buffer buf;
	buf.make_message(80000001);
	buf.write_int32(error_id);
	buf.write_int32(source);
	buf.write_string("");
	buf.finish_message();
	return send_to_client(buf);
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:9,代码来源:Chat_Player.cpp

示例7: sync_vip_info_to_chat

void Vip::sync_vip_info_to_chat(void) {
	MSG_20200024 inner_msg;
	inner_msg.vip_level = player_self()->base_detail().vip;
	inner_msg.over_time = player_self()->base_detail().vip_over_time.sec();
	Block_Buffer buf;
	buf.make_message(inner_msg.msg_id);
	inner_msg.serialize(buf);
	buf.finish_message();
	this->send_to_local_chat(buf);
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:10,代码来源:Vip.cpp

示例8: vagrant_store_trigger

int Scene_Outpost_Manager::vagrant_store_trigger(Move_Scene* scene, const int point, bool is_boss, Coord point_coord){
	int scene_id = scene->scene_id();
	int monster_id = CONFIG_CACHE_NPC->vagrant_item_trigger(scene_id, point);
	if(monster_id == 0){
		return 0;
	}
	// create monster
	NPC_Addition_Info npc_add;
	npc_add.birth_coord = point_coord;
	Monster* monster = NPC_MANAGER->create_monster(monster_id, 5, scene, NULL, npc_add);
	if(!monster){
		return 0;
	}
	int64_t monster_role_id = monster->role_id();
	// 生存流浪商店物品
	Vagrant_Item_Config_Map* vic_map = CONFIG_CACHE_NPC->get_vagrant_item_config_map();
	if(!vic_map){
		return 0;
	}
	Vagrant_Item_Info_Vec vi_vec;
	Vagrant_Item_Info vi;
	for(Vagrant_Item_Config_Map::iterator it = vic_map->begin(); it != vic_map->end();
			++ it){
		if(it->second.is_valid(monster_id)){
			vi.reset();
			vi.cfg_key = it->second.key;
			vi.cfg_item_id = it->second.item_id;
			vi.cfg_cost_type = it->second.sys_sell_type;
			vi.cfg_cost = it->second.cost;
			vi.cfg_num = it->second.num;
			vi.cfg_limit_num = it->second.limit_num;
			vi_vec.push_back(vi);
		}
	}
	Vagrant_Store_Scene_Map::iterator it = vagrant_item_map_.find(scene_id);
	if(it != vagrant_item_map_.end()){
		it->second[monster_role_id] = vi_vec;
	}else{
		Vagrant_Store_Map vagrant_stroe_map;
		vagrant_stroe_map[monster_role_id] = vi_vec;
		vagrant_item_map_[scene_id] = vagrant_stroe_map;
	}
	// 飘字
	{
		int err_id = ERROR_VAGRANT_STORE_OPEN;
		Block_Buffer buf;
		buf.make_message(80000001);
		buf.write_int32(err_id);
		buf.write_int32(0);
		buf.write_string("");
		buf.finish_message();
		scene->broadcast_all(0, buf);
	}
	return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:55,代码来源:Scene_Outpost_Manager.cpp

示例9: offline_arena_seven_day_reward

int Operating::offline_arena_seven_day_reward(role_id_t role_id, Arena_Reward_Info &info){
	Block_Buffer buf;
	buf.make_message(MONGO_OPERATING_OFFLINE_DATA);
	int type = OPERATING_OFFLINE_ARENA_SEVEN_DAY_REWARD;
	buf.write_int32(type);
	buf.write_int64(role_id);
	info.serialize(buf);
	buf.finish_message();
	DB_MANAGER->push_data_block(buf, 0);
	return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:11,代码来源:Operating.cpp

示例10: send_logic_get_integral_reward

void Answer_Scene::send_logic_get_integral_reward(Mover *mover, const uint32_t sorce) {
	if(!mover) return;
	Block_Buffer buf;
	buf.make_message(INNER_ANSWER_DATA_CHANNEL);
	buf.write_uint8(ANSWER_DATA_CHANNLE_TYPE_SL_GET_INTEGRAL_REWARD);
	//DATA START
	buf.write_uint32(sorce);
	//DATA END
	buf.finish_message();
	mover->send_to_logic(buf);
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:11,代码来源:Answer_Scene.cpp

示例11: offline_team_award

int Operating::offline_team_award(role_id_t role_id, int level_id) {

	Block_Buffer buf;
	buf.make_message(OPERATING_OFFLINE_TEAM_AWARD);
	buf.write_int64(role_id);
	buf.write_int32(level_id);
	buf.finish_message();
	DB_MANAGER->push_data_block(buf, 0);

	return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:11,代码来源:Operating.cpp

示例12: req_single_dungeon_revive

int Scene_Common::req_single_dungeon_revive(int8_t type) {
    if(player_self() && player_self()->move_scene() &&
            player_self()->move_scene()->scene_type() == FuBen_Scene_Type) {
        int param1 = 0;
        int param2 = 0;
        int param3 = 0;
        player_self()->move_scene()->get_scene_param(param1, param2, param3);
        if(param1 != 1) {
            return 0;
        }
        if(type == 0) { // 免费复活
            if(param2 <= 0) { // 免费复活次数
                {
                    MSG_50200215 msg;
                    msg.result = 0;
                    THIS_SEND_TO_CLIENT(msg);
                }
                return ERROR_FB_REVIVE_NO_FREE;
            }
            param2 -= 1;
            param1 = 0;
            player_self()->move_scene()->set_scene_param(param1, param2, param3, true);
            player_self()->reset_revive_info();
            {
                MSG_81000026 msg;
                msg.role_id = player_self()->role_id();
                msg.state = 0;
                THIS_SEND_TO_CLIENT(msg);
            }
            {
                MSG_50200215 msg;
                msg.result = 1;
                THIS_SEND_TO_CLIENT(msg);
            }
        } else { // 付费复活
            if(param2 > 0) { // 免费复活次数
                {
                    MSG_50200215 msg;
                    msg.result = 0;
                    THIS_SEND_TO_CLIENT(msg);
                }
                return ERROR_FB_REVIVE_HAS_FREE;
            }
            Block_Buffer buf;
            buf.make_message(INNER_WAR_SCENE_SYNC_INFO);
            buf.write_int8(3);
            buf.write_int32(param3);
            buf.finish_message();
            this->send_to_logic(buf);
        }
    }
    return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:53,代码来源:Scene_Common.cpp

示例13: send_scene_open_action

void Answer_Manager::send_scene_open_action(void) {
	Block_Buffer buf;
	buf.make_message(INNER_ANSWER_DATA_CHANNEL);
	buf.write_uint8(ANSWER_DATA_CHANNLE_TYPE_LS_OPEN_ACTIVE);
	buf.write_int64(start_time.sec());
	//DATA START
	answer_info.serialize(buf);
	//DATA END

	buf.finish_message();
	LOGIC_MONITOR->send_to_scene(ANSWER_INNER_SCENE_ID, 0, buf);
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:12,代码来源:Answer_Manager.cpp

示例14: offline_ganger_info_update

int Operating::offline_ganger_info_update(role_id_t role_id, Ganger_Detail& detail) {
	if ( role_id == 0 ) return 0;
	Block_Buffer buf;
	buf.make_message(MONGO_OPERATING_OFFLINE_DATA);
	int type = OPERATING_OFFLINE_GANGER_INFO;
	buf.write_int32(type);
	buf.write_int64(role_id);
	detail.serialize( buf );
	buf.finish_message();
	DB_MANAGER->push_data_block(buf, 0);
	return 0;
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:12,代码来源:Operating.cpp

示例15: send_scene_close_action

void Answer_Manager::send_scene_close_action(void) {
	is_close = true;
	Block_Buffer buf;
	buf.make_message(INNER_ANSWER_DATA_CHANNEL);
	buf.write_uint8(ANSWER_DATA_CHANNLE_TYPE_LS_CLOSE_ACTIVE);

	//DATA START
	buf.write_int64(end_time.sec());
	//DATA END

	buf.finish_message();
	LOGIC_MONITOR->send_to_scene(ANSWER_INNER_SCENE_ID, 0, buf);
}
开发者ID:tidaybreak,项目名称:game-server,代码行数:13,代码来源:Answer_Manager.cpp


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