diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-26 11:48:05 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-26 11:48:05 -0400 |
commit | 54e05a083d2aeb7a892647f64edfd52db80ce5ed (patch) | |
tree | 1fca51f8dd19c0f4871d8e1b875511c6087b3675 /OpenSim/Region/CoreModules | |
parent | * It turns out that Physics heightmap values were being stored in managed mem... (diff) | |
parent | Add reference to OpenMetaverse.dll to UserServer.Modules to make MSVS happy (diff) | |
download | opensim-SC-54e05a083d2aeb7a892647f64edfd52db80ce5ed.zip opensim-SC-54e05a083d2aeb7a892647f64edfd52db80ce5ed.tar.gz opensim-SC-54e05a083d2aeb7a892647f64edfd52db80ce5ed.tar.bz2 opensim-SC-54e05a083d2aeb7a892647f64edfd52db80ce5ed.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
6 files changed, 186 insertions, 18 deletions
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 d4cb616..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> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 787c6c8..1c66254 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -330,6 +330,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
330 | } | 330 | } |
331 | } | 331 | } |
332 | 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 | |||
333 | public override bool MoveFolder(InventoryFolderBase folder) | 350 | public override bool MoveFolder(InventoryFolderBase folder) |
334 | { | 351 | { |
335 | if (folder == null) | 352 | if (folder == null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index e6edcf2..66d11dd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -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> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 201442c..0d32c77 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -243,6 +243,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
243 | return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); | 243 | return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); |
244 | } | 244 | } |
245 | 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 | |||
246 | public override bool PurgeFolder(InventoryFolderBase folder) | 258 | public override bool PurgeFolder(InventoryFolderBase folder) |
247 | { | 259 | { |
248 | if (folder == null) | 260 | if (folder == null) |