aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs16
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs8
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs64
4 files changed, 31 insertions, 59 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 2061ab9..fb62504 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -56,7 +56,7 @@ namespace OpenSim
56 56
57 private string m_timedScript = "disabled"; 57 private string m_timedScript = "disabled";
58 private Timer m_scriptTimer; 58 private Timer m_scriptTimer;
59 59
60 /// <summary> 60 /// <summary>
61 /// List of Console Plugin Commands 61 /// List of Console Plugin Commands
62 /// </summary> 62 /// </summary>
@@ -601,11 +601,11 @@ namespace OpenSim
601 break; 601 break;
602 } 602 }
603 } 603 }
604 604
605 public override void ShowHelp(string[] helpArgs) 605 public override void ShowHelp(string[] helpArgs)
606 { 606 {
607 base.ShowHelp(helpArgs); 607 base.ShowHelp(helpArgs);
608 608
609 m_console.Notice("alert - send alert to a designated user or all users."); 609 m_console.Notice("alert - send alert to a designated user or all users.");
610 m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); 610 m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive.");
611 m_console.Notice(" alert general [Message] - send an alert to all users."); 611 m_console.Notice(" alert general [Message] - send an alert to all users.");
@@ -619,7 +619,7 @@ namespace OpenSim
619 m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False"); 619 m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False");
620 m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); 620 m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim");
621 m_console.Notice("export-map [filename] - save image of world map"); 621 m_console.Notice("export-map [filename] - save image of world map");
622 m_console.Notice("force-update - force an update of prims in the scene"); 622 m_console.Notice("force-update - force an update of prims in the scene");
623 m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); 623 m_console.Notice("restart - disconnects all clients and restarts the sims in the instance.");
624 m_console.Notice("remove-region [name] - remove a region"); 624 m_console.Notice("remove-region [name] - remove a region");
625 m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); 625 m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)");
@@ -637,15 +637,15 @@ namespace OpenSim
637 m_console.Notice("config set section field value - set a config value"); 637 m_console.Notice("config set section field value - set a config value");
638 m_console.Notice("config get section field - get a config value"); 638 m_console.Notice("config get section field - get a config value");
639 m_console.Notice("config save - save OpenSim.ini"); 639 m_console.Notice("config save - save OpenSim.ini");
640 m_console.Notice("terrain help - show help for terrain commands."); 640 m_console.Notice("terrain help - show help for terrain commands.");
641 641
642 ShowPluginCommandsHelp(CombineParams(helpArgs, 0), m_console); 642 ShowPluginCommandsHelp(CombineParams(helpArgs, 0), m_console);
643 643
644 if (m_sandbox) 644 if (m_sandbox)
645 { 645 {
646 m_console.Notice(""); 646 m_console.Notice("");
647 m_console.Notice("create user - adds a new user."); 647 m_console.Notice("create user - adds a new user.");
648 } 648 }
649 } 649 }
650 650
651 // see BaseOpenSimServer 651 // see BaseOpenSimServer
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index ef66e93..059255f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -457,7 +457,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
457 public void Close(bool shutdownCircuit) 457 public void Close(bool shutdownCircuit)
458 { 458 {
459 m_clientPingTimer.Enabled = false; 459 m_clientPingTimer.Enabled = false;
460 460
461 m_log.DebugFormat( 461 m_log.DebugFormat(
462 "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", 462 "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}",
463 shutdownCircuit, m_scene.RegionInfo.RegionName); 463 shutdownCircuit, m_scene.RegionInfo.RegionName);
@@ -658,15 +658,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
658 || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) 658 || (m_probesWithNoIngressPackets > 90 && m_clientBlocked))
659 { 659 {
660 m_clientPingTimer.Enabled = false; 660 m_clientPingTimer.Enabled = false;
661 661
662 m_log.WarnFormat( 662 m_log.WarnFormat(
663 "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", 663 "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection",
664 Name, AgentId); 664 Name, AgentId);
665 665
666 if (OnConnectionClosed != null) 666 if (OnConnectionClosed != null)
667 { 667 {
668 OnConnectionClosed(this); 668 OnConnectionClosed(this);
669 } 669 }
670 } 670 }
671 else 671 else
672 { 672 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index 2775241..3071110 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -168,7 +168,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
168 ThrottleCheck(ref TextureThrottle, ref TextureOutgoingPacketQueue, item); 168 ThrottleCheck(ref TextureThrottle, ref TextureOutgoingPacketQueue, item);
169 break; 169 break;
170 case ThrottleOutPacketType.Task: 170 case ThrottleOutPacketType.Task:
171 if((item.throttleType & ThrottleOutPacketType.LowPriority) != 0) 171 if ((item.throttleType & ThrottleOutPacketType.LowPriority) != 0)
172 ThrottleCheck(ref TaskThrottle, ref TaskLowpriorityPacketQueue, item); 172 ThrottleCheck(ref TaskThrottle, ref TaskLowpriorityPacketQueue, item);
173 else 173 else
174 ThrottleCheck(ref TaskThrottle, ref TaskOutgoingPacketQueue, item); 174 ThrottleCheck(ref TaskThrottle, ref TaskOutgoingPacketQueue, item);
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
index 7a1c516..38c52f0 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
@@ -97,7 +97,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
97 DrawObjectVolume(m_scene, mapbmp); 97 DrawObjectVolume(m_scene, mapbmp);
98 } 98 }
99 99
100
101 try 100 try
102 { 101 {
103 imageData = OpenJPEG.EncodeFromImage(mapbmp, true); 102 imageData = OpenJPEG.EncodeFromImage(mapbmp, true);
@@ -153,14 +152,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
153// if (entity is SceneObjectGroup) 152// if (entity is SceneObjectGroup)
154// { 153// {
155// SceneObjectGroup sog = (SceneObjectGroup) entity; 154// SceneObjectGroup sog = (SceneObjectGroup) entity;
156// 155//
157// foreach (SceneObjectPart primitive in sog.Children.Values) 156// foreach (SceneObjectPart primitive in sog.Children.Values)
158// { 157// {
159// int x = (int) (primitive.AbsolutePosition.X - (primitive.Scale.X / 2)); 158// int x = (int) (primitive.AbsolutePosition.X - (primitive.Scale.X / 2));
160// int y = (int) (primitive.AbsolutePosition.Y - (primitive.Scale.Y / 2)); 159// int y = (int) (primitive.AbsolutePosition.Y - (primitive.Scale.Y / 2));
161// int w = (int) primitive.Scale.X; 160// int w = (int) primitive.Scale.X;
162// int h = (int) primitive.Scale.Y; 161// int h = (int) primitive.Scale.Y;
163// 162//
164// int dx; 163// int dx;
165// for (dx = x; dx < x + w; dx++) 164// for (dx = x; dx < x + w; dx++)
166// { 165// {
@@ -171,7 +170,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
171// continue; 170// continue;
172// if (x >= map.Width || y >= map.Height) 171// if (x >= map.Width || y >= map.Height)
173// continue; 172// continue;
174// 173//
175// map.SetPixel(dx, dy, Color.DarkGray); 174// map.SetPixel(dx, dy, Color.DarkGray);
176// } 175// }
177// } 176// }
@@ -189,7 +188,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
189 188
190 double[,] hm = whichScene.Heightmap.GetDoubles(); 189 double[,] hm = whichScene.Heightmap.GetDoubles();
191 bool ShadowDebugContinue = true; 190 bool ShadowDebugContinue = true;
192 191
193 bool terraincorruptedwarningsaid = false; 192 bool terraincorruptedwarningsaid = false;
194 193
195 float low = 255; 194 float low = 255;
@@ -220,13 +219,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
220 //int tc = System.Environment.TickCount; 219 //int tc = System.Environment.TickCount;
221 for (int y = 0; y < 256; y++) 220 for (int y = 0; y < 256; y++)
222 { 221 {
223
224 float heightvalue = (float)hm[x, y]; 222 float heightvalue = (float)hm[x, y];
225 223
226
227 if (heightvalue > (float)whichScene.RegionInfo.RegionSettings.WaterHeight) 224 if (heightvalue > (float)whichScene.RegionInfo.RegionSettings.WaterHeight)
228 { 225 {
229
230 // scale height value 226 // scale height value
231 heightvalue = low + mid * (heightvalue - low) / mid; 227 heightvalue = low + mid * (heightvalue - low) / mid;
232 228
@@ -238,6 +234,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
238 234
239 if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue)) 235 if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
240 heightvalue = 0; 236 heightvalue = 0;
237
241 try 238 try
242 { 239 {
243 Color green = Color.FromArgb((int)heightvalue, 100, (int)heightvalue); 240 Color green = Color.FromArgb((int)heightvalue, 100, (int)heightvalue);
@@ -264,7 +261,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
264 261
265 if (hfdiff > 0.3f) 262 if (hfdiff > 0.3f)
266 { 263 {
267
268 } 264 }
269 else if (hfdiff < -0.3f) 265 else if (hfdiff < -0.3f)
270 { 266 {
@@ -301,15 +297,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
301 mapbmp.SetPixel(x - 1, (256 - y) - 1, Shade); 297 mapbmp.SetPixel(x - 1, (256 - y) - 1, Shade);
302 } 298 }
303 } 299 }
304
305
306 } 300 }
307
308 } 301 }
309
310
311
312
313 } 302 }
314 catch (System.ArgumentException) 303 catch (System.ArgumentException)
315 { 304 {
@@ -367,7 +356,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
367 return mapbmp; 356 return mapbmp;
368 } 357 }
369 358
370
371 private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) 359 private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp)
372 { 360 {
373 int tc = 0; 361 int tc = 0;
@@ -395,7 +383,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
395 if (part == null) 383 if (part == null)
396 continue; 384 continue;
397 385
398
399 // Draw if the object is at least 1 meter wide in any direction 386 // Draw if the object is at least 1 meter wide in any direction
400 if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f) 387 if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f)
401 { 388 {
@@ -459,8 +446,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
459 continue; 446 continue;
460 447
461 // skip prim in non-finite position 448 // skip prim in non-finite position
462 if (Single.IsNaN(pos.X) || Single.IsNaN(pos.Y) || Single.IsInfinity(pos.X) 449 if (Single.IsNaN(pos.X) || Single.IsNaN(pos.Y) ||
463 || Single.IsInfinity(pos.Y)) 450 Single.IsInfinity(pos.X) || Single.IsInfinity(pos.Y))
464 continue; 451 continue;
465 452
466 // Figure out if object is under 256m above the height of the terrain 453 // Figure out if object is under 256m above the height of the terrain
@@ -481,7 +468,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
481 Vector3 scale = new Vector3(); 468 Vector3 scale = new Vector3();
482 Vector3 tScale = new Vector3(); 469 Vector3 tScale = new Vector3();
483 Vector3 axPos = new Vector3(pos.X,pos.Y,pos.Z); 470 Vector3 axPos = new Vector3(pos.X,pos.Y,pos.Z);
484
485 471
486 LLQuaternion llrot = part.GetWorldRotation(); 472 LLQuaternion llrot = part.GetWorldRotation();
487 Quaternion rot = new Quaternion(llrot.W, llrot.X, llrot.Y, llrot.Z); 473 Quaternion rot = new Quaternion(llrot.W, llrot.X, llrot.Y, llrot.Z);
@@ -609,7 +595,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
609 FaceC[3] = vertexes[7]; 595 FaceC[3] = vertexes[7];
610 FaceD[5] = vertexes[7]; 596 FaceD[5] = vertexes[7];
611#endregion 597#endregion
612 598
613 //int wy = 0; 599 //int wy = 0;
614 600
615 //bool breakYN = false; // If we run into an error drawing, break out of the 601 //bool breakYN = false; // If we run into an error drawing, break out of the
@@ -618,14 +604,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
618 ds.brush = new SolidBrush(mapdotspot); 604 ds.brush = new SolidBrush(mapdotspot);
619 //ds.rect = new Rectangle(mapdrawstartX, (255 - mapdrawstartY), mapdrawendX - mapdrawstartX, mapdrawendY - mapdrawstartY); 605 //ds.rect = new Rectangle(mapdrawstartX, (255 - mapdrawstartY), mapdrawendX - mapdrawstartX, mapdrawendY - mapdrawstartY);
620 606
621
622 ds.trns = new face[FaceA.Length]; 607 ds.trns = new face[FaceA.Length];
623 608
624
625
626 for (int i = 0; i < FaceA.Length; i++) 609 for (int i = 0; i < FaceA.Length; i++)
627 { 610 {
628
629 Point[] working = new Point[5]; 611 Point[] working = new Point[5];
630 working[0] = project(FaceA[i], axPos); 612 working[0] = project(FaceA[i], axPos);
631 working[1] = project(FaceB[i], axPos); 613 working[1] = project(FaceB[i], axPos);
@@ -635,20 +617,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
635 617
636 face workingface = new face(); 618 face workingface = new face();
637 workingface.pts = working; 619 workingface.pts = working;
638 620
639 ds.trns[i] = workingface; 621 ds.trns[i] = workingface;
640
641 } 622 }
642 623
643
644
645
646 z_sort.Add(part.LocalId, ds); 624 z_sort.Add(part.LocalId, ds);
647 z_localIDs.Add(part.LocalId); 625 z_localIDs.Add(part.LocalId);
648 z_sortheights.Add(pos.Z); 626 z_sortheights.Add(pos.Z);
649 627
650
651
652 //for (int wx = mapdrawstartX; wx < mapdrawendX; wx++) 628 //for (int wx = mapdrawstartX; wx < mapdrawendX; wx++)
653 //{ 629 //{
654 //for (wy = mapdrawstartY; wy < mapdrawendY; wy++) 630 //for (wy = mapdrawstartY; wy < mapdrawendY; wy++)
@@ -676,20 +652,17 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
676 } // loop over group children 652 } // loop over group children
677 } // entitybase is sceneobject group 653 } // entitybase is sceneobject group
678 } // foreach loop over entities 654 } // foreach loop over entities
679 655
680 float[] sortedZHeights = z_sortheights.ToArray(); 656 float[] sortedZHeights = z_sortheights.ToArray();
681 uint[] sortedlocalIds = z_localIDs.ToArray(); 657 uint[] sortedlocalIds = z_localIDs.ToArray();
682 658
683 // Sort prim by Z position 659 // Sort prim by Z position
684 Array.Sort(sortedZHeights, sortedlocalIds); 660 Array.Sort(sortedZHeights, sortedlocalIds);
685 661
686
687
688 Graphics g = Graphics.FromImage(mapbmp); 662 Graphics g = Graphics.FromImage(mapbmp);
689 663
690 for (int s = 0; s < sortedZHeights.Length; s++) 664 for (int s = 0; s < sortedZHeights.Length; s++)
691 { 665 {
692
693 if (z_sort.ContainsKey(sortedlocalIds[s])) 666 if (z_sort.ContainsKey(sortedlocalIds[s]))
694 { 667 {
695 DrawStruct rectDrawStruct = z_sort[sortedlocalIds[s]]; 668 DrawStruct rectDrawStruct = z_sort[sortedlocalIds[s]];
@@ -701,13 +674,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
701 } 674 }
702 } 675 }
703 676
704
705 g.Dispose(); 677 g.Dispose();
706 } // lock entities objs 678 } // lock entities objs
707 679
708 m_log.Info("[MAPTILE]: Generating Maptile Step 2: Done in " + (System.Environment.TickCount - tc) + " ms"); 680 m_log.Info("[MAPTILE]: Generating Maptile Step 2: Done in " + (System.Environment.TickCount - tc) + " ms");
709 return mapbmp; 681 return mapbmp;
710 } 682 }
683
711 private Point project(Vector3 point3d, Vector3 originpos) 684 private Point project(Vector3 point3d, Vector3 originpos)
712 { 685 {
713 Point returnpt = new Point(); 686 Point returnpt = new Point();
@@ -716,12 +689,11 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
716 689
717 //Vector3 topos = new Vector3(0, 0, 0); 690 //Vector3 topos = new Vector3(0, 0, 0);
718 // float z = -point3d.z - topos.z; 691 // float z = -point3d.z - topos.z;
719 692
720 returnpt.X = (int)point3d.x;//(int)((topos.x - point3d.x) / z * d); 693 returnpt.X = (int)point3d.x;//(int)((topos.x - point3d.x) / z * d);
721 returnpt.Y = (int)(255 - point3d.y);//(int)(255 - (((topos.y - point3d.y) / z * d))); 694 returnpt.Y = (int)(255 - point3d.y);//(int)(255 - (((topos.y - point3d.y) / z * d)));
722 695
723 return returnpt; 696 return returnpt;
724
725 } 697 }
726 698
727// TODO: unused: 699// TODO: unused:
@@ -729,17 +701,17 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
729// private Bitmap TerrainToBitmap(string gradientmap) 701// private Bitmap TerrainToBitmap(string gradientmap)
730// { 702// {
731// Bitmap gradientmapLd = new Bitmap(gradientmap); 703// Bitmap gradientmapLd = new Bitmap(gradientmap);
732// 704//
733// int pallete = gradientmapLd.Height; 705// int pallete = gradientmapLd.Height;
734// 706//
735// Bitmap bmp = new Bitmap(m_scene.Heightmap.Width, m_scene.Heightmap.Height); 707// Bitmap bmp = new Bitmap(m_scene.Heightmap.Width, m_scene.Heightmap.Height);
736// Color[] colours = new Color[pallete]; 708// Color[] colours = new Color[pallete];
737// 709//
738// for (int i = 0; i < pallete; i++) 710// for (int i = 0; i < pallete; i++)
739// { 711// {
740// colours[i] = gradientmapLd.GetPixel(0, i); 712// colours[i] = gradientmapLd.GetPixel(0, i);
741// } 713// }
742// 714//
743// lock (m_scene.Heightmap) 715// lock (m_scene.Heightmap)
744// { 716// {
745// ITerrainChannel copy = m_scene.Heightmap; 717// ITerrainChannel copy = m_scene.Heightmap;
@@ -749,7 +721,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
749// { 721// {
750// // 512 is the largest possible height before colours clamp 722// // 512 is the largest possible height before colours clamp
751// int colorindex = (int) (Math.Max(Math.Min(1.0, copy[x, y] / 512.0), 0.0) * (pallete - 1)); 723// int colorindex = (int) (Math.Max(Math.Min(1.0, copy[x, y] / 512.0), 0.0) * (pallete - 1));
752// 724//
753// // Handle error conditions 725// // Handle error conditions
754// if (colorindex > pallete - 1 || colorindex < 0) 726// if (colorindex > pallete - 1 || colorindex < 0)
755// bmp.SetPixel(x, copy.Height - y - 1, Color.Red); 727// bmp.SetPixel(x, copy.Height - y - 1, Color.Red);