aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2017-06-25 15:42:36 +0100
committerUbitUmarov2017-06-25 15:42:36 +0100
commit3ce909528dd42cd2c92d8ac6590135bb1962aee4 (patch)
tree0a86cc7a4f28c5aad8a52560a286966d7f452cb4 /OpenSim/Region
parentadd respective ossl helper funtion osDrawScaleTransform(string drawList, LSL_... (diff)
downloadopensim-SC_OLD-3ce909528dd42cd2c92d8ac6590135bb1962aee4.zip
opensim-SC_OLD-3ce909528dd42cd2c92d8ac6590135bb1962aee4.tar.gz
opensim-SC_OLD-3ce909528dd42cd2c92d8ac6590135bb1962aee4.tar.bz2
opensim-SC_OLD-3ce909528dd42cd2c92d8ac6590135bb1962aee4.tar.xz
change Backup calls overlap control code
Diffstat (limited to 'OpenSim/Region')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs73
1 files changed, 46 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ebef158..09b209e 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1942,7 +1942,6 @@ namespace OpenSim.Region.Framework.Scenes
1942 { 1942 {
1943 if (!m_backingup) 1943 if (!m_backingup)
1944 { 1944 {
1945 m_backingup = true;
1946 WorkManager.RunInThreadPool(o => Backup(false), null, string.Format("BackupWorker ({0})", Name)); 1945 WorkManager.RunInThreadPool(o => Backup(false), null, string.Format("BackupWorker ({0})", Name));
1947 } 1946 }
1948 } 1947 }
@@ -1971,38 +1970,58 @@ namespace OpenSim.Region.Framework.Scenes
1971 { 1970 {
1972 lock (m_returns) 1971 lock (m_returns)
1973 { 1972 {
1974 EventManager.TriggerOnBackup(SimulationDataService, forced); 1973 if(m_backingup)
1974 {
1975 m_log.WarnFormat("[Scene] Backup of {0} already running. New call skipped", RegionInfo.RegionName);
1976 return;
1977 }
1975 1978
1976 foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns) 1979 m_backingup = true;
1980 try
1977 { 1981 {
1978 UUID transaction = UUID.Random(); 1982 EventManager.TriggerOnBackup(SimulationDataService, forced);
1979 1983
1980 GridInstantMessage msg = new GridInstantMessage(); 1984 if(m_returns.Count == 0)
1981 msg.fromAgentID = new Guid(UUID.Zero.ToString()); // From server 1985 return;
1982 msg.toAgentID = new Guid(ret.Key.ToString());
1983 msg.imSessionID = new Guid(transaction.ToString());
1984 msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
1985 msg.fromAgentName = "Server";
1986 msg.dialog = (byte)19; // Object msg
1987 msg.fromGroup = false;
1988 msg.offline = (byte)1;
1989 msg.ParentEstateID = RegionInfo.EstateSettings.ParentEstateID;
1990 msg.Position = Vector3.Zero;
1991 msg.RegionID = RegionInfo.RegionID.Guid;
1992
1993 // We must fill in a null-terminated 'empty' string here since bytes[0] will crash viewer 3.
1994 msg.binaryBucket = Util.StringToBytes256("\0");
1995 if (ret.Value.count > 1)
1996 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);
1997 else
1998 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);
1999 1986
2000 IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>(); 1987 IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>();
2001 if (tr != null) 1988 if (tr == null)
1989 return;
1990
1991 uint unixtime = (uint)Util.UnixTimeSinceEpoch();
1992 uint estateid = RegionInfo.EstateSettings.ParentEstateID;
1993 Guid regionguid = RegionInfo.RegionID.Guid;
1994
1995 foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns)
1996 {
1997 GridInstantMessage msg = new GridInstantMessage();
1998 msg.fromAgentID = Guid.Empty; // From server
1999 msg.toAgentID = ret.Key.Guid;
2000 msg.imSessionID = Guid.NewGuid();
2001 msg.timestamp = unixtime;
2002 msg.fromAgentName = "Server";
2003 msg.dialog = 19; // Object msg
2004 msg.fromGroup = false;
2005 msg.offline = 1;
2006 msg.ParentEstateID = estateid;
2007 msg.Position = Vector3.Zero;
2008 msg.RegionID = regionguid;
2009
2010 // We must fill in a null-terminated 'empty' string here since bytes[0] will crash viewer 3.
2011 msg.binaryBucket = new Byte[1] {0};
2012 if (ret.Value.count > 1)
2013 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);
2014 else
2015 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);
2016
2002 tr.SendInstantMessage(msg, delegate(bool success) { }); 2017 tr.SendInstantMessage(msg, delegate(bool success) { });
2018 }
2019 m_returns.Clear();
2020 }
2021 finally
2022 {
2023 m_backingup = false;
2003 } 2024 }
2004 m_returns.Clear();
2005 m_backingup = false;
2006 } 2025 }
2007 } 2026 }
2008 2027