diff options
Diffstat (limited to '')
7 files changed, 107 insertions, 38 deletions
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs index 0ec4af5..f0ffc2c 100644 --- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs +++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs | |||
@@ -48,6 +48,9 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
48 | 48 | ||
49 | public RegionInfo[] LoadRegions() | 49 | public RegionInfo[] LoadRegions() |
50 | { | 50 | { |
51 | int tries = 3; | ||
52 | int wait = 2000; | ||
53 | |||
51 | if (m_configSource == null) | 54 | if (m_configSource == null) |
52 | { | 55 | { |
53 | m_log.Error("[WEBLOADER]: Unable to load configuration source!"); | 56 | m_log.Error("[WEBLOADER]: Unable to load configuration source!"); |
@@ -64,35 +67,47 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
64 | } | 67 | } |
65 | else | 68 | else |
66 | { | 69 | { |
67 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); | 70 | while (tries > 0) |
68 | webRequest.Timeout = 30000; //30 Second Timeout | ||
69 | m_log.Debug("[WEBLOADER]: Sending Download Request..."); | ||
70 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); | ||
71 | m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server..."); | ||
72 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); | ||
73 | string xmlSource = String.Empty; | ||
74 | string tempStr = reader.ReadLine(); | ||
75 | while (tempStr != null) | ||
76 | { | ||
77 | xmlSource = xmlSource + tempStr; | ||
78 | tempStr = reader.ReadLine(); | ||
79 | } | ||
80 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
81 | xmlSource.Length); | ||
82 | XmlDocument xmlDoc = new XmlDocument(); | ||
83 | xmlDoc.LoadXml(xmlSource); | ||
84 | if (xmlDoc.FirstChild.Name == "Regions") | ||
85 | { | 71 | { |
86 | RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count]; | 72 | HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); |
87 | int i; | 73 | webRequest.Timeout = 30000; //30 Second Timeout |
88 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) | 74 | m_log.Debug("[WEBLOADER]: Sending Download Request..."); |
75 | HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse(); | ||
76 | m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server..."); | ||
77 | StreamReader reader = new StreamReader(webResponse.GetResponseStream()); | ||
78 | string xmlSource = String.Empty; | ||
79 | string tempStr = reader.ReadLine(); | ||
80 | while (tempStr != null) | ||
81 | { | ||
82 | xmlSource = xmlSource + tempStr; | ||
83 | tempStr = reader.ReadLine(); | ||
84 | } | ||
85 | m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + | ||
86 | xmlSource.Length); | ||
87 | XmlDocument xmlDoc = new XmlDocument(); | ||
88 | xmlDoc.LoadXml(xmlSource); | ||
89 | if (xmlDoc.FirstChild.Name == "Regions") | ||
89 | { | 90 | { |
90 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | 91 | RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count]; |
91 | regionInfos[i] = | 92 | int i; |
92 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | 93 | for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++) |
94 | { | ||
95 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | ||
96 | regionInfos[i] = | ||
97 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); | ||
98 | } | ||
99 | |||
100 | if (i > 0) | ||
101 | return regionInfos; | ||
93 | } | 102 | } |
94 | 103 | ||
95 | return regionInfos; | 104 | m_log.Debug("[WEBLOADER]: Request yielded no regions."); |
105 | tries--; | ||
106 | if (tries > 0) | ||
107 | { | ||
108 | m_log.Debug("[WEBLOADER]: Retrying"); | ||
109 | System.Threading.Thread.Sleep(wait); | ||
110 | } | ||
96 | } | 111 | } |
97 | return null; | 112 | return null; |
98 | } | 113 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 1bf3a66..c300250 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -529,7 +529,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
529 | // find small items. | 529 | // find small items. |
530 | // | 530 | // |
531 | if (!attachment) | 531 | if (!attachment) |
532 | { | ||
532 | group.RootPart.CreateSelected = true; | 533 | group.RootPart.CreateSelected = true; |
534 | foreach (SceneObjectPart child in group.Children.Values) | ||
535 | child.CreateSelected = true; | ||
536 | } | ||
533 | 537 | ||
534 | if (!m_Scene.Permissions.CanRezObject( | 538 | if (!m_Scene.Permissions.CanRezObject( |
535 | group.Children.Count, remoteClient.AgentId, pos) | 539 | group.Children.Count, remoteClient.AgentId, pos) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c77efc7..4575068 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -935,6 +935,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
935 | } | 935 | } |
936 | if (part != null && group != null) | 936 | if (part != null && group != null) |
937 | { | 937 | { |
938 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
939 | return; | ||
940 | |||
938 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); | 941 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); |
939 | if (item == null) | 942 | if (item == null) |
940 | return; | 943 | return; |
@@ -1074,9 +1077,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1074 | return; | 1077 | return; |
1075 | } | 1078 | } |
1076 | 1079 | ||
1077 | // Only owner can copy | 1080 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); |
1078 | if (remoteClient.AgentId != taskItem.OwnerID) | 1081 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1079 | return; | 1082 | { |
1083 | // If the item to be moved is no copy, we need to be able to | ||
1084 | // edit the prim. | ||
1085 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
1086 | return; | ||
1087 | } | ||
1088 | else | ||
1089 | { | ||
1090 | // If the item is copiable, then we just need to have perms | ||
1091 | // on it. The delete check is a pure rights check | ||
1092 | if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId)) | ||
1093 | return; | ||
1094 | } | ||
1080 | 1095 | ||
1081 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 1096 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
1082 | } | 1097 | } |
@@ -1359,16 +1374,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
1359 | { | 1374 | { |
1360 | agentTransactions.HandleTaskItemUpdateFromTransaction( | 1375 | agentTransactions.HandleTaskItemUpdateFromTransaction( |
1361 | remoteClient, part, transactionID, currentItem); | 1376 | remoteClient, part, transactionID, currentItem); |
1362 | } | 1377 | |
1363 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | ||
1364 | { | ||
1365 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) | 1378 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) |
1366 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | 1379 | remoteClient.SendAgentAlertMessage("Notecard saved", false); |
1367 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) | 1380 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) |
1368 | remoteClient.SendAgentAlertMessage("Script saved", false); | 1381 | remoteClient.SendAgentAlertMessage("Script saved", false); |
1369 | else | 1382 | else |
1370 | remoteClient.SendAgentAlertMessage("Item saved", false); | 1383 | remoteClient.SendAgentAlertMessage("Item saved", false); |
1384 | } | ||
1385 | |||
1386 | // Check if we're allowed to mess with permissions | ||
1387 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god | ||
1388 | { | ||
1389 | if (remoteClient.AgentId != part.OwnerID) // Not owner | ||
1390 | { | ||
1391 | // Friends and group members can't change any perms | ||
1392 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1393 | itemInfo.EveryonePermissions = currentItem.EveryonePermissions; | ||
1394 | itemInfo.GroupPermissions = currentItem.GroupPermissions; | ||
1395 | itemInfo.NextPermissions = currentItem.NextPermissions; | ||
1396 | itemInfo.CurrentPermissions = currentItem.CurrentPermissions; | ||
1397 | } | ||
1398 | else | ||
1399 | { | ||
1400 | // Owner can't change base, and can change other | ||
1401 | // only up to base | ||
1402 | // Base ALWAYS has move | ||
1403 | currentItem.BasePermissions |= (uint)PermissionMask.Move; | ||
1404 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1405 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; | ||
1406 | itemInfo.GroupPermissions &= currentItem.BasePermissions; | ||
1407 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; | ||
1408 | itemInfo.NextPermissions &= currentItem.BasePermissions; | ||
1409 | // Next ALWAYS has move | ||
1410 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; | ||
1411 | } | ||
1371 | 1412 | ||
1413 | } | ||
1414 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | ||
1415 | { | ||
1372 | part.GetProperties(remoteClient); | 1416 | part.GetProperties(remoteClient); |
1373 | } | 1417 | } |
1374 | } | 1418 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 87b2d74..b19c443 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4156,6 +4156,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4156 | // objects | 4156 | // objects |
4157 | if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) | 4157 | if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) |
4158 | _nextOwnerMask |= (uint)PermissionMask.Transfer; | 4158 | _nextOwnerMask |= (uint)PermissionMask.Transfer; |
4159 | |||
4160 | _nextOwnerMask |= (uint)PermissionMask.Move; | ||
4161 | |||
4159 | break; | 4162 | break; |
4160 | } | 4163 | } |
4161 | SendFullUpdateToAllClients(); | 4164 | SendFullUpdateToAllClients(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 0066158..2a3727a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -762,12 +762,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
762 | else if ((InventoryType)item.Type == InventoryType.Notecard) | 762 | else if ((InventoryType)item.Type == InventoryType.Notecard) |
763 | { | 763 | { |
764 | ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); | 764 | ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); |
765 | |||
766 | if (presence != null) | ||
767 | { | ||
768 | presence.ControllingClient.SendAgentAlertMessage( | ||
769 | "Notecard saved", false); | ||
770 | } | ||
771 | } | 765 | } |
772 | 766 | ||
773 | m_items[item.ItemID] = item; | 767 | m_items[item.ItemID] = item; |
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 6b17ce7..7e70db9 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | |||
@@ -1735,6 +1735,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1735 | if (m_isphysical) | 1735 | if (m_isphysical) |
1736 | { | 1736 | { |
1737 | disableBodySoft(); | 1737 | disableBodySoft(); |
1738 | |||
1739 | if (Body != IntPtr.Zero) | ||
1740 | { | ||
1741 | d.BodySetLinearVel(Body, 0f, 0f, 0f); | ||
1742 | d.BodySetForce(Body, 0, 0, 0); | ||
1743 | enableBodySoft(); | ||
1744 | } | ||
1738 | } | 1745 | } |
1739 | } | 1746 | } |
1740 | else | 1747 | else |
@@ -1756,6 +1763,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1756 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); | 1763 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); |
1757 | d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); | 1764 | d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); |
1758 | } | 1765 | } |
1766 | /* Uhhh - stop the motion if the object is _selected_!! | ||
1759 | if (m_isphysical) | 1767 | if (m_isphysical) |
1760 | { | 1768 | { |
1761 | if (Body != IntPtr.Zero) | 1769 | if (Body != IntPtr.Zero) |
@@ -1765,6 +1773,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1765 | enableBodySoft(); | 1773 | enableBodySoft(); |
1766 | } | 1774 | } |
1767 | } | 1775 | } |
1776 | */ | ||
1768 | } | 1777 | } |
1769 | 1778 | ||
1770 | resetCollisionAccounting(); | 1779 | resetCollisionAccounting(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index defe633..b196642 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4177,7 +4177,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4177 | 4177 | ||
4178 | byte[] bucket = new byte[17]; | 4178 | byte[] bucket = new byte[17]; |
4179 | bucket[0] = (byte)assetType; | 4179 | bucket[0] = (byte)assetType; |
4180 | byte[] objBytes = objId.GetBytes(); | 4180 | byte[] objBytes = agentItem.ID.GetBytes(); |
4181 | Array.Copy(objBytes, 0, bucket, 1, 16); | 4181 | Array.Copy(objBytes, 0, bucket, 1, 16); |
4182 | 4182 | ||
4183 | Console.WriteLine("Giving inventory"); | 4183 | Console.WriteLine("Giving inventory"); |