Пример #1
0
int DragonBuildingInfo::serialize(Block_Buffer &buffer) const {
	buffer.write_uint32(id);
	buffer.write_uint8(type);
	buffer.write_uint16(level);
	buffer.write_uint8(status);
	buffer.write_uint32(production);
	buffer.write_bool(is_gain);
	buffer.write_uint64((uint64_t)begin_upgrade_time.sec());
	buffer.write_uint64((uint64_t)last_output_production_time.sec());
	buffer.write_uint8(order);
	buffer.write_uint8(consume_type);
	return 0;
}
Пример #2
0
int Dragon_Vale_Detail::serialize(Block_Buffer &buffer) const {
	buffer.write_int64(role_id);
	buffer.write_int64(target_player_id);
	buffer.write_bool(is_rob_enter_dragon_vale);
	buffer.write_int64(uuid);
	buffer.write_bool(is_gold_mine_max_storage);
	buffer.write_bool(is_moon_well_max_storage);
	buffer.write_bool(is_totem_max_storage);
	buffer.write_uint8(build_gold_mine_num);
	buffer.write_uint8(build_moon_well_num);
	buffer.write_uint8(build_totem_num);
	buffer.write_uint8(build_queue_num);
	buffer.write_uint8(all_open_build_queue_num);

	uint8_t size = dragon_building_info_map.size();
	buffer.write_uint8(size);

	for(DragonBuildingInfoMap::const_iterator it = dragon_building_info_map.begin();
			it != dragon_building_info_map.end();
			++it) {
		it->second.serialize(buffer);
	}

	buffer.write_bool(is_dragon_born);
	buffer.write_uint64((uint64_t)begin_born_time.sec());

	dragon_info.serialize(buffer);

	buffer.write_uint64((uint64_t)begin_play_dragon_interval_time.sec());
	buffer.write_uint64((uint64_t)begin_down_feeling_time.sec());

	buffer.write_bool(is_vip_down_to_zero);
	buffer.write_uint32(matched_num);

	size = thief_id_quality_map.size();
	buffer.write_uint8(size);
	for(Thief_Id_Quality_Map::const_iterator it = thief_id_quality_map.begin(); it != thief_id_quality_map.end(); ++it) {
		buffer.write_int64(it->first);
		buffer.write_int64(it->second);
	}

	buffer.write_uint64((uint64_t)begin_refresh_thief_time.sec());

	buffer.write_uint8(star_num);
	buffer.write_uint8(award_foot_num);
	buffer.write_bool(is_special);

	size = foot_info_map.size();
	buffer.write_uint8(size);
	for(Foot_Info_Map::const_iterator it = foot_info_map.begin(); it != foot_info_map.end(); ++it) {
		buffer.write_int64(it->first);
		buffer.write_uint8(it->second.sex);
		buffer.write_string(it->second.name);
	}

	uint32_t size_32 = foot_id_set.size();
	buffer.write_uint32(size_32);
	for(Foot_Id_Set::const_iterator it = foot_id_set.begin(); it != foot_id_set.end(); ++it) {
		buffer.write_int64(*it);
	}

	buffer.write_bool(is_yesterday_login);
	buffer.write_uint8(dragon_heart_num);

	size = notice_board_list.size();
	buffer.write_uint8(size);
	for(Notice_Board_List::const_iterator it = notice_board_list.begin();
			it != notice_board_list.end();
			++it) {
		it->serialize(buffer);
	}

	buffer.write_bool(is_rob_protect);
	buffer.write_uint64((uint64_t)begin_rob_protect_time.sec());

	buffer.write_bool(is_first_enter_after_robbed);

	buffer.write_bool(is_in_robbed_dragon_vale);
	buffer.write_uint64((uint64_t)begin_in_robbed_dragon_vale_time.sec());

	size = cancel_create_building_set.size();
	buffer.write_uint8(size);
	for(Cancel_Create_Building_Set::const_iterator it = cancel_create_building_set.begin();
			it != cancel_create_building_set.end();
			++it) {
		buffer.write_uint8(*it);
	}

	buffer.write_bool(is_dragon_vale_open);

	buffer.write_uint64((uint64_t)begin_no_enter_time.sec());
	buffer.write_uint32(left_time);

	buffer.write_uint32(play_dragon_num);
	buffer.write_uint32(drive_thief_num);

	return 0;
}