本文整理汇总了C++中Block_Buffer::read_int64方法的典型用法代码示例。如果您正苦于以下问题:C++ Block_Buffer::read_int64方法的具体用法?C++ Block_Buffer::read_int64怎么用?C++ Block_Buffer::read_int64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block_Buffer
的用法示例。
在下文中一共展示了Block_Buffer::read_int64方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
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_);
}
示例2: deserialize
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;
}
示例3:
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;
}
示例4: gang_war_load_source_gangs_from_logic
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;
}
示例5: data_channle
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;
}
示例6: process_timer_msg
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;
}
示例7: deserialize
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;
}
示例8: find_player_by_buf
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;
}
示例9: deserialize
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;
}
示例10: update_role_score
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();
}
}
示例11: handle_scope
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);
}
示例12: inner_player_enter
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;
}
示例13: process_save_player
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;
}
示例14: inner_sync_info
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;
}
示例15: deserialize
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();
//.........这里部分代码省略.........