diff options
Diffstat (limited to 'OpenSim')
60 files changed, 1398 insertions, 1001 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index fa1f0d8..65921a2 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs | |||
@@ -1035,11 +1035,6 @@ namespace OpenSim.Client.MXP.ClientStack | |||
1035 | // Minimap function, not used. | 1035 | // Minimap function, not used. |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
1039 | { | ||
1040 | // Need to translate to MXP somehow | ||
1041 | } | ||
1042 | |||
1043 | public void SetChildAgentThrottle(byte[] throttle) | 1038 | public void SetChildAgentThrottle(byte[] throttle) |
1044 | { | 1039 | { |
1045 | // Need to translate to MXP somehow | 1040 | // Need to translate to MXP somehow |
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index cf7aaf2..b808e95 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | |||
@@ -593,11 +593,6 @@ namespace OpenSim.Client.Sirikata.ClientStack | |||
593 | throw new System.NotImplementedException(); | 593 | throw new System.NotImplementedException(); |
594 | } | 594 | } |
595 | 595 | ||
596 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
597 | { | ||
598 | throw new System.NotImplementedException(); | ||
599 | } | ||
600 | |||
601 | public void SetChildAgentThrottle(byte[] throttle) | 596 | public void SetChildAgentThrottle(byte[] throttle) |
602 | { | 597 | { |
603 | throw new System.NotImplementedException(); | 598 | throw new System.NotImplementedException(); |
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index ab23484..a6c490b 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | |||
@@ -599,11 +599,6 @@ namespace OpenSim.Client.VWoHTTP.ClientStack | |||
599 | throw new System.NotImplementedException(); | 599 | throw new System.NotImplementedException(); |
600 | } | 600 | } |
601 | 601 | ||
602 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
603 | { | ||
604 | throw new System.NotImplementedException(); | ||
605 | } | ||
606 | |||
607 | public void SetChildAgentThrottle(byte[] throttle) | 602 | public void SetChildAgentThrottle(byte[] throttle) |
608 | { | 603 | { |
609 | throw new System.NotImplementedException(); | 604 | throw new System.NotImplementedException(); |
diff --git a/OpenSim/Data/Resources/OpenSim.Data.addin.xml b/OpenSim/Data/Resources/OpenSim.Data.addin.xml index 65774ff..10c9c3c 100644 --- a/OpenSim/Data/Resources/OpenSim.Data.addin.xml +++ b/OpenSim/Data/Resources/OpenSim.Data.addin.xml | |||
@@ -3,19 +3,10 @@ | |||
3 | <Import assembly="OpenSim.Data.dll" /> | 3 | <Import assembly="OpenSim.Data.dll" /> |
4 | <Import assembly="OpenSim.Framework.dll" /> | 4 | <Import assembly="OpenSim.Framework.dll" /> |
5 | </Runtime> | 5 | </Runtime> |
6 | <ExtensionPoint path = "/OpenSim/GridData"> | ||
7 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IGridDataPlugin" /> | ||
8 | </ExtensionPoint> | ||
9 | <ExtensionPoint path = "/OpenSim/LogData"> | ||
10 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.ILogDataPlugin" /> | ||
11 | </ExtensionPoint> | ||
12 | <ExtensionPoint path = "/OpenSim/AssetData"> | 6 | <ExtensionPoint path = "/OpenSim/AssetData"> |
13 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" /> | 7 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" /> |
14 | </ExtensionPoint> | 8 | </ExtensionPoint> |
15 | <ExtensionPoint path = "/OpenSim/InventoryData"> | 9 | <ExtensionPoint path = "/OpenSim/InventoryData"> |
16 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin" /> | 10 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin" /> |
17 | </ExtensionPoint> | 11 | </ExtensionPoint> |
18 | <ExtensionPoint path = "/OpenSim/UserData"> | ||
19 | <ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IUserDataPlugin" /> | ||
20 | </ExtensionPoint> | ||
21 | </Addin> | 12 | </Addin> |
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index 9dd4a2e..fcf041e 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs | |||
@@ -328,7 +328,7 @@ namespace OpenSim.Data.SQLite | |||
328 | 328 | ||
329 | public EstateSettings LoadEstateSettings(int estateID) | 329 | public EstateSettings LoadEstateSettings(int estateID) |
330 | { | 330 | { |
331 | string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID :EstateID"; | 331 | string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID = :EstateID"; |
332 | 332 | ||
333 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 333 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
334 | 334 | ||
@@ -342,7 +342,7 @@ namespace OpenSim.Data.SQLite | |||
342 | { | 342 | { |
343 | List<int> result = new List<int>(); | 343 | List<int> result = new List<int>(); |
344 | 344 | ||
345 | string sql = "select EstateID from estate_settings where estate_settings.EstateName :EstateName"; | 345 | string sql = "select EstateID from estate_settings where estate_settings.EstateName = :EstateName"; |
346 | 346 | ||
347 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 347 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
348 | 348 | ||
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs index e135eaa..bf8ee14 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs | |||
@@ -328,7 +328,7 @@ namespace OpenSim.Data.SQLiteLegacy | |||
328 | 328 | ||
329 | public EstateSettings LoadEstateSettings(int estateID) | 329 | public EstateSettings LoadEstateSettings(int estateID) |
330 | { | 330 | { |
331 | string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID :EstateID"; | 331 | string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID = :EstateID"; |
332 | 332 | ||
333 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 333 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
334 | 334 | ||
@@ -342,7 +342,7 @@ namespace OpenSim.Data.SQLiteLegacy | |||
342 | { | 342 | { |
343 | List<int> result = new List<int>(); | 343 | List<int> result = new List<int>(); |
344 | 344 | ||
345 | string sql = "select EstateID from estate_settings where estate_settings.EstateName :EstateName"; | 345 | string sql = "select EstateID from estate_settings where estate_settings.EstateName = :EstateName"; |
346 | 346 | ||
347 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); | 347 | SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand(); |
348 | 348 | ||
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs index 1f654d3..eeffdda 100644 --- a/OpenSim/Data/Tests/RegionTests.cs +++ b/OpenSim/Data/Tests/RegionTests.cs | |||
@@ -781,7 +781,7 @@ namespace OpenSim.Data.Tests | |||
781 | // Ownership changes when you drop an object into an object | 781 | // Ownership changes when you drop an object into an object |
782 | // owned by someone else | 782 | // owned by someone else |
783 | Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID), "Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID))"); | 783 | Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID), "Assert.That(t.OwnerID,Is.EqualTo(sog.RootPart.OwnerID))"); |
784 | Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8), "Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8))"); | 784 | // Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 16), "Assert.That(t.CurrentPermissions, Is.EqualTo(curperm | 8))"); |
785 | Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))"); | 785 | Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))"); |
786 | Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))"); | 786 | Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))"); |
787 | } | 787 | } |
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index 62a1e17..da953bb 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs | |||
@@ -814,7 +814,7 @@ namespace OpenSim.Framework.Capabilities | |||
814 | 814 | ||
815 | if (mm != null) | 815 | if (mm != null) |
816 | { | 816 | { |
817 | if (!mm.UploadCovered(client)) | 817 | if (!mm.UploadCovered(client, mm.UploadCharge)) |
818 | { | 818 | { |
819 | if (client != null) | 819 | if (client != null) |
820 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 820 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index a1ac84c..89ee39c 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -265,6 +265,46 @@ namespace OpenSim.Framework | |||
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
268 | public class ControllerData | ||
269 | { | ||
270 | public UUID ItemID; | ||
271 | public uint IgnoreControls; | ||
272 | public uint EventControls; | ||
273 | |||
274 | public ControllerData(UUID item, uint ignore, uint ev) | ||
275 | { | ||
276 | ItemID = item; | ||
277 | IgnoreControls = ignore; | ||
278 | EventControls = ev; | ||
279 | } | ||
280 | |||
281 | public ControllerData(OSDMap args) | ||
282 | { | ||
283 | UnpackUpdateMessage(args); | ||
284 | } | ||
285 | |||
286 | public OSDMap PackUpdateMessage() | ||
287 | { | ||
288 | OSDMap controldata = new OSDMap(); | ||
289 | controldata["item"] = OSD.FromUUID(ItemID); | ||
290 | controldata["ignore"] = OSD.FromInteger(IgnoreControls); | ||
291 | controldata["event"] = OSD.FromInteger(EventControls); | ||
292 | |||
293 | return controldata; | ||
294 | } | ||
295 | |||
296 | |||
297 | public void UnpackUpdateMessage(OSDMap args) | ||
298 | { | ||
299 | if (args["item"] != null) | ||
300 | ItemID = args["item"].AsUUID(); | ||
301 | if (args["ignore"] != null) | ||
302 | IgnoreControls = (uint)args["ignore"].AsInteger(); | ||
303 | if (args["event"] != null) | ||
304 | EventControls = (uint)args["event"].AsInteger(); | ||
305 | } | ||
306 | } | ||
307 | |||
268 | public class AgentData : IAgentData | 308 | public class AgentData : IAgentData |
269 | { | 309 | { |
270 | private UUID m_id; | 310 | private UUID m_id; |
@@ -313,6 +353,9 @@ namespace OpenSim.Framework | |||
313 | public UUID[] Wearables; | 353 | public UUID[] Wearables; |
314 | public AttachmentData[] Attachments; | 354 | public AttachmentData[] Attachments; |
315 | 355 | ||
356 | // Scripted | ||
357 | public ControllerData[] Controllers; | ||
358 | |||
316 | public string CallbackURI; | 359 | public string CallbackURI; |
317 | 360 | ||
318 | public virtual OSDMap Pack() | 361 | public virtual OSDMap Pack() |
@@ -403,6 +446,14 @@ namespace OpenSim.Framework | |||
403 | args["attachments"] = attachs; | 446 | args["attachments"] = attachs; |
404 | } | 447 | } |
405 | 448 | ||
449 | if ((Controllers != null) && (Controllers.Length > 0)) | ||
450 | { | ||
451 | OSDArray controls = new OSDArray(Controllers.Length); | ||
452 | foreach (ControllerData ctl in Controllers) | ||
453 | controls.Add(ctl.PackUpdateMessage()); | ||
454 | args["controllers"] = controls; | ||
455 | } | ||
456 | |||
406 | 457 | ||
407 | if ((CallbackURI != null) && (!CallbackURI.Equals(""))) | 458 | if ((CallbackURI != null) && (!CallbackURI.Equals(""))) |
408 | args["callback_uri"] = OSD.FromString(CallbackURI); | 459 | args["callback_uri"] = OSD.FromString(CallbackURI); |
@@ -559,6 +610,20 @@ namespace OpenSim.Framework | |||
559 | } | 610 | } |
560 | } | 611 | } |
561 | 612 | ||
613 | if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) | ||
614 | { | ||
615 | OSDArray controls = (OSDArray)(args["controllers"]); | ||
616 | Controllers = new ControllerData[controls.Count]; | ||
617 | int i = 0; | ||
618 | foreach (OSD o in controls) | ||
619 | { | ||
620 | if (o.Type == OSDType.Map) | ||
621 | { | ||
622 | Controllers[i++] = new ControllerData((OSDMap)o); | ||
623 | } | ||
624 | } | ||
625 | } | ||
626 | |||
562 | if (args["callback_uri"] != null) | 627 | if (args["callback_uri"] != null) |
563 | CallbackURI = args["callback_uri"].AsString(); | 628 | CallbackURI = args["callback_uri"].AsString(); |
564 | } | 629 | } |
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index b70d1db..aab920b 100755 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Framework.Console | |||
118 | // (Done with no echo and suitable for passwords) | 118 | // (Done with no echo and suitable for passwords) |
119 | public string PasswdPrompt(string p) | 119 | public string PasswdPrompt(string p) |
120 | { | 120 | { |
121 | return ReadLine(p, false, false); | 121 | return ReadLine(String.Format("{0}: ", p), false, false); |
122 | } | 122 | } |
123 | 123 | ||
124 | public virtual string ReadLine(string p, bool isCommand, bool e) | 124 | public virtual string ReadLine(string p, bool isCommand, bool e) |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 556a532..db74548 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Framework | |||
57 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects); | 57 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects); |
58 | 58 | ||
59 | public delegate void ObjectAttach( | 59 | public delegate void ObjectAttach( |
60 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent); | 60 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent); |
61 | 61 | ||
62 | public delegate void ModifyTerrain(UUID user, | 62 | public delegate void ModifyTerrain(UUID user, |
63 | float height, float seconds, byte size, byte action, float north, float west, float south, float east, | 63 | float height, float seconds, byte size, byte action, float north, float west, float south, float east, |
@@ -1017,7 +1017,6 @@ namespace OpenSim.Framework | |||
1017 | 1017 | ||
1018 | void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); | 1018 | void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations); |
1019 | 1019 | ||
1020 | void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID); | ||
1021 | void SetChildAgentThrottle(byte[] throttle); | 1020 | void SetChildAgentThrottle(byte[] throttle); |
1022 | 1021 | ||
1023 | void SendAvatarDataImmediate(ISceneEntity avatar); | 1022 | void SendAvatarDataImmediate(ISceneEntity avatar); |
diff --git a/OpenSim/Framework/IMoneyModule.cs b/OpenSim/Framework/IMoneyModule.cs index 3480960..3d4873d 100644 --- a/OpenSim/Framework/IMoneyModule.cs +++ b/OpenSim/Framework/IMoneyModule.cs | |||
@@ -35,35 +35,15 @@ namespace OpenSim.Framework | |||
35 | bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, | 35 | bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, |
36 | int amount); | 36 | int amount); |
37 | 37 | ||
38 | int GetBalance(IClientAPI client); | 38 | int GetBalance(UUID agentID); |
39 | void ApplyUploadCharge(UUID agentID); | 39 | bool UploadCovered(IClientAPI client, int amount); |
40 | bool UploadCovered(IClientAPI client); | ||
41 | void ApplyGroupCreationCharge(UUID agentID); | ||
42 | bool GroupCreationCovered(IClientAPI client); | ||
43 | bool AmountCovered(IClientAPI client, int amount); | 40 | bool AmountCovered(IClientAPI client, int amount); |
44 | void ApplyCharge(UUID agentID, int amount, string text); | 41 | void ApplyCharge(UUID agentID, int amount, string text); |
42 | void ApplyUploadCharge(UUID agentID, int amount, string text); | ||
45 | 43 | ||
46 | EconomyData GetEconomyData(); | 44 | int UploadCharge { get; } |
45 | int GroupCreationCharge { get; } | ||
47 | 46 | ||
48 | event ObjectPaid OnObjectPaid; | 47 | event ObjectPaid OnObjectPaid; |
49 | } | 48 | } |
50 | |||
51 | public struct EconomyData | ||
52 | { | ||
53 | public int ObjectCapacity; | ||
54 | public int ObjectCount; | ||
55 | public int PriceEnergyUnit; | ||
56 | public int PriceGroupCreate; | ||
57 | public int PriceObjectClaim; | ||
58 | public float PriceObjectRent; | ||
59 | public float PriceObjectScaleFactor; | ||
60 | public int PriceParcelClaim; | ||
61 | public float PriceParcelClaimFactor; | ||
62 | public int PriceParcelRent; | ||
63 | public int PricePublicObjectDecay; | ||
64 | public int PricePublicObjectDelete; | ||
65 | public int PriceRentLight; | ||
66 | public int PriceUpload; | ||
67 | public int TeleportMinPrice; | ||
68 | } | ||
69 | } | 49 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 1cc19c5..b91496b 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs | |||
@@ -73,7 +73,18 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
73 | { | 73 | { |
74 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) | 74 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) |
75 | { | 75 | { |
76 | StreamReader str = new StreamReader(req.Request.Body); | 76 | StreamReader str; |
77 | try | ||
78 | { | ||
79 | str = new StreamReader(req.Request.Body); | ||
80 | } | ||
81 | catch (System.ArgumentException) | ||
82 | { | ||
83 | // Stream was not readable means a child agent | ||
84 | // was closed due to logout, leaving the | ||
85 | // Event Queue request orphaned. | ||
86 | continue; | ||
87 | } | ||
77 | 88 | ||
78 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); | 89 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); |
79 | m_server.DoHTTPGruntWork(responsedata, | 90 | m_server.DoHTTPGruntWork(responsedata, |
@@ -106,4 +117,4 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
106 | m_request.Enqueue(pPollServiceHttpRequest); | 117 | m_request.Enqueue(pPollServiceHttpRequest); |
107 | } | 118 | } |
108 | } | 119 | } |
109 | } \ No newline at end of file | 120 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index 9869a99..e9e2dca 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
55 | public IJ2KDecoder J2KDecoder; | 55 | public IJ2KDecoder J2KDecoder; |
56 | public IAssetService AssetService; | 56 | public IAssetService AssetService; |
57 | public UUID AgentID; | 57 | public UUID AgentID; |
58 | public IHyperAssetService HyperAssets; | 58 | public IInventoryAccessModule InventoryAccessModule; |
59 | public OpenJPEG.J2KLayerInfo[] Layers; | 59 | public OpenJPEG.J2KLayerInfo[] Layers; |
60 | public bool IsDecoded; | 60 | public bool IsDecoded; |
61 | public bool HasAsset; | 61 | public bool HasAsset; |
@@ -375,14 +375,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
375 | UUID assetID = UUID.Zero; | 375 | UUID assetID = UUID.Zero; |
376 | if (asset != null) | 376 | if (asset != null) |
377 | assetID = asset.FullID; | 377 | assetID = asset.FullID; |
378 | else if ((HyperAssets != null) && (sender != HyperAssets)) | 378 | else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) |
379 | { | 379 | { |
380 | // Try the user's inventory, but only if it's different from the regions' | 380 | // Unfortunately we need this here, there's no other way. |
381 | string userAssets = HyperAssets.GetUserAssetServer(AgentID); | 381 | // This is due to the fact that textures opened directly from the agent's inventory |
382 | if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer())) | 382 | // don't have any distinguishing feature. As such, in order to serve those when the |
383 | // foreign user is visiting, we need to try again after the first fail to the local | ||
384 | // asset service. | ||
385 | string assetServerURL = string.Empty; | ||
386 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) | ||
383 | { | 387 | { |
384 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); | 388 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); |
385 | AssetService.Get(userAssets + "/" + id, HyperAssets, AssetReceived); | 389 | AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); |
386 | return; | 390 | return; |
387 | } | 391 | } |
388 | } | 392 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index ddc963a..c59eedf 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -357,7 +357,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
357 | protected uint m_agentFOVCounter; | 357 | protected uint m_agentFOVCounter; |
358 | 358 | ||
359 | protected IAssetService m_assetService; | 359 | protected IAssetService m_assetService; |
360 | private IHyperAssetService m_hyperAssets; | ||
361 | private const bool m_checkPackets = true; | 360 | private const bool m_checkPackets = true; |
362 | 361 | ||
363 | private Timer m_propertiesPacketTimer; | 362 | private Timer m_propertiesPacketTimer; |
@@ -432,7 +431,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
432 | // m_attachmentsSent = new HashSet<uint>(); | 431 | // m_attachmentsSent = new HashSet<uint>(); |
433 | 432 | ||
434 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); | 433 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); |
435 | m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); | ||
436 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); | 434 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); |
437 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); | 435 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); |
438 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); | 436 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); |
@@ -3680,30 +3678,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3680 | 3678 | ||
3681 | #endregion Primitive Packet/Data Sending Methods | 3679 | #endregion Primitive Packet/Data Sending Methods |
3682 | 3680 | ||
3683 | /// <summary> | ||
3684 | /// | ||
3685 | /// </summary> | ||
3686 | /// <param name="localID"></param> | ||
3687 | /// <param name="rotation"></param> | ||
3688 | /// <param name="attachPoint"></param> | ||
3689 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
3690 | { | ||
3691 | if (attachPoint > 30 && ownerID != AgentId) // Someone else's HUD | ||
3692 | return; | ||
3693 | |||
3694 | ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach); | ||
3695 | // TODO: don't create new blocks if recycling an old packet | ||
3696 | attach.AgentData.AgentID = AgentId; | ||
3697 | attach.AgentData.SessionID = m_sessionId; | ||
3698 | attach.AgentData.AttachmentPoint = attachPoint; | ||
3699 | attach.ObjectData = new ObjectAttachPacket.ObjectDataBlock[1]; | ||
3700 | attach.ObjectData[0] = new ObjectAttachPacket.ObjectDataBlock(); | ||
3701 | attach.ObjectData[0].ObjectLocalID = localID; | ||
3702 | attach.ObjectData[0].Rotation = rotation; | ||
3703 | attach.Header.Zerocoded = true; | ||
3704 | OutPacket(attach, ThrottleOutPacketType.Task); | ||
3705 | } | ||
3706 | |||
3707 | void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) | 3681 | void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) |
3708 | { | 3682 | { |
3709 | if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) | 3683 | if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) |
@@ -5732,7 +5706,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5732 | { | 5706 | { |
5733 | if (att.ObjectData.Length > 0) | 5707 | if (att.ObjectData.Length > 0) |
5734 | { | 5708 | { |
5735 | handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, att.ObjectData[0].Rotation, false); | 5709 | handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, false); |
5736 | } | 5710 | } |
5737 | } | 5711 | } |
5738 | } | 5712 | } |
@@ -7195,59 +7169,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7195 | } | 7169 | } |
7196 | else // Agent | 7170 | else // Agent |
7197 | { | 7171 | { |
7198 | IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); | 7172 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
7199 | InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); | 7173 | if (invAccess != null) |
7200 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
7201 | if (assetRequestItem == null) | ||
7202 | { | 7174 | { |
7203 | ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>(); | 7175 | if (!invAccess.GetAgentInventoryItem(this, itemID, requestID)) |
7204 | if (lib != null) | 7176 | return false; |
7205 | assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); | ||
7206 | if (assetRequestItem == null) | ||
7207 | return true; | ||
7208 | } | ||
7209 | 7177 | ||
7210 | // At this point, we need to apply perms | ||
7211 | // only to notecards and scripts. All | ||
7212 | // other asset types are always available | ||
7213 | // | ||
7214 | if (assetRequestItem.AssetType == (int)AssetType.LSLText) | ||
7215 | { | ||
7216 | if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId)) | ||
7217 | { | ||
7218 | SendAgentAlertMessage("Insufficient permissions to view script", false); | ||
7219 | return true; | ||
7220 | } | ||
7221 | } | ||
7222 | else if (assetRequestItem.AssetType == (int)AssetType.Notecard) | ||
7223 | { | ||
7224 | if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId)) | ||
7225 | { | ||
7226 | SendAgentAlertMessage("Insufficient permissions to view notecard", false); | ||
7227 | return true; | ||
7228 | } | ||
7229 | } | 7178 | } |
7179 | else | ||
7180 | return false; | ||
7230 | 7181 | ||
7231 | if (assetRequestItem.AssetID != requestID) | ||
7232 | { | ||
7233 | m_log.WarnFormat( | ||
7234 | "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}", | ||
7235 | Name, requestID, itemID, assetRequestItem.AssetID); | ||
7236 | return true; | ||
7237 | } | ||
7238 | } | 7182 | } |
7239 | } | 7183 | } |
7240 | } | 7184 | } |
7241 | 7185 | ||
7242 | //m_assetCache.AddAssetRequest(this, transfer); | ||
7243 | |||
7244 | MakeAssetRequest(transfer, taskID); | 7186 | MakeAssetRequest(transfer, taskID); |
7245 | 7187 | ||
7246 | /* RequestAsset = OnRequestAsset; | ||
7247 | if (RequestAsset != null) | ||
7248 | { | ||
7249 | RequestAsset(this, transfer); | ||
7250 | }*/ | ||
7251 | return true; | 7188 | return true; |
7252 | } | 7189 | } |
7253 | 7190 | ||
@@ -11458,15 +11395,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11458 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) | 11395 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) |
11459 | { | 11396 | { |
11460 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); | 11397 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); |
11461 | //m_log.Debug("[XXX] inventory asset request " + requestID); | ||
11462 | //if (taskID == UUID.Zero) // Agent | ||
11463 | // if (m_scene is HGScene) | ||
11464 | // { | ||
11465 | // m_log.Debug("[XXX] hg asset request " + requestID); | ||
11466 | // // We may need to fetch the asset from the user's asset server into the local asset server | ||
11467 | // HGAssetMapper mapper = ((HGScene)m_scene).AssetMapper; | ||
11468 | // mapper.Get(requestID, AgentId); | ||
11469 | // } | ||
11470 | } | 11398 | } |
11471 | 11399 | ||
11472 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); | 11400 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); |
@@ -11482,49 +11410,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11482 | /// <param name="asset"></param> | 11410 | /// <param name="asset"></param> |
11483 | protected void AssetReceived(string id, Object sender, AssetBase asset) | 11411 | protected void AssetReceived(string id, Object sender, AssetBase asset) |
11484 | { | 11412 | { |
11413 | if (asset == null) | ||
11414 | return; | ||
11415 | |||
11485 | TransferRequestPacket transferRequest = (TransferRequestPacket)sender; | 11416 | TransferRequestPacket transferRequest = (TransferRequestPacket)sender; |
11486 | 11417 | ||
11487 | UUID requestID = UUID.Zero; | 11418 | UUID requestID = UUID.Zero; |
11488 | byte source = (byte)SourceType.Asset; | 11419 | byte source = (byte)SourceType.Asset; |
11489 | 11420 | ||
11490 | if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) | 11421 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) |
11491 | || (transferRequest.TransferInfo.SourceType == 2222)) | ||
11492 | { | 11422 | { |
11493 | requestID = new UUID(transferRequest.TransferInfo.Params, 0); | 11423 | requestID = new UUID(transferRequest.TransferInfo.Params, 0); |
11494 | } | 11424 | } |
11495 | else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) | 11425 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) |
11496 | || (transferRequest.TransferInfo.SourceType == 3333)) | ||
11497 | { | 11426 | { |
11498 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); | 11427 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); |
11499 | source = (byte)SourceType.SimInventoryItem; | 11428 | source = (byte)SourceType.SimInventoryItem; |
11500 | //m_log.Debug("asset request " + requestID); | 11429 | //m_log.Debug("asset request " + requestID); |
11501 | } | 11430 | } |
11502 | 11431 | ||
11503 | if (null == asset) | ||
11504 | { | ||
11505 | if ((m_hyperAssets != null) && (transferRequest.TransferInfo.SourceType < 2000)) | ||
11506 | { | ||
11507 | // Try the user's inventory, but only if it's different from the regions' | ||
11508 | string userAssets = m_hyperAssets.GetUserAssetServer(AgentId); | ||
11509 | if ((userAssets != string.Empty) && (userAssets != m_hyperAssets.GetSimAssetServer())) | ||
11510 | { | ||
11511 | m_log.DebugFormat("[CLIENT]: asset {0} not found in local asset storage. Trying user's storage.", id); | ||
11512 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) | ||
11513 | transferRequest.TransferInfo.SourceType = 2222; // marker | ||
11514 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) | ||
11515 | transferRequest.TransferInfo.SourceType = 3333; // marker | ||
11516 | |||
11517 | m_assetService.Get(userAssets + "/" + id, transferRequest, AssetReceived); | ||
11518 | return; | ||
11519 | } | ||
11520 | } | ||
11521 | |||
11522 | //m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID); | ||
11523 | |||
11524 | // FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right. | ||
11525 | return; | ||
11526 | } | ||
11527 | |||
11528 | // Scripts cannot be retrieved by direct request | 11432 | // Scripts cannot be retrieved by direct request |
11529 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10) | 11433 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10) |
11530 | return; | 11434 | return; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 938cf50..9e0db12 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs | |||
@@ -58,8 +58,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
58 | private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer()); | 58 | private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer()); |
59 | private object m_syncRoot = new object(); | 59 | private object m_syncRoot = new object(); |
60 | 60 | ||
61 | private IHyperAssetService m_hyperAssets; | ||
62 | |||
63 | public LLClientView Client { get { return m_client; } } | 61 | public LLClientView Client { get { return m_client; } } |
64 | public AssetBase MissingImage { get { return m_missingImage; } } | 62 | public AssetBase MissingImage { get { return m_missingImage; } } |
65 | 63 | ||
@@ -75,7 +73,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
75 | m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client"); | 73 | m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client"); |
76 | 74 | ||
77 | m_j2kDecodeModule = pJ2kDecodeModule; | 75 | m_j2kDecodeModule = pJ2kDecodeModule; |
78 | m_hyperAssets = client.Scene.RequestModuleInterface<IHyperAssetService>(); | ||
79 | } | 76 | } |
80 | 77 | ||
81 | /// <summary> | 78 | /// <summary> |
@@ -149,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
149 | imgrequest.J2KDecoder = m_j2kDecodeModule; | 146 | imgrequest.J2KDecoder = m_j2kDecodeModule; |
150 | imgrequest.AssetService = m_assetCache; | 147 | imgrequest.AssetService = m_assetCache; |
151 | imgrequest.AgentID = m_client.AgentId; | 148 | imgrequest.AgentID = m_client.AgentId; |
152 | imgrequest.HyperAssets = m_hyperAssets; | 149 | imgrequest.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>(); |
153 | imgrequest.DiscardLevel = newRequest.DiscardLevel; | 150 | imgrequest.DiscardLevel = newRequest.DiscardLevel; |
154 | imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); | 151 | imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); |
155 | imgrequest.Priority = newRequest.Priority; | 152 | imgrequest.Priority = newRequest.Priority; |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index d30e954..3d6e7f3 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -182,7 +182,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
182 | 182 | ||
183 | if (part.Inventory.UpdateInventoryItem(item)) | 183 | if (part.Inventory.UpdateInventoryItem(item)) |
184 | { | 184 | { |
185 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | 185 | if ((InventoryType)item.InvType == InventoryType.Notecard) |
186 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | ||
187 | else if ((InventoryType)item.InvType == InventoryType.LSL) | ||
188 | remoteClient.SendAgentAlertMessage("Script saved", false); | ||
189 | else | ||
190 | remoteClient.SendAgentAlertMessage("Item saved", false); | ||
191 | |||
186 | part.GetProperties(remoteClient); | 192 | part.GetProperties(remoteClient); |
187 | } | 193 | } |
188 | } | 194 | } |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 7e08ecf..ae31050 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
243 | 243 | ||
244 | if (mm != null) | 244 | if (mm != null) |
245 | { | 245 | { |
246 | if (!mm.UploadCovered(remoteClient)) | 246 | if (!mm.UploadCovered(remoteClient, mm.UploadCharge)) |
247 | { | 247 | { |
248 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 248 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |
249 | return; | 249 | return; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index a7b4c66..ff3036a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -69,7 +69,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
69 | get { return false; } | 69 | get { return false; } |
70 | } | 70 | } |
71 | 71 | ||
72 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent) | 72 | // Called by client |
73 | // | ||
74 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) | ||
73 | { | 75 | { |
74 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); | 76 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); |
75 | 77 | ||
@@ -84,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
84 | return; | 86 | return; |
85 | 87 | ||
86 | // Calls attach with a Zero position | 88 | // Calls attach with a Zero position |
87 | if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false)) | 89 | if (AttachObject(remoteClient, part.ParentGroup, AttachmentPt, false)) |
88 | { | 90 | { |
89 | m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); | 91 | m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); |
90 | 92 | ||
@@ -106,72 +108,78 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
106 | } | 108 | } |
107 | } | 109 | } |
108 | 110 | ||
109 | public bool AttachObject( | 111 | public bool AttachObject(IClientAPI remoteClient, SceneObjectGroup group, uint AttachmentPt, bool silent) |
110 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) | ||
111 | { | 112 | { |
112 | SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID); | 113 | Vector3 attachPos = group.AbsolutePosition; |
113 | if (group != null) | 114 | |
115 | if (m_scene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) | ||
114 | { | 116 | { |
115 | if (m_scene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) | 117 | // If the attachment point isn't the same as the one previously used |
118 | // set it's offset position = 0 so that it appears on the attachment point | ||
119 | // and not in a weird location somewhere unknown. | ||
120 | if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) | ||
116 | { | 121 | { |
117 | // If the attachment point isn't the same as the one previously used | 122 | attachPos = Vector3.Zero; |
118 | // set it's offset position = 0 so that it appears on the attachment point | 123 | } |
119 | // and not in a weird location somewhere unknown. | ||
120 | if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) | ||
121 | { | ||
122 | attachPos = Vector3.Zero; | ||
123 | } | ||
124 | |||
125 | // AttachmentPt 0 means the client chose to 'wear' the attachment. | ||
126 | if (AttachmentPt == 0) | ||
127 | { | ||
128 | // Check object for stored attachment point | ||
129 | AttachmentPt = (uint)group.GetAttachmentPoint(); | ||
130 | } | ||
131 | 124 | ||
132 | // if we still didn't find a suitable attachment point....... | 125 | // AttachmentPt 0 means the client chose to 'wear' the attachment. |
133 | if (AttachmentPt == 0) | 126 | if (AttachmentPt == 0) |
134 | { | 127 | { |
135 | // Stick it on left hand with Zero Offset from the attachment point. | 128 | // Check object for stored attachment point |
136 | AttachmentPt = (uint)AttachmentPoint.LeftHand; | 129 | AttachmentPt = (uint)group.GetAttachmentPoint(); |
137 | attachPos = Vector3.Zero; | 130 | } |
138 | } | ||
139 | 131 | ||
140 | group.SetAttachmentPoint((byte)AttachmentPt); | 132 | // if we still didn't find a suitable attachment point....... |
141 | group.AbsolutePosition = attachPos; | 133 | if (AttachmentPt == 0) |
134 | { | ||
135 | // Stick it on left hand with Zero Offset from the attachment point. | ||
136 | AttachmentPt = (uint)AttachmentPoint.LeftHand; | ||
137 | attachPos = Vector3.Zero; | ||
138 | } | ||
142 | 139 | ||
143 | // Saves and gets itemID | 140 | group.SetAttachmentPoint((byte)AttachmentPt); |
144 | UUID itemId; | 141 | group.AbsolutePosition = attachPos; |
145 | 142 | ||
146 | if (group.GetFromItemID() == UUID.Zero) | 143 | // Remove any previous attachments |
147 | { | 144 | ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); |
148 | m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemId); | 145 | UUID itemID = UUID.Zero; |
149 | } | 146 | if (sp != null) |
150 | else | 147 | { |
148 | foreach(SceneObjectGroup grp in sp.Attachments) | ||
151 | { | 149 | { |
152 | itemId = group.GetFromItemID(); | 150 | if (grp.GetAttachmentPoint() == (byte)AttachmentPt) |
151 | { | ||
152 | itemID = grp.GetFromItemID(); | ||
153 | break; | ||
154 | } | ||
153 | } | 155 | } |
156 | if (itemID != UUID.Zero) | ||
157 | DetachSingleAttachmentToInv(itemID, remoteClient); | ||
158 | } | ||
154 | 159 | ||
155 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemId, group); | 160 | if (group.GetFromItemID() == UUID.Zero) |
156 | 161 | { | |
157 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | 162 | m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemID); |
158 | |||
159 | // In case it is later dropped again, don't let | ||
160 | // it get cleaned up | ||
161 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | ||
162 | group.HasGroupChanged = false; | ||
163 | } | 163 | } |
164 | else | 164 | else |
165 | { | 165 | { |
166 | remoteClient.SendAgentAlertMessage( | 166 | itemID = group.GetFromItemID(); |
167 | "You don't have sufficient permissions to attach this object", false); | ||
168 | |||
169 | return false; | ||
170 | } | 167 | } |
168 | |||
169 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); | ||
170 | |||
171 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | ||
172 | |||
173 | // In case it is later dropped again, don't let | ||
174 | // it get cleaned up | ||
175 | group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | ||
176 | group.HasGroupChanged = false; | ||
171 | } | 177 | } |
172 | else | 178 | else |
173 | { | 179 | { |
174 | m_log.DebugFormat("[ATTACHMENTS MODULE]: AttachObject found no such scene object {0}", objectLocalID); | 180 | remoteClient.SendAgentAlertMessage( |
181 | "You don't have sufficient permissions to attach this object", false); | ||
182 | |||
175 | return false; | 183 | return false; |
176 | } | 184 | } |
177 | 185 | ||
@@ -237,8 +245,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
237 | if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) | 245 | if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) |
238 | tainted = true; | 246 | tainted = true; |
239 | 247 | ||
240 | AttachObject( | 248 | AttachObject(remoteClient, objatt, AttachmentPt, false); |
241 | remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false); | ||
242 | //objatt.ScheduleGroupForFullUpdate(); | 249 | //objatt.ScheduleGroupForFullUpdate(); |
243 | 250 | ||
244 | if (tainted) | 251 | if (tainted) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index b5c3176..2105f3c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -81,14 +81,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
81 | { | 81 | { |
82 | ScenePresence sp = m_scene.GetScenePresence(agentID); | 82 | ScenePresence sp = m_scene.GetScenePresence(agentID); |
83 | 83 | ||
84 | if (sp != null && !sp.IsChildAgent) | 84 | if (sp != null) |
85 | sp.ControllingClient.SendAgentAlertMessage(message, modal); | 85 | sp.ControllingClient.SendAgentAlertMessage(message, modal); |
86 | } | 86 | } |
87 | 87 | ||
88 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) | 88 | public void SendAlertToUser(string firstName, string lastName, string message, bool modal) |
89 | { | 89 | { |
90 | ScenePresence presence = m_scene.GetScenePresence(firstName, lastName); | 90 | ScenePresence presence = m_scene.GetScenePresence(firstName, lastName); |
91 | if (presence != null && !presence.IsChildAgent) | 91 | if (presence != null) |
92 | presence.ControllingClient.SendAgentAlertMessage(message, modal); | 92 | presence.ControllingClient.SendAgentAlertMessage(message, modal); |
93 | } | 93 | } |
94 | 94 | ||
@@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
119 | } | 119 | } |
120 | 120 | ||
121 | ScenePresence sp = m_scene.GetScenePresence(avatarID); | 121 | ScenePresence sp = m_scene.GetScenePresence(avatarID); |
122 | if (sp != null && !sp.IsChildAgent) | 122 | if (sp != null) |
123 | sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels); | 123 | sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels); |
124 | } | 124 | } |
125 | 125 | ||
@@ -128,7 +128,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
128 | { | 128 | { |
129 | ScenePresence sp = m_scene.GetScenePresence(avatarID); | 129 | ScenePresence sp = m_scene.GetScenePresence(avatarID); |
130 | 130 | ||
131 | if (sp != null && !sp.IsChildAgent) | 131 | if (sp != null) |
132 | sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); | 132 | sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url); |
133 | } | 133 | } |
134 | 134 | ||
@@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
149 | 149 | ||
150 | ScenePresence sp = m_scene.GetScenePresence(avatarid); | 150 | ScenePresence sp = m_scene.GetScenePresence(avatarid); |
151 | 151 | ||
152 | if (sp != null && !sp.IsChildAgent) | 152 | if (sp != null) |
153 | sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid); | 153 | sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid); |
154 | } | 154 | } |
155 | 155 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 9996074..31dfe14 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -93,37 +93,37 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
93 | /// </returns> | 93 | /// </returns> |
94 | public List<InventoryNodeBase> Execute() | 94 | public List<InventoryNodeBase> Execute() |
95 | { | 95 | { |
96 | string filePath = "ERROR"; | ||
97 | int successfulAssetRestores = 0; | ||
98 | int failedAssetRestores = 0; | ||
99 | int successfulItemRestores = 0; | ||
100 | |||
101 | List<InventoryNodeBase> loadedNodes = new List<InventoryNodeBase>(); | ||
102 | |||
103 | List<InventoryFolderBase> folderCandidates | ||
104 | = InventoryArchiveUtils.FindFolderByPath( | ||
105 | m_scene.InventoryService, m_userInfo.PrincipalID, m_invPath); | ||
106 | |||
107 | if (folderCandidates.Count == 0) | ||
108 | { | ||
109 | // Possibly provide an option later on to automatically create this folder if it does not exist | ||
110 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath); | ||
111 | |||
112 | return loadedNodes; | ||
113 | } | ||
114 | |||
115 | InventoryFolderBase rootDestinationFolder = folderCandidates[0]; | ||
116 | archive = new TarArchiveReader(m_loadStream); | ||
117 | |||
118 | // In order to load identically named folders, we need to keep track of the folders that we have already | ||
119 | // resolved | ||
120 | Dictionary <string, InventoryFolderBase> resolvedFolders = new Dictionary<string, InventoryFolderBase>(); | ||
121 | |||
122 | byte[] data; | ||
123 | TarArchiveReader.TarEntryType entryType; | ||
124 | |||
125 | try | 96 | try |
126 | { | 97 | { |
98 | string filePath = "ERROR"; | ||
99 | int successfulAssetRestores = 0; | ||
100 | int failedAssetRestores = 0; | ||
101 | int successfulItemRestores = 0; | ||
102 | |||
103 | List<InventoryNodeBase> loadedNodes = new List<InventoryNodeBase>(); | ||
104 | |||
105 | List<InventoryFolderBase> folderCandidates | ||
106 | = InventoryArchiveUtils.FindFolderByPath( | ||
107 | m_scene.InventoryService, m_userInfo.PrincipalID, m_invPath); | ||
108 | |||
109 | if (folderCandidates.Count == 0) | ||
110 | { | ||
111 | // Possibly provide an option later on to automatically create this folder if it does not exist | ||
112 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: Inventory path {0} does not exist", m_invPath); | ||
113 | |||
114 | return loadedNodes; | ||
115 | } | ||
116 | |||
117 | InventoryFolderBase rootDestinationFolder = folderCandidates[0]; | ||
118 | archive = new TarArchiveReader(m_loadStream); | ||
119 | |||
120 | // In order to load identically named folders, we need to keep track of the folders that we have already | ||
121 | // resolved | ||
122 | Dictionary <string, InventoryFolderBase> resolvedFolders = new Dictionary<string, InventoryFolderBase>(); | ||
123 | |||
124 | byte[] data; | ||
125 | TarArchiveReader.TarEntryType entryType; | ||
126 | |||
127 | while ((data = archive.ReadEntry(out filePath, out entryType)) != null) | 127 | while ((data = archive.ReadEntry(out filePath, out entryType)) != null) |
128 | { | 128 | { |
129 | if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) | 129 | if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) |
@@ -166,18 +166,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
166 | } | 166 | } |
167 | } | 167 | } |
168 | } | 168 | } |
169 | |||
170 | archive.Close(); | ||
171 | |||
172 | m_log.DebugFormat( | ||
173 | "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", | ||
174 | successfulAssetRestores, failedAssetRestores); | ||
175 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", successfulItemRestores); | ||
176 | |||
177 | return loadedNodes; | ||
169 | } | 178 | } |
170 | finally | 179 | finally |
171 | { | 180 | { |
172 | archive.Close(); | 181 | m_loadStream.Close(); |
173 | } | 182 | } |
174 | |||
175 | m_log.DebugFormat( | ||
176 | "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", | ||
177 | successfulAssetRestores, failedAssetRestores); | ||
178 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", successfulItemRestores); | ||
179 | |||
180 | return loadedNodes; | ||
181 | } | 183 | } |
182 | 184 | ||
183 | public void Close() | 185 | public void Close() |
@@ -212,9 +214,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
212 | 214 | ||
213 | InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); | 215 | InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); |
214 | 216 | ||
215 | m_log.DebugFormat( | 217 | // m_log.DebugFormat( |
216 | "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", | 218 | // "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", |
217 | iarPath, iarPathExisting); | 219 | // iarPath, iarPathExisting); |
218 | 220 | ||
219 | string iarPathToCreate = iarPath.Substring(iarPathExisting.Length); | 221 | string iarPathToCreate = iarPath.Substring(iarPathExisting.Length); |
220 | CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes); | 222 | CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes); |
@@ -247,7 +249,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
247 | ref string archivePath, | 249 | ref string archivePath, |
248 | Dictionary <string, InventoryFolderBase> resolvedFolders) | 250 | Dictionary <string, InventoryFolderBase> resolvedFolders) |
249 | { | 251 | { |
250 | string originalArchivePath = archivePath; | 252 | // string originalArchivePath = archivePath; |
251 | 253 | ||
252 | InventoryFolderBase destFolder = null; | 254 | InventoryFolderBase destFolder = null; |
253 | 255 | ||
@@ -255,12 +257,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
255 | { | 257 | { |
256 | while (null == destFolder && archivePath.Length > 0) | 258 | while (null == destFolder && archivePath.Length > 0) |
257 | { | 259 | { |
258 | m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); | 260 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); |
259 | 261 | ||
260 | if (resolvedFolders.ContainsKey(archivePath)) | 262 | if (resolvedFolders.ContainsKey(archivePath)) |
261 | { | 263 | { |
262 | m_log.DebugFormat( | 264 | // m_log.DebugFormat( |
263 | "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); | 265 | // "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); |
264 | destFolder = resolvedFolders[archivePath]; | 266 | destFolder = resolvedFolders[archivePath]; |
265 | } | 267 | } |
266 | else | 268 | else |
@@ -275,9 +277,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
275 | } | 277 | } |
276 | else | 278 | else |
277 | { | 279 | { |
278 | m_log.DebugFormat( | 280 | // m_log.DebugFormat( |
279 | "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", | 281 | // "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", |
280 | originalArchivePath); | 282 | // originalArchivePath); |
281 | archivePath = string.Empty; | 283 | archivePath = string.Empty; |
282 | destFolder = rootDestFolder; | 284 | destFolder = rootDestFolder; |
283 | } | 285 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index ca33968..84afb40 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs | |||
@@ -206,11 +206,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
206 | 206 | ||
207 | if (components.Length == 1) | 207 | if (components.Length == 1) |
208 | { | 208 | { |
209 | // m_log.DebugFormat("FOUND SINGLE COMPONENT [{0}]", components[0]); | 209 | // m_log.DebugFormat( |
210 | // "FOUND SINGLE COMPONENT [{0}]. Looking for this in [{1}] {2}", | ||
211 | // components[0], startFolder.Name, startFolder.ID); | ||
210 | 212 | ||
211 | List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); | 213 | List<InventoryItemBase> items = inventoryService.GetFolderItems(startFolder.Owner, startFolder.ID); |
214 | |||
215 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count); | ||
216 | |||
212 | foreach (InventoryItemBase item in items) | 217 | foreach (InventoryItemBase item in items) |
213 | { | 218 | { |
219 | // m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID); | ||
220 | |||
214 | if (item.Name == components[0]) | 221 | if (item.Name == components[0]) |
215 | return item; | 222 | return item; |
216 | } | 223 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 2c2724e..25a78ff 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -119,22 +119,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
119 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) | 119 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) |
120 | { | 120 | { |
121 | Exception reportedException = null; | 121 | Exception reportedException = null; |
122 | bool succeeded = true; | 122 | bool succeeded = true; |
123 | 123 | ||
124 | try | 124 | try |
125 | { | 125 | { |
126 | // We're almost done. Just need to write out the control file now | 126 | // We're almost done. Just need to write out the control file now |
127 | m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); | 127 | m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); |
128 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | 128 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); |
129 | |||
130 | m_archiveWriter.Close(); | 129 | m_archiveWriter.Close(); |
131 | } | 130 | } |
132 | catch (Exception e) | 131 | catch (Exception e) |
133 | { | 132 | { |
134 | m_saveStream.Close(); | ||
135 | reportedException = e; | 133 | reportedException = e; |
136 | succeeded = false; | 134 | succeeded = false; |
137 | } | 135 | } |
136 | finally | ||
137 | { | ||
138 | m_saveStream.Close(); | ||
139 | } | ||
138 | 140 | ||
139 | m_module.TriggerInventoryArchiveSaved( | 141 | m_module.TriggerInventoryArchiveSaved( |
140 | m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); | 142 | m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); |
@@ -213,70 +215,68 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
213 | /// </summary> | 215 | /// </summary> |
214 | public void Execute() | 216 | public void Execute() |
215 | { | 217 | { |
216 | InventoryFolderBase inventoryFolder = null; | 218 | try |
217 | InventoryItemBase inventoryItem = null; | ||
218 | InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID); | ||
219 | |||
220 | bool foundStar = false; | ||
221 | |||
222 | // Eliminate double slashes and any leading / on the path. | ||
223 | string[] components | ||
224 | = m_invPath.Split( | ||
225 | new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); | ||
226 | |||
227 | int maxComponentIndex = components.Length - 1; | ||
228 | |||
229 | // If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the | ||
230 | // folder itself. This may get more sophisicated later on | ||
231 | if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD) | ||
232 | { | ||
233 | foundStar = true; | ||
234 | maxComponentIndex--; | ||
235 | } | ||
236 | |||
237 | m_invPath = String.Empty; | ||
238 | for (int i = 0; i <= maxComponentIndex; i++) | ||
239 | { | ||
240 | m_invPath += components[i] + InventoryFolderImpl.PATH_DELIMITER; | ||
241 | } | ||
242 | |||
243 | // Annoyingly Split actually returns the original string if the input string consists only of delimiters | ||
244 | // Therefore if we still start with a / after the split, then we need the root folder | ||
245 | if (m_invPath.Length == 0) | ||
246 | { | ||
247 | inventoryFolder = rootFolder; | ||
248 | } | ||
249 | else | ||
250 | { | ||
251 | m_invPath = m_invPath.Remove(m_invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); | ||
252 | List<InventoryFolderBase> candidateFolders | ||
253 | = InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, rootFolder, m_invPath); | ||
254 | if (candidateFolders.Count > 0) | ||
255 | inventoryFolder = candidateFolders[0]; | ||
256 | } | ||
257 | |||
258 | // The path may point to an item instead | ||
259 | if (inventoryFolder == null) | ||
260 | { | ||
261 | inventoryItem = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, rootFolder, m_invPath); | ||
262 | //inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath); | ||
263 | } | ||
264 | |||
265 | if (null == inventoryFolder && null == inventoryItem) | ||
266 | { | 219 | { |
267 | // We couldn't find the path indicated | 220 | InventoryFolderBase inventoryFolder = null; |
268 | string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); | 221 | InventoryItemBase inventoryItem = null; |
269 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", errorMessage); | 222 | InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID); |
270 | m_module.TriggerInventoryArchiveSaved( | 223 | |
271 | m_id, false, m_userInfo, m_invPath, m_saveStream, | 224 | bool foundStar = false; |
272 | new Exception(errorMessage)); | 225 | |
273 | return; | 226 | // Eliminate double slashes and any leading / on the path. |
274 | } | 227 | string[] components |
228 | = m_invPath.Split( | ||
229 | new string[] { InventoryFolderImpl.PATH_DELIMITER }, StringSplitOptions.RemoveEmptyEntries); | ||
230 | |||
231 | int maxComponentIndex = components.Length - 1; | ||
232 | |||
233 | // If the path terminates with a STAR then later on we want to archive all nodes in the folder but not the | ||
234 | // folder itself. This may get more sophisicated later on | ||
235 | if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD) | ||
236 | { | ||
237 | foundStar = true; | ||
238 | maxComponentIndex--; | ||
239 | } | ||
240 | |||
241 | m_invPath = String.Empty; | ||
242 | for (int i = 0; i <= maxComponentIndex; i++) | ||
243 | { | ||
244 | m_invPath += components[i] + InventoryFolderImpl.PATH_DELIMITER; | ||
245 | } | ||
246 | |||
247 | // Annoyingly Split actually returns the original string if the input string consists only of delimiters | ||
248 | // Therefore if we still start with a / after the split, then we need the root folder | ||
249 | if (m_invPath.Length == 0) | ||
250 | { | ||
251 | inventoryFolder = rootFolder; | ||
252 | } | ||
253 | else | ||
254 | { | ||
255 | m_invPath = m_invPath.Remove(m_invPath.LastIndexOf(InventoryFolderImpl.PATH_DELIMITER)); | ||
256 | List<InventoryFolderBase> candidateFolders | ||
257 | = InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, rootFolder, m_invPath); | ||
258 | if (candidateFolders.Count > 0) | ||
259 | inventoryFolder = candidateFolders[0]; | ||
260 | } | ||
261 | |||
262 | // The path may point to an item instead | ||
263 | if (inventoryFolder == null) | ||
264 | { | ||
265 | inventoryItem = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, rootFolder, m_invPath); | ||
266 | //inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath); | ||
267 | } | ||
268 | |||
269 | if (null == inventoryFolder && null == inventoryItem) | ||
270 | { | ||
271 | // We couldn't find the path indicated | ||
272 | string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); | ||
273 | Exception e = new InventoryArchiverException(errorMessage); | ||
274 | m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e); | ||
275 | throw e; | ||
276 | } | ||
275 | 277 | ||
276 | m_archiveWriter = new TarArchiveWriter(m_saveStream); | 278 | m_archiveWriter = new TarArchiveWriter(m_saveStream); |
277 | 279 | ||
278 | try | ||
279 | { | ||
280 | if (inventoryFolder != null) | 280 | if (inventoryFolder != null) |
281 | { | 281 | { |
282 | m_log.DebugFormat( | 282 | m_log.DebugFormat( |
@@ -297,16 +297,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
297 | 297 | ||
298 | // Don't put all this profile information into the archive right now. | 298 | // Don't put all this profile information into the archive right now. |
299 | //SaveUsers(); | 299 | //SaveUsers(); |
300 | |||
301 | new AssetsRequest( | ||
302 | new AssetsArchiver(m_archiveWriter), m_assetUuids, m_scene.AssetService, ReceivedAllAssets).Execute(); | ||
300 | } | 303 | } |
301 | catch (Exception) | 304 | catch (Exception) |
302 | { | 305 | { |
303 | m_archiveWriter.Close(); | 306 | m_saveStream.Close(); |
304 | throw; | 307 | throw; |
305 | } | 308 | } |
306 | |||
307 | new AssetsRequest( | ||
308 | new AssetsArchiver(m_archiveWriter), m_assetUuids, | ||
309 | m_scene.AssetService, ReceivedAllAssets).Execute(); | ||
310 | } | 309 | } |
311 | 310 | ||
312 | /// <summary> | 311 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Interfaces/IHyperService.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs index 51ea28a..e07e2ca 100644 --- a/OpenSim/Region/Framework/Interfaces/IHyperService.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -24,14 +24,17 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | |||
27 | using System; | 28 | using System; |
28 | using OpenMetaverse; | ||
29 | 29 | ||
30 | namespace OpenSim.Region.Framework.Interfaces | 30 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver |
31 | { | 31 | { |
32 | public interface IHyperAssetService | 32 | /// <summary> |
33 | { | 33 | /// Signals an inventory archiving problem |
34 | string GetUserAssetServer(UUID userID); | 34 | /// </summary> |
35 | string GetSimAssetServer(); | 35 | public class InventoryArchiverException : Exception |
36 | { | ||
37 | public InventoryArchiverException(string message) : base(message) {} | ||
38 | public InventoryArchiverException(string message, Exception e) : base(message, e) {} | ||
36 | } | 39 | } |
37 | } | 40 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index cfefbe9..f7a2b09 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -322,34 +322,41 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
322 | /// <param name="cmdparams"></param> | 322 | /// <param name="cmdparams"></param> |
323 | protected void HandleLoadInvConsoleCommand(string module, string[] cmdparams) | 323 | protected void HandleLoadInvConsoleCommand(string module, string[] cmdparams) |
324 | { | 324 | { |
325 | m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); | 325 | try |
326 | 326 | { | |
327 | Dictionary<string, object> options = new Dictionary<string, object>(); | 327 | m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); |
328 | OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; }); | 328 | |
329 | 329 | Dictionary<string, object> options = new Dictionary<string, object>(); | |
330 | List<string> mainParams = optionSet.Parse(cmdparams); | 330 | OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; }); |
331 | 331 | ||
332 | if (mainParams.Count < 6) | 332 | List<string> mainParams = optionSet.Parse(cmdparams); |
333 | { | 333 | |
334 | m_log.Error( | 334 | if (mainParams.Count < 6) |
335 | "[INVENTORY ARCHIVER]: usage is load iar <first name> <last name> <inventory path> <user password> [<load file path>]"); | 335 | { |
336 | return; | 336 | m_log.Error( |
337 | } | 337 | "[INVENTORY ARCHIVER]: usage is load iar <first name> <last name> <inventory path> <user password> [<load file path>]"); |
338 | 338 | return; | |
339 | string firstName = mainParams[2]; | 339 | } |
340 | string lastName = mainParams[3]; | 340 | |
341 | string invPath = mainParams[4]; | 341 | string firstName = mainParams[2]; |
342 | string pass = mainParams[5]; | 342 | string lastName = mainParams[3]; |
343 | string loadPath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME); | 343 | string invPath = mainParams[4]; |
344 | 344 | string pass = mainParams[5]; | |
345 | m_log.InfoFormat( | 345 | string loadPath = (mainParams.Count > 6 ? mainParams[6] : DEFAULT_INV_BACKUP_FILENAME); |
346 | "[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}", | 346 | |
347 | loadPath, invPath, firstName, lastName); | ||
348 | |||
349 | if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options)) | ||
350 | m_log.InfoFormat( | 347 | m_log.InfoFormat( |
351 | "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", | 348 | "[INVENTORY ARCHIVER]: Loading archive {0} to inventory path {1} for {2} {3}", |
352 | loadPath, firstName, lastName); | 349 | loadPath, invPath, firstName, lastName); |
350 | |||
351 | if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options)) | ||
352 | m_log.InfoFormat( | ||
353 | "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", | ||
354 | loadPath, firstName, lastName); | ||
355 | } | ||
356 | catch (InventoryArchiverException e) | ||
357 | { | ||
358 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message); | ||
359 | } | ||
353 | } | 360 | } |
354 | 361 | ||
355 | /// <summary> | 362 | /// <summary> |
@@ -358,30 +365,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
358 | /// <param name="cmdparams"></param> | 365 | /// <param name="cmdparams"></param> |
359 | protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams) | 366 | protected void HandleSaveInvConsoleCommand(string module, string[] cmdparams) |
360 | { | 367 | { |
361 | if (cmdparams.Length < 6) | 368 | Guid id = Guid.NewGuid(); |
369 | |||
370 | try | ||
362 | { | 371 | { |
363 | m_log.Error( | 372 | if (cmdparams.Length < 6) |
364 | "[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]"); | 373 | { |
365 | return; | 374 | m_log.Error( |
375 | "[INVENTORY ARCHIVER]: usage is save iar <first name> <last name> <inventory path> <user password> [<save file path>]"); | ||
376 | return; | ||
377 | } | ||
378 | |||
379 | m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); | ||
380 | |||
381 | string firstName = cmdparams[2]; | ||
382 | string lastName = cmdparams[3]; | ||
383 | string invPath = cmdparams[4]; | ||
384 | string pass = cmdparams[5]; | ||
385 | string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME); | ||
386 | |||
387 | m_log.InfoFormat( | ||
388 | "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}", | ||
389 | savePath, invPath, firstName, lastName); | ||
390 | |||
391 | ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary<string, object>()); | ||
366 | } | 392 | } |
367 | 393 | catch (InventoryArchiverException e) | |
368 | m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); | 394 | { |
369 | 395 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message); | |
370 | string firstName = cmdparams[2]; | 396 | } |
371 | string lastName = cmdparams[3]; | 397 | |
372 | string invPath = cmdparams[4]; | ||
373 | string pass = cmdparams[5]; | ||
374 | string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME); | ||
375 | |||
376 | m_log.InfoFormat( | ||
377 | "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}", | ||
378 | savePath, invPath, firstName, lastName); | ||
379 | |||
380 | Guid id = Guid.NewGuid(); | ||
381 | ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary<string, object>()); | ||
382 | |||
383 | lock (m_pendingConsoleSaves) | 398 | lock (m_pendingConsoleSaves) |
384 | m_pendingConsoleSaves.Add(id); | 399 | m_pendingConsoleSaves.Add(id); |
385 | } | 400 | } |
386 | 401 | ||
387 | private void SaveInvConsoleCommandCompleted( | 402 | private void SaveInvConsoleCommandCompleted( |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 5130fa5..4531bfd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -63,13 +63,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
63 | } | 63 | } |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). | 66 | /// Test saving an inventory path to a V0.1 OpenSim Inventory Archive |
67 | /// (subject to change since there is no fixed format yet). | ||
67 | /// </summary> | 68 | /// </summary> |
68 | // Commenting for now! The mock inventory service needs more beef, at least for | ||
69 | // GetFolderForType | ||
70 | // REFACTORING PROBLEM. This needs to be rewritten. | ||
71 | [Test] | 69 | [Test] |
72 | public void TestSaveIarV0_1() | 70 | public void TestSavePathToIarV0_1() |
73 | { | 71 | { |
74 | TestHelper.InMethod(); | 72 | TestHelper.InMethod(); |
75 | // log4net.Config.XmlConfigurator.Configure(); | 73 | // log4net.Config.XmlConfigurator.Configure(); |
@@ -182,6 +180,123 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
182 | } | 180 | } |
183 | 181 | ||
184 | /// <summary> | 182 | /// <summary> |
183 | /// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive | ||
184 | /// (subject to change since there is no fixed format yet). | ||
185 | /// </summary> | ||
186 | [Test] | ||
187 | public void TestSaveItemToIarV0_1() | ||
188 | { | ||
189 | TestHelper.InMethod(); | ||
190 | // log4net.Config.XmlConfigurator.Configure(); | ||
191 | |||
192 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | ||
193 | |||
194 | Scene scene = SceneSetupHelpers.SetupScene("Inventory"); | ||
195 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule); | ||
196 | |||
197 | // Create user | ||
198 | string userFirstName = "Jock"; | ||
199 | string userLastName = "Stirrup"; | ||
200 | string userPassword = "troll"; | ||
201 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | ||
202 | UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword); | ||
203 | |||
204 | // Create asset | ||
205 | SceneObjectGroup object1; | ||
206 | SceneObjectPart part1; | ||
207 | { | ||
208 | string partName = "My Little Dog Object"; | ||
209 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | ||
210 | PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); | ||
211 | Vector3 groupPosition = new Vector3(10, 20, 30); | ||
212 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); | ||
213 | Vector3 offsetPosition = new Vector3(5, 10, 15); | ||
214 | |||
215 | part1 | ||
216 | = new SceneObjectPart( | ||
217 | ownerId, shape, groupPosition, rotationOffset, offsetPosition); | ||
218 | part1.Name = partName; | ||
219 | |||
220 | object1 = new SceneObjectGroup(part1); | ||
221 | scene.AddNewSceneObject(object1, false); | ||
222 | } | ||
223 | |||
224 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | ||
225 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | ||
226 | scene.AssetService.Store(asset1); | ||
227 | |||
228 | // Create item | ||
229 | UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080"); | ||
230 | string item1Name = "My Little Dog"; | ||
231 | InventoryItemBase item1 = new InventoryItemBase(); | ||
232 | item1.Name = item1Name; | ||
233 | item1.AssetID = asset1.FullID; | ||
234 | item1.ID = item1Id; | ||
235 | InventoryFolderBase objsFolder | ||
236 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; | ||
237 | item1.Folder = objsFolder.ID; | ||
238 | scene.AddInventoryItem(userId, item1); | ||
239 | |||
240 | MemoryStream archiveWriteStream = new MemoryStream(); | ||
241 | archiverModule.OnInventoryArchiveSaved += SaveCompleted; | ||
242 | |||
243 | mre.Reset(); | ||
244 | archiverModule.ArchiveInventory( | ||
245 | Guid.NewGuid(), userFirstName, userLastName, "Objects/" + item1Name, userPassword, archiveWriteStream); | ||
246 | mre.WaitOne(60000, false); | ||
247 | |||
248 | byte[] archive = archiveWriteStream.ToArray(); | ||
249 | MemoryStream archiveReadStream = new MemoryStream(archive); | ||
250 | TarArchiveReader tar = new TarArchiveReader(archiveReadStream); | ||
251 | |||
252 | //bool gotControlFile = false; | ||
253 | bool gotObject1File = false; | ||
254 | //bool gotObject2File = false; | ||
255 | string expectedObject1FileName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1); | ||
256 | string expectedObject1FilePath = string.Format( | ||
257 | "{0}{1}", | ||
258 | ArchiveConstants.INVENTORY_PATH, | ||
259 | expectedObject1FileName); | ||
260 | |||
261 | string filePath; | ||
262 | TarArchiveReader.TarEntryType tarEntryType; | ||
263 | |||
264 | // Console.WriteLine("Reading archive"); | ||
265 | |||
266 | while (tar.ReadEntry(out filePath, out tarEntryType) != null) | ||
267 | { | ||
268 | Console.WriteLine("Got {0}", filePath); | ||
269 | |||
270 | // if (ArchiveConstants.CONTROL_FILE_PATH == filePath) | ||
271 | // { | ||
272 | // gotControlFile = true; | ||
273 | // } | ||
274 | |||
275 | if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH) && filePath.EndsWith(".xml")) | ||
276 | { | ||
277 | // string fileName = filePath.Remove(0, "Objects/".Length); | ||
278 | // | ||
279 | // if (fileName.StartsWith(part1.Name)) | ||
280 | // { | ||
281 | Assert.That(expectedObject1FilePath, Is.EqualTo(filePath)); | ||
282 | gotObject1File = true; | ||
283 | // } | ||
284 | // else if (fileName.StartsWith(part2.Name)) | ||
285 | // { | ||
286 | // Assert.That(fileName, Is.EqualTo(expectedObject2FileName)); | ||
287 | // gotObject2File = true; | ||
288 | // } | ||
289 | } | ||
290 | } | ||
291 | |||
292 | // Assert.That(gotControlFile, Is.True, "No control file in archive"); | ||
293 | Assert.That(gotObject1File, Is.True, "No item1 file in archive"); | ||
294 | // Assert.That(gotObject2File, Is.True, "No object2 file in archive"); | ||
295 | |||
296 | // TODO: Test presence of more files and contents of files. | ||
297 | } | ||
298 | |||
299 | /// <summary> | ||
185 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 300 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
186 | /// an account exists with the creator name. | 301 | /// an account exists with the creator name. |
187 | /// </summary> | 302 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index c1e92f5..b13b9d8 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -157,6 +157,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
157 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); | 157 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); |
158 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); | 158 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); |
159 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); | 159 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); |
160 | if (ids.ContainsKey(assetID)) | ||
161 | ids.Remove(assetID); | ||
160 | foreach (UUID uuid in ids.Keys) | 162 | foreach (UUID uuid in ids.Keys) |
161 | FetchAsset(userAssetURL, uuid); | 163 | FetchAsset(userAssetURL, uuid); |
162 | 164 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index b0555da..8ccc941 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 | // DO NOT OVERRIDE THIS METHOD | 134 | // DO NOT OVERRIDE THE BASE METHOD |
135 | public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, | 135 | public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, |
136 | SceneObjectGroup objectGroup, IClientAPI remoteClient) | 136 | SceneObjectGroup objectGroup, IClientAPI remoteClient) |
137 | { | 137 | { |
@@ -139,7 +139,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
139 | 139 | ||
140 | if (!assetID.Equals(UUID.Zero)) | 140 | if (!assetID.Equals(UUID.Zero)) |
141 | { | 141 | { |
142 | UploadInventoryItem(remoteClient.AgentId, assetID, "", 0); | 142 | if (remoteClient != null) |
143 | UploadInventoryItem(remoteClient.AgentId, assetID, "", 0); | ||
143 | } | 144 | } |
144 | else | 145 | else |
145 | m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); | 146 | m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); |
@@ -192,9 +193,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
192 | m_assMapper.Post(item.AssetID, receiver, userAssetServer); | 193 | m_assMapper.Post(item.AssetID, receiver, userAssetServer); |
193 | } | 194 | } |
194 | 195 | ||
195 | #endregion | 196 | public override bool IsForeignUser(UUID userID, out string assetServerURL) |
196 | |||
197 | public bool IsForeignUser(UUID userID, out string assetServerURL) | ||
198 | { | 197 | { |
199 | assetServerURL = string.Empty; | 198 | assetServerURL = string.Empty; |
200 | UserAccount account = null; | 199 | UserAccount account = null; |
@@ -217,5 +216,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
217 | 216 | ||
218 | return false; | 217 | return false; |
219 | } | 218 | } |
219 | |||
220 | #endregion | ||
221 | |||
222 | protected override InventoryItemBase GetItem(UUID agentID, UUID itemID) | ||
223 | { | ||
224 | InventoryItemBase item = base.GetItem(agentID, itemID); | ||
225 | |||
226 | string userAssetServer = string.Empty; | ||
227 | if (IsForeignUser(agentID, out userAssetServer)) | ||
228 | m_assMapper.Get(item.AssetID, agentID, userAssetServer); | ||
229 | |||
230 | return item; | ||
231 | } | ||
220 | } | 232 | } |
221 | } | 233 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 12b6aa0..1a7da61 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -322,6 +322,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
322 | } | 322 | } |
323 | } | 323 | } |
324 | 324 | ||
325 | // Override and put into where it came from, if it came | ||
326 | // from anywhere in inventory | ||
327 | // | ||
328 | if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) | ||
329 | { | ||
330 | if (objectGroup.RootPart.FromFolderID != UUID.Zero) | ||
331 | { | ||
332 | InventoryFolderBase f = new InventoryFolderBase(objectGroup.RootPart.FromFolderID, userID); | ||
333 | folder = m_Scene.InventoryService.GetFolder(f); | ||
334 | } | ||
335 | } | ||
336 | |||
325 | if (folder == null) // None of the above | 337 | if (folder == null) // None of the above |
326 | { | 338 | { |
327 | folder = new InventoryFolderBase(folderID); | 339 | folder = new InventoryFolderBase(folderID); |
@@ -369,12 +381,27 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
369 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) | 381 | if ((nextPerms & (uint)PermissionMask.Modify) == 0) |
370 | perms &= ~(uint)PermissionMask.Modify; | 382 | perms &= ~(uint)PermissionMask.Modify; |
371 | 383 | ||
384 | // Make sure all bits but the ones we want are clear | ||
385 | // on take. | ||
386 | // This will be applied to the current perms, so | ||
387 | // it will do what we want. | ||
388 | objectGroup.RootPart.NextOwnerMask &= | ||
389 | ((uint)PermissionMask.Copy | | ||
390 | (uint)PermissionMask.Transfer | | ||
391 | (uint)PermissionMask.Modify); | ||
392 | objectGroup.RootPart.NextOwnerMask |= | ||
393 | (uint)PermissionMask.Move; | ||
394 | |||
372 | item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask; | 395 | item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask; |
373 | item.CurrentPermissions = item.BasePermissions; | 396 | item.CurrentPermissions = item.BasePermissions; |
374 | item.NextPermissions = objectGroup.RootPart.NextOwnerMask; | 397 | item.NextPermissions = objectGroup.RootPart.NextOwnerMask; |
375 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; | 398 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask; |
376 | item.GroupPermissions = objectGroup.RootPart.GroupMask & objectGroup.RootPart.NextOwnerMask; | 399 | item.GroupPermissions = objectGroup.RootPart.GroupMask & objectGroup.RootPart.NextOwnerMask; |
377 | item.CurrentPermissions |= 8; // Slam! | 400 | |
401 | // Magic number badness. Maybe this deserves an enum. | ||
402 | // bit 4 (16) is the "Slam" bit, it means treat as passed | ||
403 | // and apply next owner perms on rez | ||
404 | item.CurrentPermissions |= 16; // Slam! | ||
378 | } | 405 | } |
379 | else | 406 | else |
380 | { | 407 | { |
@@ -384,7 +411,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
384 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; | 411 | item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; |
385 | item.GroupPermissions = objectGroup.RootPart.GroupMask; | 412 | item.GroupPermissions = objectGroup.RootPart.GroupMask; |
386 | 413 | ||
387 | item.CurrentPermissions |= 8; // Slam! | 414 | item.CurrentPermissions &= |
415 | ((uint)PermissionMask.Copy | | ||
416 | (uint)PermissionMask.Transfer | | ||
417 | (uint)PermissionMask.Modify | | ||
418 | (uint)PermissionMask.Move | | ||
419 | 7); // Preserve folded permissions | ||
388 | } | 420 | } |
389 | 421 | ||
390 | // TODO: add the new fields (Flags, Sale info, etc) | 422 | // TODO: add the new fields (Flags, Sale info, etc) |
@@ -485,6 +517,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
485 | SceneObjectGroup group | 517 | SceneObjectGroup group |
486 | = SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData); | 518 | = SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData); |
487 | 519 | ||
520 | group.RootPart.FromFolderID = item.Folder; | ||
521 | |||
522 | // If it's rezzed in world, select it. Much easier to | ||
523 | // find small items. | ||
524 | // | ||
525 | if (!attachment) | ||
526 | group.RootPart.CreateSelected = true; | ||
527 | |||
488 | if (!m_Scene.Permissions.CanRezObject( | 528 | if (!m_Scene.Permissions.CanRezObject( |
489 | group.Children.Count, remoteClient.AgentId, pos) | 529 | group.Children.Count, remoteClient.AgentId, pos) |
490 | && !attachment) | 530 | && !attachment) |
@@ -557,7 +597,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
557 | List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); | 597 | List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values); |
558 | 598 | ||
559 | group.SetGroup(remoteClient.ActiveGroupId, remoteClient); | 599 | group.SetGroup(remoteClient.ActiveGroupId, remoteClient); |
560 | if (rootPart.OwnerID != item.Owner) | 600 | if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) |
561 | { | 601 | { |
562 | //Need to kill the for sale here | 602 | //Need to kill the for sale here |
563 | rootPart.ObjectSaleType = 0; | 603 | rootPart.ObjectSaleType = 0; |
@@ -565,14 +605,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
565 | 605 | ||
566 | if (m_Scene.Permissions.PropagatePermissions()) | 606 | if (m_Scene.Permissions.PropagatePermissions()) |
567 | { | 607 | { |
568 | if ((item.CurrentPermissions & 8) != 0) | 608 | foreach (SceneObjectPart part in partList) |
569 | { | 609 | { |
570 | foreach (SceneObjectPart part in partList) | 610 | part.EveryoneMask = item.EveryOnePermissions; |
571 | { | 611 | part.NextOwnerMask = item.NextPermissions; |
572 | part.EveryoneMask = item.EveryOnePermissions; | 612 | part.GroupMask = 0; // DO NOT propagate here |
573 | part.NextOwnerMask = item.NextPermissions; | ||
574 | part.GroupMask = 0; // DO NOT propagate here | ||
575 | } | ||
576 | } | 613 | } |
577 | 614 | ||
578 | group.ApplyNextOwnerPermissions(); | 615 | group.ApplyNextOwnerPermissions(); |
@@ -581,19 +618,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
581 | 618 | ||
582 | foreach (SceneObjectPart part in partList) | 619 | foreach (SceneObjectPart part in partList) |
583 | { | 620 | { |
584 | if (part.OwnerID != item.Owner) | 621 | if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) |
585 | { | 622 | { |
586 | part.LastOwnerID = part.OwnerID; | 623 | part.LastOwnerID = part.OwnerID; |
587 | part.OwnerID = item.Owner; | 624 | part.OwnerID = item.Owner; |
588 | part.Inventory.ChangeInventoryOwner(item.Owner); | 625 | part.Inventory.ChangeInventoryOwner(item.Owner); |
589 | } | ||
590 | else if (((item.CurrentPermissions & 8) != 0) && (!attachment)) // Slam! | ||
591 | { | ||
592 | part.EveryoneMask = item.EveryOnePermissions; | ||
593 | part.NextOwnerMask = item.NextPermissions; | ||
594 | |||
595 | part.GroupMask = 0; // DO NOT propagate here | 626 | part.GroupMask = 0; // DO NOT propagate here |
596 | } | 627 | } |
628 | part.EveryoneMask = item.EveryOnePermissions; | ||
629 | part.NextOwnerMask = item.NextPermissions; | ||
597 | } | 630 | } |
598 | 631 | ||
599 | rootPart.TrimPermissions(); | 632 | rootPart.TrimPermissions(); |
@@ -639,6 +672,57 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
639 | { | 672 | { |
640 | } | 673 | } |
641 | 674 | ||
675 | public virtual bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID) | ||
676 | { | ||
677 | InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID); | ||
678 | if (assetRequestItem == null) | ||
679 | { | ||
680 | ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>(); | ||
681 | if (lib != null) | ||
682 | assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); | ||
683 | if (assetRequestItem == null) | ||
684 | return false; | ||
685 | } | ||
686 | |||
687 | // At this point, we need to apply perms | ||
688 | // only to notecards and scripts. All | ||
689 | // other asset types are always available | ||
690 | // | ||
691 | if (assetRequestItem.AssetType == (int)AssetType.LSLText) | ||
692 | { | ||
693 | if (!m_Scene.Permissions.CanViewScript(itemID, UUID.Zero, remoteClient.AgentId)) | ||
694 | { | ||
695 | remoteClient.SendAgentAlertMessage("Insufficient permissions to view script", false); | ||
696 | return false; | ||
697 | } | ||
698 | } | ||
699 | else if (assetRequestItem.AssetType == (int)AssetType.Notecard) | ||
700 | { | ||
701 | if (!m_Scene.Permissions.CanViewNotecard(itemID, UUID.Zero, remoteClient.AgentId)) | ||
702 | { | ||
703 | remoteClient.SendAgentAlertMessage("Insufficient permissions to view notecard", false); | ||
704 | return false; | ||
705 | } | ||
706 | } | ||
707 | |||
708 | if (assetRequestItem.AssetID != requestID) | ||
709 | { | ||
710 | m_log.WarnFormat( | ||
711 | "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}", | ||
712 | Name, requestID, itemID, assetRequestItem.AssetID); | ||
713 | return false; | ||
714 | } | ||
715 | |||
716 | return true; | ||
717 | } | ||
718 | |||
719 | |||
720 | public virtual bool IsForeignUser(UUID userID, out string assetServerURL) | ||
721 | { | ||
722 | assetServerURL = string.Empty; | ||
723 | return false; | ||
724 | } | ||
725 | |||
642 | #endregion | 726 | #endregion |
643 | 727 | ||
644 | #region Misc | 728 | #region Misc |
@@ -661,6 +745,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
661 | return asset; | 745 | return asset; |
662 | } | 746 | } |
663 | 747 | ||
748 | protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID) | ||
749 | { | ||
750 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); | ||
751 | InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, agentID); | ||
752 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
753 | return assetRequestItem; | ||
754 | } | ||
755 | |||
664 | #endregion | 756 | #endregion |
665 | } | 757 | } |
666 | } | 758 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index ebd6bbd..034e692 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -41,7 +41,7 @@ using OpenMetaverse; | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset |
42 | { | 42 | { |
43 | public class HGAssetBroker : | 43 | public class HGAssetBroker : |
44 | ISharedRegionModule, IAssetService, IHyperAssetService | 44 | ISharedRegionModule, IAssetService |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -150,7 +150,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
150 | m_aScene = scene; | 150 | m_aScene = scene; |
151 | 151 | ||
152 | scene.RegisterModuleInterface<IAssetService>(this); | 152 | scene.RegisterModuleInterface<IAssetService>(this); |
153 | scene.RegisterModuleInterface<IHyperAssetService>(this); | ||
154 | } | 153 | } |
155 | 154 | ||
156 | public void RemoveRegion(Scene scene) | 155 | public void RemoveRegion(Scene scene) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index e09db15..97161fc 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -202,9 +202,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
202 | } | 202 | } |
203 | } | 203 | } |
204 | } | 204 | } |
205 | |||
206 | // else put a null; it means that the methods should forward to local grid's inventory | ||
207 | m_InventoryURLs.Add(userID, null); | ||
208 | } | 205 | } |
209 | 206 | ||
210 | private void DropInventoryServiceURL(UUID userID) | 207 | private void DropInventoryServiceURL(UUID userID) |
@@ -223,10 +220,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
223 | if (m_InventoryURLs.ContainsKey(userID)) | 220 | if (m_InventoryURLs.ContainsKey(userID)) |
224 | return m_InventoryURLs[userID]; | 221 | return m_InventoryURLs[userID]; |
225 | 222 | ||
226 | else | 223 | CacheInventoryServiceURL(userID); |
227 | CacheInventoryServiceURL(userID); | ||
228 | 224 | ||
229 | return m_InventoryURLs[userID]; | 225 | if (m_InventoryURLs.ContainsKey(userID)) |
226 | return m_InventoryURLs[userID]; | ||
227 | |||
228 | return null; //it means that the methods should forward to local grid's inventory | ||
229 | |||
230 | } | 230 | } |
231 | #endregion | 231 | #endregion |
232 | 232 | ||
@@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
253 | 253 | ||
254 | public InventoryFolderBase GetRootFolder(UUID userID) | 254 | public InventoryFolderBase GetRootFolder(UUID userID) |
255 | { | 255 | { |
256 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID); | 256 | //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID); |
257 | 257 | ||
258 | string invURL = GetInventoryServiceURL(userID); | 258 | string invURL = GetInventoryServiceURL(userID); |
259 | 259 | ||
@@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
267 | 267 | ||
268 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 268 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) |
269 | { | 269 | { |
270 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); | 270 | //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type); |
271 | 271 | ||
272 | string invURL = GetInventoryServiceURL(userID); | 272 | string invURL = GetInventoryServiceURL(userID); |
273 | 273 | ||
@@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
281 | 281 | ||
282 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 282 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
283 | { | 283 | { |
284 | m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID); | 284 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID); |
285 | 285 | ||
286 | string invURL = GetInventoryServiceURL(userID); | 286 | string invURL = GetInventoryServiceURL(userID); |
287 | 287 | ||
@@ -296,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
296 | 296 | ||
297 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 297 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
298 | { | 298 | { |
299 | m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); | 299 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID); |
300 | 300 | ||
301 | string invURL = GetInventoryServiceURL(userID); | 301 | string invURL = GetInventoryServiceURL(userID); |
302 | 302 | ||
@@ -314,7 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
314 | if (folder == null) | 314 | if (folder == null) |
315 | return false; | 315 | return false; |
316 | 316 | ||
317 | m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID); | 317 | //m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID); |
318 | 318 | ||
319 | string invURL = GetInventoryServiceURL(folder.Owner); | 319 | string invURL = GetInventoryServiceURL(folder.Owner); |
320 | 320 | ||
@@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
331 | if (folder == null) | 331 | if (folder == null) |
332 | return false; | 332 | return false; |
333 | 333 | ||
334 | m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID); | 334 | //m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID); |
335 | 335 | ||
336 | string invURL = GetInventoryServiceURL(folder.Owner); | 336 | string invURL = GetInventoryServiceURL(folder.Owner); |
337 | 337 | ||
@@ -350,7 +350,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
350 | if (folderIDs.Count == 0) | 350 | if (folderIDs.Count == 0) |
351 | return false; | 351 | return false; |
352 | 352 | ||
353 | m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID); | 353 | //m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID); |
354 | 354 | ||
355 | string invURL = GetInventoryServiceURL(ownerID); | 355 | string invURL = GetInventoryServiceURL(ownerID); |
356 | 356 | ||
@@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
367 | if (folder == null) | 367 | if (folder == null) |
368 | return false; | 368 | return false; |
369 | 369 | ||
370 | m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner); | 370 | //m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner); |
371 | 371 | ||
372 | string invURL = GetInventoryServiceURL(folder.Owner); | 372 | string invURL = GetInventoryServiceURL(folder.Owner); |
373 | 373 | ||
@@ -384,7 +384,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
384 | if (folder == null) | 384 | if (folder == null) |
385 | return false; | 385 | return false; |
386 | 386 | ||
387 | m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner); | 387 | //m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner); |
388 | 388 | ||
389 | string invURL = GetInventoryServiceURL(folder.Owner); | 389 | string invURL = GetInventoryServiceURL(folder.Owner); |
390 | 390 | ||
@@ -401,7 +401,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
401 | if (item == null) | 401 | if (item == null) |
402 | return false; | 402 | return false; |
403 | 403 | ||
404 | m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID); | 404 | //m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID); |
405 | 405 | ||
406 | string invURL = GetInventoryServiceURL(item.Owner); | 406 | string invURL = GetInventoryServiceURL(item.Owner); |
407 | 407 | ||
@@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
418 | if (item == null) | 418 | if (item == null) |
419 | return false; | 419 | return false; |
420 | 420 | ||
421 | m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID); | 421 | //m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID); |
422 | 422 | ||
423 | string invURL = GetInventoryServiceURL(item.Owner); | 423 | string invURL = GetInventoryServiceURL(item.Owner); |
424 | 424 | ||
@@ -437,7 +437,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
437 | if (items.Count == 0) | 437 | if (items.Count == 0) |
438 | return true; | 438 | return true; |
439 | 439 | ||
440 | m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID); | 440 | //m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID); |
441 | 441 | ||
442 | string invURL = GetInventoryServiceURL(ownerID); | 442 | string invURL = GetInventoryServiceURL(ownerID); |
443 | 443 | ||
@@ -451,15 +451,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
451 | 451 | ||
452 | public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | 452 | public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
453 | { | 453 | { |
454 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); | 454 | //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); |
455 | 455 | ||
456 | if (itemIDs == null) | 456 | if (itemIDs == null) |
457 | return false; | 457 | return false; |
458 | if (itemIDs.Count == 0) | 458 | if (itemIDs.Count == 0) |
459 | return true; | 459 | return true; |
460 | 460 | ||
461 | m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID); | ||
462 | |||
463 | string invURL = GetInventoryServiceURL(ownerID); | 461 | string invURL = GetInventoryServiceURL(ownerID); |
464 | 462 | ||
465 | if (invURL == null) // not there, forward to local inventory connector to resolve | 463 | if (invURL == null) // not there, forward to local inventory connector to resolve |
@@ -474,7 +472,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
474 | { | 472 | { |
475 | if (item == null) | 473 | if (item == null) |
476 | return null; | 474 | return null; |
477 | m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); | 475 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); |
478 | 476 | ||
479 | string invURL = GetInventoryServiceURL(item.Owner); | 477 | string invURL = GetInventoryServiceURL(item.Owner); |
480 | 478 | ||
@@ -491,7 +489,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
491 | if (folder == null) | 489 | if (folder == null) |
492 | return null; | 490 | return null; |
493 | 491 | ||
494 | m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); | 492 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); |
495 | 493 | ||
496 | string invURL = GetInventoryServiceURL(folder.Owner); | 494 | string invURL = GetInventoryServiceURL(folder.Owner); |
497 | 495 | ||
@@ -515,7 +513,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
515 | 513 | ||
516 | public int GetAssetPermissions(UUID userID, UUID assetID) | 514 | public int GetAssetPermissions(UUID userID, UUID assetID) |
517 | { | 515 | { |
518 | m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID); | 516 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID); |
519 | 517 | ||
520 | string invURL = GetInventoryServiceURL(userID); | 518 | string invURL = GetInventoryServiceURL(userID); |
521 | 519 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 3945142..2a87da2 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
146 | else | 146 | else |
147 | { | 147 | { |
148 | // Normal Calculations | 148 | // Normal Calculations |
149 | return (int)Math.Round(((float)LandData.Area / 65536.0f) * (float)m_scene.objectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus); | 149 | return (int)Math.Round(((float)LandData.Area / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus); |
150 | } | 150 | } |
151 | } | 151 | } |
152 | public int GetSimulatorMaxPrimCount(ILandObject thisObject) | 152 | public int GetSimulatorMaxPrimCount(ILandObject thisObject) |
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
158 | else | 158 | else |
159 | { | 159 | { |
160 | //Normal Calculations | 160 | //Normal Calculations |
161 | return m_scene.objectCapacity; | 161 | return m_scene.RegionInfo.ObjectCapacity; |
162 | } | 162 | } |
163 | } | 163 | } |
164 | #endregion | 164 | #endregion |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 0e849e5..9d9967a 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -805,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
805 | imgstream = new MemoryStream(); | 805 | imgstream = new MemoryStream(); |
806 | 806 | ||
807 | // non-async because we know we have the asset immediately. | 807 | // non-async because we know we have the asset immediately. |
808 | AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.lastMapUUID.ToString()); | 808 | AssetBase mapasset = m_scene.AssetService.Get(m_scene.RegionInfo.RegionSettings.TerrainImageID.ToString()); |
809 | 809 | ||
810 | // Decode image to System.Drawing.Image | 810 | // Decode image to System.Drawing.Image |
811 | if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image)) | 811 | if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image)) |
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs index 6e69902..00f6918 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.DataSnapshot.Providers | |||
73 | client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos, | 73 | client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos, |
74 | IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) { this.Stale = true; }; | 74 | IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs) { this.Stale = true; }; |
75 | client.OnObjectAttach += delegate(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, | 75 | client.OnObjectAttach += delegate(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, |
76 | Quaternion rot, bool silent) { this.Stale = true; }; | 76 | bool silent) { this.Stale = true; }; |
77 | client.OnObjectDuplicate += delegate(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID, | 77 | client.OnObjectDuplicate += delegate(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID, |
78 | UUID GroupID) { this.Stale = true; }; | 78 | UUID GroupID) { this.Stale = true; }; |
79 | client.OnObjectDuplicateOnRay += delegate(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, | 79 | client.OnObjectDuplicateOnRay += delegate(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, |
diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/DataSnapshot/SnapshotStore.cs index 976c2c1..70cb205 100644 --- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs +++ b/OpenSim/Region/DataSnapshot/SnapshotStore.cs | |||
@@ -258,21 +258,16 @@ namespace OpenSim.Region.DataSnapshot | |||
258 | 258 | ||
259 | private String GetRegionCategory(Scene scene) | 259 | private String GetRegionCategory(Scene scene) |
260 | { | 260 | { |
261 | //Boolean choice between: | 261 | if (scene.RegionInfo.RegionSettings.Maturity == 0) |
262 | // "PG" - Mormontown | 262 | return "PG"; |
263 | // "Mature" - Sodom and Gomorrah | 263 | |
264 | if (scene.RegionInfo.RegionSettings.Maturity == 1) | 264 | if (scene.RegionInfo.RegionSettings.Maturity == 1) |
265 | { | ||
266 | return "Mature"; | 265 | return "Mature"; |
267 | } | 266 | |
268 | else if (scene.RegionInfo.RegionSettings.Maturity == 0) | 267 | if (scene.RegionInfo.RegionSettings.Maturity == 2) |
269 | { | 268 | return "Adult"; |
270 | return "PG"; | 269 | |
271 | } | 270 | return "Unknown"; |
272 | else | ||
273 | { | ||
274 | return "Unknown"; | ||
275 | } | ||
276 | } | 271 | } |
277 | 272 | ||
278 | private XmlNode GetGridSnapshotData(XmlDocument factory) | 273 | private XmlNode GetGridSnapshotData(XmlDocument factory) |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index af9df45..f6e6163 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -536,10 +536,6 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
536 | { | 536 | { |
537 | } | 537 | } |
538 | 538 | ||
539 | public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
540 | { | ||
541 | } | ||
542 | |||
543 | public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) | 539 | public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) |
544 | { | 540 | { |
545 | } | 541 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index f8af367..2af2548 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
44 | /// <param name="rot"></param> | 44 | /// <param name="rot"></param> |
45 | /// <param name="silent"></param> | 45 | /// <param name="silent"></param> |
46 | void AttachObject( | 46 | void AttachObject( |
47 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent); | 47 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent); |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Attach an object to an avatar. | 50 | /// Attach an object to an avatar. |
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
57 | /// <param name="silent"></param> | 57 | /// <param name="silent"></param> |
58 | /// <returns>true if the object was successfully attached, false otherwise</returns> | 58 | /// <returns>true if the object was successfully attached, false otherwise</returns> |
59 | bool AttachObject( | 59 | bool AttachObject( |
60 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent); | 60 | IClientAPI remoteClient, SceneObjectGroup grp, uint AttachmentPt, bool silent); |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Rez an attachment from user inventory and change inventory status to match. | 63 | /// Rez an attachment from user inventory and change inventory status to match. |
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs index 97f4188..05fc2ad 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs | |||
@@ -43,5 +43,9 @@ namespace OpenSim.Region.Framework.Interfaces | |||
43 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 43 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
44 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); | 44 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); |
45 | void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver); | 45 | void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver); |
46 | bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID); | ||
47 | |||
48 | // Must be here because of textures in user's inventory | ||
49 | bool IsForeignUser(UUID userID, out string assetServerURL); | ||
46 | } | 50 | } |
47 | } | 51 | } |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index a4dd170..3b8d727 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -179,7 +179,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
179 | public event ScriptChangedEvent OnScriptChangedEvent; | 179 | public event ScriptChangedEvent OnScriptChangedEvent; |
180 | public delegate void ScriptChangedEvent(uint localID, uint change); | 180 | public delegate void ScriptChangedEvent(uint localID, uint change); |
181 | 181 | ||
182 | public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed); | 182 | public delegate void ScriptControlEvent(UUID item, UUID avatarID, uint held, uint changed); |
183 | public event ScriptControlEvent OnScriptControlEvent; | 183 | public event ScriptControlEvent OnScriptControlEvent; |
184 | 184 | ||
185 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); | 185 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); |
@@ -1614,7 +1614,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1614 | } | 1614 | } |
1615 | } | 1615 | } |
1616 | 1616 | ||
1617 | internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) | 1617 | internal void TriggerControlEvent(UUID scriptUUID, UUID avatarID, uint held, uint _changed) |
1618 | { | 1618 | { |
1619 | ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent; | 1619 | ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent; |
1620 | if (handlerScriptControlEvent != null) | 1620 | if (handlerScriptControlEvent != null) |
@@ -1623,7 +1623,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1623 | { | 1623 | { |
1624 | try | 1624 | try |
1625 | { | 1625 | { |
1626 | d(p, scriptUUID, avatarID, held, _changed); | 1626 | d(scriptUUID, avatarID, held, _changed); |
1627 | } | 1627 | } |
1628 | catch (Exception e) | 1628 | catch (Exception e) |
1629 | { | 1629 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index f9da341..01edf51 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
73 | IMoneyModule money=RequestModuleInterface<IMoneyModule>(); | 73 | IMoneyModule money=RequestModuleInterface<IMoneyModule>(); |
74 | if (money != null) | 74 | if (money != null) |
75 | { | 75 | { |
76 | money.ApplyUploadCharge(agentID); | 76 | money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); |
77 | } | 77 | } |
78 | 78 | ||
79 | AddInventoryItem(agentID, item); | 79 | AddInventoryItem(agentID, item); |
@@ -265,6 +265,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
265 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, | 265 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, |
266 | UUID itemID, InventoryItemBase itemUpd) | 266 | UUID itemID, InventoryItemBase itemUpd) |
267 | { | 267 | { |
268 | // This one will let people set next perms on items in agent | ||
269 | // inventory. Rut-Roh. Whatever. Make this secure. Yeah. | ||
270 | // | ||
271 | // Passing something to another avatar or a an object will already | ||
268 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 272 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
269 | item = InventoryService.GetItem(item); | 273 | item = InventoryService.GetItem(item); |
270 | 274 | ||
@@ -274,11 +278,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
274 | { | 278 | { |
275 | item.Name = itemUpd.Name; | 279 | item.Name = itemUpd.Name; |
276 | item.Description = itemUpd.Description; | 280 | item.Description = itemUpd.Description; |
277 | item.NextPermissions = itemUpd.NextPermissions; | 281 | item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; |
278 | item.CurrentPermissions |= 8; // Slam! | 282 | item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; |
279 | item.EveryOnePermissions = itemUpd.EveryOnePermissions; | 283 | item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; |
280 | item.GroupPermissions = itemUpd.GroupPermissions; | ||
281 | |||
282 | item.GroupID = itemUpd.GroupID; | 284 | item.GroupID = itemUpd.GroupID; |
283 | item.GroupOwned = itemUpd.GroupOwned; | 285 | item.GroupOwned = itemUpd.GroupOwned; |
284 | item.CreationDate = itemUpd.CreationDate; | 286 | item.CreationDate = itemUpd.CreationDate; |
@@ -384,28 +386,103 @@ namespace OpenSim.Region.Framework.Scenes | |||
384 | 386 | ||
385 | if (Permissions.PropagatePermissions() && recipient != senderId) | 387 | if (Permissions.PropagatePermissions() && recipient != senderId) |
386 | { | 388 | { |
387 | // First, make sore base is limited to the next perms | 389 | // Trying to do this right this time. This is evil. If |
388 | itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move); | 390 | // you believe in Good, go elsewhere. Vampires and other |
389 | // By default, current equals base | 391 | // evil creatores only beyond this point. You have been |
390 | itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions; | 392 | // warned. |
391 | 393 | ||
392 | // If this is an object, replace current perms | 394 | // We're going to mask a lot of things by the next perms |
393 | // with folded perms | 395 | // Tweak the next perms to be nicer to our data |
396 | // | ||
397 | // In this mask, all the bits we do NOT want to mess | ||
398 | // with are set. These are: | ||
399 | // | ||
400 | // Transfer | ||
401 | // Copy | ||
402 | // Modufy | ||
403 | uint permsMask = ~ ((uint)PermissionMask.Copy | | ||
404 | (uint)PermissionMask.Transfer | | ||
405 | (uint)PermissionMask.Modify); | ||
406 | |||
407 | // Now, reduce the next perms to the mask bits | ||
408 | // relevant to the operation | ||
409 | uint nextPerms = permsMask | (item.NextPermissions & | ||
410 | ((uint)PermissionMask.Copy | | ||
411 | (uint)PermissionMask.Transfer | | ||
412 | (uint)PermissionMask.Modify)); | ||
413 | |||
414 | // nextPerms now has all bits set, except for the actual | ||
415 | // next permission bits. | ||
416 | |||
417 | // This checks for no mod, no copy, no trans. | ||
418 | // This indicates an error or messed up item. Do it like | ||
419 | // SL and assume trans | ||
420 | if (nextPerms == permsMask) | ||
421 | nextPerms |= (uint)PermissionMask.Transfer; | ||
422 | |||
423 | // Inventory owner perms are the logical AND of the | ||
424 | // folded perms and the root prim perms, however, if | ||
425 | // the root prim is mod, the inventory perms will be | ||
426 | // mod. This happens on "take" and is of little concern | ||
427 | // here, save for preventing escalation | ||
428 | |||
429 | // This hack ensures that items previously permalocked | ||
430 | // get unlocked when they're passed or rezzed | ||
431 | uint basePerms = item.BasePermissions | | ||
432 | (uint)PermissionMask.Move; | ||
433 | uint ownerPerms = item.CurrentPermissions; | ||
434 | |||
435 | // If this is an object, root prim perms may be more | ||
436 | // permissive than folded perms. Use folded perms as | ||
437 | // a mask | ||
394 | if (item.InvType == (int)InventoryType.Object) | 438 | if (item.InvType == (int)InventoryType.Object) |
395 | { | 439 | { |
396 | itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); | 440 | // Create a safe mask for the current perms |
397 | itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13; | 441 | uint foldedPerms = (item.CurrentPermissions & 7) << 13; |
442 | foldedPerms |= permsMask; | ||
443 | |||
444 | bool isRootMod = (item.CurrentPermissions & | ||
445 | (uint)PermissionMask.Modify) != 0 ? | ||
446 | true : false; | ||
447 | |||
448 | // Mask the owner perms to the folded perms | ||
449 | ownerPerms &= foldedPerms; | ||
450 | basePerms &= foldedPerms; | ||
451 | |||
452 | // If the root was mod, let the mask reflect that | ||
453 | // We also need to adjust the base here, because | ||
454 | // we should be able to edit in-inventory perms | ||
455 | // for the root prim, if it's mod. | ||
456 | if (isRootMod) | ||
457 | { | ||
458 | ownerPerms |= (uint)PermissionMask.Modify; | ||
459 | basePerms |= (uint)PermissionMask.Modify; | ||
460 | } | ||
398 | } | 461 | } |
399 | 462 | ||
400 | // Ensure there is no escalation | 463 | // These will be applied to the root prim at next rez. |
401 | itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move); | 464 | // The slam bit (bit 3) and folded permission (bits 0-2) |
465 | // are preserved due to the above mangling | ||
466 | ownerPerms &= nextPerms; | ||
402 | 467 | ||
403 | // Need slam bit on xfer | 468 | // Mask the base permissions. This is a conservative |
404 | itemCopy.CurrentPermissions |= 8; | 469 | // approach altering only the three main perms |
470 | basePerms &= nextPerms; | ||
471 | |||
472 | // Assign to the actual item. Make sure the slam bit is | ||
473 | // set, if it wasn't set before. | ||
474 | itemCopy.BasePermissions = basePerms; | ||
475 | itemCopy.CurrentPermissions = ownerPerms | 16; // Slam | ||
405 | 476 | ||
406 | itemCopy.NextPermissions = item.NextPermissions; | 477 | itemCopy.NextPermissions = item.NextPermissions; |
407 | 478 | ||
408 | itemCopy.EveryOnePermissions = 0; | 479 | // This preserves "everyone can move" |
480 | itemCopy.EveryOnePermissions = item.EveryOnePermissions & | ||
481 | nextPerms; | ||
482 | |||
483 | // Intentionally killing "share with group" here, as | ||
484 | // the recipient will not have the group this is | ||
485 | // set to | ||
409 | itemCopy.GroupPermissions = 0; | 486 | itemCopy.GroupPermissions = 0; |
410 | } | 487 | } |
411 | else | 488 | else |
@@ -839,6 +916,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
839 | SceneObjectGroup group = part.ParentGroup; | 916 | SceneObjectGroup group = part.ParentGroup; |
840 | if (group != null) | 917 | if (group != null) |
841 | { | 918 | { |
919 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
920 | return; | ||
921 | |||
842 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); | 922 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); |
843 | if (item == null) | 923 | if (item == null) |
844 | return; | 924 | return; |
@@ -903,7 +983,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
903 | else | 983 | else |
904 | agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; | 984 | agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; |
905 | 985 | ||
906 | agentItem.CurrentPermissions |= 8; | 986 | agentItem.CurrentPermissions |= 16; // Slam |
907 | agentItem.NextPermissions = taskItem.NextPermissions; | 987 | agentItem.NextPermissions = taskItem.NextPermissions; |
908 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 988 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |
909 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; | 989 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; |
@@ -978,9 +1058,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
978 | return; | 1058 | return; |
979 | } | 1059 | } |
980 | 1060 | ||
981 | // Only owner can copy | 1061 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); |
982 | if (remoteClient.AgentId != taskItem.OwnerID) | 1062 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
983 | return; | 1063 | { |
1064 | // If the item to be moved is no copy, we need to be able to | ||
1065 | // edit the prim. | ||
1066 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
1067 | return; | ||
1068 | } | ||
1069 | else | ||
1070 | { | ||
1071 | // If the item is copiable, then we just need to have perms | ||
1072 | // on it. The delete check is a pure rights check | ||
1073 | if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId)) | ||
1074 | return; | ||
1075 | } | ||
984 | 1076 | ||
985 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 1077 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
986 | } | 1078 | } |
@@ -1094,7 +1186,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1094 | (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); | 1186 | (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); |
1095 | destTaskItem.BasePermissions = srcTaskItem.BasePermissions & | 1187 | destTaskItem.BasePermissions = srcTaskItem.BasePermissions & |
1096 | (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); | 1188 | (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); |
1097 | destTaskItem.CurrentPermissions |= 8; // Slam! | 1189 | destTaskItem.CurrentPermissions |= 16; // Slam! |
1098 | } | 1190 | } |
1099 | } | 1191 | } |
1100 | 1192 | ||
@@ -1263,10 +1355,48 @@ namespace OpenSim.Region.Framework.Scenes | |||
1263 | { | 1355 | { |
1264 | agentTransactions.HandleTaskItemUpdateFromTransaction( | 1356 | agentTransactions.HandleTaskItemUpdateFromTransaction( |
1265 | remoteClient, part, transactionID, currentItem); | 1357 | remoteClient, part, transactionID, currentItem); |
1358 | |||
1359 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) | ||
1360 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | ||
1361 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) | ||
1362 | remoteClient.SendAgentAlertMessage("Script saved", false); | ||
1363 | else | ||
1364 | remoteClient.SendAgentAlertMessage("Item saved", false); | ||
1365 | } | ||
1366 | |||
1367 | // Base ALWAYS has move | ||
1368 | currentItem.BasePermissions |= (uint)PermissionMask.Move; | ||
1369 | |||
1370 | // Check if we're allowed to mess with permissions | ||
1371 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god | ||
1372 | { | ||
1373 | if (remoteClient.AgentId != part.OwnerID) // Not owner | ||
1374 | { | ||
1375 | // Friends and group members can't change any perms | ||
1376 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1377 | itemInfo.EveryonePermissions = currentItem.EveryonePermissions; | ||
1378 | itemInfo.GroupPermissions = currentItem.GroupPermissions; | ||
1379 | itemInfo.NextPermissions = currentItem.NextPermissions; | ||
1380 | itemInfo.CurrentPermissions = currentItem.CurrentPermissions; | ||
1381 | } | ||
1382 | else | ||
1383 | { | ||
1384 | // Owner can't change base, and can change other | ||
1385 | // only up to base | ||
1386 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1387 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; | ||
1388 | itemInfo.GroupPermissions &= currentItem.BasePermissions; | ||
1389 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; | ||
1390 | itemInfo.NextPermissions &= currentItem.BasePermissions; | ||
1391 | } | ||
1392 | |||
1266 | } | 1393 | } |
1394 | |||
1395 | // Next ALWAYS has move | ||
1396 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; | ||
1397 | |||
1267 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | 1398 | if (part.Inventory.UpdateInventoryItem(itemInfo)) |
1268 | { | 1399 | { |
1269 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | ||
1270 | part.GetProperties(remoteClient); | 1400 | part.GetProperties(remoteClient); |
1271 | } | 1401 | } |
1272 | } | 1402 | } |
@@ -1478,7 +1608,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1478 | srcTaskItem.NextPermissions; | 1608 | srcTaskItem.NextPermissions; |
1479 | destTaskItem.BasePermissions = srcTaskItem.BasePermissions & | 1609 | destTaskItem.BasePermissions = srcTaskItem.BasePermissions & |
1480 | srcTaskItem.NextPermissions; | 1610 | srcTaskItem.NextPermissions; |
1481 | destTaskItem.CurrentPermissions |= 8; // Slam! | 1611 | destTaskItem.CurrentPermissions |= 16; // Slam! |
1482 | } | 1612 | } |
1483 | } | 1613 | } |
1484 | 1614 | ||
@@ -1597,7 +1727,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1597 | } | 1727 | } |
1598 | 1728 | ||
1599 | // Handle god perms | 1729 | // Handle god perms |
1600 | if (Permissions.IsGod(remoteClient.AgentId)) | 1730 | if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId)) |
1601 | { | 1731 | { |
1602 | permissionToTake = true; | 1732 | permissionToTake = true; |
1603 | permissionToTakeCopy = true; | 1733 | permissionToTakeCopy = true; |
@@ -1608,7 +1738,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1608 | if (action == DeRezAction.SaveToExistingUserInventoryItem) | 1738 | if (action == DeRezAction.SaveToExistingUserInventoryItem) |
1609 | permissionToDelete = false; | 1739 | permissionToDelete = false; |
1610 | 1740 | ||
1611 | // if we want to take a copy,, we also don't want to delete | 1741 | // if we want to take a copy, we also don't want to delete |
1612 | // Note: after this point, the permissionToTakeCopy flag | 1742 | // Note: after this point, the permissionToTakeCopy flag |
1613 | // becomes irrelevant. It already includes the permissionToTake | 1743 | // becomes irrelevant. It already includes the permissionToTake |
1614 | // permission and after excluding no copy items here, we can | 1744 | // permission and after excluding no copy items here, we can |
@@ -1619,6 +1749,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1619 | if (!permissionToTakeCopy) | 1749 | if (!permissionToTakeCopy) |
1620 | return; | 1750 | return; |
1621 | 1751 | ||
1752 | permissionToTake = true; | ||
1622 | // Don't delete | 1753 | // Don't delete |
1623 | permissionToDelete = false; | 1754 | permissionToDelete = false; |
1624 | } | 1755 | } |
@@ -1863,17 +1994,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1863 | 1994 | ||
1864 | group.SetGroup(sourcePart.GroupID, null); | 1995 | group.SetGroup(sourcePart.GroupID, null); |
1865 | 1996 | ||
1866 | if (rootPart.OwnerID != item.OwnerID) | 1997 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) |
1867 | { | 1998 | { |
1868 | if (Permissions.PropagatePermissions()) | 1999 | if (Permissions.PropagatePermissions()) |
1869 | { | 2000 | { |
1870 | if ((item.CurrentPermissions & 8) != 0) | 2001 | foreach (SceneObjectPart part in partList) |
1871 | { | 2002 | { |
1872 | foreach (SceneObjectPart part in partList) | 2003 | part.EveryoneMask = item.EveryonePermissions; |
1873 | { | 2004 | part.NextOwnerMask = item.NextPermissions; |
1874 | part.EveryoneMask = item.EveryonePermissions; | ||
1875 | part.NextOwnerMask = item.NextPermissions; | ||
1876 | } | ||
1877 | } | 2005 | } |
1878 | group.ApplyNextOwnerPermissions(); | 2006 | group.ApplyNextOwnerPermissions(); |
1879 | } | 2007 | } |
@@ -1881,17 +2009,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1881 | 2009 | ||
1882 | foreach (SceneObjectPart part in partList) | 2010 | foreach (SceneObjectPart part in partList) |
1883 | { | 2011 | { |
1884 | if (part.OwnerID != item.OwnerID) | 2012 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) |
1885 | { | 2013 | { |
1886 | part.LastOwnerID = part.OwnerID; | 2014 | part.LastOwnerID = part.OwnerID; |
1887 | part.OwnerID = item.OwnerID; | 2015 | part.OwnerID = item.OwnerID; |
1888 | part.Inventory.ChangeInventoryOwner(item.OwnerID); | 2016 | part.Inventory.ChangeInventoryOwner(item.OwnerID); |
1889 | } | 2017 | } |
1890 | else if ((item.CurrentPermissions & 8) != 0) // Slam! | 2018 | part.EveryoneMask = item.EveryonePermissions; |
1891 | { | 2019 | part.NextOwnerMask = item.NextPermissions; |
1892 | part.EveryoneMask = item.EveryonePermissions; | ||
1893 | part.NextOwnerMask = item.NextPermissions; | ||
1894 | } | ||
1895 | } | 2020 | } |
1896 | 2021 | ||
1897 | rootPart.TrimPermissions(); | 2022 | rootPart.TrimPermissions(); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5542a0c..e8dce08 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -136,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
136 | 136 | ||
137 | protected SceneCommunicationService m_sceneGridService; | 137 | protected SceneCommunicationService m_sceneGridService; |
138 | public bool LoginsDisabled = true; | 138 | public bool LoginsDisabled = true; |
139 | public bool LoadingPrims = false; | ||
139 | 140 | ||
140 | public new float TimeDilation | 141 | public new float TimeDilation |
141 | { | 142 | { |
@@ -478,8 +479,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
478 | set { m_sceneGraph.RestorePresences = value; } | 479 | set { m_sceneGraph.RestorePresences = value; } |
479 | } | 480 | } |
480 | 481 | ||
481 | public int objectCapacity = 45000; | ||
482 | |||
483 | #endregion | 482 | #endregion |
484 | 483 | ||
485 | #region BinaryStats | 484 | #region BinaryStats |
@@ -687,7 +686,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
687 | StatsReporter.OnSendStatsResult += SendSimStatsPackets; | 686 | StatsReporter.OnSendStatsResult += SendSimStatsPackets; |
688 | StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; | 687 | StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; |
689 | 688 | ||
690 | StatsReporter.SetObjectCapacity(objectCapacity); | 689 | StatsReporter.SetObjectCapacity(RegionInfo.ObjectCapacity); |
691 | 690 | ||
692 | // Old | 691 | // Old |
693 | /* | 692 | /* |
@@ -1879,6 +1878,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1879 | /// </summary> | 1878 | /// </summary> |
1880 | public virtual void LoadPrimsFromStorage(UUID regionID) | 1879 | public virtual void LoadPrimsFromStorage(UUID regionID) |
1881 | { | 1880 | { |
1881 | LoadingPrims = true; | ||
1882 | m_log.Info("[SCENE]: Loading objects from datastore"); | 1882 | m_log.Info("[SCENE]: Loading objects from datastore"); |
1883 | 1883 | ||
1884 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); | 1884 | List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); |
@@ -1904,6 +1904,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1904 | } | 1904 | } |
1905 | 1905 | ||
1906 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); | 1906 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); |
1907 | LoadingPrims = false; | ||
1907 | } | 1908 | } |
1908 | 1909 | ||
1909 | 1910 | ||
@@ -2575,8 +2576,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2575 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2576 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2576 | 2577 | ||
2577 | if (AttachmentsModule != null) | 2578 | if (AttachmentsModule != null) |
2578 | AttachmentsModule.AttachObject( | 2579 | AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false); |
2579 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); | ||
2580 | 2580 | ||
2581 | } | 2581 | } |
2582 | else | 2582 | else |
@@ -4121,20 +4121,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4121 | 4121 | ||
4122 | #region Other Methods | 4122 | #region Other Methods |
4123 | 4123 | ||
4124 | public void SetObjectCapacity(int objects) | ||
4125 | { | ||
4126 | // Region specific config overrides global | ||
4127 | // | ||
4128 | if (RegionInfo.ObjectCapacity != 0) | ||
4129 | objects = RegionInfo.ObjectCapacity; | ||
4130 | |||
4131 | if (StatsReporter != null) | ||
4132 | { | ||
4133 | StatsReporter.SetObjectCapacity(objects); | ||
4134 | } | ||
4135 | objectCapacity = objects; | ||
4136 | } | ||
4137 | |||
4138 | #endregion | 4124 | #endregion |
4139 | 4125 | ||
4140 | public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) | 4126 | public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) |
@@ -4733,7 +4719,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4733 | part.NextOwnerMask; | 4719 | part.NextOwnerMask; |
4734 | item.GroupPermissions = part.GroupMask & | 4720 | item.GroupPermissions = part.GroupMask & |
4735 | part.NextOwnerMask; | 4721 | part.NextOwnerMask; |
4736 | item.CurrentPermissions |= 8; // Slam! | 4722 | item.CurrentPermissions |= 16; // Slam! |
4737 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 4723 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
4738 | 4724 | ||
4739 | if (InventoryService.AddItem(item)) | 4725 | if (InventoryService.AddItem(item)) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index f7e46af..9a01a28 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -172,13 +172,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
172 | taskItem.GroupPermissions = item.GroupPermissions & | 172 | taskItem.GroupPermissions = item.GroupPermissions & |
173 | item.NextPermissions; | 173 | item.NextPermissions; |
174 | taskItem.NextPermissions = item.NextPermissions; | 174 | taskItem.NextPermissions = item.NextPermissions; |
175 | taskItem.CurrentPermissions |= 8; | 175 | // We're adding this to a prim we don't own. Force |
176 | // owner change | ||
177 | taskItem.CurrentPermissions |= 16; // Slam | ||
176 | } | 178 | } |
177 | else | 179 | else |
178 | { | 180 | { |
179 | taskItem.BasePermissions = item.BasePermissions; | 181 | taskItem.BasePermissions = item.BasePermissions; |
180 | taskItem.CurrentPermissions = item.CurrentPermissions; | 182 | taskItem.CurrentPermissions = item.CurrentPermissions; |
181 | taskItem.CurrentPermissions |= 8; | ||
182 | taskItem.EveryonePermissions = item.EveryOnePermissions; | 183 | taskItem.EveryonePermissions = item.EveryOnePermissions; |
183 | taskItem.GroupPermissions = item.GroupPermissions; | 184 | taskItem.GroupPermissions = item.GroupPermissions; |
184 | taskItem.NextPermissions = item.NextPermissions; | 185 | taskItem.NextPermissions = item.NextPermissions; |
@@ -281,7 +282,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
281 | PermissionMask.Move | | 282 | PermissionMask.Move | |
282 | PermissionMask.Transfer) | 7; | 283 | PermissionMask.Transfer) | 7; |
283 | 284 | ||
284 | uint ownerMask = 0x7ffffff; | 285 | uint ownerMask = 0x7fffffff; |
285 | foreach (SceneObjectPart part in m_parts.Values) | 286 | foreach (SceneObjectPart part in m_parts.Values) |
286 | { | 287 | { |
287 | ownerMask &= part.OwnerMask; | 288 | ownerMask &= part.OwnerMask; |
@@ -295,12 +296,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
295 | if ((ownerMask & (uint)PermissionMask.Transfer) == 0) | 296 | if ((ownerMask & (uint)PermissionMask.Transfer) == 0) |
296 | perms &= ~(uint)PermissionMask.Transfer; | 297 | perms &= ~(uint)PermissionMask.Transfer; |
297 | 298 | ||
298 | if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0) | 299 | // If root prim permissions are applied here, this would screw |
299 | perms &= ~((uint)PermissionMask.Modify >> 13); | 300 | // with in-inventory manipulation of the next owner perms |
300 | if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0) | 301 | // in a major way. So, let's move this to the give itself. |
301 | perms &= ~((uint)PermissionMask.Copy >> 13); | 302 | // Yes. I know. Evil. |
302 | if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) | 303 | // if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Modify) == 0) |
303 | perms &= ~((uint)PermissionMask.Transfer >> 13); | 304 | // perms &= ~((uint)PermissionMask.Modify >> 13); |
305 | // if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Copy) == 0) | ||
306 | // perms &= ~((uint)PermissionMask.Copy >> 13); | ||
307 | // if ((ownerMask & RootPart.NextOwnerMask & (uint)PermissionMask.Transfer) == 0) | ||
308 | // perms &= ~((uint)PermissionMask.Transfer >> 13); | ||
304 | 309 | ||
305 | return perms; | 310 | return perms; |
306 | } | 311 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 451b93e..c2f9117 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -294,7 +294,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
294 | 294 | ||
295 | if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) | 295 | if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) |
296 | || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) | 296 | || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) |
297 | && !IsAttachmentCheckFull()) | 297 | && !IsAttachmentCheckFull() && (!m_scene.LoadingPrims)) |
298 | { | 298 | { |
299 | m_scene.CrossPrimGroupIntoNewRegion(val, this, true); | 299 | m_scene.CrossPrimGroupIntoNewRegion(val, this, true); |
300 | } | 300 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3165f4d..444a239 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -181,6 +181,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
181 | public UUID FromItemID; | 181 | public UUID FromItemID; |
182 | 182 | ||
183 | [XmlIgnore] | 183 | [XmlIgnore] |
184 | public UUID FromFolderID; | ||
185 | |||
186 | [XmlIgnore] | ||
184 | public int STATUS_ROTATE_X; | 187 | public int STATUS_ROTATE_X; |
185 | 188 | ||
186 | [XmlIgnore] | 189 | [XmlIgnore] |
@@ -4164,6 +4167,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
4164 | case 16: | 4167 | case 16: |
4165 | _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) & | 4168 | _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) & |
4166 | baseMask; | 4169 | baseMask; |
4170 | // Prevent the client from creating no mod, no copy | ||
4171 | // objects | ||
4172 | if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) | ||
4173 | _nextOwnerMask |= (uint)PermissionMask.Transfer; | ||
4174 | |||
4175 | _nextOwnerMask |= (uint)PermissionMask.Move; | ||
4176 | |||
4167 | break; | 4177 | break; |
4168 | } | 4178 | } |
4169 | SendFullUpdateToAllClients(); | 4179 | SendFullUpdateToAllClients(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 3a8f168..4ae53a2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -118,20 +118,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
118 | /// <param name="linkNum">Link number for the part</param> | 118 | /// <param name="linkNum">Link number for the part</param> |
119 | public void ResetInventoryIDs() | 119 | public void ResetInventoryIDs() |
120 | { | 120 | { |
121 | lock (Items) | 121 | lock (m_items) |
122 | { | 122 | { |
123 | if (0 == Items.Count) | 123 | if (0 == m_items.Count) |
124 | return; | 124 | return; |
125 | 125 | ||
126 | HasInventoryChanged = true; | 126 | HasInventoryChanged = true; |
127 | m_part.ParentGroup.HasGroupChanged = true; | 127 | m_part.ParentGroup.HasGroupChanged = true; |
128 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); | 128 | IList<TaskInventoryItem> items = GetInventoryItems(); |
129 | Items.Clear(); | 129 | m_items.Clear(); |
130 | 130 | ||
131 | foreach (TaskInventoryItem item in items) | 131 | foreach (TaskInventoryItem item in items) |
132 | { | 132 | { |
133 | item.ResetIDs(m_part.UUID); | 133 | item.ResetIDs(m_part.UUID); |
134 | Items.Add(item.ItemID, item); | 134 | m_items.Add(item.ItemID, item); |
135 | } | 135 | } |
136 | } | 136 | } |
137 | } | 137 | } |
@@ -148,17 +148,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
148 | { | 148 | { |
149 | return; | 149 | return; |
150 | } | 150 | } |
151 | } | ||
151 | 152 | ||
152 | HasInventoryChanged = true; | 153 | HasInventoryChanged = true; |
153 | m_part.ParentGroup.HasGroupChanged = true; | 154 | m_part.ParentGroup.HasGroupChanged = true; |
154 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); | 155 | List<TaskInventoryItem> items = GetInventoryItems(); |
155 | foreach (TaskInventoryItem item in items) | 156 | foreach (TaskInventoryItem item in items) |
157 | { | ||
158 | if (ownerId != item.OwnerID) | ||
156 | { | 159 | { |
157 | if (ownerId != item.OwnerID) | 160 | item.LastOwnerID = item.OwnerID; |
158 | { | 161 | item.OwnerID = ownerId; |
159 | item.LastOwnerID = item.OwnerID; | ||
160 | item.OwnerID = ownerId; | ||
161 | } | ||
162 | } | 162 | } |
163 | } | 163 | } |
164 | } | 164 | } |
@@ -175,17 +175,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
175 | { | 175 | { |
176 | return; | 176 | return; |
177 | } | 177 | } |
178 | } | ||
178 | 179 | ||
179 | HasInventoryChanged = true; | 180 | HasInventoryChanged = true; |
180 | m_part.ParentGroup.HasGroupChanged = true; | 181 | m_part.ParentGroup.HasGroupChanged = true; |
181 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); | 182 | List<TaskInventoryItem> items = GetInventoryItems(); |
182 | foreach (TaskInventoryItem item in items) | 183 | foreach (TaskInventoryItem item in items) |
183 | { | 184 | { |
184 | if (groupID != item.GroupID) | 185 | if (groupID != item.GroupID) |
185 | { | 186 | item.GroupID = groupID; |
186 | item.GroupID = groupID; | ||
187 | } | ||
188 | } | ||
189 | } | 187 | } |
190 | } | 188 | } |
191 | 189 | ||
@@ -194,17 +192,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
194 | /// </summary> | 192 | /// </summary> |
195 | public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource) | 193 | public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource) |
196 | { | 194 | { |
197 | lock (m_items) | 195 | List<TaskInventoryItem> scripts = GetInventoryScripts(); |
198 | { | 196 | foreach (TaskInventoryItem item in scripts) |
199 | foreach (TaskInventoryItem item in Items.Values) | 197 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); |
200 | { | ||
201 | if ((int)InventoryType.LSL == item.InvType) | ||
202 | { | ||
203 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); | ||
204 | Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | } | 198 | } |
209 | 199 | ||
210 | public ArrayList GetScriptErrors(UUID itemID) | 200 | public ArrayList GetScriptErrors(UUID itemID) |
@@ -237,16 +227,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
237 | /// </param> | 227 | /// </param> |
238 | public void RemoveScriptInstances(bool sceneObjectBeingDeleted) | 228 | public void RemoveScriptInstances(bool sceneObjectBeingDeleted) |
239 | { | 229 | { |
240 | lock (Items) | 230 | List<TaskInventoryItem> scripts = GetInventoryScripts(); |
241 | { | 231 | foreach (TaskInventoryItem item in scripts) |
242 | foreach (TaskInventoryItem item in Items.Values) | 232 | RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted); |
243 | { | ||
244 | if ((int)InventoryType.LSL == item.InvType) | ||
245 | { | ||
246 | RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted); | ||
247 | } | ||
248 | } | ||
249 | } | ||
250 | } | 233 | } |
251 | 234 | ||
252 | /// <summary> | 235 | /// <summary> |
@@ -259,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
259 | // m_log.InfoFormat( | 242 | // m_log.InfoFormat( |
260 | // "[PRIM INVENTORY]: " + | 243 | // "[PRIM INVENTORY]: " + |
261 | // "Starting script {0}, {1} in prim {2}, {3}", | 244 | // "Starting script {0}, {1} in prim {2}, {3}", |
262 | // item.Name, item.ItemID, m_part.Name, m_part.UUID); | 245 | // item.Name, item.ItemID, Name, UUID); |
263 | 246 | ||
264 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) | 247 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) |
265 | return; | 248 | return; |
@@ -295,20 +278,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
295 | } | 278 | } |
296 | else | 279 | else |
297 | { | 280 | { |
281 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
282 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
283 | |||
298 | lock (m_items) | 284 | lock (m_items) |
299 | { | 285 | { |
300 | if (m_part.ParentGroup.m_savedScriptState != null) | ||
301 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | ||
302 | |||
303 | m_items[item.ItemID].PermsMask = 0; | 286 | m_items[item.ItemID].PermsMask = 0; |
304 | m_items[item.ItemID].PermsGranter = UUID.Zero; | 287 | m_items[item.ItemID].PermsGranter = UUID.Zero; |
305 | |||
306 | string script = Utils.BytesToString(asset.Data); | ||
307 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
308 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
309 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
310 | m_part.ScheduleFullUpdate(); | ||
311 | } | 288 | } |
289 | |||
290 | string script = Utils.BytesToString(asset.Data); | ||
291 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | ||
292 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | ||
293 | m_part.ParentGroup.AddActiveScriptCount(1); | ||
294 | m_part.ScheduleFullUpdate(); | ||
312 | } | 295 | } |
313 | } | 296 | } |
314 | } | 297 | } |
@@ -376,21 +359,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
376 | /// </param> | 359 | /// </param> |
377 | public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource) | 360 | public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource) |
378 | { | 361 | { |
379 | lock (m_items) | 362 | TaskInventoryItem item = GetInventoryItem(itemId); |
380 | { | 363 | if (item != null) |
381 | if (m_items.ContainsKey(itemId)) | 364 | CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); |
382 | { | 365 | else |
383 | CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource); | 366 | m_log.ErrorFormat( |
384 | } | 367 | "[PRIM INVENTORY]: " + |
385 | else | 368 | "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", |
386 | { | 369 | itemId, m_part.Name, m_part.UUID, |
387 | m_log.ErrorFormat( | 370 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); |
388 | "[PRIM INVENTORY]: " + | ||
389 | "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", | ||
390 | itemId, m_part.Name, m_part.UUID, | ||
391 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); | ||
392 | } | ||
393 | } | ||
394 | } | 371 | } |
395 | 372 | ||
396 | /// <summary> | 373 | /// <summary> |
@@ -431,16 +408,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
431 | 408 | ||
432 | /// <summary> | 409 | /// <summary> |
433 | /// Check if the inventory holds an item with a given name. | 410 | /// Check if the inventory holds an item with a given name. |
434 | /// This method assumes that the task inventory is already locked. | ||
435 | /// </summary> | 411 | /// </summary> |
436 | /// <param name="name"></param> | 412 | /// <param name="name"></param> |
437 | /// <returns></returns> | 413 | /// <returns></returns> |
438 | private bool InventoryContainsName(string name) | 414 | private bool InventoryContainsName(string name) |
439 | { | 415 | { |
440 | foreach (TaskInventoryItem item in Items.Values) | 416 | lock (m_items) |
441 | { | 417 | { |
442 | if (item.Name == name) | 418 | foreach (TaskInventoryItem item in m_items.Values) |
443 | return true; | 419 | { |
420 | if (item.Name == name) | ||
421 | return true; | ||
422 | } | ||
444 | } | 423 | } |
445 | return false; | 424 | return false; |
446 | } | 425 | } |
@@ -483,12 +462,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
483 | /// <param name="item"></param> | 462 | /// <param name="item"></param> |
484 | public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop) | 463 | public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop) |
485 | { | 464 | { |
486 | List<TaskInventoryItem> il; | 465 | List<TaskInventoryItem> il = GetInventoryItems(); |
487 | |||
488 | lock (m_items) | ||
489 | { | ||
490 | il = new List<TaskInventoryItem>(m_items.Values); | ||
491 | } | ||
492 | 466 | ||
493 | foreach (TaskInventoryItem i in il) | 467 | foreach (TaskInventoryItem i in il) |
494 | { | 468 | { |
@@ -528,14 +502,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
528 | item.GroupID = m_part.GroupID; | 502 | item.GroupID = m_part.GroupID; |
529 | 503 | ||
530 | lock (m_items) | 504 | lock (m_items) |
531 | { | ||
532 | m_items.Add(item.ItemID, item); | 505 | m_items.Add(item.ItemID, item); |
533 | 506 | ||
534 | if (allowedDrop) | 507 | if (allowedDrop) |
535 | m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP); | 508 | m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP); |
536 | else | 509 | else |
537 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | 510 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
538 | } | ||
539 | 511 | ||
540 | m_inventorySerial++; | 512 | m_inventorySerial++; |
541 | //m_inventorySerial += 2; | 513 | //m_inventorySerial += 2; |
@@ -559,9 +531,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
559 | m_items.Add(item.ItemID, item); | 531 | m_items.Add(item.ItemID, item); |
560 | // m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | 532 | // m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
561 | } | 533 | } |
534 | m_inventorySerial++; | ||
562 | } | 535 | } |
563 | |||
564 | m_inventorySerial++; | ||
565 | } | 536 | } |
566 | 537 | ||
567 | /// <summary> | 538 | /// <summary> |
@@ -616,45 +587,44 @@ namespace OpenSim.Region.Framework.Scenes | |||
616 | 587 | ||
617 | public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents) | 588 | public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents) |
618 | { | 589 | { |
619 | lock(m_items) | 590 | TaskInventoryItem it = GetInventoryItem(item.ItemID); |
591 | if (it != null) | ||
620 | { | 592 | { |
621 | if (m_items.ContainsKey(item.ItemID)) | 593 | item.ParentID = m_part.UUID; |
622 | { | 594 | item.ParentPartID = m_part.UUID; |
623 | if (m_items.ContainsKey(item.ItemID)) | 595 | item.Flags = m_items[item.ItemID].Flags; |
624 | { | 596 | |
625 | item.ParentID = m_part.UUID; | 597 | // If group permissions have been set on, check that the groupID is up to date in case it has |
626 | item.ParentPartID = m_part.UUID; | 598 | // changed since permissions were last set. |
627 | item.Flags = m_items[item.ItemID].Flags; | 599 | if (item.GroupPermissions != (uint)PermissionMask.None) |
628 | 600 | item.GroupID = m_part.GroupID; | |
629 | // If group permissions have been set on, check that the groupID is up to date in case it has | 601 | |
630 | // changed since permissions were last set. | 602 | if (item.AssetID == UUID.Zero) |
631 | if (item.GroupPermissions != (uint)PermissionMask.None) | 603 | item.AssetID = it.AssetID; |
632 | item.GroupID = m_part.GroupID; | ||
633 | |||
634 | if (item.AssetID == UUID.Zero) | ||
635 | { | ||
636 | item.AssetID = m_items[item.ItemID].AssetID; | ||
637 | } | ||
638 | m_items[item.ItemID] = item; | ||
639 | m_inventorySerial++; | ||
640 | if (fireScriptEvents) | ||
641 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | ||
642 | HasInventoryChanged = true; | ||
643 | m_part.ParentGroup.HasGroupChanged = true; | ||
644 | return true; | ||
645 | } | ||
646 | else | ||
647 | { | ||
648 | m_log.ErrorFormat( | ||
649 | "[PRIM INVENTORY]: " + | ||
650 | "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", | ||
651 | item.ItemID, m_part.Name, m_part.UUID, | ||
652 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); | ||
653 | } | ||
654 | 604 | ||
605 | lock (m_items) | ||
606 | { | ||
607 | m_items[item.ItemID] = item; | ||
608 | m_inventorySerial++; | ||
655 | } | 609 | } |
656 | return false; | 610 | |
611 | if (fireScriptEvents) | ||
612 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | ||
613 | |||
614 | HasInventoryChanged = true; | ||
615 | m_part.ParentGroup.HasGroupChanged = true; | ||
616 | return true; | ||
657 | } | 617 | } |
618 | else | ||
619 | { | ||
620 | m_log.ErrorFormat( | ||
621 | "[PRIM INVENTORY]: " + | ||
622 | "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", | ||
623 | item.ItemID, m_part.Name, m_part.UUID, | ||
624 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); | ||
625 | } | ||
626 | return false; | ||
627 | |||
658 | } | 628 | } |
659 | 629 | ||
660 | /// <summary> | 630 | /// <summary> |
@@ -665,52 +635,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
665 | /// in this prim's inventory.</returns> | 635 | /// in this prim's inventory.</returns> |
666 | public int RemoveInventoryItem(UUID itemID) | 636 | public int RemoveInventoryItem(UUID itemID) |
667 | { | 637 | { |
668 | lock (m_items) | 638 | TaskInventoryItem item = GetInventoryItem(itemID); |
639 | if (item != null) | ||
669 | { | 640 | { |
670 | if (m_items.ContainsKey(itemID)) | 641 | int type = m_items[itemID].InvType; |
642 | if (type == 10) // Script | ||
671 | { | 643 | { |
672 | int type = m_items[itemID].InvType; | 644 | m_part.RemoveScriptEvents(itemID); |
673 | if (type == 10) // Script | 645 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); |
674 | { | 646 | } |
675 | m_part.RemoveScriptEvents(itemID); | 647 | m_items.Remove(itemID); |
676 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); | 648 | m_inventorySerial++; |
677 | } | 649 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
678 | m_items.Remove(itemID); | ||
679 | m_inventorySerial++; | ||
680 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | ||
681 | |||
682 | HasInventoryChanged = true; | ||
683 | m_part.ParentGroup.HasGroupChanged = true; | ||
684 | 650 | ||
685 | int scriptcount = 0; | 651 | HasInventoryChanged = true; |
686 | lock (m_items) | 652 | m_part.ParentGroup.HasGroupChanged = true; |
687 | { | ||
688 | foreach (TaskInventoryItem item in m_items.Values) | ||
689 | { | ||
690 | if (item.Type == 10) | ||
691 | { | ||
692 | scriptcount++; | ||
693 | } | ||
694 | } | ||
695 | } | ||
696 | 653 | ||
697 | if (scriptcount <= 0) | 654 | if (!ContainsScripts()) |
698 | { | 655 | m_part.RemFlag(PrimFlags.Scripted); |
699 | m_part.RemFlag(PrimFlags.Scripted); | ||
700 | } | ||
701 | 656 | ||
702 | m_part.ScheduleFullUpdate(); | 657 | m_part.ScheduleFullUpdate(); |
703 | 658 | ||
704 | return type; | 659 | return type; |
705 | } | 660 | |
706 | else | 661 | } |
707 | { | 662 | else |
708 | m_log.ErrorFormat( | 663 | { |
709 | "[PRIM INVENTORY]: " + | 664 | m_log.ErrorFormat( |
710 | "Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", | 665 | "[PRIM INVENTORY]: " + |
711 | itemID, m_part.Name, m_part.UUID, | 666 | "Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", |
712 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); | 667 | itemID, m_part.Name, m_part.UUID, |
713 | } | 668 | m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); |
714 | } | 669 | } |
715 | 670 | ||
716 | return -1; | 671 | return -1; |
@@ -764,52 +719,50 @@ namespace OpenSim.Region.Framework.Scenes | |||
764 | // isn't available (such as drag from prim inventory to agent inventory) | 719 | // isn't available (such as drag from prim inventory to agent inventory) |
765 | InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); | 720 | InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); |
766 | 721 | ||
767 | lock (m_items) | 722 | List<TaskInventoryItem> items = GetInventoryItems(); |
723 | foreach (TaskInventoryItem item in items) | ||
768 | { | 724 | { |
769 | foreach (TaskInventoryItem item in m_items.Values) | 725 | UUID ownerID = item.OwnerID; |
770 | { | 726 | uint everyoneMask = 0; |
771 | UUID ownerID = item.OwnerID; | 727 | uint baseMask = item.BasePermissions; |
772 | uint everyoneMask = 0; | 728 | uint ownerMask = item.CurrentPermissions; |
773 | uint baseMask = item.BasePermissions; | 729 | uint groupMask = item.GroupPermissions; |
774 | uint ownerMask = item.CurrentPermissions; | ||
775 | uint groupMask = item.GroupPermissions; | ||
776 | 730 | ||
777 | invString.AddItemStart(); | 731 | invString.AddItemStart(); |
778 | invString.AddNameValueLine("item_id", item.ItemID.ToString()); | 732 | invString.AddNameValueLine("item_id", item.ItemID.ToString()); |
779 | invString.AddNameValueLine("parent_id", m_part.UUID.ToString()); | 733 | invString.AddNameValueLine("parent_id", m_part.UUID.ToString()); |
780 | 734 | ||
781 | invString.AddPermissionsStart(); | 735 | invString.AddPermissionsStart(); |
782 | 736 | ||
783 | invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); | 737 | invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask)); |
784 | invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); | 738 | invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask)); |
785 | invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask)); | 739 | invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask)); |
786 | invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); | 740 | invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask)); |
787 | invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); | 741 | invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions)); |
788 | 742 | ||
789 | invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); | 743 | invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); |
790 | invString.AddNameValueLine("owner_id", ownerID.ToString()); | 744 | invString.AddNameValueLine("owner_id", ownerID.ToString()); |
791 | 745 | ||
792 | invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); | 746 | invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); |
793 | 747 | ||
794 | invString.AddNameValueLine("group_id", item.GroupID.ToString()); | 748 | invString.AddNameValueLine("group_id", item.GroupID.ToString()); |
795 | invString.AddSectionEnd(); | 749 | invString.AddSectionEnd(); |
796 | 750 | ||
797 | invString.AddNameValueLine("asset_id", item.AssetID.ToString()); | 751 | invString.AddNameValueLine("asset_id", item.AssetID.ToString()); |
798 | invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); | 752 | invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); |
799 | invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); | 753 | invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); |
800 | invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); | 754 | invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); |
801 | 755 | ||
802 | invString.AddSaleStart(); | 756 | invString.AddSaleStart(); |
803 | invString.AddNameValueLine("sale_type", "not"); | 757 | invString.AddNameValueLine("sale_type", "not"); |
804 | invString.AddNameValueLine("sale_price", "0"); | 758 | invString.AddNameValueLine("sale_price", "0"); |
805 | invString.AddSectionEnd(); | 759 | invString.AddSectionEnd(); |
806 | 760 | ||
807 | invString.AddNameValueLine("name", item.Name + "|"); | 761 | invString.AddNameValueLine("name", item.Name + "|"); |
808 | invString.AddNameValueLine("desc", item.Description + "|"); | 762 | invString.AddNameValueLine("desc", item.Description + "|"); |
809 | 763 | ||
810 | invString.AddNameValueLine("creation_date", item.CreationDate.ToString()); | 764 | invString.AddNameValueLine("creation_date", item.CreationDate.ToString()); |
811 | invString.AddSectionEnd(); | 765 | invString.AddSectionEnd(); |
812 | } | ||
813 | } | 766 | } |
814 | 767 | ||
815 | fileData = Utils.StringToBytes(invString.BuildString); | 768 | fileData = Utils.StringToBytes(invString.BuildString); |
@@ -831,12 +784,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
831 | { | 784 | { |
832 | if (HasInventoryChanged) | 785 | if (HasInventoryChanged) |
833 | { | 786 | { |
834 | lock (Items) | ||
835 | { | ||
836 | datastore.StorePrimInventory(m_part.UUID, Items.Values); | ||
837 | } | ||
838 | |||
839 | HasInventoryChanged = false; | 787 | HasInventoryChanged = false; |
788 | List<TaskInventoryItem> items = GetInventoryItems(); | ||
789 | datastore.StorePrimInventory(m_part.UUID, items); | ||
790 | |||
840 | } | 791 | } |
841 | } | 792 | } |
842 | 793 | ||
@@ -952,7 +903,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
952 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; | 903 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; |
953 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | 904 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) |
954 | item.CurrentPermissions &= ~(uint)PermissionMask.Modify; | 905 | item.CurrentPermissions &= ~(uint)PermissionMask.Modify; |
955 | item.CurrentPermissions |= 8; | ||
956 | } | 906 | } |
957 | item.CurrentPermissions &= item.NextPermissions; | 907 | item.CurrentPermissions &= item.NextPermissions; |
958 | item.BasePermissions &= item.NextPermissions; | 908 | item.BasePermissions &= item.NextPermissions; |
@@ -1002,6 +952,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
1002 | 952 | ||
1003 | return ret; | 953 | return ret; |
1004 | } | 954 | } |
955 | |||
956 | public List<TaskInventoryItem> GetInventoryItems() | ||
957 | { | ||
958 | List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); | ||
959 | |||
960 | lock (m_items) | ||
961 | ret = new List<TaskInventoryItem>(m_items.Values); | ||
962 | |||
963 | return ret; | ||
964 | } | ||
965 | |||
966 | public List<TaskInventoryItem> GetInventoryScripts() | ||
967 | { | ||
968 | List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); | ||
969 | |||
970 | lock (m_items) | ||
971 | { | ||
972 | foreach (TaskInventoryItem item in m_items.Values) | ||
973 | if (item.InvType == (int)InventoryType.LSL) | ||
974 | ret.Add(item); | ||
975 | } | ||
976 | |||
977 | return ret; | ||
978 | } | ||
1005 | 979 | ||
1006 | public Dictionary<UUID, string> GetScriptStates() | 980 | public Dictionary<UUID, string> GetScriptStates() |
1007 | { | 981 | { |
@@ -1011,24 +985,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1011 | if (engines == null) // No engine at all | 985 | if (engines == null) // No engine at all |
1012 | return ret; | 986 | return ret; |
1013 | 987 | ||
1014 | lock (m_items) | 988 | List<TaskInventoryItem> scripts = GetInventoryScripts(); |
989 | |||
990 | foreach (TaskInventoryItem item in scripts) | ||
1015 | { | 991 | { |
1016 | foreach (TaskInventoryItem item in m_items.Values) | 992 | foreach (IScriptModule e in engines) |
1017 | { | 993 | { |
1018 | if (item.InvType == (int)InventoryType.LSL) | 994 | if (e != null) |
1019 | { | 995 | { |
1020 | foreach (IScriptModule e in engines) | 996 | string n = e.GetXMLState(item.ItemID); |
997 | if (n != String.Empty) | ||
1021 | { | 998 | { |
1022 | if (e != null) | 999 | if (!ret.ContainsKey(item.ItemID)) |
1023 | { | 1000 | ret[item.ItemID] = n; |
1024 | string n = e.GetXMLState(item.ItemID); | 1001 | break; |
1025 | if (n != String.Empty) | ||
1026 | { | ||
1027 | if (!ret.ContainsKey(item.ItemID)) | ||
1028 | ret[item.ItemID] = n; | ||
1029 | break; | ||
1030 | } | ||
1031 | } | ||
1032 | } | 1002 | } |
1033 | } | 1003 | } |
1034 | } | 1004 | } |
@@ -1043,25 +1013,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
1043 | if (engines == null) | 1013 | if (engines == null) |
1044 | return; | 1014 | return; |
1045 | 1015 | ||
1046 | lock (m_items) | 1016 | List<TaskInventoryItem> scripts = GetInventoryScripts(); |
1017 | |||
1018 | foreach (TaskInventoryItem item in scripts) | ||
1047 | { | 1019 | { |
1048 | foreach (TaskInventoryItem item in m_items.Values) | 1020 | foreach (IScriptModule engine in engines) |
1049 | { | 1021 | { |
1050 | if (item.InvType == (int)InventoryType.LSL) | 1022 | if (engine != null) |
1051 | { | 1023 | { |
1052 | foreach (IScriptModule engine in engines) | 1024 | if (item.OwnerChanged) |
1053 | { | 1025 | engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER }); |
1054 | if (engine != null) | 1026 | item.OwnerChanged = false; |
1055 | { | 1027 | engine.ResumeScript(item.ItemID); |
1056 | if (item.OwnerChanged) | ||
1057 | engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER }); | ||
1058 | item.OwnerChanged = false; | ||
1059 | engine.ResumeScript(item.ItemID); | ||
1060 | } | ||
1061 | } | ||
1062 | } | 1028 | } |
1063 | } | 1029 | } |
1064 | } | 1030 | } |
1065 | } | 1031 | } |
1032 | |||
1066 | } | 1033 | } |
1067 | } | 1034 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6c119c2..1e8ce22 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -60,7 +60,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
60 | struct ScriptControllers | 60 | struct ScriptControllers |
61 | { | 61 | { |
62 | public UUID itemID; | 62 | public UUID itemID; |
63 | public uint objID; | ||
64 | public ScriptControlled ignoreControls; | 63 | public ScriptControlled ignoreControls; |
65 | public ScriptControlled eventControls; | 64 | public ScriptControlled eventControls; |
66 | } | 65 | } |
@@ -3057,6 +3056,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
3057 | cAgent.Attachments = attachs; | 3056 | cAgent.Attachments = attachs; |
3058 | } | 3057 | } |
3059 | 3058 | ||
3059 | lock (scriptedcontrols) | ||
3060 | { | ||
3061 | ControllerData[] controls = new ControllerData[scriptedcontrols.Count]; | ||
3062 | int i = 0; | ||
3063 | |||
3064 | foreach (ScriptControllers c in scriptedcontrols.Values) | ||
3065 | { | ||
3066 | controls[i++] = new ControllerData(c.itemID, (uint)c.ignoreControls, (uint)c.eventControls); | ||
3067 | } | ||
3068 | cAgent.Controllers = controls; | ||
3069 | } | ||
3070 | |||
3060 | // Animations | 3071 | // Animations |
3061 | try | 3072 | try |
3062 | { | 3073 | { |
@@ -3137,6 +3148,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3137 | } | 3148 | } |
3138 | catch { } | 3149 | catch { } |
3139 | 3150 | ||
3151 | try | ||
3152 | { | ||
3153 | lock (scriptedcontrols) | ||
3154 | { | ||
3155 | if (cAgent.Controllers != null) | ||
3156 | { | ||
3157 | scriptedcontrols.Clear(); | ||
3158 | |||
3159 | foreach (ControllerData c in cAgent.Controllers) | ||
3160 | { | ||
3161 | ScriptControllers sc = new ScriptControllers(); | ||
3162 | sc.itemID = c.ItemID; | ||
3163 | sc.ignoreControls = (ScriptControlled)c.IgnoreControls; | ||
3164 | sc.eventControls = (ScriptControlled)c.EventControls; | ||
3165 | |||
3166 | scriptedcontrols[sc.itemID] = sc; | ||
3167 | } | ||
3168 | } | ||
3169 | } | ||
3170 | } | ||
3171 | catch { } | ||
3140 | // Animations | 3172 | // Animations |
3141 | try | 3173 | try |
3142 | { | 3174 | { |
@@ -3468,7 +3500,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3468 | obj.eventControls = ScriptControlled.CONTROL_ZERO; | 3500 | obj.eventControls = ScriptControlled.CONTROL_ZERO; |
3469 | 3501 | ||
3470 | obj.itemID = Script_item_UUID; | 3502 | obj.itemID = Script_item_UUID; |
3471 | obj.objID = Obj_localID; | ||
3472 | if (pass_on == 0 && accept == 0) | 3503 | if (pass_on == 0 && accept == 0) |
3473 | { | 3504 | { |
3474 | IgnoredControls |= (ScriptControlled)controls; | 3505 | IgnoredControls |= (ScriptControlled)controls; |
@@ -3611,7 +3642,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3611 | if (localHeld != ScriptControlled.CONTROL_ZERO || localChange != ScriptControlled.CONTROL_ZERO) | 3642 | if (localHeld != ScriptControlled.CONTROL_ZERO || localChange != ScriptControlled.CONTROL_ZERO) |
3612 | { | 3643 | { |
3613 | // only send if still pressed or just changed | 3644 | // only send if still pressed or just changed |
3614 | m_scene.EventManager.TriggerControlEvent(scriptControlData.objID, scriptUUID, UUID, (uint)localHeld, (uint)localChange); | 3645 | m_scene.EventManager.TriggerControlEvent(scriptUUID, UUID, (uint)localHeld, (uint)localChange); |
3615 | } | 3646 | } |
3616 | } | 3647 | } |
3617 | } | 3648 | } |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 754b925..ee7aa2da 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1055,11 +1055,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1055 | 1055 | ||
1056 | } | 1056 | } |
1057 | 1057 | ||
1058 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
1059 | { | ||
1060 | |||
1061 | } | ||
1062 | |||
1063 | public void SendAvatarDataImmediate(ISceneEntity avatar) | 1058 | public void SendAvatarDataImmediate(ISceneEntity avatar) |
1064 | { | 1059 | { |
1065 | 1060 | ||
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 56c0d98..3f15b69 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -722,11 +722,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
722 | if (money != null) | 722 | if (money != null) |
723 | { | 723 | { |
724 | // do the transaction, that is if the agent has got sufficient funds | 724 | // do the transaction, that is if the agent has got sufficient funds |
725 | if (!money.GroupCreationCovered(remoteClient)) { | 725 | if (!money.AmountCovered(remoteClient, money.GroupCreationCharge)) { |
726 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); | 726 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); |
727 | return UUID.Zero; | 727 | return UUID.Zero; |
728 | } | 728 | } |
729 | money.ApplyGroupCreationCharge(GetRequestingAgentID(remoteClient)); | 729 | money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation"); |
730 | } | 730 | } |
731 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); | 731 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); |
732 | 732 | ||
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index b9a75cc..653f856 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -108,6 +108,16 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
108 | 108 | ||
109 | public event ObjectPaid OnObjectPaid; | 109 | public event ObjectPaid OnObjectPaid; |
110 | 110 | ||
111 | public int UploadCharge | ||
112 | { | ||
113 | get { return 0; } | ||
114 | } | ||
115 | |||
116 | public int GroupCreationCharge | ||
117 | { | ||
118 | get { return 0; } | ||
119 | } | ||
120 | |||
111 | /// <summary> | 121 | /// <summary> |
112 | /// Startup | 122 | /// Startup |
113 | /// </summary> | 123 | /// </summary> |
@@ -128,8 +138,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
128 | public void AddRegion(Scene scene) | 138 | public void AddRegion(Scene scene) |
129 | { | 139 | { |
130 | // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter. | 140 | // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter. |
131 | scene.SetObjectCapacity(ObjectCapacity); | ||
132 | |||
133 | if (m_enabled) | 141 | if (m_enabled) |
134 | { | 142 | { |
135 | scene.RegisterModuleInterface<IMoneyModule>(this); | 143 | scene.RegisterModuleInterface<IMoneyModule>(this); |
@@ -188,15 +196,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
188 | // Please do not refactor these to be just one method | 196 | // Please do not refactor these to be just one method |
189 | // Existing implementations need the distinction | 197 | // Existing implementations need the distinction |
190 | // | 198 | // |
191 | public void ApplyUploadCharge(UUID agentID) | 199 | public void ApplyCharge(UUID agentID, int amount, string text) |
192 | { | ||
193 | } | ||
194 | |||
195 | public void ApplyGroupCreationCharge(UUID agentID) | ||
196 | { | 200 | { |
197 | } | 201 | } |
198 | 202 | public void ApplyUploadCharge(UUID agentID, int amount, string text) | |
199 | public void ApplyCharge(UUID agentID, int amount, string text) | ||
200 | { | 203 | { |
201 | } | 204 | } |
202 | 205 | ||
@@ -247,7 +250,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
247 | 250 | ||
248 | if (config == "Economy" && startupConfig != null) | 251 | if (config == "Economy" && startupConfig != null) |
249 | { | 252 | { |
250 | ObjectCapacity = startupConfig.GetInt("ObjectCapacity", 45000); | ||
251 | PriceEnergyUnit = startupConfig.GetInt("PriceEnergyUnit", 100); | 253 | PriceEnergyUnit = startupConfig.GetInt("PriceEnergyUnit", 100); |
252 | PriceObjectClaim = startupConfig.GetInt("PriceObjectClaim", 10); | 254 | PriceObjectClaim = startupConfig.GetInt("PriceObjectClaim", 10); |
253 | PricePublicObjectDecay = startupConfig.GetInt("PricePublicObjectDecay", 4); | 255 | PricePublicObjectDecay = startupConfig.GetInt("PricePublicObjectDecay", 4); |
@@ -268,27 +270,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
268 | 270 | ||
269 | } | 271 | } |
270 | 272 | ||
271 | public EconomyData GetEconomyData() | ||
272 | { | ||
273 | EconomyData edata = new EconomyData(); | ||
274 | edata.ObjectCapacity = ObjectCapacity; | ||
275 | edata.ObjectCount = ObjectCount; | ||
276 | edata.PriceEnergyUnit = PriceEnergyUnit; | ||
277 | edata.PriceGroupCreate = PriceGroupCreate; | ||
278 | edata.PriceObjectClaim = PriceObjectClaim; | ||
279 | edata.PriceObjectRent = PriceObjectRent; | ||
280 | edata.PriceObjectScaleFactor = PriceObjectScaleFactor; | ||
281 | edata.PriceParcelClaim = PriceParcelClaim; | ||
282 | edata.PriceParcelClaimFactor = PriceParcelClaimFactor; | ||
283 | edata.PriceParcelRent = PriceParcelRent; | ||
284 | edata.PricePublicObjectDecay = PricePublicObjectDecay; | ||
285 | edata.PricePublicObjectDelete = PricePublicObjectDelete; | ||
286 | edata.PriceRentLight = PriceRentLight; | ||
287 | edata.PriceUpload = PriceUpload; | ||
288 | edata.TeleportMinPrice = TeleportMinPrice; | ||
289 | return edata; | ||
290 | } | ||
291 | |||
292 | private void GetClientFunds(IClientAPI client) | 273 | private void GetClientFunds(IClientAPI client) |
293 | { | 274 | { |
294 | CheckExistAndRefreshFunds(client.AgentId); | 275 | CheckExistAndRefreshFunds(client.AgentId); |
@@ -717,7 +698,9 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
717 | 698 | ||
718 | if (user != null) | 699 | if (user != null) |
719 | { | 700 | { |
720 | user.SendEconomyData(EnergyEfficiency, ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate, | 701 | Scene s = LocateSceneClientIn(user.AgentId); |
702 | |||
703 | user.SendEconomyData(EnergyEfficiency, s.RegionInfo.ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate, | ||
721 | PriceObjectClaim, PriceObjectRent, PriceObjectScaleFactor, PriceParcelClaim, PriceParcelClaimFactor, | 704 | PriceObjectClaim, PriceObjectRent, PriceObjectScaleFactor, PriceParcelClaim, PriceParcelClaimFactor, |
722 | PriceParcelRent, PricePublicObjectDecay, PricePublicObjectDelete, PriceRentLight, PriceUpload, | 705 | PriceParcelRent, PricePublicObjectDecay, PricePublicObjectDelete, PriceRentLight, PriceUpload, |
723 | TeleportMinPrice, TeleportPriceExponent); | 706 | TeleportMinPrice, TeleportPriceExponent); |
@@ -790,7 +773,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
790 | //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString()); | 773 | //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString()); |
791 | } | 774 | } |
792 | 775 | ||
793 | public int GetBalance(IClientAPI client) | 776 | public int GetBalance(UUID agentID) |
794 | { | 777 | { |
795 | return 0; | 778 | return 0; |
796 | } | 779 | } |
@@ -798,16 +781,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
798 | // Please do not refactor these to be just one method | 781 | // Please do not refactor these to be just one method |
799 | // Existing implementations need the distinction | 782 | // Existing implementations need the distinction |
800 | // | 783 | // |
801 | public bool UploadCovered(IClientAPI client) | 784 | public bool UploadCovered(IClientAPI client, int amount) |
802 | { | 785 | { |
803 | return AmountCovered(client, PriceUpload); | 786 | return true; |
804 | } | ||
805 | |||
806 | public bool GroupCreationCovered(IClientAPI client) | ||
807 | { | ||
808 | return AmountCovered(client, PriceGroupCreate); | ||
809 | } | 787 | } |
810 | |||
811 | public bool AmountCovered(IClientAPI client, int amount) | 788 | public bool AmountCovered(IClientAPI client, int amount) |
812 | { | 789 | { |
813 | return true; | 790 | return true; |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 12d6643..2e0450c 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -627,10 +627,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
627 | { | 627 | { |
628 | } | 628 | } |
629 | 629 | ||
630 | public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
631 | { | ||
632 | } | ||
633 | |||
634 | public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) | 630 | public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) |
635 | { | 631 | { |
636 | } | 632 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 4773a50..8903c3b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -451,12 +451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
451 | public LSL_Vector llVecNorm(LSL_Vector v) | 451 | public LSL_Vector llVecNorm(LSL_Vector v) |
452 | { | 452 | { |
453 | m_host.AddScriptLPS(1); | 453 | m_host.AddScriptLPS(1); |
454 | double mag = LSL_Vector.Mag(v); | 454 | return LSL_Vector.Norm(v); |
455 | LSL_Vector nor = new LSL_Vector(); | ||
456 | nor.x = v.x / mag; | ||
457 | nor.y = v.y / mag; | ||
458 | nor.z = v.z / mag; | ||
459 | return nor; | ||
460 | } | 455 | } |
461 | 456 | ||
462 | public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b) | 457 | public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b) |
@@ -470,22 +465,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
470 | 465 | ||
471 | //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke | 466 | //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke |
472 | 467 | ||
473 | // Utility function for llRot2Euler | 468 | // Old implementation of llRot2Euler. Normalization not required as Atan2 function will |
474 | 469 | // only return values >= -PI (-180 degrees) and <= PI (180 degrees). | |
475 | // normalize an angle between -PI and PI (-180 to +180 degrees) | ||
476 | protected double NormalizeAngle(double angle) | ||
477 | { | ||
478 | if (angle > -Math.PI && angle < Math.PI) | ||
479 | return angle; | ||
480 | |||
481 | int numPis = (int)(Math.PI / angle); | ||
482 | double remainder = angle - Math.PI * numPis; | ||
483 | if (numPis % 2 == 1) | ||
484 | return Math.PI - angle; | ||
485 | return remainder; | ||
486 | } | ||
487 | |||
488 | // Old implementation of llRot2Euler, now normalized | ||
489 | 470 | ||
490 | public LSL_Vector llRot2Euler(LSL_Rotation r) | 471 | public LSL_Vector llRot2Euler(LSL_Rotation r) |
491 | { | 472 | { |
@@ -497,13 +478,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
497 | double n = 2 * (r.y * r.s + r.x * r.z); | 478 | double n = 2 * (r.y * r.s + r.x * r.z); |
498 | double p = m * m - n * n; | 479 | double p = m * m - n * n; |
499 | if (p > 0) | 480 | if (p > 0) |
500 | return new LSL_Vector(NormalizeAngle(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s))), | 481 | return new LSL_Vector(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)), |
501 | NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), | 482 | Math.Atan2(n, Math.Sqrt(p)), |
502 | NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)))); | 483 | Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))); |
503 | else if (n > 0) | 484 | else if (n > 0) |
504 | return new LSL_Vector(0.0, Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); | 485 | return new LSL_Vector(0.0, Math.PI * 0.5, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); |
505 | else | 486 | else |
506 | return new LSL_Vector(0.0, -Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); | 487 | return new LSL_Vector(0.0, -Math.PI * 0.5, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); |
507 | } | 488 | } |
508 | 489 | ||
509 | /* From wiki: | 490 | /* From wiki: |
@@ -2945,9 +2926,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2945 | 2926 | ||
2946 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | 2927 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; |
2947 | if (attachmentsModule != null) | 2928 | if (attachmentsModule != null) |
2948 | attachmentsModule.AttachObject( | 2929 | attachmentsModule.AttachObject(presence.ControllingClient, |
2949 | presence.ControllingClient, grp.LocalId, | 2930 | grp, (uint)attachment, false); |
2950 | (uint)attachment, Quaternion.Identity, Vector3.Zero, false); | ||
2951 | } | 2931 | } |
2952 | } | 2932 | } |
2953 | 2933 | ||
@@ -4950,7 +4930,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4950 | case ',': | 4930 | case ',': |
4951 | if (parens == 0) | 4931 | if (parens == 0) |
4952 | { | 4932 | { |
4953 | result.Add(src.Substring(start,length).Trim()); | 4933 | result.Add(new LSL_String(src.Substring(start,length).Trim())); |
4954 | start += length+1; | 4934 | start += length+1; |
4955 | length = 0; | 4935 | length = 0; |
4956 | } | 4936 | } |
@@ -5879,6 +5859,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5879 | PSYS_PART_MAX_AGE = 7, | 5859 | PSYS_PART_MAX_AGE = 7, |
5880 | PSYS_SRC_ACCEL = 8, | 5860 | PSYS_SRC_ACCEL = 8, |
5881 | PSYS_SRC_PATTERN = 9, | 5861 | PSYS_SRC_PATTERN = 9, |
5862 | PSYS_SRC_INNERANGLE = 10, | ||
5863 | PSYS_SRC_OUTERANGLE = 11, | ||
5882 | PSYS_SRC_TEXTURE = 12, | 5864 | PSYS_SRC_TEXTURE = 12, |
5883 | PSYS_SRC_BURST_RATE = 13, | 5865 | PSYS_SRC_BURST_RATE = 13, |
5884 | PSYS_SRC_BURST_PART_COUNT = 15, | 5866 | PSYS_SRC_BURST_PART_COUNT = 15, |
@@ -6011,6 +5993,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6011 | prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi; | 5993 | prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi; |
6012 | break; | 5994 | break; |
6013 | 5995 | ||
5996 | // PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The | ||
5997 | // PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The | ||
5998 | // client tells the difference between the two by looking at the 0x02 bit in | ||
5999 | // the PartFlags variable. | ||
6000 | case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE: | ||
6001 | tempf = (float)rules.GetLSLFloatItem(i + 1); | ||
6002 | prules.InnerAngle = (float)tempf; | ||
6003 | prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off. | ||
6004 | break; | ||
6005 | |||
6006 | case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE: | ||
6007 | tempf = (float)rules.GetLSLFloatItem(i + 1); | ||
6008 | prules.OuterAngle = (float)tempf; | ||
6009 | prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off. | ||
6010 | break; | ||
6011 | |||
6014 | case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: | 6012 | case (int)ScriptBaseClass.PSYS_SRC_TEXTURE: |
6015 | prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1)); | 6013 | prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1)); |
6016 | break; | 6014 | break; |
@@ -6067,11 +6065,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6067 | case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN: | 6065 | case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN: |
6068 | tempf = (float)rules.GetLSLFloatItem(i + 1); | 6066 | tempf = (float)rules.GetLSLFloatItem(i + 1); |
6069 | prules.InnerAngle = (float)tempf; | 6067 | prules.InnerAngle = (float)tempf; |
6068 | prules.PartFlags |= 0x02; // Set new angle format. | ||
6070 | break; | 6069 | break; |
6071 | 6070 | ||
6072 | case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END: | 6071 | case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END: |
6073 | tempf = (float)rules.GetLSLFloatItem(i + 1); | 6072 | tempf = (float)rules.GetLSLFloatItem(i + 1); |
6074 | prules.OuterAngle = (float)tempf; | 6073 | prules.OuterAngle = (float)tempf; |
6074 | prules.PartFlags |= 0x02; // Set new angle format. | ||
6075 | break; | 6075 | break; |
6076 | } | 6076 | } |
6077 | 6077 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 1ea52c5..91e03ac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -262,7 +262,12 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
262 | public static Vector3 Norm(Vector3 vector) | 262 | public static Vector3 Norm(Vector3 vector) |
263 | { | 263 | { |
264 | double mag = Mag(vector); | 264 | double mag = Mag(vector); |
265 | return new Vector3(vector.x / mag, vector.y / mag, vector.z / mag); | 265 | if (mag > 0.0) |
266 | { | ||
267 | double invMag = 1.0 / mag; | ||
268 | return vector * invMag; | ||
269 | } | ||
270 | return new Vector3(0, 0, 0); | ||
266 | } | 271 | } |
267 | 272 | ||
268 | #endregion | 273 | #endregion |
@@ -663,13 +668,13 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
663 | Object[] ret; | 668 | Object[] ret; |
664 | 669 | ||
665 | if (start < 0) | 670 | if (start < 0) |
666 | start=m_data.Length-start; | 671 | start=m_data.Length+start; |
667 | 672 | ||
668 | if (start < 0) | 673 | if (start < 0) |
669 | start=0; | 674 | start=0; |
670 | 675 | ||
671 | if (end < 0) | 676 | if (end < 0) |
672 | end=m_data.Length-end; | 677 | end=m_data.Length+end; |
673 | if (end < 0) | 678 | if (end < 0) |
674 | end=0; | 679 | end=0; |
675 | 680 | ||
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 09b79d0..0ac8b5c 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | |||
@@ -356,9 +356,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
356 | // timer: not handled here | 356 | // timer: not handled here |
357 | // listen: not handled here | 357 | // listen: not handled here |
358 | 358 | ||
359 | public void control(uint localID, UUID itemID, UUID agentID, uint held, uint change) | 359 | public void control(UUID itemID, UUID agentID, uint held, uint change) |
360 | { | 360 | { |
361 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 361 | myScriptEngine.PostScriptEvent(itemID, new EventParams( |
362 | "control",new object[] { | 362 | "control",new object[] { |
363 | new LSL_Types.LSLString(agentID.ToString()), | 363 | new LSL_Types.LSLString(agentID.ToString()), |
364 | new LSL_Types.LSLInteger(held), | 364 | new LSL_Types.LSLInteger(held), |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 4715690..b050349 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -488,6 +488,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
488 | 488 | ||
489 | if (stateSource == (int)StateSource.ScriptedRez) | 489 | if (stateSource == (int)StateSource.ScriptedRez) |
490 | { | 490 | { |
491 | lock (m_CompileDict) | ||
492 | { | ||
493 | m_CompileDict[itemID] = 0; | ||
494 | } | ||
495 | |||
491 | DoOnRezScript(parms); | 496 | DoOnRezScript(parms); |
492 | } | 497 | } |
493 | else | 498 | else |
@@ -696,9 +701,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
696 | } | 701 | } |
697 | } | 702 | } |
698 | 703 | ||
704 | ScriptInstance instance = null; | ||
699 | lock (m_Scripts) | 705 | lock (m_Scripts) |
700 | { | 706 | { |
701 | ScriptInstance instance = null; | ||
702 | // Create the object record | 707 | // Create the object record |
703 | 708 | ||
704 | if ((!m_Scripts.ContainsKey(itemID)) || | 709 | if ((!m_Scripts.ContainsKey(itemID)) || |
@@ -765,8 +770,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
765 | item.Name, startParam, postOnRez, | 770 | item.Name, startParam, postOnRez, |
766 | stateSource, m_MaxScriptQueue); | 771 | stateSource, m_MaxScriptQueue); |
767 | 772 | ||
768 | m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", | 773 | m_log.DebugFormat( |
769 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); | 774 | "[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}.{5}", |
775 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, | ||
776 | part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); | ||
770 | 777 | ||
771 | if (presence != null) | 778 | if (presence != null) |
772 | { | 779 | { |
@@ -779,28 +786,29 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
779 | 786 | ||
780 | m_Scripts[itemID] = instance; | 787 | m_Scripts[itemID] = instance; |
781 | } | 788 | } |
789 | } | ||
782 | 790 | ||
783 | lock (m_PrimObjects) | 791 | lock (m_PrimObjects) |
784 | { | 792 | { |
785 | if (!m_PrimObjects.ContainsKey(localID)) | 793 | if (!m_PrimObjects.ContainsKey(localID)) |
786 | m_PrimObjects[localID] = new List<UUID>(); | 794 | m_PrimObjects[localID] = new List<UUID>(); |
787 | 795 | ||
788 | if (!m_PrimObjects[localID].Contains(itemID)) | 796 | if (!m_PrimObjects[localID].Contains(itemID)) |
789 | m_PrimObjects[localID].Add(itemID); | 797 | m_PrimObjects[localID].Add(itemID); |
790 | 798 | ||
791 | } | 799 | } |
792 | 800 | ||
793 | if (!m_Assemblies.ContainsKey(assetID)) | 801 | if (!m_Assemblies.ContainsKey(assetID)) |
794 | m_Assemblies[assetID] = assembly; | 802 | m_Assemblies[assetID] = assembly; |
795 | 803 | ||
796 | lock (m_AddingAssemblies) | 804 | lock (m_AddingAssemblies) |
797 | { | 805 | { |
798 | m_AddingAssemblies[assembly]--; | 806 | m_AddingAssemblies[assembly]--; |
799 | } | ||
800 | |||
801 | if (instance!=null) | ||
802 | instance.Init(); | ||
803 | } | 807 | } |
808 | |||
809 | if (instance != null) | ||
810 | instance.Init(); | ||
811 | |||
804 | return true; | 812 | return true; |
805 | } | 813 | } |
806 | 814 | ||
@@ -813,60 +821,60 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
813 | m_CompileDict.Remove(itemID); | 821 | m_CompileDict.Remove(itemID); |
814 | } | 822 | } |
815 | 823 | ||
824 | IScriptInstance instance = null; | ||
825 | |||
816 | lock (m_Scripts) | 826 | lock (m_Scripts) |
817 | { | 827 | { |
818 | // Do we even have it? | 828 | // Do we even have it? |
819 | if (!m_Scripts.ContainsKey(itemID)) | 829 | if (!m_Scripts.ContainsKey(itemID)) |
820 | return; | 830 | return; |
821 | 831 | ||
822 | IScriptInstance instance=m_Scripts[itemID]; | 832 | instance=m_Scripts[itemID]; |
823 | m_Scripts.Remove(itemID); | 833 | m_Scripts.Remove(itemID); |
834 | } | ||
824 | 835 | ||
825 | instance.ClearQueue(); | 836 | instance.ClearQueue(); |
826 | instance.Stop(0); | 837 | instance.Stop(0); |
827 | |||
828 | // bool objectRemoved = false; | 838 | // bool objectRemoved = false; |
829 | 839 | ||
830 | lock (m_PrimObjects) | 840 | lock (m_PrimObjects) |
841 | { | ||
842 | // Remove the script from it's prim | ||
843 | if (m_PrimObjects.ContainsKey(localID)) | ||
831 | { | 844 | { |
832 | // Remove the script from it's prim | 845 | // Remove inventory item record |
833 | if (m_PrimObjects.ContainsKey(localID)) | 846 | if (m_PrimObjects[localID].Contains(itemID)) |
834 | { | 847 | m_PrimObjects[localID].Remove(itemID); |
835 | // Remove inventory item record | ||
836 | if (m_PrimObjects[localID].Contains(itemID)) | ||
837 | m_PrimObjects[localID].Remove(itemID); | ||
838 | 848 | ||
839 | // If there are no more scripts, remove prim | 849 | // If there are no more scripts, remove prim |
840 | if (m_PrimObjects[localID].Count == 0) | 850 | if (m_PrimObjects[localID].Count == 0) |
841 | { | 851 | { |
842 | m_PrimObjects.Remove(localID); | 852 | m_PrimObjects.Remove(localID); |
843 | // objectRemoved = true; | 853 | // objectRemoved = true; |
844 | } | ||
845 | } | 854 | } |
846 | } | 855 | } |
856 | } | ||
847 | 857 | ||
848 | instance.RemoveState(); | 858 | instance.RemoveState(); |
849 | instance.DestroyScriptInstance(); | 859 | instance.DestroyScriptInstance(); |
850 | 860 | ||
851 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); | 861 | m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); |
852 | if (m_DomainScripts[instance.AppDomain].Count == 0) | 862 | if (m_DomainScripts[instance.AppDomain].Count == 0) |
853 | { | 863 | { |
854 | m_DomainScripts.Remove(instance.AppDomain); | 864 | m_DomainScripts.Remove(instance.AppDomain); |
855 | UnloadAppDomain(instance.AppDomain); | 865 | UnloadAppDomain(instance.AppDomain); |
856 | } | 866 | } |
857 | 867 | ||
858 | instance = null; | 868 | instance = null; |
859 | 869 | ||
860 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; | 870 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; |
861 | if (handlerObjectRemoved != null) | 871 | if (handlerObjectRemoved != null) |
862 | { | 872 | { |
863 | SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); | 873 | SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); |
864 | handlerObjectRemoved(part.UUID); | 874 | handlerObjectRemoved(part.UUID); |
865 | } | ||
866 | |||
867 | CleanAssemblies(); | ||
868 | } | 875 | } |
869 | 876 | ||
877 | |||
870 | ScriptRemoved handlerScriptRemoved = OnScriptRemoved; | 878 | ScriptRemoved handlerScriptRemoved = OnScriptRemoved; |
871 | if (handlerScriptRemoved != null) | 879 | if (handlerScriptRemoved != null) |
872 | handlerScriptRemoved(itemID); | 880 | handlerScriptRemoved(itemID); |
@@ -1000,26 +1008,33 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1000 | public bool PostObjectEvent(uint localID, EventParams p) | 1008 | public bool PostObjectEvent(uint localID, EventParams p) |
1001 | { | 1009 | { |
1002 | bool result = false; | 1010 | bool result = false; |
1003 | 1011 | List<UUID> uuids = null; | |
1012 | |||
1004 | lock (m_PrimObjects) | 1013 | lock (m_PrimObjects) |
1005 | { | 1014 | { |
1006 | if (!m_PrimObjects.ContainsKey(localID)) | 1015 | if (!m_PrimObjects.ContainsKey(localID)) |
1007 | return false; | 1016 | return false; |
1008 | 1017 | ||
1009 | 1018 | uuids = m_PrimObjects[localID]; | |
1010 | foreach (UUID itemID in m_PrimObjects[localID]) | 1019 | } |
1020 | |||
1021 | foreach (UUID itemID in uuids) | ||
1022 | { | ||
1023 | IScriptInstance instance = null; | ||
1024 | try | ||
1011 | { | 1025 | { |
1012 | if (m_Scripts.ContainsKey(itemID)) | 1026 | if (m_Scripts.ContainsKey(itemID)) |
1013 | { | 1027 | instance = m_Scripts[itemID]; |
1014 | IScriptInstance instance = m_Scripts[itemID]; | 1028 | } |
1015 | if (instance != null) | 1029 | catch { /* ignore race conditions */ } |
1016 | { | 1030 | |
1017 | instance.PostEvent(p); | 1031 | if (instance != null) |
1018 | result = true; | 1032 | { |
1019 | } | 1033 | instance.PostEvent(p); |
1020 | } | 1034 | result = true; |
1021 | } | 1035 | } |
1022 | } | 1036 | } |
1037 | |||
1023 | return result; | 1038 | return result; |
1024 | } | 1039 | } |
1025 | 1040 | ||
@@ -1336,10 +1351,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1336 | 1351 | ||
1337 | try | 1352 | try |
1338 | { | 1353 | { |
1339 | FileStream tfs = File.Open(assemName + ".text", | 1354 | using (FileStream tfs = File.Open(assemName + ".text", |
1340 | FileMode.Open, FileAccess.Read); | 1355 | FileMode.Open, FileAccess.Read)) |
1341 | tfs.Read(tdata, 0, tdata.Length); | 1356 | { |
1342 | tfs.Close(); | 1357 | tfs.Read(tdata, 0, tdata.Length); |
1358 | tfs.Close(); | ||
1359 | } | ||
1343 | 1360 | ||
1344 | assem = new System.Text.ASCIIEncoding().GetString(tdata); | 1361 | assem = new System.Text.ASCIIEncoding().GetString(tdata); |
1345 | } | 1362 | } |
@@ -1359,9 +1376,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1359 | 1376 | ||
1360 | try | 1377 | try |
1361 | { | 1378 | { |
1362 | FileStream fs = File.Open(assemName, FileMode.Open, FileAccess.Read); | 1379 | using (FileStream fs = File.Open(assemName, FileMode.Open, FileAccess.Read)) |
1363 | fs.Read(data, 0, data.Length); | 1380 | { |
1364 | fs.Close(); | 1381 | fs.Read(data, 0, data.Length); |
1382 | fs.Close(); | ||
1383 | } | ||
1365 | 1384 | ||
1366 | assem = System.Convert.ToBase64String(data); | 1385 | assem = System.Convert.ToBase64String(data); |
1367 | } | 1386 | } |
@@ -1377,13 +1396,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1377 | 1396 | ||
1378 | if (File.Exists(fn + ".map")) | 1397 | if (File.Exists(fn + ".map")) |
1379 | { | 1398 | { |
1380 | FileStream mfs = File.Open(fn + ".map", FileMode.Open, FileAccess.Read); | 1399 | using (FileStream mfs = File.Open(fn + ".map", FileMode.Open, FileAccess.Read)) |
1381 | StreamReader msr = new StreamReader(mfs); | 1400 | { |
1382 | 1401 | using (StreamReader msr = new StreamReader(mfs)) | |
1383 | map = msr.ReadToEnd(); | 1402 | { |
1384 | 1403 | map = msr.ReadToEnd(); | |
1385 | msr.Close(); | 1404 | msr.Close(); |
1386 | mfs.Close(); | 1405 | } |
1406 | mfs.Close(); | ||
1407 | } | ||
1387 | } | 1408 | } |
1388 | 1409 | ||
1389 | XmlElement assemblyData = doc.CreateElement("", "Assembly", ""); | 1410 | XmlElement assemblyData = doc.CreateElement("", "Assembly", ""); |
@@ -1471,30 +1492,59 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1471 | { | 1492 | { |
1472 | Byte[] filedata = Convert.FromBase64String(base64); | 1493 | Byte[] filedata = Convert.FromBase64String(base64); |
1473 | 1494 | ||
1474 | FileStream fs = File.Create(path); | 1495 | try |
1475 | fs.Write(filedata, 0, filedata.Length); | 1496 | { |
1476 | fs.Close(); | 1497 | using (FileStream fs = File.Create(path)) |
1477 | 1498 | { | |
1478 | fs = File.Create(path + ".text"); | 1499 | fs.Write(filedata, 0, filedata.Length); |
1479 | StreamWriter sw = new StreamWriter(fs); | 1500 | fs.Close(); |
1480 | 1501 | } | |
1481 | sw.Write(base64); | 1502 | } |
1482 | 1503 | catch (IOException ex) | |
1483 | sw.Close(); | 1504 | { |
1484 | fs.Close(); | 1505 | // if there already exists a file at that location, it may be locked. |
1506 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message); | ||
1507 | } | ||
1508 | try | ||
1509 | { | ||
1510 | using (FileStream fs = File.Create(path + ".text")) | ||
1511 | { | ||
1512 | using (StreamWriter sw = new StreamWriter(fs)) | ||
1513 | { | ||
1514 | sw.Write(base64); | ||
1515 | sw.Close(); | ||
1516 | } | ||
1517 | fs.Close(); | ||
1518 | } | ||
1519 | } | ||
1520 | catch (IOException ex) | ||
1521 | { | ||
1522 | // if there already exists a file at that location, it may be locked. | ||
1523 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message); | ||
1524 | } | ||
1485 | } | 1525 | } |
1486 | } | 1526 | } |
1487 | 1527 | ||
1488 | string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | 1528 | string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); |
1489 | statepath = Path.Combine(statepath, itemID.ToString() + ".state"); | 1529 | statepath = Path.Combine(statepath, itemID.ToString() + ".state"); |
1490 | 1530 | ||
1491 | FileStream sfs = File.Create(statepath); | 1531 | try |
1492 | StreamWriter ssw = new StreamWriter(sfs); | 1532 | { |
1493 | 1533 | using (FileStream sfs = File.Create(statepath)) | |
1494 | ssw.Write(stateE.OuterXml); | 1534 | { |
1495 | 1535 | using (StreamWriter ssw = new StreamWriter(sfs)) | |
1496 | ssw.Close(); | 1536 | { |
1497 | sfs.Close(); | 1537 | ssw.Write(stateE.OuterXml); |
1538 | ssw.Close(); | ||
1539 | } | ||
1540 | sfs.Close(); | ||
1541 | } | ||
1542 | } | ||
1543 | catch (IOException ex) | ||
1544 | { | ||
1545 | // if there already exists a file at that location, it may be locked. | ||
1546 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", statepath, ex.Message); | ||
1547 | } | ||
1498 | 1548 | ||
1499 | XmlNodeList mapL = rootE.GetElementsByTagName("LineMap"); | 1549 | XmlNodeList mapL = rootE.GetElementsByTagName("LineMap"); |
1500 | if (mapL.Count > 0) | 1550 | if (mapL.Count > 0) |
@@ -1504,13 +1554,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1504 | string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | 1554 | string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); |
1505 | mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); | 1555 | mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); |
1506 | 1556 | ||
1507 | FileStream mfs = File.Create(mappath); | 1557 | try |
1508 | StreamWriter msw = new StreamWriter(mfs); | 1558 | { |
1509 | 1559 | using (FileStream mfs = File.Create(mappath)) | |
1510 | msw.Write(mapE.InnerText); | 1560 | { |
1511 | 1561 | using (StreamWriter msw = new StreamWriter(mfs)) | |
1512 | msw.Close(); | 1562 | { |
1513 | mfs.Close(); | 1563 | msw.Write(mapE.InnerText); |
1564 | msw.Close(); | ||
1565 | } | ||
1566 | mfs.Close(); | ||
1567 | } | ||
1568 | } | ||
1569 | catch (IOException ex) | ||
1570 | { | ||
1571 | // if there already exists a file at that location, it may be locked. | ||
1572 | m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", statepath, ex.Message); | ||
1573 | } | ||
1514 | } | 1574 | } |
1515 | 1575 | ||
1516 | return true; | 1576 | return true; |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs index fbf4648..704790e 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
88 | 88 | ||
89 | public void Initialise(IConfigSource source) | 89 | public void Initialise(IConfigSource source) |
90 | { | 90 | { |
91 | if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) | 91 | if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector")) |
92 | { | 92 | { |
93 | IConfig gridConfig = source.Configs["UserAccountService"]; | 93 | IConfig gridConfig = source.Configs["UserAccountService"]; |
94 | if (gridConfig == null) | 94 | if (gridConfig == null) |
@@ -108,6 +108,23 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
108 | serviceUrl = serviceUrl + '/'; | 108 | serviceUrl = serviceUrl + '/'; |
109 | 109 | ||
110 | m_serverUrl = serviceUrl; | 110 | m_serverUrl = serviceUrl; |
111 | IConfig profilesConfig = source.Configs["Profiles"]; | ||
112 | if (profilesConfig == null) | ||
113 | { | ||
114 | // Do not run this module by default. | ||
115 | return; | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | // if profiles aren't enabled, we're not needed. | ||
120 | // if we're not specified as the connector to use, then we're not wanted | ||
121 | if (profilesConfig.GetString("Module", String.Empty) != Name) | ||
122 | { | ||
123 | |||
124 | return; | ||
125 | } | ||
126 | m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name); | ||
127 | } | ||
111 | } | 128 | } |
112 | } | 129 | } |
113 | 130 | ||
@@ -135,6 +152,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
135 | 152 | ||
136 | // Profiles | 153 | // Profiles |
137 | client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler; | 154 | client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler; |
155 | |||
138 | client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler; | 156 | client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler; |
139 | client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler; | 157 | client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler; |
140 | client.OnUserInfoRequest += UserInfoRequestHandler; | 158 | client.OnUserInfoRequest += UserInfoRequestHandler; |
@@ -302,12 +320,25 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
302 | System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags, | 320 | System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags, |
303 | about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID()); | 321 | about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID()); |
304 | 322 | ||
323 | OSDMap interests = null; | ||
324 | if (user.ContainsKey("LLInterests")) | ||
325 | { | ||
326 | try | ||
327 | { | ||
328 | interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap; | ||
329 | client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["languages"].AsString()); | ||
330 | } | ||
331 | catch { } | ||
332 | } | ||
333 | |||
334 | if (about == null) | ||
335 | about = new OSDMap(0); | ||
305 | } | 336 | } |
306 | else | 337 | else |
307 | { | 338 | { |
308 | m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values"); | 339 | m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values"); |
309 | client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes, | 340 | client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes, |
310 | String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero); | 341 | String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero); |
311 | } | 342 | } |
312 | } | 343 | } |
313 | 344 | ||
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 225530f..46d72dc 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -278,7 +278,11 @@ namespace OpenSim.Services.GridService | |||
278 | 278 | ||
279 | foreach (RegionData rdata in rdatas) | 279 | foreach (RegionData rdata in rdatas) |
280 | if (rdata.RegionID != regionID) | 280 | if (rdata.RegionID != regionID) |
281 | rinfos.Add(RegionData2RegionInfo(rdata)); | 281 | { |
282 | int flags = Convert.ToInt32(rdata.Data["flags"]); | ||
283 | if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours | ||
284 | rinfos.Add(RegionData2RegionInfo(rdata)); | ||
285 | } | ||
282 | 286 | ||
283 | } | 287 | } |
284 | m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count); | 288 | m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count); |
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index f48bf60..bb24292 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -259,13 +259,15 @@ namespace OpenSim.Services.InventoryService | |||
259 | 259 | ||
260 | public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) | 260 | public virtual List<InventoryItemBase> GetFolderItems(UUID principalID, UUID folderID) |
261 | { | 261 | { |
262 | // m_log.DebugFormat("[XINVENTORY]: Fetch items for folder {0}", folderID); | ||
263 | |||
262 | // Since we probably don't get a valid principal here, either ... | 264 | // Since we probably don't get a valid principal here, either ... |
263 | // | 265 | // |
264 | List<InventoryItemBase> invItems = new List<InventoryItemBase>(); | 266 | List<InventoryItemBase> invItems = new List<InventoryItemBase>(); |
265 | 267 | ||
266 | XInventoryItem[] items = m_Database.GetItems( | 268 | XInventoryItem[] items = m_Database.GetItems( |
267 | new string[] { "parentFolderID"}, | 269 | new string[] { "parentFolderID" }, |
268 | new string[] { UUID.Zero.ToString() }); | 270 | new string[] { folderID.ToString() }); |
269 | 271 | ||
270 | foreach (XInventoryItem i in items) | 272 | foreach (XInventoryItem i in items) |
271 | invItems.Add(ConvertToOpenSim(i)); | 273 | invItems.Add(ConvertToOpenSim(i)); |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 54d53fb..3366922 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -170,6 +170,9 @@ namespace OpenSim.Services.LLLoginService | |||
170 | private string firstname; | 170 | private string firstname; |
171 | private string lastname; | 171 | private string lastname; |
172 | 172 | ||
173 | // Web map | ||
174 | private string mapTileURL; | ||
175 | |||
173 | // Error Flags | 176 | // Error Flags |
174 | private string errorReason; | 177 | private string errorReason; |
175 | private string errorMessage; | 178 | private string errorMessage; |
@@ -218,7 +221,7 @@ namespace OpenSim.Services.LLLoginService | |||
218 | public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, | 221 | public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, |
219 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, | 222 | GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService, |
220 | string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, | 223 | string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message, |
221 | GridRegion home, IPEndPoint clientIP) | 224 | GridRegion home, IPEndPoint clientIP, string mapTileURL) |
222 | : this() | 225 | : this() |
223 | { | 226 | { |
224 | FillOutInventoryData(invSkel, libService); | 227 | FillOutInventoryData(invSkel, libService); |
@@ -234,6 +237,7 @@ namespace OpenSim.Services.LLLoginService | |||
234 | Message = message; | 237 | Message = message; |
235 | BuddList = ConvertFriendListItem(friendsList); | 238 | BuddList = ConvertFriendListItem(friendsList); |
236 | StartLocation = where; | 239 | StartLocation = where; |
240 | MapTileURL = mapTileURL; | ||
237 | 241 | ||
238 | FillOutHomeData(pinfo, home); | 242 | FillOutHomeData(pinfo, home); |
239 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); | 243 | LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); |
@@ -405,6 +409,7 @@ namespace OpenSim.Services.LLLoginService | |||
405 | InitialOutfitHash["folder_name"] = "Nightclub Female"; | 409 | InitialOutfitHash["folder_name"] = "Nightclub Female"; |
406 | InitialOutfitHash["gender"] = "female"; | 410 | InitialOutfitHash["gender"] = "female"; |
407 | initialOutfit.Add(InitialOutfitHash); | 411 | initialOutfit.Add(InitialOutfitHash); |
412 | mapTileURL = String.Empty; | ||
408 | } | 413 | } |
409 | 414 | ||
410 | 415 | ||
@@ -468,6 +473,9 @@ namespace OpenSim.Services.LLLoginService | |||
468 | responseData["region_x"] = (Int32)(RegionX); | 473 | responseData["region_x"] = (Int32)(RegionX); |
469 | responseData["region_y"] = (Int32)(RegionY); | 474 | responseData["region_y"] = (Int32)(RegionY); |
470 | 475 | ||
476 | if (mapTileURL != String.Empty) | ||
477 | responseData["map-server-url"] = mapTileURL; | ||
478 | |||
471 | if (m_buddyList != null) | 479 | if (m_buddyList != null) |
472 | { | 480 | { |
473 | responseData["buddy-list"] = m_buddyList.ToArray(); | 481 | responseData["buddy-list"] = m_buddyList.ToArray(); |
@@ -564,6 +572,9 @@ namespace OpenSim.Services.LLLoginService | |||
564 | map["region_x"] = OSD.FromInteger(RegionX); | 572 | map["region_x"] = OSD.FromInteger(RegionX); |
565 | map["region_y"] = OSD.FromInteger(RegionY); | 573 | map["region_y"] = OSD.FromInteger(RegionY); |
566 | 574 | ||
575 | if (mapTileURL != String.Empty) | ||
576 | map["map-server-url"] = OSD.FromString(mapTileURL); | ||
577 | |||
567 | if (m_buddyList != null) | 578 | if (m_buddyList != null) |
568 | { | 579 | { |
569 | map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); | 580 | map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); |
@@ -647,7 +658,7 @@ namespace OpenSim.Services.LLLoginService | |||
647 | Hashtable TempHash; | 658 | Hashtable TempHash; |
648 | foreach (InventoryFolderBase InvFolder in folders) | 659 | foreach (InventoryFolderBase InvFolder in folders) |
649 | { | 660 | { |
650 | if (InvFolder.ParentID == UUID.Zero) | 661 | if (InvFolder.ParentID == UUID.Zero && InvFolder.Name == "My Inventory") |
651 | { | 662 | { |
652 | rootID = InvFolder.ID; | 663 | rootID = InvFolder.ID; |
653 | } | 664 | } |
@@ -915,6 +926,12 @@ namespace OpenSim.Services.LLLoginService | |||
915 | set { home = value; } | 926 | set { home = value; } |
916 | } | 927 | } |
917 | 928 | ||
929 | public string MapTileURL | ||
930 | { | ||
931 | get { return mapTileURL; } | ||
932 | set { mapTileURL = value; } | ||
933 | } | ||
934 | |||
918 | public string Message | 935 | public string Message |
919 | { | 936 | { |
920 | get { return welcomeMessage; } | 937 | get { return welcomeMessage; } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 00fffff..f4e045c 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -73,6 +73,7 @@ namespace OpenSim.Services.LLLoginService | |||
73 | protected int m_MinLoginLevel; | 73 | protected int m_MinLoginLevel; |
74 | protected string m_GatekeeperURL; | 74 | protected string m_GatekeeperURL; |
75 | protected bool m_AllowRemoteSetLoginLevel; | 75 | protected bool m_AllowRemoteSetLoginLevel; |
76 | protected string m_MapTileURL; | ||
76 | 77 | ||
77 | IConfig m_LoginServerConfig; | 78 | IConfig m_LoginServerConfig; |
78 | 79 | ||
@@ -100,6 +101,7 @@ namespace OpenSim.Services.LLLoginService | |||
100 | m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); | 101 | m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); |
101 | m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); | 102 | m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); |
102 | m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); | 103 | m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); |
104 | m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); | ||
103 | 105 | ||
104 | // These are required; the others aren't | 106 | // These are required; the others aren't |
105 | if (accountService == string.Empty || authService == string.Empty) | 107 | if (accountService == string.Empty || authService == string.Empty) |
@@ -356,7 +358,7 @@ namespace OpenSim.Services.LLLoginService | |||
356 | // Finally, fill out the response and return it | 358 | // Finally, fill out the response and return it |
357 | // | 359 | // |
358 | LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, | 360 | LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, |
359 | where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP); | 361 | where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL); |
360 | 362 | ||
361 | m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); | 363 | m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); |
362 | return response; | 364 | return response; |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 496cfb8..999cf5e 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -630,10 +630,6 @@ namespace OpenSim.Tests.Common.Mock | |||
630 | { | 630 | { |
631 | } | 631 | } |
632 | 632 | ||
633 | public virtual void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
634 | { | ||
635 | } | ||
636 | |||
637 | public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) | 633 | public virtual void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) |
638 | { | 634 | { |
639 | } | 635 | } |