aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-06-29 20:36:36 +0100
committerMelanie2010-06-29 20:36:36 +0100
commit5d11833ae1969718187c23b9d29ebd233ecbb401 (patch)
tree3be12b67f0c1198a10c2e15afbfffa32b8a4f77f /OpenSim
parentFix a nullref on autoreturn (diff)
parentstop exceptions in setting and getting state from propogating since they aren... (diff)
downloadopensim-SC_OLD-5d11833ae1969718187c23b9d29ebd233ecbb401.zip
opensim-SC_OLD-5d11833ae1969718187c23b9d29ebd233ecbb401.tar.gz
opensim-SC_OLD-5d11833ae1969718187c23b9d29ebd233ecbb401.tar.bz2
opensim-SC_OLD-5d11833ae1969718187c23b9d29ebd233ecbb401.tar.xz
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs39
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs85
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs4
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs6
-rw-r--r--OpenSim/Services/InventoryService/HGInventoryService.cs4
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs9
11 files changed, 133 insertions, 46 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 5552be7..6f044cb 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -768,8 +768,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
768 bool canEditObjectsChanged = ((rights ^ userFlags) & (int)FriendRights.CanModifyObjects) != 0; 768 bool canEditObjectsChanged = ((rights ^ userFlags) & (int)FriendRights.CanModifyObjects) != 0;
769 if (canEditObjectsChanged) 769 if (canEditObjectsChanged)
770 friendClient.SendChangeUserRights(userID, friendID, rights); 770 friendClient.SendChangeUserRights(userID, friendID, rights);
771
771 } 772 }
772 773
774 // update local cache
775 //m_Friends[friendID].Friends = m_FriendsService.GetFriends(friendID);
776 foreach (FriendInfo finfo in m_Friends[friendID].Friends)
777 if (finfo.Friend == userID.ToString())
778 finfo.TheirFlags = rights;
779
773 return true; 780 return true;
774 } 781 }
775 782
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 2ab46aa..58c396c 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
131 return ret; 131 return ret;
132 } 132 }
133 133
134 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 134 public override UUID DeleteToInventory(DeRezAction action, UUID folderID,
135 SceneObjectGroup objectGroup, IClientAPI remoteClient) 135 SceneObjectGroup objectGroup, IClientAPI remoteClient)
136 { 136 {
137 UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient); 137 UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 3035d88..12b6aa0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -286,23 +286,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
286 { 286 {
287 // Deleting someone else's item 287 // Deleting someone else's item
288 // 288 //
289
290
291 if (remoteClient == null || 289 if (remoteClient == null ||
292 objectGroup.OwnerID != remoteClient.AgentId) 290 objectGroup.OwnerID != remoteClient.AgentId)
293 { 291 {
294 // Folder skeleton may not be loaded and we 292
295 // have to wait for the inventory to find
296 // the destination folder
297 //
298 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); 293 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
299 } 294 }
300 else 295 else
301 { 296 {
302 // Assume inventory skeleton was loaded during login 297 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
303 // and all folders can be found
304 //
305 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
306 } 298 }
307 } 299 }
308 else if (action == DeRezAction.Return) 300 else if (action == DeRezAction.Return)
@@ -332,7 +324,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
332 324
333 if (folder == null) // None of the above 325 if (folder == null) // None of the above
334 { 326 {
335 //folder = userInfo.RootFolder.FindFolder(folderID);
336 folder = new InventoryFolderBase(folderID); 327 folder = new InventoryFolderBase(folderID);
337 328
338 if (folder == null) // Nowhere to put it 329 if (folder == null) // Nowhere to put it
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
index ae03cdf..209cf0d 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
@@ -96,7 +96,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory
96 96
97 Object[] args = new Object[] { m_Config, MainServer.Instance, "HGInventoryService" }; 97 Object[] args = new Object[] { m_Config, MainServer.Instance, "HGInventoryService" };
98 98
99 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:HGInventoryServiceInConnector", args); 99 ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:XInventoryInConnector", args);
100 } 100 }
101 } 101 }
102 102
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index 4d360f6..a1451ce 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -134,8 +134,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
134 134
135 foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) 135 foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
136 { 136 {
137 if (kvp.Key != UUID.Zero) 137 m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
138 m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
139 } 138 }
140 139
141 m_requestCallbackTimer.Enabled = true; 140 m_requestCallbackTimer.Enabled = true;
@@ -270,7 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
270 } 269 }
271 catch (Exception e) 270 catch (Exception e)
272 { 271 {
273 m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}{1}", e.Message, e.StackTrace); 272 m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e);
274 } 273 }
275 } 274 }
276 275
@@ -286,8 +285,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
286 catch (Exception e) 285 catch (Exception e)
287 { 286 {
288 m_log.ErrorFormat( 287 m_log.ErrorFormat(
289 "[ARCHIVER]: Terminating archive creation since asset requester callback failed with {0}{1}", 288 "[ARCHIVER]: Terminating archive creation since asset requster callback failed with {0}", e);
290 e.Message, e.StackTrace);
291 } 289 }
292 } 290 }
293 } 291 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 3a8f168..a6067ad 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -218,7 +218,7 @@ namespace OpenSim.Region.Framework.Scenes
218 foreach (IScriptModule e in engines) 218 foreach (IScriptModule e in engines)
219 { 219 {
220 if (e != null) 220 if (e != null)
221 { 221 {
222 ArrayList errors = e.GetScriptErrors(itemID); 222 ArrayList errors = e.GetScriptErrors(itemID);
223 foreach (Object line in errors) 223 foreach (Object line in errors)
224 ret.Add(line); 224 ret.Add(line);
@@ -356,14 +356,26 @@ namespace OpenSim.Region.Framework.Scenes
356 356
357 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; 357 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml;
358 } 358 }
359
359 foreach (IScriptModule e in engines) 360 foreach (IScriptModule e in engines)
360 { 361 {
361 if (e != null) 362 if (e != null)
362 { 363 {
363 if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID])) 364 // Stop an exception in setting saved state from propogating since this is not fatal.
364 break; 365 try
366 {
367 if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
368 break;
369 }
370 catch (Exception ex)
371 {
372 m_log.WarnFormat(
373 "[PRIM INVENTORY]: Could not set script state for old key {0}, new key {1} in prim {2} {3}. Exception {4}{5}",
374 oldID, newID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
375 }
365 } 376 }
366 } 377 }
378
367 m_part.ParentGroup.m_savedScriptState.Remove(oldID); 379 m_part.ParentGroup.m_savedScriptState.Remove(oldID);
368 } 380 }
369 } 381 }
@@ -1021,12 +1033,23 @@ namespace OpenSim.Region.Framework.Scenes
1021 { 1033 {
1022 if (e != null) 1034 if (e != null)
1023 { 1035 {
1024 string n = e.GetXMLState(item.ItemID); 1036 // Stop any exception from the script engine from propogating since setting state
1025 if (n != String.Empty) 1037 // isn't essential.
1038 try
1039 {
1040 string n = e.GetXMLState(item.ItemID);
1041 if (n != String.Empty)
1042 {
1043 if (!ret.ContainsKey(item.ItemID))
1044 ret[item.ItemID] = n;
1045 break;
1046 }
1047 }
1048 catch (Exception ex)
1026 { 1049 {
1027 if (!ret.ContainsKey(item.ItemID)) 1050 m_log.WarnFormat(
1028 ret[item.ItemID] = n; 1051 "[PRIM INVENTORY]: Could not retrieve script state for item {0} {1} in prim {2} {3}. Exception {4}{5}",
1029 break; 1052 item.Name, item.ItemID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
1030 } 1053 }
1031 } 1054 }
1032 } 1055 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 1feb153..712bd7d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -705,22 +705,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
705 { 705 {
706 //A and B should both be normalized 706 //A and B should both be normalized
707 m_host.AddScriptLPS(1); 707 m_host.AddScriptLPS(1);
708 double dotProduct = LSL_Vector.Dot(a, b); 708 LSL_Rotation rotBetween;
709 LSL_Vector crossProduct = LSL_Vector.Cross(a, b); 709 // Check for zero vectors. If either is zero, return zero rotation. Otherwise,
710 double magProduct = LSL_Vector.Mag(a) * LSL_Vector.Mag(b); 710 // continue calculation.
711 double angle = Math.Acos(dotProduct / magProduct); 711 if (a == new LSL_Vector(0.0f, 0.0f, 0.0f) || b == new LSL_Vector(0.0f, 0.0f, 0.0f))
712 LSL_Vector axis = LSL_Vector.Norm(crossProduct); 712 {
713 double s = Math.Sin(angle / 2); 713 rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
714 714 }
715 double x = axis.x * s; 715 else
716 double y = axis.y * s; 716 {
717 double z = axis.z * s; 717 a = LSL_Vector.Norm(a);
718 double w = Math.Cos(angle / 2); 718 b = LSL_Vector.Norm(b);
719 719 double dotProduct = LSL_Vector.Dot(a, b);
720 if (Double.IsNaN(x) || Double.IsNaN(y) || Double.IsNaN(z) || Double.IsNaN(w)) 720 // There are two degenerate cases possible. These are for vectors 180 or
721 return new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f); 721 // 0 degrees apart. These have to be detected and handled individually.
722 722 //
723 return new LSL_Rotation((float)x, (float)y, (float)z, (float)w); 723 // Check for vectors 180 degrees apart.
724 // A dot product of -1 would mean the angle between vectors is 180 degrees.
725 if (dotProduct < -0.9999999f)
726 {
727 // First assume X axis is orthogonal to the vectors.
728 LSL_Vector orthoVector = new LSL_Vector(1.0f, 0.0f, 0.0f);
729 orthoVector = orthoVector - a * (a.x / LSL_Vector.Dot(a, a));
730 // Check for near zero vector. A very small non-zero number here will create
731 // a rotation in an undesired direction.
732 if (LSL_Vector.Mag(orthoVector) > 0.0001)
733 {
734 rotBetween = new LSL_Rotation(orthoVector.x, orthoVector.y, orthoVector.z, 0.0f);
735 }
736 // If the magnitude of the vector was near zero, then assume the X axis is not
737 // orthogonal and use the Z axis instead.
738 else
739 {
740 // Set 180 z rotation.
741 rotBetween = new LSL_Rotation(0.0f, 0.0f, 1.0f, 0.0f);
742 }
743 }
744 // Check for parallel vectors.
745 // A dot product of 1 would mean the angle between vectors is 0 degrees.
746 else if (dotProduct > 0.9999999f)
747 {
748 // Set zero rotation.
749 rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
750 }
751 else
752 {
753 // All special checks have been performed so get the axis of rotation.
754 LSL_Vector crossProduct = LSL_Vector.Cross(a, b);
755 // Quarternion s value is the length of the unit vector + dot product.
756 double qs = 1.0 + dotProduct;
757 rotBetween = new LSL_Rotation(crossProduct.x, crossProduct.y, crossProduct.z, qs);
758 // Normalize the rotation.
759 double mag = LSL_Rotation.Mag(rotBetween);
760 // We shouldn't have to worry about a divide by zero here. The qs value will be
761 // non-zero because we already know if we're here, then the dotProduct is not -1 so
762 // qs will not be zero. Also, we've already handled the input vectors being zero so the
763 // crossProduct vector should also not be zero.
764 rotBetween.x = rotBetween.x / mag;
765 rotBetween.y = rotBetween.y / mag;
766 rotBetween.z = rotBetween.z / mag;
767 rotBetween.s = rotBetween.s / mag;
768 // Check for undefined values and set zero rotation if any found. This code might not actually be required
769 // any longer since zero vectors are checked for at the top.
770 if (Double.IsNaN(rotBetween.x) || Double.IsNaN(rotBetween.y) || Double.IsNaN(rotBetween.z) || Double.IsNaN(rotBetween.s))
771 {
772 rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
773 }
774 }
775 }
776 return rotBetween;
724 } 777 }
725 778
726 public void llWhisper(int channelID, string text) 779 public void llWhisper(int channelID, string text)
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 6e580f1..ac6a3ab 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Server.Handlers.Asset
44{ 44{
45 public class XInventoryInConnector : ServiceConnector 45 public class XInventoryInConnector : ServiceConnector
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48
47 private IInventoryService m_InventoryService; 49 private IInventoryService m_InventoryService;
48 private string m_ConfigName = "InventoryService"; 50 private string m_ConfigName = "InventoryService";
49 51
@@ -53,6 +55,8 @@ namespace OpenSim.Server.Handlers.Asset
53 if (configName != String.Empty) 55 if (configName != String.Empty)
54 m_ConfigName = configName; 56 m_ConfigName = configName;
55 57
58 m_log.DebugFormat("[XInventoryInConnector]: Starting with config name {0}", m_ConfigName);
59
56 IConfig serverConfig = config.Configs[m_ConfigName]; 60 IConfig serverConfig = config.Configs[m_ConfigName];
57 if (serverConfig == null) 61 if (serverConfig == null)
58 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); 62 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index af603b2..ae80a8c 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -255,7 +255,11 @@ namespace OpenSim.Services.GridService
255 { 255 {
256 m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName); 256 m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName);
257 } 257 }
258 regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName; 258 string name = regInfo.RegionName;
259 regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort;
260 if (name != string.Empty)
261 regInfo.RegionName += ":" + name;
262
259 // Try get the map image 263 // Try get the map image
260 //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); 264 //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
261 // I need a texture that works for this... the one I tried doesn't seem to be working 265 // I need a texture that works for this... the one I tried doesn't seem to be working
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs
index 061effe..6e6b019 100644
--- a/OpenSim/Services/InventoryService/HGInventoryService.cs
+++ b/OpenSim/Services/InventoryService/HGInventoryService.cs
@@ -108,13 +108,13 @@ namespace OpenSim.Services.InventoryService
108 // Warp! Root folder for travelers 108 // Warp! Root folder for travelers
109 XInventoryFolder[] folders = m_Database.GetFolders( 109 XInventoryFolder[] folders = m_Database.GetFolders(
110 new string[] { "agentID", "folderName"}, 110 new string[] { "agentID", "folderName"},
111 new string[] { principalID.ToString(), "Suitcase" }); 111 new string[] { principalID.ToString(), "My Suitcase" });
112 112
113 if (folders.Length > 0) 113 if (folders.Length > 0)
114 return ConvertToOpenSim(folders[0]); 114 return ConvertToOpenSim(folders[0]);
115 115
116 // make one 116 // make one
117 XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "Suitcase"); 117 XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "My Suitcase");
118 return ConvertToOpenSim(suitcase); 118 return ConvertToOpenSim(suitcase);
119 } 119 }
120 120
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index af831fd..f48bf60 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -200,7 +200,14 @@ namespace OpenSim.Services.InventoryService
200 if (folders.Length == 0) 200 if (folders.Length == 0)
201 return null; 201 return null;
202 202
203 return ConvertToOpenSim(folders[0]); 203 XInventoryFolder root = null;
204 foreach (XInventoryFolder folder in folders)
205 if (folder.folderName == "My Inventory")
206 root = folder;
207 if (folders == null) // oops
208 root = folders[0];
209
210 return ConvertToOpenSim(root);
204 } 211 }
205 212
206 public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) 213 public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type)