diff options
author | Melanie | 2010-09-05 15:06:00 +0100 |
---|---|---|
committer | Melanie | 2010-09-05 15:06:00 +0100 |
commit | e4c2b44e5cb756b957a96d13ad9a611dfba12df4 (patch) | |
tree | d7978fc31ce346cae467df7a81737cfa323ae6c1 /OpenSim/Region/Framework | |
parent | Remove "Dwell" support from core and replace it with calls to methods (diff) | |
parent | Remove "Dwell" support from core and replace it with calls to methods (diff) | |
download | opensim-SC-e4c2b44e5cb756b957a96d13ad9a611dfba12df4.zip opensim-SC-e4c2b44e5cb756b957a96d13ad9a611dfba12df4.tar.gz opensim-SC-e4c2b44e5cb756b957a96d13ad9a611dfba12df4.tar.bz2 opensim-SC-e4c2b44e5cb756b957a96d13ad9a611dfba12df4.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 59 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 2 |
2 files changed, 43 insertions, 18 deletions
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 | ||