diff options
author | Melanie | 2012-08-03 16:46:11 +0100 |
---|---|---|
committer | Melanie | 2012-08-03 16:46:11 +0100 |
commit | 0c00abcce18d00ae151a7340b808ffe8d7e200ef (patch) | |
tree | 3f19d7653c984120f16b3a2ea74ccf6b34928a2e /OpenSim | |
parent | Merge branch 'master' into careminster (diff) | |
parent | refactor: rename SOG.RezzingObjectID to SOG.FromPartID to match FromFolderID,... (diff) | |
download | opensim-SC_OLD-0c00abcce18d00ae151a7340b808ffe8d7e200ef.zip opensim-SC_OLD-0c00abcce18d00ae151a7340b808ffe8d7e200ef.tar.gz opensim-SC_OLD-0c00abcce18d00ae151a7340b808ffe8d7e200ef.tar.bz2 opensim-SC_OLD-0c00abcce18d00ae151a7340b808ffe8d7e200ef.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim')
14 files changed, 457 insertions, 297 deletions
diff --git a/OpenSim/Region/CoreModules/World/Tests/SOGSpamTest.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs index 53d775e..9787c8c 100644 --- a/OpenSim/Region/CoreModules/World/Tests/SOGSpamTest.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/Tests/VectorRenderModuleTests.cs | |||
@@ -27,11 +27,49 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Text; | 30 | using System.IO; |
31 | using System.Reflection; | ||
32 | using System.Threading; | ||
33 | using log4net.Config; | ||
34 | using NUnit.Framework; | ||
35 | using OpenMetaverse; | ||
36 | using OpenMetaverse.Assets; | ||
37 | using OpenSim.Framework; | ||
38 | using OpenSim.Region.CoreModules.Scripting.DynamicTexture; | ||
39 | using OpenSim.Region.CoreModules.Scripting.VectorRender; | ||
40 | using OpenSim.Region.Framework.Scenes; | ||
41 | using OpenSim.Region.Framework.Scenes.Serialization; | ||
42 | using OpenSim.Tests.Common; | ||
43 | using OpenSim.Tests.Common.Mock; | ||
31 | 44 | ||
32 | namespace OpenSim.Region.CoreModules.World.Tests | 45 | namespace OpenSim.Region.CoreModules.Scripting.VectorRender.Tests |
33 | { | 46 | { |
34 | class SOGSpamTest | 47 | [TestFixture] |
48 | public class VectorRenderModuleTests | ||
35 | { | 49 | { |
50 | [Test] | ||
51 | public void TestDraw() | ||
52 | { | ||
53 | TestHelpers.InMethod(); | ||
54 | |||
55 | Scene scene = new SceneHelpers().SetupScene(); | ||
56 | DynamicTextureModule dtm = new DynamicTextureModule(); | ||
57 | VectorRenderModule vrm = new VectorRenderModule(); | ||
58 | SceneHelpers.SetupSceneModules(scene, dtm, vrm); | ||
59 | |||
60 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene); | ||
61 | UUID originalTextureID = so.RootPart.Shape.Textures.GetFace(0).TextureID; | ||
62 | |||
63 | dtm.AddDynamicTextureData( | ||
64 | scene.RegionInfo.RegionID, | ||
65 | so.UUID, | ||
66 | vrm.GetContentType(), | ||
67 | "PenColour BLACK; MoveTo 40,220; FontSize 32; Text Hello World;", | ||
68 | "", | ||
69 | 0); | ||
70 | |||
71 | |||
72 | Assert.That(originalTextureID, Is.Not.EqualTo(so.RootPart.Shape.Textures.GetFace(0).TextureID)); | ||
73 | } | ||
36 | } | 74 | } |
37 | } | 75 | } \ 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 c061868..d039111 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -98,16 +98,18 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
98 | public void GetDrawStringSize(string text, string fontName, int fontSize, | 98 | public void GetDrawStringSize(string text, string fontName, int fontSize, |
99 | out double xSize, out double ySize) | 99 | out double xSize, out double ySize) |
100 | { | 100 | { |
101 | Font myFont = new Font(fontName, fontSize); | 101 | using (Font myFont = new Font(fontName, fontSize)) |
102 | SizeF stringSize = new SizeF(); | 102 | { |
103 | lock (m_graph) { | 103 | SizeF stringSize = new SizeF(); |
104 | stringSize = m_graph.MeasureString(text, myFont); | 104 | lock (m_graph) |
105 | xSize = stringSize.Width; | 105 | { |
106 | ySize = stringSize.Height; | 106 | stringSize = m_graph.MeasureString(text, myFont); |
107 | xSize = stringSize.Width; | ||
108 | ySize = stringSize.Height; | ||
109 | } | ||
107 | } | 110 | } |
108 | } | 111 | } |
109 | 112 | ||
110 | |||
111 | #endregion | 113 | #endregion |
112 | 114 | ||
113 | #region IRegionModule Members | 115 | #region IRegionModule Members |
@@ -121,6 +123,8 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
121 | 123 | ||
122 | if (m_graph == null) | 124 | if (m_graph == null) |
123 | { | 125 | { |
126 | // We won't dispose of these explicitly since this module is only removed when the entire simulator | ||
127 | // is shut down. | ||
124 | Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); | 128 | Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); |
125 | m_graph = Graphics.FromImage(bitmap); | 129 | m_graph = Graphics.FromImage(bitmap); |
126 | } | 130 | } |
@@ -299,53 +303,64 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
299 | } | 303 | } |
300 | } | 304 | } |
301 | 305 | ||
302 | Bitmap bitmap; | 306 | Bitmap bitmap = null; |
303 | 307 | Graphics graph = null; | |
304 | if (alpha == 256) | ||
305 | { | ||
306 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); | ||
311 | } | ||
312 | |||
313 | Graphics graph = Graphics.FromImage(bitmap); | ||
314 | |||
315 | // this is really just to save people filling the | ||
316 | // background color in their scripts, only do when fully opaque | ||
317 | if (alpha >= 255) | ||
318 | { | ||
319 | graph.FillRectangle(new SolidBrush(bgColor), 0, 0, width, height); | ||
320 | } | ||
321 | 308 | ||
322 | for (int w = 0; w < bitmap.Width; w++) | 309 | try |
323 | { | 310 | { |
324 | if (alpha <= 255) | 311 | if (alpha == 256) |
312 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | ||
313 | else | ||
314 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); | ||
315 | |||
316 | graph = Graphics.FromImage(bitmap); | ||
317 | |||
318 | // this is really just to save people filling the | ||
319 | // background color in their scripts, only do when fully opaque | ||
320 | if (alpha >= 255) | ||
325 | { | 321 | { |
326 | for (int h = 0; h < bitmap.Height; h++) | 322 | using (SolidBrush bgFillBrush = new SolidBrush(bgColor)) |
327 | { | 323 | { |
328 | bitmap.SetPixel(w, h, Color.FromArgb(alpha, bitmap.GetPixel(w, h))); | 324 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); |
329 | } | 325 | } |
330 | } | 326 | } |
331 | } | 327 | |
332 | 328 | for (int w = 0; w < bitmap.Width; w++) | |
333 | GDIDraw(data, graph, altDataDelim); | 329 | { |
334 | 330 | if (alpha <= 255) | |
335 | byte[] imageJ2000 = new byte[0]; | 331 | { |
332 | for (int h = 0; h < bitmap.Height; h++) | ||
333 | { | ||
334 | bitmap.SetPixel(w, h, Color.FromArgb(alpha, bitmap.GetPixel(w, h))); | ||
335 | } | ||
336 | } | ||
337 | } | ||
338 | |||
339 | GDIDraw(data, graph, altDataDelim); | ||
340 | |||
341 | byte[] imageJ2000 = new byte[0]; | ||
342 | |||
343 | try | ||
344 | { | ||
345 | imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true); | ||
346 | } | ||
347 | catch (Exception e) | ||
348 | { | ||
349 | m_log.ErrorFormat( | ||
350 | "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Exception {0}{1}", | ||
351 | e.Message, e.StackTrace); | ||
352 | } | ||
336 | 353 | ||
337 | try | 354 | m_textureManager.ReturnData(id, imageJ2000); |
338 | { | ||
339 | imageJ2000 = OpenJPEG.EncodeFromImage(bitmap, true); | ||
340 | } | 355 | } |
341 | catch (Exception e) | 356 | finally |
342 | { | 357 | { |
343 | m_log.ErrorFormat( | 358 | if (graph != null) |
344 | "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Exception {0}{1}", | 359 | graph.Dispose(); |
345 | e.Message, e.StackTrace); | ||
346 | } | ||
347 | 360 | ||
348 | m_textureManager.ReturnData(id, imageJ2000); | 361 | if (bitmap != null) |
362 | bitmap.Dispose(); | ||
363 | } | ||
349 | } | 364 | } |
350 | 365 | ||
351 | private int parseIntParam(string strInt) | 366 | private int parseIntParam(string strInt) |
@@ -407,238 +422,285 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
407 | { | 422 | { |
408 | Point startPoint = new Point(0, 0); | 423 | Point startPoint = new Point(0, 0); |
409 | Point endPoint = new Point(0, 0); | 424 | Point endPoint = new Point(0, 0); |
410 | Pen drawPen = new Pen(Color.Black, 7); | 425 | Pen drawPen = null; |
411 | string fontName = m_fontName; | 426 | Font myFont = null; |
412 | float fontSize = 14; | 427 | SolidBrush myBrush = null; |
413 | Font myFont = new Font(fontName, fontSize); | ||
414 | SolidBrush myBrush = new SolidBrush(Color.Black); | ||
415 | |||
416 | char[] lineDelimiter = {dataDelim}; | ||
417 | char[] partsDelimiter = {','}; | ||
418 | string[] lines = data.Split(lineDelimiter); | ||
419 | 428 | ||
420 | foreach (string line in lines) | 429 | try |
421 | { | 430 | { |
422 | string nextLine = line.Trim(); | 431 | drawPen = new Pen(Color.Black, 7); |
423 | //replace with switch, or even better, do some proper parsing | 432 | string fontName = m_fontName; |
424 | if (nextLine.StartsWith("MoveTo")) | 433 | float fontSize = 14; |
425 | { | 434 | myFont = new Font(fontName, fontSize); |
426 | float x = 0; | 435 | myBrush = new SolidBrush(Color.Black); |
427 | float y = 0; | 436 | |
428 | GetParams(partsDelimiter, ref nextLine, 6, ref x, ref y); | 437 | char[] lineDelimiter = {dataDelim}; |
429 | startPoint.X = (int) x; | 438 | char[] partsDelimiter = {','}; |
430 | startPoint.Y = (int) y; | 439 | string[] lines = data.Split(lineDelimiter); |
431 | } | 440 | |
432 | else if (nextLine.StartsWith("LineTo")) | 441 | foreach (string line in lines) |
433 | { | ||
434 | float x = 0; | ||
435 | float y = 0; | ||
436 | GetParams(partsDelimiter, ref nextLine, 6, ref x, ref y); | ||
437 | endPoint.X = (int) x; | ||
438 | endPoint.Y = (int) y; | ||
439 | graph.DrawLine(drawPen, startPoint, endPoint); | ||
440 | startPoint.X = endPoint.X; | ||
441 | startPoint.Y = endPoint.Y; | ||
442 | } | ||
443 | else if (nextLine.StartsWith("Text")) | ||
444 | { | ||
445 | nextLine = nextLine.Remove(0, 4); | ||
446 | nextLine = nextLine.Trim(); | ||
447 | graph.DrawString(nextLine, myFont, myBrush, startPoint); | ||
448 | } | ||
449 | else if (nextLine.StartsWith("Image")) | ||
450 | { | 442 | { |
451 | float x = 0; | 443 | string nextLine = line.Trim(); |
452 | float y = 0; | 444 | //replace with switch, or even better, do some proper parsing |
453 | GetParams(partsDelimiter, ref nextLine, 5, ref x, ref y); | 445 | if (nextLine.StartsWith("MoveTo")) |
454 | endPoint.X = (int) x; | ||
455 | endPoint.Y = (int) y; | ||
456 | Image image = ImageHttpRequest(nextLine); | ||
457 | if (image != null) | ||
458 | { | 446 | { |
459 | graph.DrawImage(image, (float)startPoint.X, (float)startPoint.Y, x, y); | 447 | float x = 0; |
448 | float y = 0; | ||
449 | GetParams(partsDelimiter, ref nextLine, 6, ref x, ref y); | ||
450 | startPoint.X = (int) x; | ||
451 | startPoint.Y = (int) y; | ||
460 | } | 452 | } |
461 | else | 453 | else if (nextLine.StartsWith("LineTo")) |
462 | { | 454 | { |
463 | graph.DrawString("URL couldn't be resolved or is", new Font(m_fontName,6), | 455 | float x = 0; |
464 | myBrush, startPoint); | 456 | float y = 0; |
465 | graph.DrawString("not an image. Please check URL.", new Font(m_fontName, 6), | 457 | GetParams(partsDelimiter, ref nextLine, 6, ref x, ref y); |
466 | myBrush, new Point(startPoint.X, 12 + startPoint.Y)); | 458 | endPoint.X = (int) x; |
467 | graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | 459 | endPoint.Y = (int) y; |
460 | graph.DrawLine(drawPen, startPoint, endPoint); | ||
461 | startPoint.X = endPoint.X; | ||
462 | startPoint.Y = endPoint.Y; | ||
468 | } | 463 | } |
469 | startPoint.X += endPoint.X; | 464 | else if (nextLine.StartsWith("Text")) |
470 | startPoint.Y += endPoint.Y; | 465 | { |
471 | } | 466 | nextLine = nextLine.Remove(0, 4); |
472 | else if (nextLine.StartsWith("Rectangle")) | 467 | nextLine = nextLine.Trim(); |
473 | { | 468 | graph.DrawString(nextLine, myFont, myBrush, startPoint); |
474 | float x = 0; | 469 | } |
475 | float y = 0; | 470 | else if (nextLine.StartsWith("Image")) |
476 | GetParams(partsDelimiter, ref nextLine, 9, ref x, ref y); | ||
477 | endPoint.X = (int) x; | ||
478 | endPoint.Y = (int) y; | ||
479 | graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | ||
480 | startPoint.X += endPoint.X; | ||
481 | startPoint.Y += endPoint.Y; | ||
482 | } | ||
483 | else if (nextLine.StartsWith("FillRectangle")) | ||
484 | { | ||
485 | float x = 0; | ||
486 | float y = 0; | ||
487 | GetParams(partsDelimiter, ref nextLine, 13, ref x, ref y); | ||
488 | endPoint.X = (int) x; | ||
489 | endPoint.Y = (int) y; | ||
490 | graph.FillRectangle(myBrush, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | ||
491 | startPoint.X += endPoint.X; | ||
492 | startPoint.Y += endPoint.Y; | ||
493 | } | ||
494 | else if (nextLine.StartsWith("FillPolygon")) | ||
495 | { | ||
496 | PointF[] points = null; | ||
497 | GetParams(partsDelimiter, ref nextLine, 11, ref points); | ||
498 | graph.FillPolygon(myBrush, points); | ||
499 | } | ||
500 | else if (nextLine.StartsWith("Polygon")) | ||
501 | { | ||
502 | PointF[] points = null; | ||
503 | GetParams(partsDelimiter, ref nextLine, 7, ref points); | ||
504 | graph.DrawPolygon(drawPen, points); | ||
505 | } | ||
506 | else if (nextLine.StartsWith("Ellipse")) | ||
507 | { | ||
508 | float x = 0; | ||
509 | float y = 0; | ||
510 | GetParams(partsDelimiter, ref nextLine, 7, ref x, ref y); | ||
511 | endPoint.X = (int)x; | ||
512 | endPoint.Y = (int)y; | ||
513 | graph.DrawEllipse(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | ||
514 | startPoint.X += endPoint.X; | ||
515 | startPoint.Y += endPoint.Y; | ||
516 | } | ||
517 | else if (nextLine.StartsWith("FontSize")) | ||
518 | { | ||
519 | nextLine = nextLine.Remove(0, 8); | ||
520 | nextLine = nextLine.Trim(); | ||
521 | fontSize = Convert.ToSingle(nextLine, CultureInfo.InvariantCulture); | ||
522 | myFont = new Font(fontName, fontSize); | ||
523 | } | ||
524 | else if (nextLine.StartsWith("FontProp")) | ||
525 | { | ||
526 | nextLine = nextLine.Remove(0, 8); | ||
527 | nextLine = nextLine.Trim(); | ||
528 | |||
529 | string[] fprops = nextLine.Split(partsDelimiter); | ||
530 | foreach (string prop in fprops) | ||
531 | { | 471 | { |
472 | float x = 0; | ||
473 | float y = 0; | ||
474 | GetParams(partsDelimiter, ref nextLine, 5, ref x, ref y); | ||
475 | endPoint.X = (int) x; | ||
476 | endPoint.Y = (int) y; | ||
532 | 477 | ||
533 | switch (prop) | 478 | using (Image image = ImageHttpRequest(nextLine)) |
534 | { | 479 | { |
535 | case "B": | 480 | if (image != null) |
536 | if (!(myFont.Bold)) | 481 | { |
537 | myFont = new Font(myFont, myFont.Style | FontStyle.Bold); | 482 | graph.DrawImage(image, (float)startPoint.X, (float)startPoint.Y, x, y); |
538 | break; | 483 | } |
539 | case "I": | 484 | else |
540 | if (!(myFont.Italic)) | 485 | { |
541 | myFont = new Font(myFont, myFont.Style | FontStyle.Italic); | 486 | using (Font errorFont = new Font(m_fontName,6)) |
542 | break; | 487 | { |
543 | case "U": | 488 | graph.DrawString("URL couldn't be resolved or is", errorFont, |
544 | if (!(myFont.Underline)) | 489 | myBrush, startPoint); |
545 | myFont = new Font(myFont, myFont.Style | FontStyle.Underline); | 490 | graph.DrawString("not an image. Please check URL.", errorFont, |
546 | break; | 491 | myBrush, new Point(startPoint.X, 12 + startPoint.Y)); |
547 | case "S": | 492 | } |
548 | if (!(myFont.Strikeout)) | 493 | |
549 | myFont = new Font(myFont, myFont.Style | FontStyle.Strikeout); | 494 | graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); |
550 | break; | 495 | } |
551 | case "R": | ||
552 | myFont = new Font(myFont, FontStyle.Regular); | ||
553 | break; | ||
554 | } | 496 | } |
497 | |||
498 | startPoint.X += endPoint.X; | ||
499 | startPoint.Y += endPoint.Y; | ||
555 | } | 500 | } |
556 | } | 501 | else if (nextLine.StartsWith("Rectangle")) |
557 | else if (nextLine.StartsWith("FontName")) | ||
558 | { | ||
559 | nextLine = nextLine.Remove(0, 8); | ||
560 | fontName = nextLine.Trim(); | ||
561 | myFont = new Font(fontName, fontSize); | ||
562 | } | ||
563 | else if (nextLine.StartsWith("PenSize")) | ||
564 | { | ||
565 | nextLine = nextLine.Remove(0, 7); | ||
566 | nextLine = nextLine.Trim(); | ||
567 | float size = Convert.ToSingle(nextLine, CultureInfo.InvariantCulture); | ||
568 | drawPen.Width = size; | ||
569 | } | ||
570 | else if (nextLine.StartsWith("PenCap")) | ||
571 | { | ||
572 | bool start = true, end = true; | ||
573 | nextLine = nextLine.Remove(0, 6); | ||
574 | nextLine = nextLine.Trim(); | ||
575 | string[] cap = nextLine.Split(partsDelimiter); | ||
576 | if (cap[0].ToLower() == "start") | ||
577 | end = false; | ||
578 | else if (cap[0].ToLower() == "end") | ||
579 | start = false; | ||
580 | else if (cap[0].ToLower() != "both") | ||
581 | return; | ||
582 | string type = cap[1].ToLower(); | ||
583 | |||
584 | if (end) | ||
585 | { | 502 | { |
586 | switch (type) | 503 | float x = 0; |
587 | { | 504 | float y = 0; |
588 | case "arrow": | 505 | GetParams(partsDelimiter, ref nextLine, 9, ref x, ref y); |
589 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor; | 506 | endPoint.X = (int) x; |
590 | break; | 507 | endPoint.Y = (int) y; |
591 | case "round": | 508 | graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); |
592 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.RoundAnchor; | 509 | startPoint.X += endPoint.X; |
593 | break; | 510 | startPoint.Y += endPoint.Y; |
594 | case "diamond": | 511 | } |
595 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.DiamondAnchor; | 512 | else if (nextLine.StartsWith("FillRectangle")) |
596 | break; | 513 | { |
597 | case "flat": | 514 | float x = 0; |
598 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.Flat; | 515 | float y = 0; |
599 | break; | 516 | GetParams(partsDelimiter, ref nextLine, 13, ref x, ref y); |
600 | } | 517 | endPoint.X = (int) x; |
518 | endPoint.Y = (int) y; | ||
519 | graph.FillRectangle(myBrush, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | ||
520 | startPoint.X += endPoint.X; | ||
521 | startPoint.Y += endPoint.Y; | ||
522 | } | ||
523 | else if (nextLine.StartsWith("FillPolygon")) | ||
524 | { | ||
525 | PointF[] points = null; | ||
526 | GetParams(partsDelimiter, ref nextLine, 11, ref points); | ||
527 | graph.FillPolygon(myBrush, points); | ||
601 | } | 528 | } |
602 | if (start) | 529 | else if (nextLine.StartsWith("Polygon")) |
603 | { | 530 | { |
604 | switch (type) | 531 | PointF[] points = null; |
532 | GetParams(partsDelimiter, ref nextLine, 7, ref points); | ||
533 | graph.DrawPolygon(drawPen, points); | ||
534 | } | ||
535 | else if (nextLine.StartsWith("Ellipse")) | ||
536 | { | ||
537 | float x = 0; | ||
538 | float y = 0; | ||
539 | GetParams(partsDelimiter, ref nextLine, 7, ref x, ref y); | ||
540 | endPoint.X = (int)x; | ||
541 | endPoint.Y = (int)y; | ||
542 | graph.DrawEllipse(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); | ||
543 | startPoint.X += endPoint.X; | ||
544 | startPoint.Y += endPoint.Y; | ||
545 | } | ||
546 | else if (nextLine.StartsWith("FontSize")) | ||
547 | { | ||
548 | nextLine = nextLine.Remove(0, 8); | ||
549 | nextLine = nextLine.Trim(); | ||
550 | fontSize = Convert.ToSingle(nextLine, CultureInfo.InvariantCulture); | ||
551 | |||
552 | myFont.Dispose(); | ||
553 | myFont = new Font(fontName, fontSize); | ||
554 | } | ||
555 | else if (nextLine.StartsWith("FontProp")) | ||
556 | { | ||
557 | nextLine = nextLine.Remove(0, 8); | ||
558 | nextLine = nextLine.Trim(); | ||
559 | |||
560 | string[] fprops = nextLine.Split(partsDelimiter); | ||
561 | foreach (string prop in fprops) | ||
605 | { | 562 | { |
606 | case "arrow": | 563 | |
607 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor; | 564 | switch (prop) |
608 | break; | 565 | { |
609 | case "round": | 566 | case "B": |
610 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.RoundAnchor; | 567 | if (!(myFont.Bold)) |
611 | break; | 568 | { |
612 | case "diamond": | 569 | Font newFont = new Font(myFont, myFont.Style | FontStyle.Bold); |
613 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.DiamondAnchor; | 570 | myFont.Dispose(); |
614 | break; | 571 | myFont = newFont; |
615 | case "flat": | 572 | } |
616 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.Flat; | 573 | break; |
617 | break; | 574 | case "I": |
575 | if (!(myFont.Italic)) | ||
576 | { | ||
577 | Font newFont = new Font(myFont, myFont.Style | FontStyle.Italic); | ||
578 | myFont.Dispose(); | ||
579 | myFont = newFont; | ||
580 | } | ||
581 | break; | ||
582 | case "U": | ||
583 | if (!(myFont.Underline)) | ||
584 | { | ||
585 | Font newFont = new Font(myFont, myFont.Style | FontStyle.Underline); | ||
586 | myFont.Dispose(); | ||
587 | myFont = newFont; | ||
588 | } | ||
589 | break; | ||
590 | case "S": | ||
591 | if (!(myFont.Strikeout)) | ||
592 | { | ||
593 | Font newFont = new Font(myFont, myFont.Style | FontStyle.Strikeout); | ||
594 | myFont.Dispose(); | ||
595 | myFont = newFont; | ||
596 | } | ||
597 | break; | ||
598 | case "R": | ||
599 | Font newFont = new Font(myFont, FontStyle.Regular); | ||
600 | myFont.Dispose(); | ||
601 | myFont = newFont; | ||
602 | break; | ||
603 | } | ||
618 | } | 604 | } |
619 | } | 605 | } |
620 | } | 606 | else if (nextLine.StartsWith("FontName")) |
621 | else if (nextLine.StartsWith("PenColour") || nextLine.StartsWith("PenColor")) | ||
622 | { | ||
623 | nextLine = nextLine.Remove(0, 9); | ||
624 | nextLine = nextLine.Trim(); | ||
625 | int hex = 0; | ||
626 | |||
627 | Color newColor; | ||
628 | if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) | ||
629 | { | 607 | { |
630 | newColor = Color.FromArgb(hex); | 608 | nextLine = nextLine.Remove(0, 8); |
609 | fontName = nextLine.Trim(); | ||
610 | myFont.Dispose(); | ||
611 | myFont = new Font(fontName, fontSize); | ||
631 | } | 612 | } |
632 | else | 613 | else if (nextLine.StartsWith("PenSize")) |
633 | { | 614 | { |
634 | // this doesn't fail, it just returns black if nothing is found | 615 | nextLine = nextLine.Remove(0, 7); |
635 | newColor = Color.FromName(nextLine); | 616 | nextLine = nextLine.Trim(); |
617 | float size = Convert.ToSingle(nextLine, CultureInfo.InvariantCulture); | ||
618 | drawPen.Width = size; | ||
636 | } | 619 | } |
620 | else if (nextLine.StartsWith("PenCap")) | ||
621 | { | ||
622 | bool start = true, end = true; | ||
623 | nextLine = nextLine.Remove(0, 6); | ||
624 | nextLine = nextLine.Trim(); | ||
625 | string[] cap = nextLine.Split(partsDelimiter); | ||
626 | if (cap[0].ToLower() == "start") | ||
627 | end = false; | ||
628 | else if (cap[0].ToLower() == "end") | ||
629 | start = false; | ||
630 | else if (cap[0].ToLower() != "both") | ||
631 | return; | ||
632 | string type = cap[1].ToLower(); | ||
633 | |||
634 | if (end) | ||
635 | { | ||
636 | switch (type) | ||
637 | { | ||
638 | case "arrow": | ||
639 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor; | ||
640 | break; | ||
641 | case "round": | ||
642 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.RoundAnchor; | ||
643 | break; | ||
644 | case "diamond": | ||
645 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.DiamondAnchor; | ||
646 | break; | ||
647 | case "flat": | ||
648 | drawPen.EndCap = System.Drawing.Drawing2D.LineCap.Flat; | ||
649 | break; | ||
650 | } | ||
651 | } | ||
652 | if (start) | ||
653 | { | ||
654 | switch (type) | ||
655 | { | ||
656 | case "arrow": | ||
657 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor; | ||
658 | break; | ||
659 | case "round": | ||
660 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.RoundAnchor; | ||
661 | break; | ||
662 | case "diamond": | ||
663 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.DiamondAnchor; | ||
664 | break; | ||
665 | case "flat": | ||
666 | drawPen.StartCap = System.Drawing.Drawing2D.LineCap.Flat; | ||
667 | break; | ||
668 | } | ||
669 | } | ||
670 | } | ||
671 | else if (nextLine.StartsWith("PenColour") || nextLine.StartsWith("PenColor")) | ||
672 | { | ||
673 | nextLine = nextLine.Remove(0, 9); | ||
674 | nextLine = nextLine.Trim(); | ||
675 | int hex = 0; | ||
676 | |||
677 | Color newColor; | ||
678 | if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) | ||
679 | { | ||
680 | newColor = Color.FromArgb(hex); | ||
681 | } | ||
682 | else | ||
683 | { | ||
684 | // this doesn't fail, it just returns black if nothing is found | ||
685 | newColor = Color.FromName(nextLine); | ||
686 | } | ||
637 | 687 | ||
638 | myBrush.Color = newColor; | 688 | myBrush.Color = newColor; |
639 | drawPen.Color = newColor; | 689 | drawPen.Color = newColor; |
690 | } | ||
640 | } | 691 | } |
641 | } | 692 | } |
693 | finally | ||
694 | { | ||
695 | if (drawPen != null) | ||
696 | drawPen.Dispose(); | ||
697 | |||
698 | if (myFont != null) | ||
699 | myFont.Dispose(); | ||
700 | |||
701 | if (myBrush != null) | ||
702 | myBrush.Dispose(); | ||
703 | } | ||
642 | } | 704 | } |
643 | 705 | ||
644 | private static void GetParams(char[] partsDelimiter, ref string line, int startLength, ref float x, ref float y) | 706 | private static void GetParams(char[] partsDelimiter, ref string line, int startLength, ref float x, ref float y) |
@@ -691,7 +753,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
691 | { | 753 | { |
692 | try | 754 | try |
693 | { | 755 | { |
694 | WebRequest request = HttpWebRequest.Create(url); | 756 | WebRequest request = HttpWebRequest.Create(url); |
695 | //Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. | 757 | //Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used. |
696 | //Ckrinke Stream str = null; | 758 | //Ckrinke Stream str = null; |
697 | HttpWebResponse response = (HttpWebResponse)(request).GetResponse(); | 759 | HttpWebResponse response = (HttpWebResponse)(request).GetResponse(); |
@@ -702,7 +764,8 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
702 | } | 764 | } |
703 | } | 765 | } |
704 | catch { } | 766 | catch { } |
767 | |||
705 | return null; | 768 | return null; |
706 | } | 769 | } |
707 | } | 770 | } |
708 | } | 771 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 1eb641d..89e9593 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -154,6 +154,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
154 | 154 | ||
155 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) | 155 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) |
156 | { | 156 | { |
157 | bool close = true; | ||
158 | |||
157 | try | 159 | try |
158 | { | 160 | { |
159 | lock (this) | 161 | lock (this) |
@@ -161,7 +163,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
161 | // Take care of the possibilty that this thread started but was paused just outside the lock before | 163 | // Take care of the possibilty that this thread started but was paused just outside the lock before |
162 | // the final request came in (assuming that such a thing is possible) | 164 | // the final request came in (assuming that such a thing is possible) |
163 | if (m_requestState == RequestState.Completed) | 165 | if (m_requestState == RequestState.Completed) |
166 | { | ||
167 | close = false; | ||
164 | return; | 168 | return; |
169 | } | ||
165 | 170 | ||
166 | m_requestState = RequestState.Aborted; | 171 | m_requestState = RequestState.Aborted; |
167 | } | 172 | } |
@@ -208,7 +213,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
208 | } | 213 | } |
209 | finally | 214 | finally |
210 | { | 215 | { |
211 | m_assetsArchiver.ForceClose(); | 216 | if (close) |
217 | m_assetsArchiver.ForceClose(); | ||
212 | } | 218 | } |
213 | } | 219 | } |
214 | 220 | ||
@@ -242,11 +248,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
242 | 248 | ||
243 | m_requestCallbackTimer.Stop(); | 249 | m_requestCallbackTimer.Stop(); |
244 | 250 | ||
245 | if (m_requestState == RequestState.Aborted) | 251 | if ((m_requestState == RequestState.Aborted) || (m_requestState == RequestState.Completed)) |
246 | { | 252 | { |
247 | m_log.WarnFormat( | 253 | m_log.WarnFormat( |
248 | "[ARCHIVER]: Received information about asset {0} after archive save abortion. Ignoring.", | 254 | "[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.", |
249 | id); | 255 | id, m_requestState); |
250 | 256 | ||
251 | return; | 257 | return; |
252 | } | 258 | } |
@@ -264,7 +270,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
264 | m_notFoundAssetUuids.Add(new UUID(id)); | 270 | m_notFoundAssetUuids.Add(new UUID(id)); |
265 | } | 271 | } |
266 | 272 | ||
267 | if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count == m_repliesRequired) | 273 | if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired) |
268 | { | 274 | { |
269 | m_requestState = RequestState.Completed; | 275 | m_requestState = RequestState.Completed; |
270 | 276 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 672d95a..0b73df5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2283,7 +2283,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2283 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 2283 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
2284 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); | 2284 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); |
2285 | } | 2285 | } |
2286 | 2286 | ||
2287 | group.FromPartID = sourcePart.UUID; | ||
2287 | AddNewSceneObject(group, true, pos, rot, vel); | 2288 | AddNewSceneObject(group, true, pos, rot, vel); |
2288 | 2289 | ||
2289 | // We can only call this after adding the scene object, since the scene object references the scene | 2290 | // We can only call this after adding the scene object, since the scene object references the scene |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 08c7a58..d51281d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.ComponentModel; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.Drawing; | 31 | using System.Drawing; |
31 | using System.IO; | 32 | using System.IO; |
@@ -911,6 +912,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
911 | public UUID FromItemID { get; set; } | 912 | public UUID FromItemID { get; set; } |
912 | 913 | ||
913 | /// <summary> | 914 | /// <summary> |
915 | /// Refers to the SceneObjectPart.UUID property of the object that this object was rezzed from, if applicable. | ||
916 | /// </summary> | ||
917 | /// <remarks> | ||
918 | /// If not applicable will be UUID.Zero | ||
919 | /// </remarks> | ||
920 | public UUID FromPartID { get; set; } | ||
921 | |||
922 | /// <summary> | ||
914 | /// The folder ID that this object was rezzed from, if applicable. | 923 | /// The folder ID that this object was rezzed from, if applicable. |
915 | /// </summary> | 924 | /// </summary> |
916 | /// <remarks> | 925 | /// <remarks> |
@@ -941,6 +950,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
941 | /// The original SceneObjectPart will be used rather than a copy, preserving | 950 | /// The original SceneObjectPart will be used rather than a copy, preserving |
942 | /// its existing localID and UUID. | 951 | /// its existing localID and UUID. |
943 | /// </summary> | 952 | /// </summary> |
953 | /// <param name='part'>Root part for this scene object.</param> | ||
944 | public SceneObjectGroup(SceneObjectPart part) | 954 | public SceneObjectGroup(SceneObjectPart part) |
945 | { | 955 | { |
946 | SetRootPart(part); | 956 | SetRootPart(part); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index bd11cde..ce652b4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3081,7 +3081,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3081 | 3081 | ||
3082 | /// <summary> | 3082 | /// <summary> |
3083 | /// Schedule a terse update for this prim. Terse updates only send position, | 3083 | /// Schedule a terse update for this prim. Terse updates only send position, |
3084 | /// rotation, velocity, rotational velocity and shape information. | 3084 | /// rotation, velocity and rotational velocity information. |
3085 | /// </summary> | 3085 | /// </summary> |
3086 | public void ScheduleTerseUpdate() | 3086 | public void ScheduleTerseUpdate() |
3087 | { | 3087 | { |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 61aaf04..d412cd1 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs | |||
@@ -54,12 +54,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
54 | 54 | ||
55 | private bool m_debugEnabled = false; | 55 | private bool m_debugEnabled = false; |
56 | 56 | ||
57 | public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | | 57 | public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | |
58 | GroupPowers.Accountable | | 58 | GroupPowers.Accountable | |
59 | GroupPowers.JoinChat | | 59 | GroupPowers.JoinChat | |
60 | GroupPowers.AllowVoiceChat | | 60 | GroupPowers.AllowVoiceChat | |
61 | GroupPowers.ReceiveNotices | | 61 | GroupPowers.ReceiveNotices | |
62 | GroupPowers.StartProposal | | 62 | GroupPowers.StartProposal | |
63 | GroupPowers.VoteOnProposal; | 63 | GroupPowers.VoteOnProposal; |
64 | 64 | ||
65 | private bool m_connectorEnabled = false; | 65 | private bool m_connectorEnabled = false; |
@@ -201,8 +201,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
201 | /// <summary> | 201 | /// <summary> |
202 | /// Create a Group, including Everyone and Owners Role, place FounderID in both groups, select Owner as selected role, and newly created group as agent's active role. | 202 | /// Create a Group, including Everyone and Owners Role, place FounderID in both groups, select Owner as selected role, and newly created group as agent's active role. |
203 | /// </summary> | 203 | /// </summary> |
204 | public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, | 204 | public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, |
205 | int membershipFee, bool openEnrollment, bool allowPublish, | 205 | int membershipFee, bool openEnrollment, bool allowPublish, |
206 | bool maturePublish, UUID founderID) | 206 | bool maturePublish, UUID founderID) |
207 | { | 207 | { |
208 | UUID GroupID = UUID.Random(); | 208 | UUID GroupID = UUID.Random(); |
@@ -214,7 +214,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
214 | param["Charter"] = charter; | 214 | param["Charter"] = charter; |
215 | param["ShowInList"] = showInList == true ? 1 : 0; | 215 | param["ShowInList"] = showInList == true ? 1 : 0; |
216 | param["InsigniaID"] = insigniaID.ToString(); | 216 | param["InsigniaID"] = insigniaID.ToString(); |
217 | param["MembershipFee"] = 0; | 217 | param["MembershipFee"] = membershipFee; |
218 | param["OpenEnrollment"] = openEnrollment == true ? 1 : 0; | 218 | param["OpenEnrollment"] = openEnrollment == true ? 1 : 0; |
219 | param["AllowPublish"] = allowPublish == true ? 1 : 0; | 219 | param["AllowPublish"] = allowPublish == true ? 1 : 0; |
220 | param["MaturePublish"] = maturePublish == true ? 1 : 0; | 220 | param["MaturePublish"] = maturePublish == true ? 1 : 0; |
@@ -285,8 +285,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
285 | return UUID.Parse((string)respData["GroupID"]); | 285 | return UUID.Parse((string)respData["GroupID"]); |
286 | } | 286 | } |
287 | 287 | ||
288 | public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, | 288 | public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, |
289 | UUID insigniaID, int membershipFee, bool openEnrollment, | 289 | UUID insigniaID, int membershipFee, bool openEnrollment, |
290 | bool allowPublish, bool maturePublish) | 290 | bool allowPublish, bool maturePublish) |
291 | { | 291 | { |
292 | Hashtable param = new Hashtable(); | 292 | Hashtable param = new Hashtable(); |
@@ -302,7 +302,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
302 | XmlRpcCall(requestingAgentID, "groups.updateGroup", param); | 302 | XmlRpcCall(requestingAgentID, "groups.updateGroup", param); |
303 | } | 303 | } |
304 | 304 | ||
305 | public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, | 305 | public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, |
306 | string title, ulong powers) | 306 | string title, ulong powers) |
307 | { | 307 | { |
308 | Hashtable param = new Hashtable(); | 308 | Hashtable param = new Hashtable(); |
@@ -325,7 +325,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
325 | XmlRpcCall(requestingAgentID, "groups.removeRoleFromGroup", param); | 325 | XmlRpcCall(requestingAgentID, "groups.removeRoleFromGroup", param); |
326 | } | 326 | } |
327 | 327 | ||
328 | public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, | 328 | public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, |
329 | string title, ulong powers) | 329 | string title, ulong powers) |
330 | { | 330 | { |
331 | Hashtable param = new Hashtable(); | 331 | Hashtable param = new Hashtable(); |
@@ -580,7 +580,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
580 | memberships.Add(HashTableToGroupMembershipData((Hashtable)membership)); | 580 | memberships.Add(HashTableToGroupMembershipData((Hashtable)membership)); |
581 | } | 581 | } |
582 | } | 582 | } |
583 | 583 | ||
584 | return memberships; | 584 | return memberships; |
585 | } | 585 | } |
586 | 586 | ||
@@ -800,9 +800,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
800 | 800 | ||
801 | public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID) | 801 | public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID) |
802 | { | 802 | { |
803 | // If we're tracking drops for this group, | 803 | // If we're tracking drops for this group, |
804 | // and we find them, well... then they've dropped | 804 | // and we find them, well... then they've dropped |
805 | return m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID) | 805 | return m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID) |
806 | && m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID); | 806 | && m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID); |
807 | } | 807 | } |
808 | 808 | ||
@@ -888,7 +888,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
888 | 888 | ||
889 | return group; | 889 | return group; |
890 | } | 890 | } |
891 | 891 | ||
892 | private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData) | 892 | private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData) |
893 | { | 893 | { |
894 | GroupMembershipData data = new GroupMembershipData(); | 894 | GroupMembershipData data = new GroupMembershipData(); |
@@ -921,7 +921,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
921 | data.MembershipFee = int.Parse((string)respData["MembershipFee"]); | 921 | data.MembershipFee = int.Parse((string)respData["MembershipFee"]); |
922 | data.OpenEnrollment = ((string)respData["OpenEnrollment"] == "1"); | 922 | data.OpenEnrollment = ((string)respData["OpenEnrollment"] == "1"); |
923 | data.ShowInList = ((string)respData["ShowInList"] == "1"); | 923 | data.ShowInList = ((string)respData["ShowInList"] == "1"); |
924 | 924 | ||
925 | return data; | 925 | return data; |
926 | } | 926 | } |
927 | 927 | ||
@@ -958,7 +958,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
958 | m_memoryCache.TryGetValue(CacheKey, out resp); | 958 | m_memoryCache.TryGetValue(CacheKey, out resp); |
959 | } | 959 | } |
960 | } | 960 | } |
961 | 961 | ||
962 | if (resp == null) | 962 | if (resp == null) |
963 | { | 963 | { |
964 | if (m_debugEnabled) | 964 | if (m_debugEnabled) |
@@ -967,7 +967,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
967 | string UserService; | 967 | string UserService; |
968 | UUID SessionID; | 968 | UUID SessionID; |
969 | GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); | 969 | GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); |
970 | 970 | ||
971 | param.Add("RequestingAgentID", requestingAgentID.ToString()); | 971 | param.Add("RequestingAgentID", requestingAgentID.ToString()); |
972 | param.Add("RequestingAgentUserService", UserService); | 972 | param.Add("RequestingAgentUserService", UserService); |
973 | param.Add("RequestingSessionID", SessionID.ToString()); | 973 | param.Add("RequestingSessionID", SessionID.ToString()); |
@@ -992,9 +992,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
992 | catch (Exception e) | 992 | catch (Exception e) |
993 | { | 993 | { |
994 | m_log.ErrorFormat( | 994 | m_log.ErrorFormat( |
995 | "[XMLRPC-GROUPS-CONNECTOR]: An error has occured while attempting to access the XmlRpcGroups server method {0} at {1}", | 995 | "[XMLRPC-GROUPS-CONNECTOR]: An error has occured while attempting to access the XmlRpcGroups server method {0} at {1}", |
996 | function, m_groupsServerURI); | 996 | function, m_groupsServerURI); |
997 | 997 | ||
998 | m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}{1}", e.Message, e.StackTrace); | 998 | m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}{1}", e.Message, e.StackTrace); |
999 | 999 | ||
1000 | foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) | 1000 | foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) |
@@ -1061,9 +1061,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1061 | } | 1061 | } |
1062 | } | 1062 | } |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | /// <summary> | 1065 | /// <summary> |
1066 | /// Group Request Tokens are an attempt to allow the groups service to authenticate | 1066 | /// Group Request Tokens are an attempt to allow the groups service to authenticate |
1067 | /// requests. | 1067 | /// requests. |
1068 | /// TODO: This broke after the big grid refactor, either find a better way, or discard this | 1068 | /// TODO: This broke after the big grid refactor, either find a better way, or discard this |
1069 | /// </summary> | 1069 | /// </summary> |
@@ -1103,7 +1103,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
1103 | } | 1103 | } |
1104 | */ | 1104 | */ |
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | } | 1107 | } |
1108 | } | 1108 | } |
1109 | 1109 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index a4ab702..ebfd85b 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -1331,13 +1331,15 @@ public sealed class BSPrim : PhysicsActor | |||
1331 | 1331 | ||
1332 | base.RequestPhysicsterseUpdate(); | 1332 | base.RequestPhysicsterseUpdate(); |
1333 | } | 1333 | } |
1334 | /* | ||
1334 | else | 1335 | else |
1335 | { | 1336 | { |
1336 | // For debugging, we can also report the movement of children | 1337 | // For debugging, we also report the movement of children |
1337 | DetailLog("{0},UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}", | 1338 | DetailLog("{0},UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}", |
1338 | LocalID, entprop.Position, entprop.Rotation, entprop.Velocity, | 1339 | LocalID, entprop.Position, entprop.Rotation, entprop.Velocity, |
1339 | entprop.Acceleration, entprop.RotationalVelocity); | 1340 | entprop.Acceleration, entprop.RotationalVelocity); |
1340 | } | 1341 | } |
1342 | */ | ||
1341 | } | 1343 | } |
1342 | 1344 | ||
1343 | // I've collided with something | 1345 | // I've collided with something |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 28d5cb5..011033c 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -390,9 +390,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
390 | // Simulate one timestep | 390 | // Simulate one timestep |
391 | public override float Simulate(float timeStep) | 391 | public override float Simulate(float timeStep) |
392 | { | 392 | { |
393 | int updatedEntityCount; | 393 | int updatedEntityCount = 0; |
394 | IntPtr updatedEntitiesPtr; | 394 | IntPtr updatedEntitiesPtr; |
395 | int collidersCount; | 395 | int collidersCount = 0; |
396 | IntPtr collidersPtr; | 396 | IntPtr collidersPtr; |
397 | 397 | ||
398 | LastSimulatedTimestep = timeStep; | 398 | LastSimulatedTimestep = timeStep; |
@@ -411,8 +411,21 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
411 | 411 | ||
412 | // step the physical world one interval | 412 | // step the physical world one interval |
413 | m_simulationStep++; | 413 | m_simulationStep++; |
414 | int numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep, | 414 | int numSubSteps = 0; |
415 | out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr); | 415 | try |
416 | { | ||
417 | numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep, | ||
418 | out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr); | ||
419 | DetailLog("{0},Simulate,call, substeps={1}, updates={2}, colliders={3}", "0000000000", numSubSteps, updatedEntityCount, collidersCount); | ||
420 | } | ||
421 | catch (Exception e) | ||
422 | { | ||
423 | m_log.WarnFormat("{0},PhysicsStep Exception: substeps={1}, updates={2}, colliders={3}, e={4}", LogHeader, numSubSteps, updatedEntityCount, collidersCount, e); | ||
424 | DetailLog("{0},PhysicsStepException,call, substeps={1}, updates={2}, colliders={3}", "0000000000", numSubSteps, updatedEntityCount, collidersCount); | ||
425 | // updatedEntityCount = 0; | ||
426 | collidersCount = 0; | ||
427 | } | ||
428 | |||
416 | 429 | ||
417 | // Don't have to use the pointers passed back since we know it is the same pinned memory we passed in | 430 | // Don't have to use the pointers passed back since we know it is the same pinned memory we passed in |
418 | 431 | ||
@@ -711,7 +724,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
711 | return true; | 724 | return true; |
712 | } | 725 | } |
713 | 726 | ||
714 | // The calls to the PhysicsActors can't directly call into the physics engine | 727 | // Calls to the PhysicsActors can't directly call into the physics engine |
715 | // because it might be busy. We delay changes to a known time. | 728 | // because it might be busy. We delay changes to a known time. |
716 | // We rely on C#'s closure to save and restore the context for the delegate. | 729 | // We rely on C#'s closure to save and restore the context for the delegate. |
717 | public void TaintedObject(TaintCallback callback) | 730 | public void TaintedObject(TaintCallback callback) |
@@ -1275,5 +1288,11 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
1275 | 1288 | ||
1276 | #endregion Runtime settable parameters | 1289 | #endregion Runtime settable parameters |
1277 | 1290 | ||
1291 | // Invoke the detailed logger and output something if it's enabled. | ||
1292 | private void DetailLog(string msg, params Object[] args) | ||
1293 | { | ||
1294 | PhysicsLogging.Write(msg, args); | ||
1295 | } | ||
1296 | |||
1278 | } | 1297 | } |
1279 | } | 1298 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 1181c10..0bb933c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3362,5 +3362,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3362 | 3362 | ||
3363 | return Math.Max(a, b); | 3363 | return Math.Max(a, b); |
3364 | } | 3364 | } |
3365 | |||
3366 | public LSL_Key osGetRezzingObject() | ||
3367 | { | ||
3368 | CheckThreatLevel(ThreatLevel.None, "osGetRezzingObject"); | ||
3369 | m_host.AddScriptLPS(1); | ||
3370 | |||
3371 | return new LSL_Key(m_host.ParentGroup.FromPartID.ToString()); | ||
3372 | } | ||
3365 | } | 3373 | } |
3366 | } | 3374 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index aba66d3..8c34ed3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -299,5 +299,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
299 | /// <param name="b"></param> | 299 | /// <param name="b"></param> |
300 | /// <returns></returns> | 300 | /// <returns></returns> |
301 | LSL_Float osMax(double a, double b); | 301 | LSL_Float osMax(double a, double b); |
302 | |||
303 | /// <summary> | ||
304 | /// Get the key of the object that rezzed this object. | ||
305 | /// </summary> | ||
306 | /// <returns>Rezzing object key or NULL_KEY if rezzed by agent or otherwise unknown.</returns> | ||
307 | LSL_Key osGetRezzingObject(); | ||
302 | } | 308 | } |
303 | } | 309 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 53daa13..94405d2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -945,5 +945,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
945 | { | 945 | { |
946 | return m_OSSL_Functions.osMax(a, b); | 946 | return m_OSSL_Functions.osMax(a, b); |
947 | } | 947 | } |
948 | |||
949 | public LSL_Key osGetRezzingObject() | ||
950 | { | ||
951 | return m_OSSL_Functions.osGetRezzingObject(); | ||
952 | } | ||
948 | } | 953 | } |
949 | } | 954 | } |
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index 1427e84..96b430d 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs | |||
@@ -194,7 +194,8 @@ namespace OpenSim.Services.AssetService | |||
194 | 194 | ||
195 | public virtual bool Delete(string id) | 195 | public virtual bool Delete(string id) |
196 | { | 196 | { |
197 | m_log.DebugFormat("[ASSET SERVICE]: Deleting asset {0}", id); | 197 | // m_log.DebugFormat("[ASSET SERVICE]: Deleting asset {0}", id); |
198 | |||
198 | UUID assetID; | 199 | UUID assetID; |
199 | if (!UUID.TryParse(id, out assetID)) | 200 | if (!UUID.TryParse(id, out assetID)) |
200 | return false; | 201 | return false; |
diff --git a/OpenSim/Services/AssetService/XAssetService.cs b/OpenSim/Services/AssetService/XAssetService.cs index 05eb125..e62bcb5 100644 --- a/OpenSim/Services/AssetService/XAssetService.cs +++ b/OpenSim/Services/AssetService/XAssetService.cs | |||
@@ -188,7 +188,8 @@ namespace OpenSim.Services.AssetService | |||
188 | 188 | ||
189 | public virtual bool Delete(string id) | 189 | public virtual bool Delete(string id) |
190 | { | 190 | { |
191 | m_log.DebugFormat("[XASSET SERVICE]: Deleting asset {0}", id); | 191 | // m_log.DebugFormat("[XASSET SERVICE]: Deleting asset {0}", id); |
192 | |||
192 | UUID assetID; | 193 | UUID assetID; |
193 | if (!UUID.TryParse(id, out assetID)) | 194 | if (!UUID.TryParse(id, out assetID)) |
194 | return false; | 195 | return false; |