Changed the writer/reader access functions to m_primsInSync in PrimSyncInfoManager.

dsg
Huaiyu (Kitty) Liu 2011-06-28 14:47:56 -07:00
parent 9817734adf
commit 981ac91393
1 changed files with 213 additions and 183 deletions

View File

@ -3367,8 +3367,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
HashSet<SceneObjectPartSyncProperties> updatedProperties = updatedPrimProperties.Value;
//Sync the SOP data and cached property values in PrimSyncInfoManager again
HashSet<SceneObjectPartSyncProperties> propertiesWithSyncInfoUpdated = m_primSyncInfoManager.UpdatePrimSyncInfoByLocal(sop, new List<SceneObjectPartSyncProperties>(updatedProperties));
updatedProperties.UnionWith(propertiesWithSyncInfoUpdated);
//HashSet<SceneObjectPartSyncProperties> propertiesWithSyncInfoUpdated = m_primSyncInfoManager.UpdatePrimSyncInfoByLocal(sop, new List<SceneObjectPartSyncProperties>(updatedProperties));
//updatedProperties.UnionWith(propertiesWithSyncInfoUpdated);
SendPrimPropertyUpdates(sop, updatedProperties);
}
}
@ -3943,6 +3943,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
public OSDMap ToOSDMap()
{
OSDMap propertyData = new OSDMap();
lock (m_syncInfoLock)
{
propertyData["LastUpdateTimeStamp"] = LastUpdateTimeStamp;
propertyData["LastUpdateSyncID"] = LastUpdateSyncID;
@ -4139,6 +4141,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
DebugLog.WarnFormat("PrimSynInfo.PropertyToOSD -- no handler for property {0} ", m_property);
break;
}
}
return propertyData;
}
@ -7077,18 +7080,23 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{
lock (m_primsInSyncLock)
{
if (m_primsInSync.ContainsKey(primUUID))
{
m_primsInSync[primUUID] = primSyncInfo;
return false;
}
/*
//copy the items from the old list and insert the new record
Dictionary<UUID, PrimSyncInfo> newPrimsInSync = new Dictionary<UUID, PrimSyncInfo>(m_primsInSync);
newPrimsInSync.Add(primUUID, primSyncInfo);
//replace the old list
m_primsInSync = newPrimsInSync;
* */
m_primsInSync.Add(primUUID, primSyncInfo);
}
return true;
}
@ -7113,10 +7121,13 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
m_primsInSync[part.UUID] = primSyncInfo;
return false;
}
/*
Dictionary<UUID, PrimSyncInfo> newPrimsInSync = new Dictionary<UUID, PrimSyncInfo>(m_primsInSync);
newPrimsInSync.Add(part.UUID, primSyncInfo);
m_primsInSync = newPrimsInSync;
* */
m_primsInSync.Add(part.UUID, primSyncInfo);
}
return true;
}
@ -7126,6 +7137,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
lock (m_primsInSyncLock)
{
//copy the old list, update the copied list
/*
Dictionary<UUID, PrimSyncInfo> newPrimsInSync = new Dictionary<UUID, PrimSyncInfo>(m_primsInSync);
foreach (KeyValuePair<UUID, PrimSyncInfo> valPair in multiPrimsSyncInfo)
{
@ -7141,6 +7153,19 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
//replace the old list
m_primsInSync = newPrimsInSync;
* */
foreach (KeyValuePair<UUID, PrimSyncInfo> valPair in multiPrimsSyncInfo)
{
UUID primUUID = valPair.Key;
PrimSyncInfo primSyncInfo = valPair.Value;
if (m_primsInSync.ContainsKey(primUUID))
{
m_primsInSync[primUUID] = primSyncInfo;
continue;
}
m_primsInSync.Add(primUUID, primSyncInfo);
}
}
}
@ -7152,21 +7177,26 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
}
lock (m_primsInSyncLock)
{
/*
Dictionary<UUID, PrimSyncInfo> newPrimsInSync = new Dictionary<UUID, PrimSyncInfo>(m_primsInSync);
newPrimsInSync.Remove(part.UUID);
m_primsInSync = newPrimsInSync;
* */
m_primsInSync.Remove(part.UUID);
}
return true;
}
public PrimSyncInfo GetPrimSyncInfo(UUID primUUID)
{
lock (m_primsInSyncLock)
{
if (m_primsInSync.ContainsKey(primUUID))
{
return m_primsInSync[primUUID];
}
else
}
return null;
}