aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-21 07:33:13 +0000
committerMelanie Thielker2008-11-21 07:33:13 +0000
commitee4d4d784eb9b51b29fe4bda3fc9ec3594d24f5a (patch)
tree9ce899e33c2550d61048ca0690ba5e103aa8abd6 /OpenSim/Region/Environment/Scenes/Scene.cs
parentAllow selecting group objects and selecting objects by owner from the (diff)
downloadopensim-SC_OLD-ee4d4d784eb9b51b29fe4bda3fc9ec3594d24f5a.zip
opensim-SC_OLD-ee4d4d784eb9b51b29fe4bda3fc9ec3594d24f5a.tar.gz
opensim-SC_OLD-ee4d4d784eb9b51b29fe4bda3fc9ec3594d24f5a.tar.bz2
opensim-SC_OLD-ee4d4d784eb9b51b29fe4bda3fc9ec3594d24f5a.tar.xz
Fully implement object return from the parcel dialog
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs90
1 files changed, 48 insertions, 42 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index f37ba25..741c47e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -966,54 +966,60 @@ namespace OpenSim.Region.Environment.Scenes
966 /// <returns></returns> 966 /// <returns></returns>
967 public void Backup() 967 public void Backup()
968 { 968 {
969 m_returns.Clear(); 969 lock(m_returns)
970 970 {
971 EventManager.TriggerOnBackup(m_storageManager.DataStore); 971 EventManager.TriggerOnBackup(m_storageManager.DataStore);
972 m_backingup = false; 972 m_backingup = false;
973
974 foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns)
975 {
976 UUID transaction = UUID.Random();
977
978 GridInstantMessage msg = new GridInstantMessage();
979 msg.fromAgentID = new Guid(UUID.Zero.ToString()); // From server
980 msg.toAgentID = new Guid(ret.Key.ToString());
981 msg.imSessionID = new Guid(transaction.ToString());
982 msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
983 msg.fromAgentName = "Server";
984 msg.dialog = (byte)19; // Object msg
985 msg.fromGroup = false;
986 msg.offline = (byte)1;
987 msg.ParentEstateID = RegionInfo.EstateSettings.ParentEstateID;
988 msg.Position = Vector3.Zero;
989 msg.RegionID = RegionInfo.RegionID.Guid;
990 msg.binaryBucket = new byte[0];
991 if (ret.Value.count > 1)
992 msg.message = string.Format("Your {0} objects were returned from {1} in region {2} due to parcel auto return", ret.Value.count, ret.Value.location.ToString(), RegionInfo.RegionName);
993 else
994 msg.message = string.Format("Your object {0} was returned from {1} in region {2} due to parcel auto return", ret.Value.objectName, ret.Value.location.ToString(), RegionInfo.RegionName);
995 973
996 IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>(); 974 foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns)
997 if (tr != null) 975 {
998 tr.SendInstantMessage(msg, delegate(bool success) {} ); 976 UUID transaction = UUID.Random();
977
978 GridInstantMessage msg = new GridInstantMessage();
979 msg.fromAgentID = new Guid(UUID.Zero.ToString()); // From server
980 msg.toAgentID = new Guid(ret.Key.ToString());
981 msg.imSessionID = new Guid(transaction.ToString());
982 msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
983 msg.fromAgentName = "Server";
984 msg.dialog = (byte)19; // Object msg
985 msg.fromGroup = false;
986 msg.offline = (byte)1;
987 msg.ParentEstateID = RegionInfo.EstateSettings.ParentEstateID;
988 msg.Position = Vector3.Zero;
989 msg.RegionID = RegionInfo.RegionID.Guid;
990 msg.binaryBucket = new byte[0];
991 if (ret.Value.count > 1)
992 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);
993 else
994 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);
995
996 IMessageTransferModule tr = RequestModuleInterface<IMessageTransferModule>();
997 if (tr != null)
998 tr.SendInstantMessage(msg, delegate(bool success) {} );
999 }
1000 m_returns.Clear();
999 } 1001 }
1000 } 1002 }
1001 1003
1002 public void AddReturn(UUID agentID, string objectName, Vector3 location) 1004 public void AddReturn(UUID agentID, string objectName, Vector3 location, string reason)
1003 { 1005 {
1004 if (m_returns.ContainsKey(agentID)) 1006 lock(m_returns)
1005 {
1006 ReturnInfo info = m_returns[agentID];
1007 info.count++;
1008 m_returns[agentID] = info;
1009 }
1010 else
1011 { 1007 {
1012 ReturnInfo info = new ReturnInfo(); 1008 if (m_returns.ContainsKey(agentID))
1013 info.count = 1; 1009 {
1014 info.objectName = objectName; 1010 ReturnInfo info = m_returns[agentID];
1015 info.location = location; 1011 info.count++;
1016 m_returns[agentID] = info; 1012 m_returns[agentID] = info;
1013 }
1014 else
1015 {
1016 ReturnInfo info = new ReturnInfo();
1017 info.count = 1;
1018 info.objectName = objectName;
1019 info.location = location;
1020 info.reason = reason;
1021 m_returns[agentID] = info;
1022 }
1017 } 1023 }
1018 } 1024 }
1019 1025