aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/OpenSimMain.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim.RegionServer/OpenSimMain.cs')
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs53
1 files changed, 52 insertions, 1 deletions
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index cb184e8..e26f200 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -48,7 +48,7 @@ using OpenSim.Physics.Manager;
48 48
49namespace OpenSim 49namespace OpenSim
50{ 50{
51 public class OpenSimMain : OpenSimApplication 51 public class OpenSimMain : OpenSimApplication, conscmd_callback
52 { 52 {
53 private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); 53 private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
54 private PhysicsManager physManager; 54 private PhysicsManager physManager;
@@ -67,8 +67,12 @@ namespace OpenSim
67 public bool sandbox = false; 67 public bool sandbox = false;
68 public bool loginserver = false; 68 public bool loginserver = false;
69 69
70 protected ConsoleBase m_console;
71
70 public OpenSimMain() 72 public OpenSimMain()
71 { 73 {
74 m_console = new ConsoleBase("region-console.log", "Region", this);
75 OpenSim.Framework.Console.MainConsole.Instance = m_console;
72 } 76 }
73 77
74 public override void StartUp() 78 public override void StartUp()
@@ -246,6 +250,53 @@ namespace OpenSim
246 { 250 {
247 OpenSimRoot.Instance.LocalWorld.Update(); 251 OpenSimRoot.Instance.LocalWorld.Update();
248 } 252 }
253
254 public void RunCmd(string command, string[] cmdparams)
255 {
256 switch (command)
257 {
258 case "help":
259 m_console.WriteLine("show users - show info about connected users");
260 m_console.WriteLine("shutdown - disconnect all clients and shutdown");
261 m_console.WriteLine("regenerate - regenerate the sim's terrain");
262 break;
263
264 case "show":
265 Show(cmdparams[0]);
266 break;
267
268 case "regenerate":
269 OpenSimRoot.Instance.LocalWorld.RegenerateTerrain();
270 break;
271
272 case "shutdown":
273 OpenSimRoot.Instance.Shutdown();
274 break;
275 }
276 }
277
278 public void Show(string ShowWhat)
279 {
280 switch (ShowWhat)
281 {
282 case "uptime":
283 m_console.WriteLine("OpenSim has been running since " + OpenSimRoot.Instance.startuptime.ToString());
284 m_console.WriteLine("That is " + (DateTime.Now - OpenSimRoot.Instance.startuptime).ToString());
285 break;
286 case "users":
287 OpenSim.world.Avatar TempAv;
288 m_console.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
289 foreach (libsecondlife.LLUUID UUID in OpenSimRoot.Instance.LocalWorld.Entities.Keys)
290 {
291 if (OpenSimRoot.Instance.LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
292 {
293 TempAv = (OpenSim.world.Avatar)OpenSimRoot.Instance.LocalWorld.Entities[UUID];
294 m_console.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
295 }
296 }
297 break;
298 }
299 }
249 } 300 }
250 301
251 302