Esempio n. 1
0
        public void InsertSyncInfo(UUID uuid, SyncInfoBase syncinfo)
        {
            bool isPrim = syncinfo is SyncInfoPrim;

            // DebugLog.WarnFormat("[SYNC INFO MANAGER] InsertSyncInfo for uuid {0}, type={1}", uuid, isPrim?"Prim":"Presence");
            lock (m_syncLock)
                m_syncedUUIDs[uuid] = syncinfo;
        }
Esempio n. 2
0
        /// <summary>
        /// For a newly synced object or avatar, create a SyncInfoBase for it.
        /// Assume the timestamp for each property is at least T ticks old, T=m_ageOutThreshold.
        /// </summary>
        /// <param name="uuid"></param>
        /// <param name="syncInfoInitTime"></param>
        /// <param name="syncID"></param>
        public void InsertSyncInfo(UUID uuid, long syncInfoInitTime, string syncID)
        {
            // DebugLog.WarnFormat("[SYNC INFO MANAGER] InsertSyncInfo: uuid={0}, syncID={1}", uuid, syncID);
            long         lastUpdateTimeStamp = syncInfoInitTime - m_ageOutThreshold;
            SyncInfoBase sib = SyncInfoBase.SyncInfoFactory(uuid, Scene, lastUpdateTimeStamp, syncID);

            lock (m_syncLock)
            {
                m_syncedUUIDs[uuid] = sib;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// For each property in updatedProperties, (1) if the value in local sop/sp's
        /// data is different than that in SyncInfo, and what's in SyncInfo
        /// has an older timestamp, then update that property's value and syncInfo
        /// in SyncInfo; (2) otherwise, skip the property and do nothing.
        /// </summary>
        /// <param name="part"></param>
        /// <param name="updatedProperties"></param>
        /// <returns>The list properties among updatedProperties whose value have been copied over to SyncInfo.</returns>
        public HashSet <SyncableProperties.Type> UpdateSyncInfoByLocal(UUID uuid, HashSet <SyncableProperties.Type> updatedProperties)
        {
            SyncInfoBase thisSyncInfo = null;
            bool         found        = false;

            lock (m_syncLock){
                found = m_syncedUUIDs.TryGetValue(uuid, out thisSyncInfo);
            }
            if (found)
            {
                // DebugLog.WarnFormat("[SYNC INFO MANAGER] UpdateSyncInfoByLocal SyncInfo for {0} FOUND.", uuid);
                return(thisSyncInfo.UpdatePropertiesByLocal(uuid, updatedProperties, RegionSyncModule.NowTicks(), m_regionSyncModule.SyncID));
            }
            // DebugLog.WarnFormat("[SYNC INFO MANAGER] UpdateSyncInfoByLocal SyncInfo for {0} NOT FOUND.", uuid);
            return(new HashSet <SyncableProperties.Type>());
        }
Esempio n. 4
0
        public HashSet <string> GetLastUpdatedSyncIDs(UUID uuid, HashSet <SyncableProperties.Type> properties)
        {
            HashSet <string> syncIDs      = null;
            SyncInfoBase     thisSyncInfo = null;
            bool             found        = false;

            lock (m_syncLock)
            {
                found = m_syncedUUIDs.TryGetValue(uuid, out thisSyncInfo);
            }
            if (found)
            {
                syncIDs = thisSyncInfo.GetLastUpdateSyncIDs(properties);
            }

            return(syncIDs);
        }
Esempio n. 5
0
        public OSDMap EncodeProperties(UUID uuid, HashSet <SyncableProperties.Type> propertiesToEncode)
        {
            // DebugLog.WarnFormat("[SYNC INFO MANAGER] EncodeProperties SyncInfo for {0}", uuid);
            SyncInfoBase thisSyncInfo = null;

            lock (m_syncLock)
            {
                m_syncedUUIDs.TryGetValue(uuid, out thisSyncInfo);
            }
            if (thisSyncInfo != null)
            {
                OSDMap data = new OSDMap();
                data["uuid"]       = OSD.FromUUID(uuid);
                data["properties"] = thisSyncInfo.EncodeSyncedProperties(propertiesToEncode);
                return(data);
            }

            // DebugLog.WarnFormat("[SYNC INFO MANAGER] EncodeProperties SyncInfo for {0} not in m_syncedUUIDs.", uuid);
            return(null);
        }
Esempio n. 6
0
        public HashSet <SyncableProperties.Type> UpdateSyncInfoBySync(UUID uuid, HashSet <SyncedProperty> syncedProperties)
        {
            SyncInfoBase thisSyncInfo = null;
            bool         found        = false;

            lock (m_syncLock)
            {
                found = m_syncedUUIDs.TryGetValue(uuid, out thisSyncInfo);
            }
            if (found)
            {
                //DebugLog.WarnFormat("[SYNC INFO MANAGER] UpdateSyncInfoBySync SyncInfo for {0} FOUND.", uuid);
                //return m_syncedUUIDs[uuid].UpdatePropertiesBySync(uuid, syncedProperties);
                return(thisSyncInfo.UpdatePropertiesBySync(uuid, syncedProperties));
            }

            //This should not happen, as we should only receive UpdatedPrimProperties after receiving a NewObject message
            DebugLog.WarnFormat("[SYNC INFO MANAGER] UpdateSyncInfoBySync SyncInfo for {0} NOT FOUND.", uuid);
            return(new HashSet <SyncableProperties.Type>());
        }
Esempio n. 7
0
        public SyncInfoBase GetSyncInfo(UUID uuid)
        {
            // DebugLog.WarnFormat("[SYNC INFO MANAGER] GetSyncInfo for uuid {0}", uuid);
            // Should never be called unless SyncInfo has already been added
            //lock (m_syncLock)
            //    return m_syncedUUIDs[uuid];
            SyncInfoBase thisSyncInfo = null;
            bool         found        = false;

            lock (m_syncLock)
            {
                found = m_syncedUUIDs.TryGetValue(uuid, out thisSyncInfo);
            }
            if (found)
            {
                return(thisSyncInfo);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 8
0
 // Decodes scene presence data into sync info
 protected void DecodeScenePresence(OSDMap data, out SyncInfoBase syncInfo, Scene scene)
 {
     //Decode the syncInfo
     try
     {
     UUID uuid = data["uuid"].AsUUID();
     OSDMap presenceData = (OSDMap)data["ScenePresence"];
     OSDArray properties = (OSDArray)presenceData["properties"];
     syncInfo = new SyncInfoPresence(uuid, (OSDArray)properties, scene);
     }
     catch (Exception)
     {
     m_log.ErrorFormat("{0}: DecodeScenePresence missing required data", LogHeader);
     syncInfo = null;
     }
 }