Esempio n. 1
0
        /// <summary>
        /// Make an OSDMap (json) with only the needed parts for the database and then compress it
        /// </summary>
        /// <returns>A compressed (gzip) string of the data needed for the database</returns>
        public string CompressedPack()
        {
            OSDMap assetMap = new OSDMap();

            assetMap["AssetFlags"]   = (int)this.AssetFlags;
            assetMap["CreationDate"] = this.CreationDate;
            assetMap["CreatorID"]    = this.CreatorID;

            //In the database table, don't save it
            //assetMap["OwnerID"] = this.OwnerID;

            //In the database table, don't save it
            //assetMap["Data"] = this.Data;

            assetMap["HostUri"]      = this.HostUri;
            assetMap["LastAccessed"] = this.LastAccessed;
            assetMap["LastChanged"]  = this.LastChanged;

            //In the database table, don't save it
            //assetMap["Name"] = this.Name;

            //In the database table, don't save it
            //assetMap["AssetType"] = (int)this.AssetType;

            //Serialize it with json
            string jsonString = OSDParser.SerializeJsonString(assetMap);
            //Now use gzip to compress this map
            string compressedString = Util.Compress(jsonString);

            return(compressedString);
        }