diff options
author | Kitto Flora | 2010-09-06 21:45:17 +0000 |
---|---|---|
committer | Kitto Flora | 2010-09-06 21:45:17 +0000 |
commit | cfaefad754642677dbddfcbe743c3fa5e058785d (patch) | |
tree | 48ac26cc5289d8c0459837cd7d6936152216403b /OpenSim/Region/Framework | |
parent | Falling animation fix, comment out instrumentation. (diff) | |
parent | Fix yet another cause of "Ghost attachments" (diff) | |
download | opensim-SC_OLD-cfaefad754642677dbddfcbe743c3fa5e058785d.zip opensim-SC_OLD-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.gz opensim-SC_OLD-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.bz2 opensim-SC_OLD-cfaefad754642677dbddfcbe743c3fa5e058785d.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 59 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 21 |
6 files changed, 91 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 52e6e92..d4e2736 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -113,6 +113,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
113 | 113 | ||
114 | public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; | 114 | public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; |
115 | 115 | ||
116 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | ||
117 | |||
116 | /// <summary> | 118 | /// <summary> |
117 | /// Fired when an object is touched/grabbed. | 119 | /// Fired when an object is touched/grabbed. |
118 | /// </summary> | 120 | /// </summary> |
@@ -2128,5 +2130,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2128 | } | 2130 | } |
2129 | } | 2131 | } |
2130 | } | 2132 | } |
2133 | |||
2134 | public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, | ||
2135 | int local_id, IClientAPI remote_client) | ||
2136 | { | ||
2137 | ParcelPropertiesUpdateRequest handler = OnParcelPropertiesUpdateRequest; | ||
2138 | if (handler != null) | ||
2139 | { | ||
2140 | foreach (ParcelPropertiesUpdateRequest d in handler.GetInvocationList()) | ||
2141 | { | ||
2142 | try | ||
2143 | { | ||
2144 | d(args, local_id, remote_client); | ||
2145 | } | ||
2146 | catch (Exception e) | ||
2147 | { | ||
2148 | m_log.ErrorFormat( | ||
2149 | "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}", | ||
2150 | e.Message, e.StackTrace); | ||
2151 | } | ||
2152 | } | ||
2153 | } | ||
2154 | } | ||
2131 | } | 2155 | } |
2132 | } \ No newline at end of file | 2156 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 0d9682e..5ee8955 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -70,18 +70,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
70 | 70 | ||
71 | public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) | 71 | public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) |
72 | { | 72 | { |
73 | IMoneyModule money=RequestModuleInterface<IMoneyModule>(); | 73 | IMoneyModule money = RequestModuleInterface<IMoneyModule>(); |
74 | if (money != null) | 74 | if (money != null) |
75 | { | 75 | { |
76 | money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); | 76 | money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); |
77 | } | 77 | } |
78 | 78 | ||
79 | AddInventoryItem(agentID, item); | 79 | AddInventoryItem(item); |
80 | } | 80 | } |
81 | 81 | ||
82 | public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item) | 82 | public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item) |
83 | { | 83 | { |
84 | if (InventoryService.AddItem(item)) | 84 | if (AddInventoryItem(item)) |
85 | return true; | 85 | return true; |
86 | else | 86 | else |
87 | { | 87 | { |
@@ -92,19 +92,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | public void AddInventoryItem(UUID AgentID, InventoryItemBase item) | 95 | /// <summary> |
96 | /// Add the given inventory item to a user's inventory. | ||
97 | /// </summary> | ||
98 | /// <param name="item"></param> | ||
99 | public bool AddInventoryItem(InventoryItemBase item) | ||
96 | { | 100 | { |
97 | InventoryFolderBase folder; | 101 | InventoryFolderBase folder; |
98 | 102 | ||
99 | if (item.Folder == UUID.Zero) | 103 | if (item.Folder == UUID.Zero) |
100 | { | 104 | { |
101 | folder = InventoryService.GetFolderForType(AgentID, (AssetType)item.AssetType); | 105 | folder = InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType); |
102 | if (folder == null) | 106 | if (folder == null) |
103 | { | 107 | { |
104 | folder = InventoryService.GetRootFolder(AgentID); | 108 | folder = InventoryService.GetRootFolder(item.Owner); |
105 | 109 | ||
106 | if (folder == null) | 110 | if (folder == null) |
107 | return; | 111 | return false; |
108 | } | 112 | } |
109 | 113 | ||
110 | item.Folder = folder.ID; | 114 | item.Folder = folder.ID; |
@@ -113,20 +117,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
113 | if (InventoryService.AddItem(item)) | 117 | if (InventoryService.AddItem(item)) |
114 | { | 118 | { |
115 | int userlevel = 0; | 119 | int userlevel = 0; |
116 | if (Permissions.IsGod(AgentID)) | 120 | if (Permissions.IsGod(item.Owner)) |
117 | { | 121 | { |
118 | userlevel = 1; | 122 | userlevel = 1; |
119 | } | 123 | } |
120 | EventManager.TriggerOnNewInventoryItemUploadComplete(AgentID, item.AssetID, item.Name, userlevel); | 124 | EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, item.AssetID, item.Name, userlevel); |
125 | |||
126 | return true; | ||
121 | } | 127 | } |
122 | else | 128 | else |
123 | { | 129 | { |
124 | m_log.WarnFormat( | 130 | m_log.WarnFormat( |
125 | "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}", | 131 | "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}", |
126 | AgentID, item.Name, item.ID); | 132 | item.Owner, item.Name, item.ID); |
127 | 133 | ||
128 | return; | 134 | return false; |
129 | } | 135 | } |
136 | } | ||
137 | |||
138 | /// <summary> | ||
139 | /// Add the given inventory item to a user's inventory. | ||
140 | /// </summary> | ||
141 | /// <param name="AgentID"> | ||
142 | /// A <see cref="UUID"/> | ||
143 | /// </param> | ||
144 | /// <param name="item"> | ||
145 | /// A <see cref="InventoryItemBase"/> | ||
146 | /// </param> | ||
147 | [Obsolete("Use AddInventoryItem(InventoryItemBase item) instead. This was deprecated in OpenSim 0.7.1")] | ||
148 | public void AddInventoryItem(UUID AgentID, InventoryItemBase item) | ||
149 | { | ||
150 | AddInventoryItem(item); | ||
130 | } | 151 | } |
131 | 152 | ||
132 | /// <summary> | 153 | /// <summary> |
@@ -137,7 +158,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
137 | /// in which the item is to be placed.</param> | 158 | /// in which the item is to be placed.</param> |
138 | public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) | 159 | public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) |
139 | { | 160 | { |
140 | AddInventoryItem(remoteClient.AgentId, item); | 161 | AddInventoryItem(item); |
141 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 162 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
142 | } | 163 | } |
143 | 164 | ||
@@ -529,7 +550,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
529 | itemCopy.SalePrice = item.SalePrice; | 550 | itemCopy.SalePrice = item.SalePrice; |
530 | itemCopy.SaleType = item.SaleType; | 551 | itemCopy.SaleType = item.SaleType; |
531 | 552 | ||
532 | if (InventoryService.AddItem(itemCopy)) | 553 | if (AddInventoryItem(itemCopy)) |
533 | { | 554 | { |
534 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | 555 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); |
535 | if (invAccess != null) | 556 | if (invAccess != null) |
@@ -775,8 +796,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
775 | item.BasePermissions = baseMask; | 796 | item.BasePermissions = baseMask; |
776 | item.CreationDate = creationDate; | 797 | item.CreationDate = creationDate; |
777 | 798 | ||
778 | if (InventoryService.AddItem(item)) | 799 | if (AddInventoryItem(item)) |
800 | { | ||
779 | remoteClient.SendInventoryItemCreateUpdate(item, callbackID); | 801 | remoteClient.SendInventoryItemCreateUpdate(item, callbackID); |
802 | } | ||
780 | else | 803 | else |
781 | { | 804 | { |
782 | m_dialogModule.SendAlertToUser(remoteClient, "Failed to create item"); | 805 | m_dialogModule.SendAlertToUser(remoteClient, "Failed to create item"); |
@@ -1142,7 +1165,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1142 | 1165 | ||
1143 | agentItem.Folder = folderId; | 1166 | agentItem.Folder = folderId; |
1144 | 1167 | ||
1145 | AddInventoryItem(avatarId, agentItem); | 1168 | AddInventoryItem(agentItem); |
1146 | 1169 | ||
1147 | return agentItem; | 1170 | return agentItem; |
1148 | } | 1171 | } |
@@ -1266,7 +1289,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1266 | { | 1289 | { |
1267 | agentItem.Folder = newFolderID; | 1290 | agentItem.Folder = newFolderID; |
1268 | 1291 | ||
1269 | AddInventoryItem(destID, agentItem); | 1292 | AddInventoryItem(agentItem); |
1270 | } | 1293 | } |
1271 | } | 1294 | } |
1272 | 1295 | ||
@@ -1908,7 +1931,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1908 | // sets itemID so client can show item as 'attached' in inventory | 1931 | // sets itemID so client can show item as 'attached' in inventory |
1909 | grp.SetFromItemID(item.ID); | 1932 | grp.SetFromItemID(item.ID); |
1910 | 1933 | ||
1911 | if (InventoryService.AddItem(item)) | 1934 | if (AddInventoryItem(item)) |
1912 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | 1935 | remoteClient.SendInventoryItemCreateUpdate(item, 0); |
1913 | else | 1936 | else |
1914 | m_dialogModule.SendAlertToUser(remoteClient, "Operation failed"); | 1937 | m_dialogModule.SendAlertToUser(remoteClient, "Operation failed"); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 400f4c0..94a9dab 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2729,6 +2729,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2729 | try | 2729 | try |
2730 | { | 2730 | { |
2731 | ScenePresence sp = GetScenePresence(agentID); | 2731 | ScenePresence sp = GetScenePresence(agentID); |
2732 | PresenceService.LogoutAgent(sp.ControllingClient.SessionId); | ||
2733 | |||
2732 | if (sp != null) | 2734 | if (sp != null) |
2733 | sp.ControllingClient.Close(); | 2735 | sp.ControllingClient.Close(); |
2734 | 2736 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 8823df1..86842b3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1619,11 +1619,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1619 | 1619 | ||
1620 | if (child != null) | 1620 | if (child != null) |
1621 | { | 1621 | { |
1622 | // Make sure no child prim is set for sale | ||
1623 | // So that, on delink, no prims are unwittingly | ||
1624 | // left for sale and sold off | ||
1625 | child.RootPart.ObjectSaleType = 0; | ||
1626 | child.RootPart.SalePrice = 10; | ||
1627 | childGroups.Add(child); | 1622 | childGroups.Add(child); |
1628 | } | 1623 | } |
1629 | } | 1624 | } |
@@ -1907,9 +1902,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1907 | child.ApplyNextOwnerPermissions(); | 1902 | child.ApplyNextOwnerPermissions(); |
1908 | } | 1903 | } |
1909 | } | 1904 | } |
1910 | |||
1911 | copy.RootPart.ObjectSaleType = 0; | ||
1912 | copy.RootPart.SalePrice = 10; | ||
1913 | } | 1905 | } |
1914 | 1906 | ||
1915 | Entities.Add(copy); | 1907 | Entities.Add(copy); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index c5994b2..1959427 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
278 | 278 | ||
279 | if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) | 279 | if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) |
280 | { | 280 | { |
281 | if (stateSource == 1 && // Prim crossing | 281 | if (stateSource == 2 && // Prim crossing |
282 | m_part.ParentGroup.Scene.m_trustBinaries) | 282 | m_part.ParentGroup.Scene.m_trustBinaries) |
283 | { | 283 | { |
284 | m_items.LockItemsForWrite(true); | 284 | m_items.LockItemsForWrite(true); |
@@ -1263,4 +1263,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
1263 | Items.LockItemsForRead(false); | 1263 | Items.LockItemsForRead(false); |
1264 | } | 1264 | } |
1265 | } | 1265 | } |
1266 | } \ No newline at end of file | 1266 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index faf6354..d88f2cc 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3913,6 +3913,27 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju | |||
3913 | m_attachments.Add(gobj); | 3913 | m_attachments.Add(gobj); |
3914 | } | 3914 | } |
3915 | } | 3915 | } |
3916 | |||
3917 | /// <summary> | ||
3918 | /// Get the scene object attached to the given point. | ||
3919 | /// </summary> | ||
3920 | /// <param name="attachmentPoint"></param> | ||
3921 | /// <returns>Returns an empty list if there were no attachments at the point.</returns> | ||
3922 | public List<SceneObjectGroup> GetAttachments(uint attachmentPoint) | ||
3923 | { | ||
3924 | List<SceneObjectGroup> attachments = new List<SceneObjectGroup>(); | ||
3925 | |||
3926 | lock (m_attachments) | ||
3927 | { | ||
3928 | foreach (SceneObjectGroup so in m_attachments) | ||
3929 | { | ||
3930 | if (attachmentPoint == so.RootPart.AttachmentPoint) | ||
3931 | attachments.Add(so); | ||
3932 | } | ||
3933 | } | ||
3934 | |||
3935 | return attachments; | ||
3936 | } | ||
3916 | 3937 | ||
3917 | public bool HasAttachments() | 3938 | public bool HasAttachments() |
3918 | { | 3939 | { |