本文整理汇总了C++中Block_Buffer::read_uint32方法的典型用法代码示例。如果您正苦于以下问题:C++ Block_Buffer::read_uint32方法的具体用法?C++ Block_Buffer::read_uint32怎么用?C++ Block_Buffer::read_uint32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block_Buffer
的用法示例。
在下文中一共展示了Block_Buffer::read_uint32方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
int Skill_Running_Info::deserialize(Block_Buffer &buf) {
uint32_t sec = 0, usec = 0;
buf.read_int32(skill_id);
buf.read_uint32(sec);
buf.read_uint32(usec);
last_use_timestamp.sec(sec);
last_use_timestamp.usec(usec);
buf.read_int32(use_times);
uint16_t size;
buf.read_uint16(size);
buf.read_int32(last_step);
buf.read_uint32(sec);
buf.read_uint32(usec);
config_cache = CONFIG_CACHE_FIGHTER->skill_config_cache(skill_id);
if (NULL == config_cache) {
return -1;
}
return 0;
}
示例2: process_client_buffer
int Message_Unit::process_client_buffer(Block_Buffer &buf) {
msg_tick_ = Time_Value::gettimeofday();
int cid = 0;
uint32_t len = 0;
uint32_t msg_id = 0;
uint32_t serial_cipher = 0;
uint32_t msg_time_cipher = 0;
if (buf.read_int32(cid) ||
buf.read_uint32(len) ||
buf.read_uint32(msg_id) ||
buf.read_uint32(serial_cipher) ||
buf.read_uint32(msg_time_cipher)) {
LOG_USER("deserialize error, cid:%d len:%d msg_id:%d", cid, len, msg_id);
monitor()->close_client_by_cid(cid, Time_Value(2), 10000101);
return -1;
}
process_client_msg(msg_id, cid, buf, serial_cipher, msg_time_cipher);
count_process_time(msg_id);
return 0;
}
示例3: 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_);
}
示例4: deserialize
int Stronghold::deserialize(Block_Buffer &r) {
r.read_uint32(point_id);
int8_t tp = 0;
r.read_int8(tp);
type = (Expedition_Build_Type)tp;
info.deserialize(r);
return 0;
}
示例5: process_timer_buffer
int Message_Unit::process_timer_buffer(Block_Buffer &buf) {
msg_tick_ = Time_Value::gettimeofday();
uint32_t len = 0;
uint32_t msg_id = 0;
if (buf.read_uint32(len) ||
buf.read_uint32(msg_id)) {
LOG_USER("deserialize error, cid:%d len:%d msg_id:%d", len, msg_id);
return -1;
}
process_timer_msg(msg_id, buf, msg_tick_);
count_process_time(msg_id);
return 0;
}
示例6: deserialize
int DragonBuildingInfo::deserialize(Block_Buffer &buffer) {
buffer.read_uint32(id);
buffer.read_uint8(type);
buffer.read_uint16(level);
buffer.read_uint8(status);
buffer.read_uint32(production);
buffer.read_bool(is_gain);
uint64_t temp_begin_upgrade_time_sec = 0;
uint64_t temp_last_output_production_time_sec = 0;
buffer.read_uint64(temp_begin_upgrade_time_sec);
buffer.read_uint64(temp_last_output_production_time_sec);
begin_upgrade_time.sec((long)temp_begin_upgrade_time_sec);
last_output_production_time.sec((long)temp_last_output_production_time_sec);
buffer.read_uint8(order);
buffer.read_uint8(consume_type);
return 0;
}
示例7: process_async_data
int Message_Unit::process_async_data(int data_type, void *ptr_data) {
switch (data_type) {
case Unit_Message::TYPE_DATA_BUFFER: {
Block_Buffer *buf = (Block_Buffer *)ptr_data;
uint32_t len = 0;
uint32_t msg_id = 0;
if (buf->read_uint32(len) ||
buf->read_uint32(msg_id)) {
LOG_USER("deserialize error, cid:%d len:%d msg_id:%d", len, msg_id);
return -1;
}
process_async_buff(msg_id, *buf);
break;
}
default: {
return CALL_CONTINUE;
break;
}
}
return CALL_RETURN;
}