diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-25 16:13:02 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-25 16:13:02 -0400 |
commit | a7917b428a6bc3c9e33da64879b9e473516540a3 (patch) | |
tree | 2c38d9c33c4977a3d0356912915082a8bd568a23 /OpenSim/Region/CoreModules | |
parent | Patch from jhurliman to HttpServer (diff) | |
parent | Implemented osPenCap, that sets EndCap and StartCap to Pen. This allows using... (diff) | |
download | opensim-SC_OLD-a7917b428a6bc3c9e33da64879b9e473516540a3.zip opensim-SC_OLD-a7917b428a6bc3c9e33da64879b9e473516540a3.tar.gz opensim-SC_OLD-a7917b428a6bc3c9e33da64879b9e473516540a3.tar.bz2 opensim-SC_OLD-a7917b428a6bc3c9e33da64879b9e473516540a3.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
11 files changed, 291 insertions, 65 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 582beee..35c59aa 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -130,7 +130,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
130 | } | 130 | } |
131 | else | 131 | else |
132 | { | 132 | { |
133 | InventoryItemBase baseItem = invService.GetItem(new InventoryItemBase(appearance.Wearables[i].ItemID)); | 133 | InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); |
134 | baseItem = invService.GetItem(baseItem); | ||
134 | 135 | ||
135 | if (baseItem != null) | 136 | if (baseItem != null) |
136 | { | 137 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index a68db1b..ff12361 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -65,7 +65,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
65 | { | 65 | { |
66 | IInventoryService invService = m_scene.InventoryService; | 66 | IInventoryService invService = m_scene.InventoryService; |
67 | 67 | ||
68 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); | 68 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); |
69 | item = invService.GetItem(item); | ||
69 | if (item != null) | 70 | if (item != null) |
70 | { | 71 | { |
71 | item.Flags = 1; | 72 | item.Flags = 1; |
@@ -80,7 +81,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
80 | { | 81 | { |
81 | IInventoryService invService = m_scene.InventoryService; | 82 | IInventoryService invService = m_scene.InventoryService; |
82 | 83 | ||
83 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); | 84 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); |
85 | item = invService.GetItem(item); | ||
84 | if (item != null) | 86 | if (item != null) |
85 | { | 87 | { |
86 | item.Flags = 0; | 88 | item.Flags = 0; |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 5e7cf4b..4495303 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -56,7 +56,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
56 | if (cnf != null && cnf.GetString( | 56 | if (cnf != null && cnf.GetString( |
57 | "MessageTransferModule", "MessageTransferModule") != | 57 | "MessageTransferModule", "MessageTransferModule") != |
58 | "MessageTransferModule") | 58 | "MessageTransferModule") |
59 | { | ||
60 | m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration"); | ||
59 | return; | 61 | return; |
62 | } | ||
60 | 63 | ||
61 | cnf = config.Configs["Startup"]; | 64 | cnf = config.Configs["Startup"]; |
62 | if (cnf != null) | 65 | if (cnf != null) |
@@ -72,6 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
72 | "grid_instant_message", processXMLRPCGridInstantMessage); | 75 | "grid_instant_message", processXMLRPCGridInstantMessage); |
73 | } | 76 | } |
74 | 77 | ||
78 | m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); | ||
75 | scene.RegisterModuleInterface<IMessageTransferModule>(this); | 79 | scene.RegisterModuleInterface<IMessageTransferModule>(this); |
76 | m_Scenes.Add(scene); | 80 | m_Scenes.Add(scene); |
77 | } | 81 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 5315c11..75976e2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -67,13 +67,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
67 | 67 | ||
68 | if (!m_Scenelist.Contains(scene)) | 68 | if (!m_Scenelist.Contains(scene)) |
69 | { | 69 | { |
70 | if (m_Scenelist.Count == 0) | ||
71 | { | ||
72 | m_TransferModule = scene.RequestModuleInterface<IMessageTransferModule>(); | ||
73 | if (m_TransferModule == null) | ||
74 | m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); | ||
75 | } | ||
76 | |||
77 | m_Scenelist.Add(scene); | 70 | m_Scenelist.Add(scene); |
78 | 71 | ||
79 | scene.RegisterModuleInterface<IInventoryTransferModule>(this); | 72 | scene.RegisterModuleInterface<IInventoryTransferModule>(this); |
@@ -86,6 +79,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
86 | 79 | ||
87 | public void PostInitialise() | 80 | public void PostInitialise() |
88 | { | 81 | { |
82 | if (m_Scenelist.Count > 0) | ||
83 | { | ||
84 | m_TransferModule = m_Scenelist[0].RequestModuleInterface<IMessageTransferModule>(); | ||
85 | if (m_TransferModule == null) | ||
86 | m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); | ||
87 | } | ||
89 | } | 88 | } |
90 | 89 | ||
91 | public void Close() | 90 | public void Close() |
@@ -257,8 +256,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
257 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); | 256 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); |
258 | 257 | ||
259 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 258 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
260 | 259 | ||
261 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(inventoryEntityID)); | 260 | InventoryItemBase item = new InventoryItemBase(inventoryEntityID, client.AgentId); |
261 | item = invService.GetItem(item); | ||
262 | InventoryFolderBase folder = null; | 262 | InventoryFolderBase folder = null; |
263 | 263 | ||
264 | if (item != null && trashFolder != null) | 264 | if (item != null && trashFolder != null) |
@@ -266,12 +266,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
266 | item.Folder = trashFolder.ID; | 266 | item.Folder = trashFolder.ID; |
267 | 267 | ||
268 | // Diva comment: can't we just update this item??? | 268 | // Diva comment: can't we just update this item??? |
269 | invService.DeleteItem(item); | 269 | List<UUID> uuids = new List<UUID>(); |
270 | uuids.Add(item.ID); | ||
271 | invService.DeleteItems(item.Owner, uuids); | ||
270 | scene.AddInventoryItem(client, item); | 272 | scene.AddInventoryItem(client, item); |
271 | } | 273 | } |
272 | else | 274 | else |
273 | { | 275 | { |
274 | folder = invService.GetFolder(new InventoryFolderBase(inventoryEntityID)); | 276 | folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); |
277 | folder = invService.GetFolder(folder); | ||
275 | 278 | ||
276 | if (folder != null & trashFolder != null) | 279 | if (folder != null & trashFolder != null) |
277 | { | 280 | { |
@@ -451,10 +454,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
451 | else | 454 | else |
452 | { | 455 | { |
453 | UUID itemID = new UUID(msg.binaryBucket, 1); | 456 | UUID itemID = new UUID(msg.binaryBucket, 1); |
454 | InventoryItemBase item = new InventoryItemBase(); | 457 | InventoryItemBase item = new InventoryItemBase(itemID, user.ControllingClient.AgentId); |
455 | |||
456 | item.ID = itemID; | ||
457 | item.Owner = user.ControllingClient.AgentId; | ||
458 | 458 | ||
459 | // Fetch from service | 459 | // Fetch from service |
460 | // | 460 | // |
diff --git a/OpenSim/Region/CoreModules/Avatar/NPC/INPCModule.cs b/OpenSim/Region/CoreModules/Avatar/NPC/INPCModule.cs new file mode 100644 index 0000000..cd2fe4f --- /dev/null +++ b/OpenSim/Region/CoreModules/Avatar/NPC/INPCModule.cs | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
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. | ||
26 | */ | ||
27 | |||
28 | using OpenMetaverse; | ||
29 | using OpenSim.Region.Framework.Scenes; | ||
30 | |||
31 | namespace OpenSim.Region.CoreModules.Avatar.NPC | ||
32 | { | ||
33 | public interface INPCModule | ||
34 | { | ||
35 | UUID CreateNPC(string firstname, string lastname, Vector3 position, Scene scene, UUID cloneAppearanceFrom); | ||
36 | void Autopilot(UUID agentID, Scene scene, Vector3 pos); | ||
37 | void Say(UUID agentID, Scene scene, string text); | ||
38 | void DeleteNPC(UUID agentID, Scene scene); | ||
39 | } | ||
40 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 2640f08..e577fbe 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -443,7 +443,16 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
443 | endPoint.X = (int) x; | 443 | endPoint.X = (int) x; |
444 | endPoint.Y = (int) y; | 444 | endPoint.Y = (int) y; |
445 | Image image = ImageHttpRequest(nextLine); | 445 | Image image = ImageHttpRequest(nextLine); |
446 | graph.DrawImage(image, (float) startPoint.X, (float) startPoint.Y, x, y); | 446 | if (image != null) |
447 | { | ||
448 | graph.DrawImage(image, (float)startPoint.X, (float)startPoint.Y, x, y); | ||
449 | } | ||
450 | else | ||
451 | { | ||
452 | graph.DrawString("URL couldn't be resolved or is", new Font("Arial",6), myBrush, startPoint); | ||
453 | graph.DrawString("not an image. Please check URL.", new Font("Arial", 6), myBrush, new Point(startPoint.X, 12 + startPoint.Y)); | ||
454 | graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | ||
455 | } | ||
447 | startPoint.X += endPoint.X; | 456 | startPoint.X += endPoint.X; |
448 | startPoint.Y += endPoint.Y; | 457 | startPoint.Y += endPoint.Y; |
449 | } | 458 | } |
@@ -469,13 +478,19 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
469 | startPoint.X += endPoint.X; | 478 | startPoint.X += endPoint.X; |
470 | startPoint.Y += endPoint.Y; | 479 | startPoint.Y += endPoint.Y; |
471 | } | 480 | } |
481 | else if (nextLine.StartsWith("FillPolygon")) | ||
482 | { | ||
483 | PointF[] points = null; | ||
484 | GetParams(partsDelimiter, ref nextLine, 11, ref points); | ||
485 | graph.FillPolygon(myBrush, points); | ||
486 | } | ||
472 | else if (nextLine.StartsWith("Ellipse")) | 487 | else if (nextLine.StartsWith("Ellipse")) |
473 | { | 488 | { |
474 | float x = 0; | 489 | float x = 0; |
475 | float y = 0; | 490 | float y = 0; |
476 | GetParams(partsDelimiter, ref nextLine, 7, ref x, ref y); | 491 | GetParams(partsDelimiter, ref nextLine, 7, ref x, ref y); |
477 | endPoint.X = (int) x; | 492 | endPoint.X = (int)x; |
478 | endPoint.Y = (int) y; | 493 | endPoint.Y = (int)y; |
479 | graph.DrawEllipse(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | 494 | graph.DrawEllipse(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); |
480 | startPoint.X += endPoint.X; | 495 | startPoint.X += endPoint.X; |
481 | startPoint.Y += endPoint.Y; | 496 | startPoint.Y += endPoint.Y; |
@@ -492,30 +507,31 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
492 | nextLine = nextLine.Remove(0, 8); | 507 | nextLine = nextLine.Remove(0, 8); |
493 | nextLine = nextLine.Trim(); | 508 | nextLine = nextLine.Trim(); |
494 | 509 | ||
495 | string [] fprops = nextLine.Split(partsDelimiter); | 510 | string[] fprops = nextLine.Split(partsDelimiter); |
496 | foreach (string prop in fprops) { | 511 | foreach (string prop in fprops) |
497 | 512 | { | |
513 | |||
498 | switch (prop) | 514 | switch (prop) |
499 | { | 515 | { |
500 | case "B": | 516 | case "B": |
501 | if (!(myFont.Bold)) | 517 | if (!(myFont.Bold)) |
502 | myFont = new Font(myFont, myFont.Style | FontStyle.Bold); | 518 | myFont = new Font(myFont, myFont.Style | FontStyle.Bold); |
503 | break; | 519 | break; |
504 | case "I": | 520 | case "I": |
505 | if (!(myFont.Italic)) | 521 | if (!(myFont.Italic)) |
506 | myFont = new Font(myFont, myFont.Style | FontStyle.Italic); | 522 | myFont = new Font(myFont, myFont.Style | FontStyle.Italic); |
507 | break; | 523 | break; |
508 | case "U": | 524 | case "U": |
509 | if (!(myFont.Underline)) | 525 | if (!(myFont.Underline)) |
510 | myFont = new Font(myFont, myFont.Style | FontStyle.Underline); | 526 | myFont = new Font(myFont, myFont.Style | FontStyle.Underline); |
511 | break; | 527 | break; |
512 | case "S": | 528 | case "S": |
513 | if (!(myFont.Strikeout)) | 529 | if (!(myFont.Strikeout)) |
514 | myFont = new Font(myFont, myFont.Style | FontStyle.Strikeout); | 530 | myFont = new Font(myFont, myFont.Style | FontStyle.Strikeout); |
515 | break; | 531 | break; |
516 | case "R": | 532 | case "R": |
517 | myFont = new Font(myFont, FontStyle.Regular); | 533 | myFont = new Font(myFont, FontStyle.Regular); |
518 | break; | 534 | break; |
519 | } | 535 | } |
520 | } | 536 | } |
521 | } | 537 | } |
@@ -532,6 +548,57 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
532 | float size = Convert.ToSingle(nextLine, CultureInfo.InvariantCulture); | 548 | float size = Convert.ToSingle(nextLine, CultureInfo.InvariantCulture); |
533 | drawPen.Width = size; | 549 | drawPen.Width = size; |
534 | } | 550 | } |
551 | else if (nextLine.StartsWith("PenCap")) | ||
552 | { | ||
553 | bool start = true, end = true; | ||
554 | nextLine = nextLine.Remove(0, 6); | ||
555 | nextLine = nextLine.Trim(); | ||
556 | string[] cap = nextLine.Split(partsDelimiter); | ||
557 | if (cap[0].ToLower() == "start") | ||
558 | end = false; | ||
559 | else if (cap[0].ToLower() == "end") | ||
560 | start = false; | ||
561 | else if (cap[0].ToLower() != "both") | ||
562 | return; | ||
563 | string type = cap[1].ToLower(); | ||
564 | |||
565 | if (end) | ||
566 | { | ||
567 | switch (type) | ||
568 | { | ||
569 | case "arrow": | ||
570 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor; | ||
571 | break; | ||
572 | case "round": | ||
573 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.RoundAnchor; | ||
574 | break; | ||
575 | case "diamond": | ||
576 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.DiamondAnchor; | ||
577 | break; | ||
578 | case "flat": | ||
579 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.Flat; | ||
580 | break; | ||
581 | } | ||
582 | } | ||
583 | if (start) | ||
584 | { | ||
585 | switch (type) | ||
586 | { | ||
587 | case "arrow": | ||
588 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor; | ||
589 | break; | ||
590 | case "round": | ||
591 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.RoundAnchor; | ||
592 | break; | ||
593 | case "diamond": | ||
594 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.DiamondAnchor; | ||
595 | break; | ||
596 | case "flat": | ||
597 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.Flat; | ||
598 | break; | ||
599 | } | ||
600 | } | ||
601 | } | ||
535 | else if (nextLine.StartsWith("PenColour")) | 602 | else if (nextLine.StartsWith("PenColour")) |
536 | { | 603 | { |
537 | nextLine = nextLine.Remove(0, 9); | 604 | nextLine = nextLine.Remove(0, 9); |
@@ -542,7 +609,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
542 | if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) | 609 | if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) |
543 | { | 610 | { |
544 | newColour = Color.FromArgb(hex); | 611 | newColour = Color.FromArgb(hex); |
545 | } | 612 | } |
546 | else | 613 | else |
547 | { | 614 | { |
548 | // this doesn't fail, it just returns black if nothing is found | 615 | // this doesn't fail, it just returns black if nothing is found |
@@ -582,18 +649,40 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
582 | } | 649 | } |
583 | } | 650 | } |
584 | 651 | ||
652 | private static void GetParams(char[] partsDelimiter, ref string line, int startLength, ref PointF[] points) | ||
653 | { | ||
654 | line = line.Remove(0, startLength); | ||
655 | string[] parts = line.Split(partsDelimiter); | ||
656 | if (parts.Length > 1 && parts.Length % 2 == 0) | ||
657 | { | ||
658 | points = new PointF[parts.Length / 2]; | ||
659 | for (int i = 0; i < parts.Length; i = i + 2) | ||
660 | { | ||
661 | string xVal = parts[i].Trim(); | ||
662 | string yVal = parts[i+1].Trim(); | ||
663 | float x = Convert.ToSingle(xVal, CultureInfo.InvariantCulture); | ||
664 | float y = Convert.ToSingle(yVal, CultureInfo.InvariantCulture); | ||
665 | PointF point = new PointF(x, y); | ||
666 | points[i / 2] = point; | ||
667 | } | ||
668 | } | ||
669 | } | ||
670 | |||
585 | private Bitmap ImageHttpRequest(string url) | 671 | private Bitmap ImageHttpRequest(string url) |
586 | { | 672 | { |
673 | try | ||
674 | { | ||
587 | WebRequest request = HttpWebRequest.Create(url); | 675 | WebRequest request = HttpWebRequest.Create(url); |
588 | //Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. | 676 | //Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. |
589 | //Ckrinke Stream str = null; | 677 | //Ckrinke Stream str = null; |
590 | HttpWebResponse response = (HttpWebResponse) (request).GetResponse(); | 678 | HttpWebResponse response = (HttpWebResponse)(request).GetResponse(); |
591 | if (response.StatusCode == HttpStatusCode.OK) | 679 | if (response.StatusCode == HttpStatusCode.OK) |
592 | { | 680 | { |
593 | Bitmap image = new Bitmap(response.GetResponseStream()); | 681 | Bitmap image = new Bitmap(response.GetResponseStream()); |
594 | return image; | 682 | return image; |
683 | } | ||
595 | } | 684 | } |
596 | 685 | catch { } | |
597 | return null; | 686 | return null; |
598 | } | 687 | } |
599 | } | 688 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index ef5ffe1..bd32f3b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -139,6 +139,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
139 | public abstract bool MoveFolder(InventoryFolderBase folder); | 139 | public abstract bool MoveFolder(InventoryFolderBase folder); |
140 | 140 | ||
141 | /// <summary> | 141 | /// <summary> |
142 | /// Delete a list of inventory folders (from trash) | ||
143 | /// </summary> | ||
144 | public abstract bool DeleteFolders(UUID ownerID, List<UUID> folderIDs); | ||
145 | |||
146 | /// <summary> | ||
142 | /// Purge an inventory folder of all its items and subfolders. | 147 | /// Purge an inventory folder of all its items and subfolders. |
143 | /// </summary> | 148 | /// </summary> |
144 | /// <param name="folder"></param> | 149 | /// <param name="folder"></param> |
@@ -181,12 +186,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
181 | /// <returns>true if the item was successfully updated</returns> | 186 | /// <returns>true if the item was successfully updated</returns> |
182 | public abstract bool UpdateItem(InventoryItemBase item); | 187 | public abstract bool UpdateItem(InventoryItemBase item); |
183 | 188 | ||
189 | public abstract bool MoveItems(UUID ownerID, List<InventoryItemBase> items); | ||
190 | |||
184 | /// <summary> | 191 | /// <summary> |
185 | /// Delete an item from the user's inventory | 192 | /// Delete an item from the user's inventory |
186 | /// </summary> | 193 | /// </summary> |
187 | /// <param name="item"></param> | 194 | /// <param name="item"></param> |
188 | /// <returns>true if the item was successfully deleted</returns> | 195 | /// <returns>true if the item was successfully deleted</returns> |
189 | public abstract bool DeleteItem(InventoryItemBase item); | 196 | public abstract bool DeleteItems(UUID ownerID, List<UUID> itemIDs); |
190 | 197 | ||
191 | public abstract InventoryItemBase GetItem(InventoryItemBase item); | 198 | public abstract InventoryItemBase GetItem(InventoryItemBase item); |
192 | 199 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index dd451ef..1c66254 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -290,7 +290,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
290 | 290 | ||
291 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 291 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
292 | { | 292 | { |
293 | return new List<InventoryItemBase>(); | 293 | if (IsLocalGridUser(userID)) |
294 | return m_GridService.GetFolderItems(userID, folderID); | ||
295 | else | ||
296 | { | ||
297 | UUID sessionID = GetSessionID(userID); | ||
298 | string uri = GetUserInventoryURI(userID) + "/" + userID; | ||
299 | return m_HGService.GetFolderItems(uri, folderID, sessionID); | ||
300 | } | ||
294 | } | 301 | } |
295 | 302 | ||
296 | public override bool AddFolder(InventoryFolderBase folder) | 303 | public override bool AddFolder(InventoryFolderBase folder) |
@@ -323,6 +330,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
323 | } | 330 | } |
324 | } | 331 | } |
325 | 332 | ||
333 | public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
334 | { | ||
335 | if (folderIDs == null) | ||
336 | return false; | ||
337 | if (folderIDs.Count == 0) | ||
338 | return false; | ||
339 | |||
340 | if (IsLocalGridUser(ownerID)) | ||
341 | return m_GridService.DeleteFolders(ownerID, folderIDs); | ||
342 | else | ||
343 | { | ||
344 | UUID sessionID = GetSessionID(ownerID); | ||
345 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); | ||
346 | return m_HGService.DeleteFolders(uri, folderIDs, sessionID); | ||
347 | } | ||
348 | } | ||
349 | |||
326 | public override bool MoveFolder(InventoryFolderBase folder) | 350 | public override bool MoveFolder(InventoryFolderBase folder) |
327 | { | 351 | { |
328 | if (folder == null) | 352 | if (folder == null) |
@@ -386,18 +410,39 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
386 | } | 410 | } |
387 | } | 411 | } |
388 | 412 | ||
389 | public override bool DeleteItem(InventoryItemBase item) | 413 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) |
390 | { | 414 | { |
391 | if (item == null) | 415 | if (items == null) |
392 | return false; | 416 | return false; |
417 | if (items.Count == 0) | ||
418 | return true; | ||
393 | 419 | ||
394 | if (IsLocalGridUser(item.Owner)) | 420 | if (IsLocalGridUser(ownerID)) |
395 | return m_GridService.DeleteItem(item); | 421 | return m_GridService.MoveItems(ownerID, items); |
396 | else | 422 | else |
397 | { | 423 | { |
398 | UUID sessionID = GetSessionID(item.Owner); | 424 | UUID sessionID = GetSessionID(ownerID); |
399 | string uri = GetUserInventoryURI(item.Owner) + "/" + item.Owner.ToString(); | 425 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); |
400 | return m_HGService.DeleteItem(uri, item, sessionID); | 426 | return m_HGService.MoveItems(uri, items, sessionID); |
427 | } | ||
428 | } | ||
429 | |||
430 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | ||
431 | { | ||
432 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); | ||
433 | |||
434 | if (itemIDs == null) | ||
435 | return false; | ||
436 | if (itemIDs.Count == 0) | ||
437 | return true; | ||
438 | |||
439 | if (IsLocalGridUser(ownerID)) | ||
440 | return m_GridService.DeleteItems(ownerID, itemIDs); | ||
441 | else | ||
442 | { | ||
443 | UUID sessionID = GetSessionID(ownerID); | ||
444 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); | ||
445 | return m_HGService.DeleteItems(uri, itemIDs, sessionID); | ||
401 | } | 446 | } |
402 | } | 447 | } |
403 | 448 | ||
@@ -483,12 +528,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
483 | string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); | 528 | string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); |
484 | string uri = m_LocalGridInventoryURI.TrimEnd('/'); | 529 | string uri = m_LocalGridInventoryURI.TrimEnd('/'); |
485 | 530 | ||
486 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, comparing {0} to {1}.", userInventoryServerURI, uri); | ||
487 | |||
488 | if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) | 531 | if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) |
489 | { | 532 | { |
490 | return true; | 533 | return true; |
491 | } | 534 | } |
535 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user {0} is foreign({1} - {2})", userID, userInventoryServerURI, uri); | ||
492 | return false; | 536 | return false; |
493 | } | 537 | } |
494 | 538 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 2fbc5fe..66d11dd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
191 | 191 | ||
192 | public override Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) | 192 | public override Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) |
193 | { | 193 | { |
194 | InventoryFolderBase root = GetRootFolder(userID); | 194 | InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); |
195 | if (root != null) | 195 | if (root != null) |
196 | { | 196 | { |
197 | InventoryCollection content = GetFolderContent(userID, root.ID); | 197 | InventoryCollection content = GetFolderContent(userID, root.ID); |
@@ -202,13 +202,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
202 | { | 202 | { |
203 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | 203 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) |
204 | { | 204 | { |
205 | m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); | 205 | //m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); |
206 | folders[(AssetType)folder.Type] = folder; | 206 | folders[(AssetType)folder.Type] = folder; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | // Put the root folder there, as type Folder | 209 | // Put the root folder there, as type Folder |
210 | folders[AssetType.Folder] = root; | 210 | folders[AssetType.Folder] = root; |
211 | m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); | 211 | //m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); |
212 | 212 | ||
213 | return folders; | 213 | return folders; |
214 | } | 214 | } |
@@ -258,6 +258,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
258 | return m_InventoryService.MoveFolder(folder); | 258 | return m_InventoryService.MoveFolder(folder); |
259 | } | 259 | } |
260 | 260 | ||
261 | public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
262 | { | ||
263 | return m_InventoryService.DeleteFolders(ownerID, folderIDs); | ||
264 | } | ||
265 | |||
261 | /// <summary> | 266 | /// <summary> |
262 | /// Purge an inventory folder of all its items and subfolders. | 267 | /// Purge an inventory folder of all its items and subfolders. |
263 | /// </summary> | 268 | /// </summary> |
@@ -289,14 +294,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
289 | return m_InventoryService.UpdateItem(item); | 294 | return m_InventoryService.UpdateItem(item); |
290 | } | 295 | } |
291 | 296 | ||
297 | |||
298 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
299 | { | ||
300 | return m_InventoryService.MoveItems(ownerID, items); | ||
301 | } | ||
302 | |||
292 | /// <summary> | 303 | /// <summary> |
293 | /// Delete an item from the user's inventory | 304 | /// Delete an item from the user's inventory |
294 | /// </summary> | 305 | /// </summary> |
295 | /// <param name="item"></param> | 306 | /// <param name="item"></param> |
296 | /// <returns>true if the item was successfully deleted</returns> | 307 | /// <returns>true if the item was successfully deleted</returns> |
297 | public override bool DeleteItem(InventoryItemBase item) | 308 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
298 | { | 309 | { |
299 | return m_InventoryService.DeleteItem(item); | 310 | return m_InventoryService.DeleteItems(ownerID, itemIDs); |
300 | } | 311 | } |
301 | 312 | ||
302 | public override InventoryItemBase GetItem(InventoryItemBase item) | 313 | public override InventoryItemBase GetItem(InventoryItemBase item) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index bef716b..0d32c77 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -212,7 +212,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
212 | 212 | ||
213 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 213 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
214 | { | 214 | { |
215 | return new List<InventoryItemBase>(); | 215 | UUID sessionID = GetSessionID(userID); |
216 | return m_RemoteConnector.GetFolderItems(userID.ToString(), folderID, sessionID); | ||
216 | } | 217 | } |
217 | 218 | ||
218 | public override bool AddFolder(InventoryFolderBase folder) | 219 | public override bool AddFolder(InventoryFolderBase folder) |
@@ -242,6 +243,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
242 | return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); | 243 | return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); |
243 | } | 244 | } |
244 | 245 | ||
246 | public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
247 | { | ||
248 | if (folderIDs == null) | ||
249 | return false; | ||
250 | if (folderIDs.Count == 0) | ||
251 | return false; | ||
252 | |||
253 | UUID sessionID = GetSessionID(ownerID); | ||
254 | return m_RemoteConnector.DeleteFolders(ownerID.ToString(), folderIDs, sessionID); | ||
255 | } | ||
256 | |||
257 | |||
245 | public override bool PurgeFolder(InventoryFolderBase folder) | 258 | public override bool PurgeFolder(InventoryFolderBase folder) |
246 | { | 259 | { |
247 | if (folder == null) | 260 | if (folder == null) |
@@ -272,13 +285,25 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
272 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); | 285 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); |
273 | } | 286 | } |
274 | 287 | ||
275 | public override bool DeleteItem(InventoryItemBase item) | 288 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) |
276 | { | 289 | { |
277 | if (item == null) | 290 | if (items == null) |
278 | return false; | 291 | return false; |
279 | 292 | ||
280 | UUID sessionID = GetSessionID(item.Owner); | 293 | UUID sessionID = GetSessionID(ownerID); |
281 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); | 294 | return m_RemoteConnector.MoveItems(ownerID.ToString(), items, sessionID); |
295 | } | ||
296 | |||
297 | |||
298 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | ||
299 | { | ||
300 | if (itemIDs == null) | ||
301 | return false; | ||
302 | if (itemIDs.Count == 0) | ||
303 | return true; | ||
304 | |||
305 | UUID sessionID = GetSessionID(ownerID); | ||
306 | return m_RemoteConnector.DeleteItems(ownerID.ToString(), itemIDs, sessionID); | ||
282 | } | 307 | } |
283 | 308 | ||
284 | public override InventoryItemBase GetItem(InventoryItemBase item) | 309 | public override InventoryItemBase GetItem(InventoryItemBase item) |
@@ -320,14 +345,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
320 | 345 | ||
321 | private UUID GetSessionID(UUID userID) | 346 | private UUID GetSessionID(UUID userID) |
322 | { | 347 | { |
323 | if (m_Scene == null) | 348 | //if (m_Scene == null) |
324 | { | 349 | //{ |
325 | m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); | 350 | // m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); |
326 | } | 351 | //} |
327 | 352 | ||
328 | if (m_UserProfileService == null) | 353 | if (m_UserProfileService == null) |
329 | { | 354 | { |
330 | m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); | 355 | //m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); |
331 | return UUID.Zero; | 356 | return UUID.Zero; |
332 | } | 357 | } |
333 | 358 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 9c71b41..f360577 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -966,7 +966,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
966 | if (objectID == UUID.Zero) // User inventory | 966 | if (objectID == UUID.Zero) // User inventory |
967 | { | 967 | { |
968 | IInventoryService invService = m_scene.InventoryService; | 968 | IInventoryService invService = m_scene.InventoryService; |
969 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); | 969 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); |
970 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
970 | if (assetRequestItem == null) // Library item | 971 | if (assetRequestItem == null) // Library item |
971 | { | 972 | { |
972 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 973 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); |
@@ -1385,7 +1386,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1385 | if (objectID == UUID.Zero) // User inventory | 1386 | if (objectID == UUID.Zero) // User inventory |
1386 | { | 1387 | { |
1387 | IInventoryService invService = m_scene.InventoryService; | 1388 | IInventoryService invService = m_scene.InventoryService; |
1388 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(script)); | 1389 | InventoryItemBase assetRequestItem = new InventoryItemBase(script, user); |
1390 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1389 | if (assetRequestItem == null) // Library item | 1391 | if (assetRequestItem == null) // Library item |
1390 | { | 1392 | { |
1391 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); | 1393 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); |
@@ -1479,7 +1481,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1479 | if (objectID == UUID.Zero) // User inventory | 1481 | if (objectID == UUID.Zero) // User inventory |
1480 | { | 1482 | { |
1481 | IInventoryService invService = m_scene.InventoryService; | 1483 | IInventoryService invService = m_scene.InventoryService; |
1482 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); | 1484 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); |
1485 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1483 | if (assetRequestItem == null) // Library item | 1486 | if (assetRequestItem == null) // Library item |
1484 | { | 1487 | { |
1485 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 1488 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); |