function wpn_d_r(sobj)
local sv_sip = net_packet()
	sobj:STATE_Write(sv_sip)
local size = sv_sip:w_tell()
	sv_sip:r_seek(0)
local tab_config = {object_pack = {},visual_pack = {},item_pack = {},item_wpn_packet = {}}

local function up_vis_pack(visual_pack,sv_sip,size)
	visual_pack.visual_name = sv_sip:r_stringZ()
	visual_pack.vsu8u1 = sv_sip:r_u8()
	return visual_pack
end

	tab_config.object_pack.gvid = sv_sip:r_u16()
	tab_config.object_pack.obf32u1 = sv_sip:r_float()
	tab_config.object_pack.obs32u2 = sv_sip:r_s32()
	tab_config.object_pack.lvid = sv_sip:r_s32()
	tab_config.object_pack.oflags = sv_sip:r_s32()
	tab_config.object_pack.custom = sv_sip:r_stringZ()
	tab_config.object_pack.sid = sv_sip:r_s32()
	tab_config.object_pack.obs32u3 = sv_sip:r_s32()
	
	up_vis_pack(tab_config.visual_pack,sv_sip,size)
	
	tab_config.item_pack.condition = sv_sip:r_float()
	
	tab_config.item_wpn_packet.ammo_current = sv_sip:r_u16()
	tab_config.item_wpn_packet.ammo_elapsed = sv_sip:r_u16()
	tab_config.item_wpn_packet.weapon_state = sv_sip:r_u8()
	tab_config.item_wpn_packet.addon_flags = sv_sip:r_u8()
	tab_config.item_wpn_packet.ammo_type = sv_sip:r_u8()

		return tab_config
end

function wpn_d_w(tab_config,sobj)
local sv_sip = net_packet()
local function vis_pack_rd(visual_pack,sv_sip)
	sv_sip:w_stringZ(visual_pack.visual_name)
	sv_sip:w_u8(visual_pack.vsu8u1)
	return visual_pack
end

	sv_sip:w_u16(tab_config.object_pack.gvid)
	sv_sip:w_float(tab_config.object_pack.obf32u1)
	sv_sip:w_s32(tab_config.object_pack.obs32u2)
	sv_sip:w_s32(tab_config.object_pack.lvid)
	sv_sip:w_s32(tab_config.object_pack.oflags)
	sv_sip:w_stringZ(tab_config.object_pack.custom)
	sv_sip:w_s32(tab_config.object_pack.sid)
	sv_sip:w_s32(tab_config.object_pack.obs32u3)
	
	vis_pack_rd(tab_config.visual_pack,sv_sip)
	
	sv_sip:w_float(tab_config.item_pack.condition)

	sv_sip:w_u16(tab_config.item_wpn_packet.ammo_current)
	sv_sip:w_u16(tab_config.item_wpn_packet.ammo_elapsed)
	sv_sip:w_u8(tab_config.item_wpn_packet.weapon_state)
	sv_sip:w_u8(tab_config.item_wpn_packet.addon_flags)
	sv_sip:w_u8(tab_config.item_wpn_packet.ammo_type)

	sv_sip:w_u16(tab_config.object_pack.gvid)
	sv_sip:w_float(tab_config.object_pack.obf32u1)
	sv_sip:w_s32(tab_config.object_pack.obs32u2)
	sv_sip:w_s32(tab_config.object_pack.lvid)
	sv_sip:w_s32(tab_config.object_pack.oflags)
	sv_sip:w_stringZ(tab_config.object_pack.custom)
	sv_sip:w_s32(tab_config.object_pack.sid)
	sv_sip:w_s32(tab_config.object_pack.obs32u3)

local size = sv_sip:w_tell()
	sv_sip:r_seek(0)
	sobj:STATE_Read(sv_sip,size)
end