Пример #1
0
        public static Message Decode(UDPPacket p)
        {
            var m = new RemoveInventoryItem
            {
                AgentID   = p.ReadUUID(),
                SessionID = p.ReadUUID()
            };
            uint c = p.ReadUInt8();

            for (uint i = 0; i < c; ++i)
            {
                m.InventoryData.Add(p.ReadUUID());
            }

            return(m);
        }
Пример #2
0
        public static Message DeserializeEQG(IValue value)
        {
            var m   = (MapType)value;
            var a   = (MapType)((AnArray)m["AgentData"])[0];
            var res = new RemoveInventoryItem
            {
                AgentID   = a["AgentID"].AsUUID,
                SessionID = a["SessionID"].AsUUID
            };

            foreach (MapType foldermap in ((AnArray)m["InventoryData"]).OfType <MapType>())
            {
                res.InventoryData.Add(foldermap["ItemID"].AsUUID);
            }

            return(res);
        }