int Hero_Info_Detail::deserialize(Block_Buffer &r) {
	if( r.read_int32(hero_id)  ||  r.read_int32(hero_index)  ||  r.read_int32(hero_facade_id)  ||
			r.read_string(hero_name)  ||  r.read_int8(is_outer) ||  r.read_int8(is_fighter)  ||
			r.read_int32(level)  ||  r.read_int32(formation)  || r.read_int32(awake_lvl) ||
			r.read_double(exp)	)
			return -1;

	uint16_t __prop_value_vec_size;
	if(r.read_uint16(__prop_value_vec_size) )
			return -1;
	prop_value.reserve(__prop_value_vec_size);
	for(uint16_t i = 0; i < __prop_value_vec_size; ++i) {
			Int_Double v;
			if(v.deserialize(r))
					return -1;
			prop_value.push_back(v);
	}

	uint16_t size = 0;
	Artifact_Detail artifact_detail;
	r.read_uint16(size);
	for(uint16_t i = 0; i < size; ++i) {
		artifact_detail.reset();
		if (artifact_detail.deserialize(r)) {
			continue;
		};
		artifacts.insert(std::make_pair(artifact_detail.artifact_id, artifact_detail));
	}
	hero_fighter_detail.deserialize(r);
	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);
}
Exemplo n.º 3
0
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);
}
Exemplo n.º 4
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;
}
Exemplo n.º 5
0
int Prop_Base::deserialize(Block_Buffer & r) {
	if(r.read_double(basic_value)  ||  r.read_double(fixed_value)  ||  r.read_double(percent_value))
			return -1;
		return 0;
}
Exemplo n.º 6
0
int Prop_Setter::deserialize(Block_Buffer & r) {
	int prop_type_ =0, addition_type_ = 0;
	uint8_t operate_ = 0;
	if( r.read_int32(prop_type_)  ||  r.read_int32(addition_type_)  ||  r.read_uint8(operate_)  || r.read_double(basic) || r.read_double(fixed)  ||  r.read_double(percent)  )
			return -1;
	prop_type = Property_Type(prop_type_);
	addi_type = Addition_Type(addition_type_);
	operate = Operate_Type(operate_);
		return 0;
}