aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorMelanie2012-05-27 19:24:30 +0100
committerMelanie2012-05-27 19:24:30 +0100
commit884c0e7bb10bd2c2a951901c6f1dd56a86ef6b9f (patch)
treedd692a54213f86fd64bd29c6662584df85088193 /OpenSim/Region/CoreModules/World
parentMerge branch 'master' into careminster (diff)
parentminor: code formatting from 0b72f773 (diff)
downloadopensim-SC_OLD-884c0e7bb10bd2c2a951901c6f1dd56a86ef6b9f.zip
opensim-SC_OLD-884c0e7bb10bd2c2a951901c6f1dd56a86ef6b9f.tar.gz
opensim-SC_OLD-884c0e7bb10bd2c2a951901c6f1dd56a86ef6b9f.tar.bz2
opensim-SC_OLD-884c0e7bb10bd2c2a951901c6f1dd56a86ef6b9f.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Data/MySQL/MySQLSimulationData.cs OpenSim/Data/MySQL/Resources/RegionStore.migrations OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs155
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/TIFF.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs28
4 files changed, 175 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 504f09b..4edaaca 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -428,9 +428,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
428 s = sw.ToString(); 428 s = sw.ToString();
429 } 429 }
430 430
431 if (m_scene != null) 431// if (m_scene != null)
432 Console.WriteLine( 432// Console.WriteLine(
433 "[ARCHIVE WRITE REQUEST PREPARATION]: Control file for {0} is: {1}", m_scene.RegionInfo.RegionName, s); 433// "[ARCHIVE WRITE REQUEST PREPARATION]: Control file for {0} is: {1}", m_scene.RegionInfo.RegionName, s);
434 434
435 return s; 435 return s;
436 } 436 }
diff --git a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs
new file mode 100644
index 0000000..2838e0c
--- /dev/null
+++ b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs
@@ -0,0 +1,155 @@
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
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using System.Text;
32using System.Text.RegularExpressions;
33using log4net;
34using Mono.Addins;
35using NDesk.Options;
36using Nini.Config;
37using OpenMetaverse;
38using OpenSim.Framework;
39using OpenSim.Framework.Console;
40using OpenSim.Framework.Statistics;
41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes;
43
44namespace OpenSim.Region.CoreModules.World.Objects.Commands
45{
46 /// <summary>
47 /// A module that holds commands for manipulating objects in the scene.
48 /// </summary>
49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RegionCommandsModule")]
50 public class RegionCommandsModule : INonSharedRegionModule
51 {
52 private Scene m_scene;
53 private ICommandConsole m_console;
54
55 public string Name { get { return "Region Commands Module"; } }
56
57 public Type ReplaceableInterface { get { return null; } }
58
59 public void Initialise(IConfigSource source)
60 {
61// m_log.DebugFormat("[REGION COMMANDS MODULE]: INITIALIZED MODULE");
62 }
63
64 public void PostInitialise()
65 {
66// m_log.DebugFormat("[REGION COMMANDS MODULE]: POST INITIALIZED MODULE");
67 }
68
69 public void Close()
70 {
71// m_log.DebugFormat("[REGION COMMANDS MODULE]: CLOSED MODULE");
72 }
73
74 public void AddRegion(Scene scene)
75 {
76// m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
77
78 m_scene = scene;
79 m_console = MainConsole.Instance;
80
81 m_console.Commands.AddCommand(
82 "Regions", false, "show scene",
83 "show scene",
84 "Show live scene information for the currently selected region.", HandleShowScene);
85 }
86
87 public void RemoveRegion(Scene scene)
88 {
89// m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
90 }
91
92 public void RegionLoaded(Scene scene)
93 {
94// m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
95 }
96
97 private void HandleShowScene(string module, string[] cmd)
98 {
99 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
100 return;
101
102 SimStatsReporter r = m_scene.StatsReporter;
103 float[] stats = r.LastReportedSimStats;
104
105 float timeDilation = stats[0];
106 float simFps = stats[1];
107 float physicsFps = stats[2];
108 float agentUpdates = stats[3];
109 float rootAgents = stats[4];
110 float childAgents = stats[5];
111 float totalPrims = stats[6];
112 float activePrims = stats[7];
113 float totalFrameTime = stats[8];
114// float netFrameTime = stats.StatsBlock[9].StatValue; // Ignored - not used by OpenSimulator
115 float physicsFrameTime = stats[10];
116 float otherFrameTime = stats[11];
117// float imageFrameTime = stats.StatsBlock[12].StatValue; // Ignored
118 float inPacketsPerSecond = stats[13];
119 float outPacketsPerSecond = stats[14];
120 float unackedBytes = stats[15];
121// float agentFrameTime = stats.StatsBlock[16].StatValue; // Not really used
122 float pendingDownloads = stats[17];
123 float pendingUploads = stats[18];
124 float activeScripts = stats[19];
125 float scriptLinesPerSecond = stats[20];
126
127 StringBuilder sb = new StringBuilder();
128 sb.AppendFormat("Scene statistics for {0}\n", m_scene.RegionInfo.RegionName);
129
130 ConsoleDisplayList dispList = new ConsoleDisplayList();
131 dispList.AddRow("Time Dilation", timeDilation);
132 dispList.AddRow("Sim FPS", simFps);
133 dispList.AddRow("Physics FPS", physicsFps);
134 dispList.AddRow("Avatars", rootAgents);
135 dispList.AddRow("Child agents", childAgents);
136 dispList.AddRow("Total prims", totalPrims);
137 dispList.AddRow("Scripts", activeScripts);
138 dispList.AddRow("Script lines processed per second", scriptLinesPerSecond);
139 dispList.AddRow("Physics enabled prims", activePrims);
140 dispList.AddRow("Total frame time", totalFrameTime);
141 dispList.AddRow("Physics frame time", physicsFrameTime);
142 dispList.AddRow("Other frame time", otherFrameTime);
143 dispList.AddRow("Agent Updates per second", agentUpdates);
144 dispList.AddRow("Packets processed from clients per second", inPacketsPerSecond);
145 dispList.AddRow("Packets sent to clients per second", outPacketsPerSecond);
146 dispList.AddRow("Bytes unacknowledged by clients", unackedBytes);
147 dispList.AddRow("Pending asset downloads to clients", pendingDownloads);
148 dispList.AddRow("Pending asset uploads from clients", pendingUploads);
149
150 dispList.AddToStringBuilder(sb);
151
152 MainConsole.Instance.Output(sb.ToString());
153 }
154 }
155} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/TIFF.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/TIFF.cs
index 5d2f893..b416b82 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/TIFF.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/TIFF.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
59 } 59 }
60 60
61 //Returns true if this extension is supported for terrain save-tile 61 //Returns true if this extension is supported for terrain save-tile
62 public bool SupportsTileSave() 62 public override bool SupportsTileSave()
63 { 63 {
64 return false; 64 return false;
65 } 65 }
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs
index 1ebf916..71c71e6 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
65 bool eof = false; 65 bool eof = false;
66 66
67 int fileXPoints = 0; 67 int fileXPoints = 0;
68 int fileYPoints = 0; 68// int fileYPoints = 0;
69 69
70 // Terragen file 70 // Terragen file
71 while (eof == false) 71 while (eof == false)
@@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
75 { 75 {
76 case "SIZE": 76 case "SIZE":
77 fileXPoints = bs.ReadInt16() + 1; 77 fileXPoints = bs.ReadInt16() + 1;
78 fileYPoints = fileXPoints; 78// fileYPoints = fileXPoints;
79 bs.ReadInt16(); 79 bs.ReadInt16();
80 break; 80 break;
81 case "XPTS": 81 case "XPTS":
@@ -83,7 +83,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
83 bs.ReadInt16(); 83 bs.ReadInt16();
84 break; 84 break;
85 case "YPTS": 85 case "YPTS":
86 fileYPoints = bs.ReadInt16(); 86// fileYPoints = bs.ReadInt16();
87 bs.ReadInt16();
87 bs.ReadInt16(); 88 bs.ReadInt16();
88 break; 89 break;
89 case "ALTW": 90 case "ALTW":
@@ -164,10 +165,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
164 bool eof = false; 165 bool eof = false;
165 if (Encoding.ASCII.GetString(bs.ReadBytes(16)) == "TERRAGENTERRAIN ") 166 if (Encoding.ASCII.GetString(bs.ReadBytes(16)) == "TERRAGENTERRAIN ")
166 { 167 {
167 168// int fileWidth = w;
168 int fileWidth = w; 169// int fileHeight = h;
169 int fileHeight = h;
170
171 170
172 // Terragen file 171 // Terragen file
173 while (eof == false) 172 while (eof == false)
@@ -176,17 +175,22 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
176 switch (tmp) 175 switch (tmp)
177 { 176 {
178 case "SIZE": 177 case "SIZE":
179 int sztmp = bs.ReadInt16() + 1; 178// int sztmp = bs.ReadInt16() + 1;
180 fileWidth = sztmp; 179// fileWidth = sztmp;
181 fileHeight = sztmp; 180// fileHeight = sztmp;
181 bs.ReadInt16();
182 bs.ReadInt16();
183 bs.ReadInt16();
182 bs.ReadInt16(); 184 bs.ReadInt16();
183 break; 185 break;
184 case "XPTS": 186 case "XPTS":
185 fileWidth = bs.ReadInt16(); 187// fileWidth = bs.ReadInt16();
188 bs.ReadInt16();
186 bs.ReadInt16(); 189 bs.ReadInt16();
187 break; 190 break;
188 case "YPTS": 191 case "YPTS":
189 fileHeight = bs.ReadInt16(); 192// fileHeight = bs.ReadInt16();
193 bs.ReadInt16();
190 bs.ReadInt16(); 194 bs.ReadInt16();
191 break; 195 break;
192 case "ALTW": 196 case "ALTW":