From bea7d4d81ad7a75706305be6c8ca06f8dc6e6eca Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 19 Aug 2008 02:59:27 +0000 Subject: Update svn properties, formatting cleanup. --- OpenSim/Region/Application/OpenSim.cs | 16 +++--- .../Region/ClientStack/LindenUDP/LLClientView.cs | 8 +-- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 2 +- .../Modules/World/WorldMap/MapImageModule.cs | 64 ++++++---------------- 4 files changed, 31 insertions(+), 59 deletions(-) (limited to 'OpenSim/Region') 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 private string m_timedScript = "disabled"; private Timer m_scriptTimer; - + /// /// List of Console Plugin Commands /// @@ -601,11 +601,11 @@ namespace OpenSim break; } } - + public override void ShowHelp(string[] helpArgs) { base.ShowHelp(helpArgs); - + m_console.Notice("alert - send alert to a designated user or all users."); m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); m_console.Notice(" alert general [Message] - send an alert to all users."); @@ -619,7 +619,7 @@ namespace OpenSim m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False"); m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim"); m_console.Notice("export-map [filename] - save image of world map"); - m_console.Notice("force-update - force an update of prims in the scene"); + m_console.Notice("force-update - force an update of prims in the scene"); m_console.Notice("restart - disconnects all clients and restarts the sims in the instance."); m_console.Notice("remove-region [name] - remove a region"); m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)"); @@ -637,15 +637,15 @@ namespace OpenSim m_console.Notice("config set section field value - set a config value"); m_console.Notice("config get section field - get a config value"); m_console.Notice("config save - save OpenSim.ini"); - m_console.Notice("terrain help - show help for terrain commands."); - + m_console.Notice("terrain help - show help for terrain commands."); + ShowPluginCommandsHelp(CombineParams(helpArgs, 0), m_console); - + if (m_sandbox) { m_console.Notice(""); m_console.Notice("create user - adds a new user."); - } + } } // 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 public void Close(bool shutdownCircuit) { m_clientPingTimer.Enabled = false; - + m_log.DebugFormat( "[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}", shutdownCircuit, m_scene.RegionInfo.RegionName); @@ -658,15 +658,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP || (m_probesWithNoIngressPackets > 90 && m_clientBlocked)) { m_clientPingTimer.Enabled = false; - + m_log.WarnFormat( "[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection", Name, AgentId); - + if (OnConnectionClosed != null) { OnConnectionClosed(this); - } + } } else { 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 ThrottleCheck(ref TextureThrottle, ref TextureOutgoingPacketQueue, item); break; case ThrottleOutPacketType.Task: - if((item.throttleType & ThrottleOutPacketType.LowPriority) != 0) + if ((item.throttleType & ThrottleOutPacketType.LowPriority) != 0) ThrottleCheck(ref TaskThrottle, ref TaskLowpriorityPacketQueue, item); else 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 DrawObjectVolume(m_scene, mapbmp); } - try { imageData = OpenJPEG.EncodeFromImage(mapbmp, true); @@ -153,14 +152,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // if (entity is SceneObjectGroup) // { // SceneObjectGroup sog = (SceneObjectGroup) entity; -// +// // foreach (SceneObjectPart primitive in sog.Children.Values) // { // int x = (int) (primitive.AbsolutePosition.X - (primitive.Scale.X / 2)); // int y = (int) (primitive.AbsolutePosition.Y - (primitive.Scale.Y / 2)); // int w = (int) primitive.Scale.X; // int h = (int) primitive.Scale.Y; -// +// // int dx; // for (dx = x; dx < x + w; dx++) // { @@ -171,7 +170,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // continue; // if (x >= map.Width || y >= map.Height) // continue; -// +// // map.SetPixel(dx, dy, Color.DarkGray); // } // } @@ -189,7 +188,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap double[,] hm = whichScene.Heightmap.GetDoubles(); bool ShadowDebugContinue = true; - + bool terraincorruptedwarningsaid = false; float low = 255; @@ -220,13 +219,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //int tc = System.Environment.TickCount; for (int y = 0; y < 256; y++) { - float heightvalue = (float)hm[x, y]; - if (heightvalue > (float)whichScene.RegionInfo.RegionSettings.WaterHeight) { - // scale height value heightvalue = low + mid * (heightvalue - low) / mid; @@ -238,6 +234,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue)) heightvalue = 0; + try { Color green = Color.FromArgb((int)heightvalue, 100, (int)heightvalue); @@ -264,7 +261,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap if (hfdiff > 0.3f) { - } else if (hfdiff < -0.3f) { @@ -301,15 +297,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap mapbmp.SetPixel(x - 1, (256 - y) - 1, Shade); } } - - } - } - - - - } catch (System.ArgumentException) { @@ -367,7 +356,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap return mapbmp; } - private Bitmap DrawObjectVolume(Scene whichScene, Bitmap mapbmp) { int tc = 0; @@ -395,7 +383,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap if (part == null) continue; - // Draw if the object is at least 1 meter wide in any direction if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f) { @@ -459,8 +446,8 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap continue; // skip prim in non-finite position - if (Single.IsNaN(pos.X) || Single.IsNaN(pos.Y) || Single.IsInfinity(pos.X) - || Single.IsInfinity(pos.Y)) + if (Single.IsNaN(pos.X) || Single.IsNaN(pos.Y) || + Single.IsInfinity(pos.X) || Single.IsInfinity(pos.Y)) continue; // Figure out if object is under 256m above the height of the terrain @@ -481,7 +468,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap Vector3 scale = new Vector3(); Vector3 tScale = new Vector3(); Vector3 axPos = new Vector3(pos.X,pos.Y,pos.Z); - LLQuaternion llrot = part.GetWorldRotation(); Quaternion rot = new Quaternion(llrot.W, llrot.X, llrot.Y, llrot.Z); @@ -609,7 +595,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap FaceC[3] = vertexes[7]; FaceD[5] = vertexes[7]; #endregion - + //int wy = 0; //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 ds.brush = new SolidBrush(mapdotspot); //ds.rect = new Rectangle(mapdrawstartX, (255 - mapdrawstartY), mapdrawendX - mapdrawstartX, mapdrawendY - mapdrawstartY); - ds.trns = new face[FaceA.Length]; - - - + for (int i = 0; i < FaceA.Length; i++) { - Point[] working = new Point[5]; working[0] = project(FaceA[i], axPos); working[1] = project(FaceB[i], axPos); @@ -635,20 +617,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap face workingface = new face(); workingface.pts = working; - + ds.trns[i] = workingface; - } - - - z_sort.Add(part.LocalId, ds); z_localIDs.Add(part.LocalId); z_sortheights.Add(pos.Z); - - //for (int wx = mapdrawstartX; wx < mapdrawendX; wx++) //{ //for (wy = mapdrawstartY; wy < mapdrawendY; wy++) @@ -676,20 +652,17 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } // loop over group children } // entitybase is sceneobject group } // foreach loop over entities - + float[] sortedZHeights = z_sortheights.ToArray(); uint[] sortedlocalIds = z_localIDs.ToArray(); // Sort prim by Z position Array.Sort(sortedZHeights, sortedlocalIds); - - Graphics g = Graphics.FromImage(mapbmp); for (int s = 0; s < sortedZHeights.Length; s++) { - if (z_sort.ContainsKey(sortedlocalIds[s])) { DrawStruct rectDrawStruct = z_sort[sortedlocalIds[s]]; @@ -701,13 +674,13 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap } } - g.Dispose(); } // lock entities objs m_log.Info("[MAPTILE]: Generating Maptile Step 2: Done in " + (System.Environment.TickCount - tc) + " ms"); return mapbmp; } + private Point project(Vector3 point3d, Vector3 originpos) { Point returnpt = new Point(); @@ -716,12 +689,11 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap //Vector3 topos = new Vector3(0, 0, 0); // float z = -point3d.z - topos.z; - + returnpt.X = (int)point3d.x;//(int)((topos.x - point3d.x) / z * d); returnpt.Y = (int)(255 - point3d.y);//(int)(255 - (((topos.y - point3d.y) / z * d))); return returnpt; - } // TODO: unused: @@ -729,17 +701,17 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // private Bitmap TerrainToBitmap(string gradientmap) // { // Bitmap gradientmapLd = new Bitmap(gradientmap); -// +// // int pallete = gradientmapLd.Height; -// +// // Bitmap bmp = new Bitmap(m_scene.Heightmap.Width, m_scene.Heightmap.Height); // Color[] colours = new Color[pallete]; -// +// // for (int i = 0; i < pallete; i++) // { // colours[i] = gradientmapLd.GetPixel(0, i); // } -// +// // lock (m_scene.Heightmap) // { // ITerrainChannel copy = m_scene.Heightmap; @@ -749,7 +721,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap // { // // 512 is the largest possible height before colours clamp // int colorindex = (int) (Math.Max(Math.Min(1.0, copy[x, y] / 512.0), 0.0) * (pallete - 1)); -// +// // // Handle error conditions // if (colorindex > pallete - 1 || colorindex < 0) // bmp.SetPixel(x, copy.Height - y - 1, Color.Red); -- cgit v1.1