本文整理汇总了C#中ISimulationDataService.StoreObject方法的典型用法代码示例。如果您正苦于以下问题:C# ISimulationDataService.StoreObject方法的具体用法?C# ISimulationDataService.StoreObject怎么用?C# ISimulationDataService.StoreObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISimulationDataService
的用法示例。
在下文中一共展示了ISimulationDataService.StoreObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessBackup
//.........这里部分代码省略.........
// don't autoreturn if we have a sitting avatar
// mantis 7828 (but none the provided patchs)
if(GetSittingAvatarsCount() > 0)
{
// do not respect npcs
List<ScenePresence> sitters = GetSittingAvatars();
foreach(ScenePresence sp in sitters)
{
if(!sp.IsDeleted && !sp.isNPC && sp.IsSatOnObject)
return;
}
}
DetachFromBackup();
m_log.DebugFormat(
"[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
RootPart.UUID);
m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero,
DeRezAction.Return, UUID.Zero);
return;
}
}
}
}
if (m_scene.UseBackup && HasGroupChanged)
{
// don't backup while it's selected or you're asking for changes mid stream.
if (isTimeToPersist() || forcedBackup)
{
if (m_rootPart.PhysActor != null &&
(!m_rootPart.PhysActor.IsPhysical))
{
// Possible ghost prim
if (m_rootPart.PhysActor.Position != m_rootPart.GroupPosition)
{
foreach (SceneObjectPart part in m_parts.GetArray())
{
// Re-set physics actor positions and
// orientations
part.GroupPosition = m_rootPart.GroupPosition;
}
}
}
// m_log.DebugFormat(
// "[SCENE]: Storing {0}, {1} in {2}",
// Name, UUID, m_scene.RegionInfo.RegionName);
if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0)
{
RootPart.Shape.LastAttachPoint = RootPart.Shape.State;
RootPart.Shape.State = 0;
ScheduleGroupForFullUpdate();
}
SceneObjectGroup backup_group = Copy(false);
backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration;
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
HasGroupChanged = false;
GroupContainsForeignPrims = false;
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
backup_group.ForEachPart(delegate(SceneObjectPart part)
{
part.Inventory.ProcessInventoryBackup(datastore);
if(part.KeyframeMotion != null)
{
part.KeyframeMotion.Delete();
part.KeyframeMotion = null;
}
});
backup_group.Clear();
backup_group = null;
}
// else
// {
// m_log.DebugFormat(
// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
// Name, UUID, IsSelected);
// }
}
}
catch (Exception e)
{
m_log.ErrorFormat(
"[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}",
Name, UUID, m_scene.RegionInfo.RegionName, e.Message, e.StackTrace);
}
}
示例2: ProcessBackup
/// <summary>
/// Processes backup.
/// </summary>
/// <param name="datastore"></param>
public virtual void ProcessBackup(ISimulationDataService datastore, bool forcedBackup)
{
if (!m_isBackedUp)
{
// m_log.DebugFormat(
// "[WATER WARS]: Ignoring backup of {0} {1} since object is not marked to be backed up", Name, UUID);
return;
}
if (IsDeleted || UUID == UUID.Zero)
{
// m_log.DebugFormat(
// "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
return;
}
// Since this is the top of the section of call stack for backing up a particular scene object, don't let
// any exception propogate upwards.
try
{
if (!m_scene.ShuttingDown) // if shutting down then there will be nothing to handle the return so leave till next restart
{
ILandObject parcel = m_scene.LandChannel.GetLandObject(
m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
if (parcel != null && parcel.LandData != null &&
parcel.LandData.OtherCleanTime != 0)
{
if (parcel.LandData.OwnerID != OwnerID &&
(parcel.LandData.GroupID != GroupID ||
parcel.LandData.GroupID == UUID.Zero))
{
if ((DateTime.UtcNow - RootPart.Rezzed).TotalMinutes >
parcel.LandData.OtherCleanTime)
{
DetachFromBackup();
m_log.DebugFormat(
"[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
RootPart.UUID);
m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero,
DeRezAction.Return, UUID.Zero);
return;
}
}
}
}
if (m_scene.UseBackup && HasGroupChanged)
{
// don't backup while it's selected or you're asking for changes mid stream.
if (isTimeToPersist() || forcedBackup)
{
// m_log.DebugFormat(
// "[SCENE]: Storing {0}, {1} in {2}",
// Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(false);
backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration;
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
HasGroupChanged = false;
HasGroupChangedDueToDelink = false;
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
backup_group.ForEachPart(delegate(SceneObjectPart part)
{
part.Inventory.ProcessInventoryBackup(datastore);
});
backup_group = null;
}
// else
// {
// m_log.DebugFormat(
// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
// Name, UUID, IsSelected);
// }
}
}
catch (Exception e)
{
m_log.ErrorFormat(
"[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}",
Name, UUID, m_scene.RegionInfo.RegionName, e.Message, e.StackTrace);
}
}
示例3: ProcessBackup
/// <summary>
/// Processes backup.
/// </summary>
/// <param name="datastore"></param>
public virtual bool ProcessBackup(ISimulationDataService datastore, bool forcedBackup)
{
//if (!m_isBackedUp)
// return true;
// Since this is the top of the section of call stack for backing up a particular scene object, don't let
// any exception propogate upwards.
if (IsDeleted || UUID == UUID.Zero)
return true;
try
{
if (isTimeToPersist() || forcedBackup) // forced means FORCED, you don't get a choice!
{
if (HasGroupChanged || forcedBackup)
{
// don't backup while it's selected or you're asking for changes mid stream.
//m_log.DebugFormat(
// "[SCENE]: Storing {0}, {1} in {2}",
// Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false, Scene, false);
backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration;
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
HasGroupChanged = false;
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
backup_group.ForEachPart(delegate(SceneObjectPart part)
{
part.Inventory.ProcessInventoryBackup(datastore);
});
backup_group = null;
return true;
}
}
}
catch (Exception e)
{
m_log.ErrorFormat(
"[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}\n\t{4}",
Name, UUID, m_scene.RegionInfo.RegionName, e, e.StackTrace);
}
return false;
}