void Map_Team::deserialize(Block_Buffer &buf) { buf.read_int8(type_); buf.read_string(words_); buf.read_int32(scene_id_); buf.read_int8(degree_); buf.read_uint32(team_index_); buf.read_int64(team_id_); buf.read_int64(team_id_for_scene_); buf.read_int64(leader_role_id_); uint16_t len = 0; buf.read_uint16(len); int64_t role_id = 0; for (uint16_t i = 0; i < len; ++i) { buf.read_int64(role_id); team_member_set_.insert(role_id); } buf.read_uint16(len); for (uint16_t i = 0; i < len; ++i) { buf.read_int64(role_id); offline_teamer_map_.insert(std::make_pair(role_id, Online_Teamer_Info())); } buf.read_int8(in_battle_); buf.read_uint16(len); Int_Role_Id int_role_id; Int_Role_Id_Vec lineup; for (uint16_t i = 0; i < len; ++i) { int_role_id.deserialize(buf); lineup.push_back(int_role_id); } this->lineup_replace(lineup); buf.read_int32(enter_level_); buf.read_int16(fail_times_); buf.read_int16(match_fail_); buf.read_bool(is_not_first_team_fb_); }
int Expedition_Force::deserialize(Block_Buffer &r) { r.read_int64(server_uuid); r.read_string(server_name); r.read_int64(gang_id); r.read_string(gang_name); return 0; }
int Scene_Server_Request::process_20300100(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &buf) { Monitor_Unique_ID logic_muid; role_id_t player_role_id = 0; int level = 0; int force = 0; role_id_t gang_id = 0; int8_t remain_income_num = 0; int16_t income_rate = 0; int total_merit = 0; int remain_time = 0; int act_time = 0; std::string server_name; logic_muid.deserialize(buf); buf.read_int64(player_role_id); buf.read_int32(level); buf.read_int32(force); buf.read_int64(gang_id); buf.read_int8(remain_income_num); buf.read_int16(income_rate); buf.read_int32(total_merit); buf.read_int32(remain_time); buf.read_int32(act_time); buf.read_string(server_name); SCENE_WAR_MANAGER->req_enter_war_scene(logic_muid, player_role_id, level, force, gang_id, remain_income_num, income_rate, total_merit, remain_time, act_time, server_name); return 0; }
int Scene_Gang_Manager::gang_war_load_source_gangs_from_logic(Block_Buffer &buf) { int8_t type = 0; buf.read_int8(type); if (type == 1) { int64_t server_id = 0; std::string zone; uint16_t len = 0; int8_t stage = 0; buf.read_int64(server_id); buf.read_string(zone); buf.read_int8(stage); if (stage != stage_ || load_source_ < Time_Value::gettimeofday()) { gang_map_.clear(); gangid_serverid_map_.clear(); gangid_zone_map_.clear(); server_ids_.clear(); stage_ = stage; load_source_ = Time_Value::gettimeofday() + Time_Value(Time_Value::ONE_MINUTE_IN_SECS * 5); MSG_USER("GANG_WAR: source_gangs server_id(%d) clear data",server_id); } server_ids_.insert(server_id); buf.read_uint16(len); Gang_War_Spot spot; std::map<int8_t, Gang_War_Spot> gang_war_result_map; for (uint16_t i = 0; i < len; ++i) { spot.reset(); spot.deserialize(buf); gang_war_result_map.insert(std::make_pair(spot.index, spot)); } if (!gang_war_result_map.empty()) { gang_war_result_map_.clear(); gang_war_result_map_ = gang_war_result_map; } buf.read_uint16(len); Gang_DB_View info; for (uint16_t i = 0; i < len; ++i) { info.reset(); info.gang_war_deserialize(buf); gang_map_.insert(std::make_pair(info.gang_id, info)); gangid_serverid_map_.insert(std::make_pair(info.gang_id, server_id)); gangid_zone_map_.insert(std::make_pair(info.gang_id, zone)); SCENE_GANG_GLOBAL_MANAGER->add_gang(info.gang_id, this); } MSG_USER("GANG_WAR: source_gangs server_id(%d)",server_id); } else { role_id_t gang_id = 0; buf.read_int64(gang_id); gang_map_.erase(gang_id); gangid_serverid_map_.erase(gang_id); gangid_zone_map_.erase(gang_id); SCENE_GANG_GLOBAL_MANAGER->erase_gang(gang_id); } return 0; }
void Expedition_Scene_Demage_Rank_Data::deserialize(Block_Buffer &r) { r.read_string(role_name); r.read_int64(role_id); r.read_int64(gang_id); r.read_string(gang_name); r.read_int64(uuid); r.read_string(server_name); r.read_int32(force); r.read_int32(level); r.read_double(demage); }
int Expedition_Occupy_Castle_Data::deserialize(Block_Buffer &r) { r.read_int64(role_id); r.read_int64(gang_id); r.read_int64(server_uuid); r.read_string(role_name); r.read_string(gang_name); r.read_string(server_name); r.read_int32(level); r.read_int32(force); r.read_int16(nums); r.read_int16(get_nums); return 0; }
int Answer_Manager::data_channle(Block_Buffer& buf) { uint8_t type = 0; buf.read_uint8(type); switch(type) { case ANSWER_DATA_CHANNLE_TYPE_SL_GET_RANK_REWARD: { uint16_t size = 0; buf.read_uint16(size); for(uint16_t i = 0; i < size; ++i) { uint16_t nsize = 0; buf.read_uint16(nsize); for(uint16_t j = 0; j < nsize; ++j) { role_id_t role_id = 0; buf.read_int64(role_id); reward_to_player(role_id, i+1); } //end j }//end i break; }// end case case ANSWER_DATA_CHANNLE_TYPE_SL_SAVE_DATA: { save_data(buf); break; } } return 0; }
int Scene_Server_Request::process_20300303(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &buf) { //MSG_20300303 msg; //JUDGE_ERROR_RETURN(msg.deserialize(buf)); int act_icon_id = 0; role_id_t gang_id = 0; buf.read_int32(act_icon_id); buf.read_int64(gang_id); switch(act_icon_id){ case 16:{ WORLD_BOSS_MANAGER->inner_act_end(gang_id, buf); break; } case 19:{ GANG_BOSS_MANAGER->inner_act_end(gang_id, buf); break; } case 20:{ VALENTINE_MONSTER_MANAGER->inner_act_end(gang_id, buf); break; } case 22:{ HONOR_ARENA_MANAGER->inner_act_end(gang_id, buf); break; } default:{ break; } } return 0; }
int Message_Unit::process_timer_msg(uint32_t msg_id, Block_Buffer &buf, Time_Value &now) { if (data_pro_tick_ < Time_Value::gettimeofday()) { server_status(); } switch (msg_id) { case SERVER_INNER_CLIENT_CLOSE: { int cid = 0, close_type = 0; int64_t value = 0; buf.read_int32(cid); buf.read_int32(close_type); buf.read_int64(value); monitor()->close_link_by_cid(cid, Link_Close(close_type, value)); break; } default : { return CALL_CONTINUE; break; } } return CALL_RETURN; }
int Scene_Server_Request::process_20100050(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &inner_buf) { JUDGE_PLAYER_NULL(player, role_id); uint16_t change_info_size = 0; inner_buf.read_uint16(change_info_size); if (change_info_size == 0) { return -1; } MSG_81000066 active_msg; active_msg.change_info.reserve(change_info_size); String_Info_Change string_info_change; for (uint16_t i = 0; i < change_info_size; ++i) { string_info_change.reset(); if (string_info_change.deserialize(inner_buf)) { return -1; } active_msg.change_info.push_back(string_info_change); } inner_buf.read_int64(active_msg.role_id); Block_Buffer active_buf; MAKE_MSG_BUF(active_msg, active_buf); player->scene_broad_around(active_buf,Mover::SCENE_MOVE); return 0; }
int Anci_Artifact_Detail::deserialize(Block_Buffer &buffer) { buffer.read_int64(role_id); // buffer.read_int64(perfectPoint); uint16_t len = 0; buffer.read_uint16(len); aa_info_map.clear(); Anci_Artifact_Cond_Info info; for (uint16_t i = 0; i < len; ++i) { info.reset(); buffer.read_int32(info.id); buffer.read_int8(info.state_count); buffer.read_int32(info.data); aa_info_map.insert(std::make_pair(info.id, info)); } buffer.read_uint16(len); complete_ids.clear(); int32_t complete_id = 0; for (uint16_t i = 0; i < len; ++i) { buffer.read_int32(complete_id); complete_ids.insert(complete_id); } aa_unban_info.clear(); Anci_Artifact_Unban_Info aa_ui; for (uint16_t i = 0; i < len; ++i) { aa_ui.reset(); buffer.read_int32(aa_ui.id); buffer.read_int8(aa_ui.state); buffer.read_int8(aa_ui.box_state); aa_unban_info.insert(std::make_pair(aa_ui.id, aa_ui)); } return 0; }
int Scene_Server_Request::process_20400001_3(Block_Buffer &buf) { Fighter_Detail detail; detail.reset(); detail.deserialize(buf); role_id_t master_role_id = 0; buf.read_int64(master_role_id); // 跟随英雄 Hero *outer_hero = SCENE_PUBLIC->find_master_id_hero(master_role_id); if (outer_hero && !outer_hero->validate_battle_scene()) { outer_hero->refresh_hero_fighter_detail(detail); } else { MSG_USER("cannot find outer_hero, master_role_id = %ld", master_role_id); return -1; } // 战斗英雄 Hero *fight_hero = SCENE_PUBLIC->find_fight_hero(master_role_id); if (fight_hero && !fight_hero->validate_battle_scene()) { fight_hero->refresh_hero_fighter_detail(detail); } else { MSG_USER("cannot find fight_hero, master_role_id = %ld", master_role_id); return -1; } return 0; }
int Scene_Server_Request::process_20420000(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &buf) { JUDGE_PLAYER_NULL(player, role_id); role_id_t sender_role_id = 0; int bless_buf_id = 0; buf.read_int64(sender_role_id); buf.read_int32(bless_buf_id); player->inner_send_bless_buf(sender_role_id, bless_buf_id); return 0; }
void Expedition_Drop_Or_Material::deserialize(Block_Buffer &r) { this->birth_time.deserialize(r); uint16_t len = 0; r.read_uint16(len); for (uint16_t i = 0; i < len; ++i) { int64_t role_id = 0; r.read_int64(role_id); had_collected.insert(role_id); } }
int Expedition_Global_Manager_Data::deserialize(Block_Buffer &r) { uint16_t len = 0; int64_t uuid = 0; Time_Value tv = Time_Value::zero; r.read_uint16(len); for (uint16_t i = 0; i < len; ++i) { r.read_int64(uuid); tv.deserialize(r); opened_uuid_opentime_map_.insert(std::make_pair(uuid, tv)); } int inter = 0; r.read_uint16(len); for (uint16_t i = 0; i < len; ++i) { r.read_int64(uuid); r.read_int32(inter); uuid_inter_map_.insert(std::make_pair(uuid, inter)); } r.read_uint16(len); for (uint16_t i = 0; i < len; ++i) { r.read_int32(inter); tv.deserialize(r); opentime_.insert(std::make_pair(inter, tv)); } mmuid_.deserialize(r); // uint32_t inter_u = 0; // Expedition_Manager_Data emd; // r.read_uint16(len); // for (uint16_t i = 0; i < len; ++i) { // emd.reset(); // r.read_uint32(inter_u); // emd.deserialize(r); // inter_manager_data_map_.insert(std::make_pair(inter_u, emd)); // } return 0; }
int Stronghold_Info::deserialize(Block_Buffer &r) { occupier.deserialize(r); uint16_t len = 0; int64_t i_64 = 0; int i_32 = 0; r.read_uint16(len); for (uint16_t i = 0; i < len; ++i) { r.read_int64(i_64); r.read_int32(i_32); defend_id_map.insert(std::make_pair(i_64, i_32)); } return 0; }
int Scene_Server_Request::find_player_by_buf(Block_Buffer &buf, Scene_Player *&player) { role_id_t role_id = 0; if (buf.read_int64(role_id)) { MSG_USER_TRACE("read role id:%ld", role_id); return CALL_RETURN; } player = monitor()->find_scene_player_by_role_id(role_id); if (! player) { MSG_USER_TRACE("can not find scene player:%ld", role_id); return CALL_RETURN; } return 0; }
int Scene_Server_Request::process_20100051(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &inner_buf) { JUDGE_PLAYER_NULL(player, role_id); MSG_81000067 active_msg; inner_buf.read_int64(active_msg.role_id); inner_buf.read_int8(active_msg.int_type); switch (active_msg.int_type) { case 32: { uint16_t change_info_size = 0; inner_buf.read_uint16(change_info_size); if (change_info_size == 0) { return -1; } Int32_Info_Change int32_info_change; bool is_hero_awake = false; for (uint16_t i = 0; i < change_info_size; ++i) { int32_info_change.reset(); if (int32_info_change.deserialize(inner_buf)) { return -1; } if (int32_info_change.type == IICT_HERO_AWAKE_LVL) { is_hero_awake = true; } active_msg.vec_32_change_info.push_back(int32_info_change); } // 英雄觉醒等级更新 if (is_hero_awake) { Hero *hero = SCENE_PUBLIC->find_mover_hero(player->role_id()); if (hero) { active_msg.role_id = hero->role_id(); Block_Buffer active_buf; MAKE_MSG_BUF(active_msg, active_buf); hero->scene_broad_around(active_buf,Mover::SCENE_MOVE); } } break; } case 8: case 16: case 64: break; default: break; } return 0; }
int Rune_Stone_Detail::deserialize(Block_Buffer & r) { r.read_int64(role_id); r.read_int32(points); uint16_t size = 0; r.read_uint16(size); Smelter_Detail smelter_detail; for (uint16_t i = 0; i < size; ++i) { smelter_detail.reset(); smelter_detail.deserialize(r); if (smelter_detail.smelter_idx) { smelter_detail_map[smelter_detail.smelter_idx] = smelter_detail; } } return 0; }
void Team_Arena_Controler::update_role_score(Block_Buffer &buf) { uint8_t type = 0; buf.read_uint8(type); if (type) { int role_size = 0; std::string server_name; buf.read_string(server_name); buf.read_int32(role_size); for (int i = 0; i < role_size; ++i) { role_id_t role_id = 0; int score = 0; int force = 0; std::string name; buf.read_int64(role_id); buf.read_int32(score); buf.read_int32(force); buf.read_string(name); Team_Role_Score_Map::iterator find_it = team_role_score_map.find(role_id); if (find_it != team_role_score_map.end()) { find_it->second.score = score; find_it->second.change = true; } else { Team_Role_Score role_score; role_score.role_id = role_id; role_score.score = score; role_score.force = force; role_score.name = name; role_score.area = server_name; team_role_score_map.insert(std::make_pair(role_id, role_score)); } } if (level_team_role_score_map.empty()) refresh_rank_list(); } else { team_role_score_map.clear(); level_team_role_score_map.clear(); } }
v8::Local<v8::Value> Msg_Struct::build_object_arg(const Field_Info &field_info, Block_Buffer &buffer, Isolate* isolate) { EscapableHandleScope handle_scope(isolate); Local<Value> value; if(field_info.field_type == "int8") { int8_t val = 0; buffer.read_int8(val); value = Int32::New(isolate, val); } else if(field_info.field_type == "int16") { int16_t val = 0; buffer.read_int16(val); value = Int32::New(isolate, val); } else if(field_info.field_type == "int32") { int32_t val = 0; buffer.read_int32(val); value = Int32::New(isolate, val); } else if(field_info.field_type == "int64") { int64_t val = 0; buffer.read_int64(val); value = Number::New(isolate, val); } else if(field_info.field_type == "double") { double val = 0; buffer.read_double(val); value = Number::New(isolate, val); } else if(field_info.field_type == "bool") { bool val = false; buffer.read_bool(val); value = Boolean::New(isolate, val); } else if(field_info.field_type == "string") { std::string val = ""; buffer.read_string(val); value = String::NewFromUtf8(isolate, val.c_str(), NewStringType::kNormal).ToLocalChecked(); } else { LOG_ERROR("Can not find the field_type:%s, struct_name:%s", field_info.field_type.c_str(), struct_name().c_str()); return handle_scope.Escape(Local<Value>()); } return handle_scope.Escape(value); }
int Scene_Server_Request::process_20100200(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &buf) { JUDGE_PLAYER_NULL(player, role_id); role_id_t role_id_2 = 0; int8_t open_type = 0; buf.read_int64(role_id_2); buf.read_int8(open_type); MSG_50100032 res_msg; res_msg.role_id = role_id_2; res_msg.open_type = open_type; player->fighter_detail().property_list(res_msg.prop_value); Hero *hero = SCENE_PUBLIC->find_fight_hero(player->role_id()); if (hero) { int hero_init_morale_type = hero->fighter_detail().init_morale.type; double hero_init_morale_val = hero->fighter_detail().init_morale.total(); for (uint16_t i = 0; i < res_msg.prop_value.size(); ++i) { if (res_msg.prop_value[i].type == hero_init_morale_type) { res_msg.prop_value[i].value += hero_init_morale_val; } } } res_msg.prop_value.push_back(Property(PT_CAREER, player->career())); res_msg.prop_value.push_back(Property(PT_CHARM, player->base_detail().charm)); /*魅力值*/ res_msg.role_name = player->role_name();/*人物姓名*/ res_msg.gang_name = player->base_detail().gang_name;/*人物id*/ res_msg.gender = player->base_detail().gender;/*性别(1男,2女)*/ res_msg.gang_id = player->base_detail().gang_id;/*职业*/ res_msg.headship = player->ganger_detail().headship; res_msg.avatar_vec = player->base_detail().avatar_vec; res_msg.vip = player->vip(); // OBJ_SEND_TO_CLIENT(res_msg, (*player)); Block_Buffer inner_buf; inner_buf.make_message(INNER_REQ_OPEN_PANEL); res_msg.serialize(inner_buf); inner_buf.finish_message(); player->send_to_logic(inner_buf); return 0; }
int Scene_Server_Request::process_20400001_2(Block_Buffer &buf) { Fighter_Detail detail; detail.reset(); detail.deserialize(buf); role_id_t master_role_id = 0; buf.read_int64(master_role_id); Hero *hero = SCENE_PUBLIC->find_fight_hero(master_role_id); if (hero && !hero->validate_battle_scene()) { hero->refresh_hero_fighter_detail(detail); hero->load_status_info(buf); } else { int battle_id = hero ? hero->battle_scene_id() : -2; MSG_USER("cannot find fight_hero, master_role_id = %ld, b_id:%d", master_role_id, battle_id); return -1; } return 0; }
int Honor_Arena_Manager::inner_player_enter(const role_id_t gang_id, Block_Buffer& buf){ role_id_t role_id = 0; std::string role_name = ""; int vip_lv = 0; int career = 0; int force = 0; std::string gang_name; buf.read_int64(role_id); buf.read_string(role_name); buf.read_int32(vip_lv); buf.read_int32(career); buf.read_int32(force); buf.read_string(gang_name); bool is_new = false; Honor_Arena_Player_Info_Map::iterator it = player_info_map_.find(role_id); if(it == player_info_map_.end()){ Honor_Arena_Player_Info player_info; player_info.rank_info.role_id = role_id; player_info.rank_info.score = CONFIG_CACHE_HONOR_ARENA->get_base_score(); player_info.streak_win_state = CONFIG_CACHE_HONOR_ARENA->get_streak_show(); std::pair<Honor_Arena_Player_Info_Map::iterator, bool> result_pair = player_info_map_.insert(std::make_pair(role_id, player_info)); if(result_pair.second == true){ rank_info_.push_back(&(result_pair.first->second)); } is_new = true; } it = player_info_map_.find(role_id); if(it != player_info_map_.end()){ it->second.rank_info.role_name = role_name; it->second.rank_info.guild_name = gang_name; //it->second.rank_info.career = career; it->second.rank_info.force = force; it->second.state = 0; // idle } if(is_new){ refresh_rank(); } return 0; }
int DB_Worker::process_save_player(int cid, Block_Buffer &buffer) { int32_t status = buffer.read_int32(); if (status == 1) { int rdx = buffer.get_read_idx(); buffer.read_int32(); int64_t role_id = buffer.read_int64(); buffer.set_read_idx(rdx); save_player_data(buffer); Block_Buffer buf; buf.make_inner_message(SYNC_DB_GAME_SAVE_PLAYER); MSG_550003 msg; msg.role_id = role_id; msg.serialize(buf); buf.finish_message(); DB_MANAGER->send_data_block(cid, buf); } else { save_player_data(buffer); } return 0; }
int Honor_Arena_Manager::inner_sync_info(Scene_Player* player, Block_Buffer& buf){ int8_t sync_type = 0; buf.read_int8(sync_type); switch(sync_type){ case 99:{ role_id_t role_id = 0; std::string role_name = ""; uint8_t gender = 0; buf.read_int64(role_id); buf.read_string(role_name); buf.read_uint8(gender); Honor_Arena_Player_Info_Map::iterator it = player_info_map_.find(role_id); if(it != player_info_map_.end()){ it->second.rank_info.role_name = role_name; } break; } default:{ break; } } return 0; }
int Fighter_Detail::deserialize(Block_Buffer &buffer) { buffer.read_int64(role_id); power.deserialize(buffer); agility.deserialize(buffer); dexterity.deserialize(buffer); armor.deserialize(buffer); stamina.deserialize(buffer); physical_attack.deserialize(buffer); spell_attack.deserialize(buffer); physical_defense.deserialize(buffer); spell_defense.deserialize(buffer); hit_rate.deserialize(buffer); avoid.deserialize(buffer); ignore_def.deserialize(buffer); blood_max.deserialize(buffer); cure.deserialize(buffer); cure_rate.deserialize(buffer); sing_rate.deserialize(buffer); crit.deserialize(buffer); crit_def.deserialize(buffer); init_morale.deserialize(buffer); morale_caps.deserialize(buffer); crit_hurt.deserialize(buffer); crit_hurt_sub.deserialize(buffer); hit_rate_addition.deserialize(buffer); avoid_rate_addition.deserialize(buffer); crit_rate_addition.deserialize(buffer); crit_def_rate_addition.deserialize(buffer); speed.deserialize(buffer); blood_current.deserialize(buffer); morale_current.deserialize(buffer); strength_current.deserialize(buffer); strength_max.deserialize(buffer); blood_pool_current.deserialize(buffer); blood_pool_max.deserialize(buffer); ignore_def_rate.deserialize(buffer); status_hit_rate.deserialize(buffer); status_def_rate.deserialize(buffer); blood_steal.deserialize(buffer); phy_hurt_fix.deserialize(buffer); phy_hurt_rate.deserialize(buffer); spell_hurt_fix.deserialize(buffer); spell_hurt_rate.deserialize(buffer); hurt_fix.deserialize(buffer); hurt_rate.deserialize(buffer); be_hurt_fix.deserialize(buffer); be_hurt_rate.deserialize(buffer); pk_hurt_add.deserialize(buffer); pk_hurt_sub.deserialize(buffer); phy_hurt_rate_sub.deserialize(buffer); spell_hurt_rate_sub.deserialize(buffer); skill_hurt_rate.deserialize(buffer); human_add.deserialize(buffer); elf_add.deserialize(buffer); orc_add.deserialize(buffer); dragon_add.deserialize(buffer); undead_add.deserialize(buffer); demon_add.deserialize(buffer); human_sub.deserialize(buffer); elf_sub.deserialize(buffer); orc_sub.deserialize(buffer); dragon_sub.deserialize(buffer); undead_sub.deserialize(buffer); demon_sub.deserialize(buffer); summon_add.deserialize(buffer); summon_sub.deserialize(buffer); be_cure_rate.deserialize(buffer); effect_rate.deserialize(buffer); pve_hurt_add.deserialize(buffer); pve_hurt_sub.deserialize(buffer); dizz_strengthen.deserialize(buffer); dizz_weaken.deserialize(buffer); buffer.read_int32(phy_power_recover_time); buffer.read_int32(phy_power_buy_times); buffer.read_int32(level); buffer.read_double(experience); buffer.read_double(elite_btl_morale); buffer.read_int32(force); buffer.read_int32(highest_force); buffer.read_int32(ttl_force); buffer.read_int32(ttl_skill_points_); buffer.read_int32(default_skill); buffer.read_int32(cur_used_talent_); buffer.read_int32(reset_skill_times); uint16_t s = 0; buffer.read_uint16(s); Talent talent; talent_map.clear(); for (uint16_t i=0; i < s; ++i) { talent.reset(); talent.deserialize(buffer); talent_map[talent.talent_id] = talent; } s = 0; buffer.read_uint16(s); Skill_DB_Info skill_info; extra_skill_vec.clear(); for (uint16_t i=0; i<s; ++i) { skill_info.reset(); skill_info.deserialize(buffer); extra_skill_vec.push_back(skill_info); } buffer.read_bool(is_clear_moral_); return 0; }
int Scene_Knight_Trials_Manager::scene_knight_trials_match_player(Block_Buffer& buf) { uint8_t type = 0; buf.read_uint8(type); role_id_t role_id = 0; buf.read_int64(role_id); if(!type || !role_id) { return 0; } int64_t from_uuid = 0; buf.read_int64(from_uuid); switch(type) { case KNIGHT_TRIALS_SIX_MATCH: { int ttl_force = 0; buf.read_int32(ttl_force); std::vector<int64_t> uuid_vector; SCENE_MONITOR->logic_server_uuid_to_vector(uuid_vector); //为了排除自己服; for(std::vector<int64_t>::iterator it = uuid_vector.begin(); it != uuid_vector.end(); ++it) { if(*it == from_uuid) { uuid_vector.erase(it); break; } } if(uuid_vector.empty()) { return 0; } std::map<int64_t, std::vector<uint8_t>> uuid_num_map; const Knight_Trials_Points_Conf_Map &conf = CONFIG_CACHE_KNIGHT_TRIALS->get_points_conf(); for(uint8_t i=1; i<=conf.size(); i++){ srandom(Time_Value::gettimeofday().sec() + Time_Value::gettimeofday().usec()); uint32_t index = random() % uuid_vector.size(); std::map<int64_t, std::vector<uint8_t>>::iterator it = uuid_num_map.find(uuid_vector[index]); if(it == uuid_num_map.end()) { std::vector<uint8_t> rank_vec; rank_vec.clear(); rank_vec.push_back(i); uuid_num_map.insert(std::make_pair(uuid_vector[index], rank_vec)); } else { it->second.push_back(i); } } for(std::map<int64_t, std::vector<uint8_t>>::iterator it = uuid_num_map.begin(); it != uuid_num_map.end(); ++it) { Block_Buffer block_buf; block_buf.make_message(INNER_KNIGHT_TRIALS_MATCH_PLAYER); block_buf.write_uint8(KNIGHT_TRIALS_SIX_MATCH); block_buf.write_int64(role_id); block_buf.write_int64(from_uuid); block_buf.write_int32(ttl_force); block_buf.write_uint8(it->second.size()); for(std::vector<uint8_t>::iterator rit = it->second.begin(); rit != it->second.end(); ++rit) { block_buf.write_uint8(*rit); } block_buf.finish_message(); SCENE_MONITOR->send_to_logic(it->first, block_buf); } break; } case KNIGHT_TRIALS_ONE_MATCH: { break; } case KNIGHT_TRIALS_SIX_MATCH_BACK: { Block_Buffer block_buf; block_buf.make_message(INNER_KNIGHT_TRIALS_MATCH_PLAYER); block_buf.write_uint8(KNIGHT_TRIALS_SIX_MATCH_BACK); block_buf.write_int64(role_id); block_buf.write_int64(from_uuid); block_buf.copy(&buf); SCENE_MONITOR->send_to_logic(from_uuid, block_buf); break; } case KNIGHT_TRIALS_ONE_MATCH_BACK: { break; } } return 0; }
int Dragon_Vale_Detail::deserialize(Block_Buffer &buffer) { buffer.read_int64(role_id); buffer.read_int64(target_player_id); buffer.read_bool(is_rob_enter_dragon_vale); buffer.read_int64(uuid); buffer.read_bool(is_gold_mine_max_storage); buffer.read_bool(is_moon_well_max_storage); buffer.read_bool(is_totem_max_storage); buffer.read_uint8(build_gold_mine_num); buffer.read_uint8(build_moon_well_num); buffer.read_uint8(build_totem_num); buffer.read_uint8(build_queue_num); buffer.read_uint8(all_open_build_queue_num); uint8_t size = 0; buffer.read_uint8(size); dragon_building_info_map.clear(); uint64_t key = 0; DragonBuildingInfo building_info; for(uint8_t i = 0; i < size; ++i) { building_info.reset(); building_info.deserialize(buffer); key = create_key_of_Dragon_Building_Info(building_info.id, building_info.type); dragon_building_info_map.insert(std::make_pair(key, building_info)); } buffer.read_bool(is_dragon_born); uint64_t temp_begin_born_time_sec = 0; buffer.read_uint64(temp_begin_born_time_sec); begin_born_time.sec((long)temp_begin_born_time_sec); dragon_info.deserialize(buffer); uint64_t temp_begin_play_dragon_interval_time_sec = 0; buffer.read_uint64(temp_begin_play_dragon_interval_time_sec); begin_play_dragon_interval_time.sec((long)temp_begin_play_dragon_interval_time_sec); uint64_t temp_begin_down_feeling_time_sec = 0; buffer.read_uint64(temp_begin_down_feeling_time_sec); begin_down_feeling_time.sec((long)temp_begin_down_feeling_time_sec); buffer.read_bool(is_vip_down_to_zero); buffer.read_uint32(matched_num); buffer.read_uint8(size); for(uint8_t i = 0; i < size; ++i) { int64_t key = 0; int64_t value = 0; buffer.read_int64(key); buffer.read_int64(value); thief_id_quality_map.insert(std::make_pair(key, value)); } uint64_t temp_begin_refresh_thief_time = 0; buffer.read_uint64(temp_begin_refresh_thief_time); begin_refresh_thief_time.sec((long)temp_begin_refresh_thief_time); buffer.read_uint8(star_num); buffer.read_uint8(award_foot_num); buffer.read_bool(is_special); buffer.read_uint8(size); for(uint8_t i = 0; i < size; ++i) { int64_t key = 0; buffer.read_int64(key); Foot_Info foot_info; foot_info.reset(); buffer.read_uint8(foot_info.sex); buffer.read_string(foot_info.name); foot_info_map.insert(std::make_pair(key, foot_info)); } uint32_t size_32 = 0; buffer.read_uint32(size_32); for(uint32_t i = 0; i < size_32; ++i) { int64_t role_id = 0; buffer.read_int64(role_id); foot_id_set.insert(role_id); } buffer.read_bool(is_yesterday_login); buffer.read_uint8(dragon_heart_num); buffer.read_uint8(size); Notice_Board notice_board; for(uint8_t i = 0; i < size; ++i) { notice_board.reset(); notice_board.deserialize(buffer); notice_board_list.push_back(notice_board); } buffer.read_bool(is_rob_protect); uint64_t temp_begin_rob_protect_time = 0; buffer.read_uint64(temp_begin_rob_protect_time); begin_rob_protect_time.sec((long)temp_begin_rob_protect_time); buffer.read_bool(is_first_enter_after_robbed); buffer.read_bool(is_in_robbed_dragon_vale); uint64_t temp_begin_in_robbed_dragon_vale_time = 0; buffer.read_uint64(temp_begin_in_robbed_dragon_vale_time); begin_in_robbed_dragon_vale_time.sec((long)temp_begin_in_robbed_dragon_vale_time); buffer.read_uint8(size); for(uint8_t i = 0; i < size; ++i) { uint8_t order = 0; buffer.read_uint8(order); cancel_create_building_set.insert(order); } buffer.read_bool(is_dragon_vale_open); uint64_t temp_begin_no_enter_time = 0; buffer.read_uint64(temp_begin_no_enter_time); begin_no_enter_time.sec((long)temp_begin_no_enter_time); buffer.read_uint32(left_time); buffer.read_uint32(play_dragon_num); buffer.read_uint32(drive_thief_num); return 0; }
int Scene_Server_Request::process_20600012(int cid, role_id_t role_id, Scene_Player *player, Block_Buffer &buf) { int64_t creater = 0; buf.read_int64(creater); SCENE_DRAGON_VALE_MANAGER->process_broadcast_dragon_vale_scene(creater, buf); return 0; }