change Backup calls overlap control code
parent
84abdf866a
commit
3ce909528d
|
@ -1942,7 +1942,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
if (!m_backingup)
|
||||
{
|
||||
m_backingup = true;
|
||||
WorkManager.RunInThreadPool(o => Backup(false), null, string.Format("BackupWorker ({0})", Name));
|
||||
}
|
||||
}
|
||||
|
@ -1970,41 +1969,61 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
public void Backup(bool forced)
|
||||
{
|
||||
lock (m_returns)
|
||||
{
|
||||
if(m_backingup)
|
||||
{
|
||||
m_log.WarnFormat("[Scene] Backup of {0} already running. New call skipped", RegionInfo.RegionName);
|
||||
return;
|
||||
}
|
||||
|
||||
m_backingup = true;
|
||||
try
|
||||
{
|
||||
EventManager.TriggerOnBackup(SimulationDataService, forced);
|
||||
|
||||
if(m_returns.Count == 0)
|
||||
return;
|
||||
|
||||
IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>();
|
||||
if (tr == null)
|
||||
return;
|
||||
|
||||
uint unixtime = (uint)Util.UnixTimeSinceEpoch();
|
||||
uint estateid = RegionInfo.EstateSettings.ParentEstateID;
|
||||
Guid regionguid = RegionInfo.RegionID.Guid;
|
||||
|
||||
foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns)
|
||||
{
|
||||
UUID transaction = UUID.Random();
|
||||
|
||||
GridInstantMessage msg = new GridInstantMessage();
|
||||
msg.fromAgentID = new Guid(UUID.Zero.ToString()); // From server
|
||||
msg.toAgentID = new Guid(ret.Key.ToString());
|
||||
msg.imSessionID = new Guid(transaction.ToString());
|
||||
msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
|
||||
msg.fromAgentID = Guid.Empty; // From server
|
||||
msg.toAgentID = ret.Key.Guid;
|
||||
msg.imSessionID = Guid.NewGuid();
|
||||
msg.timestamp = unixtime;
|
||||
msg.fromAgentName = "Server";
|
||||
msg.dialog = (byte)19; // Object msg
|
||||
msg.dialog = 19; // Object msg
|
||||
msg.fromGroup = false;
|
||||
msg.offline = (byte)1;
|
||||
msg.ParentEstateID = RegionInfo.EstateSettings.ParentEstateID;
|
||||
msg.offline = 1;
|
||||
msg.ParentEstateID = estateid;
|
||||
msg.Position = Vector3.Zero;
|
||||
msg.RegionID = RegionInfo.RegionID.Guid;
|
||||
msg.RegionID = regionguid;
|
||||
|
||||
// We must fill in a null-terminated 'empty' string here since bytes[0] will crash viewer 3.
|
||||
msg.binaryBucket = Util.StringToBytes256("\0");
|
||||
msg.binaryBucket = new Byte[1] {0};
|
||||
if (ret.Value.count > 1)
|
||||
msg.message = string.Format("Your {0} objects were returned from {1} in region {2} due to {3}", ret.Value.count, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason);
|
||||
else
|
||||
msg.message = string.Format("Your object {0} was returned from {1} in region {2} due to {3}", ret.Value.objectName, ret.Value.location.ToString(), RegionInfo.RegionName, ret.Value.reason);
|
||||
|
||||
IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>();
|
||||
if (tr != null)
|
||||
tr.SendInstantMessage(msg, delegate(bool success) { });
|
||||
}
|
||||
m_returns.Clear();
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_backingup = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Synchronous force backup. For deletes and links/unlinks
|
||||
|
|
Loading…
Reference in New Issue