aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
authorAdam Frisby2008-05-02 16:41:08 +0000
committerAdam Frisby2008-05-02 16:41:08 +0000
commit29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71 (patch)
tree848ce119d9b87bc186c20b08cc604de50a872b31 /OpenSim/Region/Application
parent* Refactored ClientView into LLClientView. Removed all direct references to U... (diff)
downloadopensim-SC-29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71.zip
opensim-SC-29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71.tar.gz
opensim-SC-29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71.tar.bz2
opensim-SC-29b8c84ceaaeca80bfa9c0bfc8c31e421e39ef71.tar.xz
* Commit 2/3 - Please dont attempt to update to this revision until all 3 are in.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs27
-rw-r--r--OpenSim/Region/Application/OpenSimMainConsole.cs60
2 files changed, 19 insertions, 68 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index c4c0eb4..1f67c6a 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -40,6 +40,7 @@ using OpenSim.Framework.Communications.Cache;
40using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
41using OpenSim.Framework.Statistics; 41using OpenSim.Framework.Statistics;
42using OpenSim.Region.ClientStack; 42using OpenSim.Region.ClientStack;
43using OpenSim.Region.ClientStack.LindenUDP;
43using OpenSim.Region.Communications.Local; 44using OpenSim.Region.Communications.Local;
44using OpenSim.Region.Communications.OGS1; 45using OpenSim.Region.Communications.OGS1;
45using OpenSim.Region.Environment; 46using OpenSim.Region.Environment;
@@ -70,7 +71,7 @@ namespace OpenSim
70 71
71 protected string m_storageDll; 72 protected string m_storageDll;
72 73
73 protected List<UDPServer> m_udpServers = new List<UDPServer>(); 74 protected List<IClientNetworkServer> m_clientServers = new List<IClientNetworkServer>();
74 protected List<RegionInfo> m_regionData = new List<RegionInfo>(); 75 protected List<RegionInfo> m_regionData = new List<RegionInfo>();
75 76
76 protected bool m_physicalPrim; 77 protected bool m_physicalPrim;
@@ -105,9 +106,9 @@ namespace OpenSim
105 get { return m_httpServer; } 106 get { return m_httpServer; }
106 } 107 }
107 108
108 public List<UDPServer> UdpServers 109 public List<IClientNetworkServer> UdpServers
109 { 110 {
110 get { return m_udpServers; } 111 get { return m_clientServers; }
111 } 112 }
112 113
113 public List<RegionInfo> RegionData 114 public List<RegionInfo> RegionData
@@ -327,7 +328,7 @@ namespace OpenSim
327 328
328 // We are done with startup 329 // We are done with startup
329 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}", 330 m_log.InfoFormat("[OPENSIM MAIN]: Startup complete, serving {0} region{1}",
330 m_udpServers.Count.ToString(), m_udpServers.Count > 1 ? "s" : ""); 331 m_clientServers.Count.ToString(), m_clientServers.Count > 1 ? "s" : "");
331 WorldHasComeToAnEnd.WaitOne(); 332 WorldHasComeToAnEnd.WaitOne();
332 m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye."); 333 m_log.Info("[OPENSIM MAIN]: Shutdown complete, goodbye.");
333 Environment.Exit(0); 334 Environment.Exit(0);
@@ -452,7 +453,7 @@ namespace OpenSim
452 /// <param name="regionInfo"></param> 453 /// <param name="regionInfo"></param>
453 /// <param name="portadd_flag"></param> 454 /// <param name="portadd_flag"></param>
454 /// <returns></returns> 455 /// <returns></returns>
455 public UDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag) 456 public LLUDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag)
456 { 457 {
457 return CreateRegion(regionInfo, portadd_flag, false); 458 return CreateRegion(regionInfo, portadd_flag, false);
458 } 459 }
@@ -463,7 +464,7 @@ namespace OpenSim
463 /// <param name="regionInfo"></param> 464 /// <param name="regionInfo"></param>
464 /// <param name="portadd_flag"></param> 465 /// <param name="portadd_flag"></param>
465 /// <returns></returns> 466 /// <returns></returns>
466 public UDPServer CreateRegion(RegionInfo regionInfo) 467 public LLUDPServer CreateRegion(RegionInfo regionInfo)
467 { 468 {
468 return CreateRegion(regionInfo, false, true); 469 return CreateRegion(regionInfo, false, true);
469 } 470 }
@@ -475,7 +476,7 @@ namespace OpenSim
475 /// <param name="portadd_flag"></param> 476 /// <param name="portadd_flag"></param>
476 /// <param name="do_post_init"></param> 477 /// <param name="do_post_init"></param>
477 /// <returns></returns> 478 /// <returns></returns>
478 public UDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init) 479 public LLUDPServer CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init)
479 { 480 {
480 int port = regionInfo.InternalEndPoint.Port; 481 int port = regionInfo.InternalEndPoint.Port;
481 482
@@ -495,7 +496,7 @@ namespace OpenSim
495 Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName); 496 Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName);
496 } 497 }
497 498
498 UDPServer udpServer; 499 LLUDPServer udpServer;
499 Scene scene = SetupScene(regionInfo, proxyOffset, out udpServer, m_permissions); 500 Scene scene = SetupScene(regionInfo, proxyOffset, out udpServer, m_permissions);
500 501
501 m_log.Info("[MODULES]: Loading Region's modules"); 502 m_log.Info("[MODULES]: Loading Region's modules");
@@ -548,7 +549,7 @@ namespace OpenSim
548 549
549 m_sceneManager.Add(scene); 550 m_sceneManager.Add(scene);
550 551
551 m_udpServers.Add(udpServer); 552 m_clientServers.Add(udpServer);
552 m_regionData.Add(regionInfo); 553 m_regionData.Add(regionInfo);
553 udpServer.ServerListener(); 554 udpServer.ServerListener();
554 555
@@ -586,9 +587,9 @@ namespace OpenSim
586 bool foundUDPServer = false; 587 bool foundUDPServer = false;
587 int UDPServerElement = 0; 588 int UDPServerElement = 0;
588 589
589 for (int i = 0; i < m_udpServers.Count; i++) 590 for (int i = 0; i < m_clientServers.Count; i++)
590 { 591 {
591 if (m_udpServers[i].RegionHandle == whichRegion.RegionHandle) 592 if (m_clientServers[i].HandlesRegion(new Location(whichRegion.RegionHandle)))
592 { 593 {
593 UDPServerElement = i; 594 UDPServerElement = i;
594 foundUDPServer = true; 595 foundUDPServer = true;
@@ -598,8 +599,8 @@ namespace OpenSim
598 if (foundUDPServer) 599 if (foundUDPServer)
599 { 600 {
600 // m_udpServers[UDPServerElement].Server.End 601 // m_udpServers[UDPServerElement].Server.End
601 m_udpServers[UDPServerElement].Server.Close(); 602 m_clientServers[UDPServerElement].Server.Close();
602 m_udpServers.RemoveAt(UDPServerElement); 603 m_clientServers.RemoveAt(UDPServerElement);
603 } 604 }
604 605
605 //Removing the region from the sim's database of regions.. 606 //Removing the region from the sim's database of regions..
diff --git a/OpenSim/Region/Application/OpenSimMainConsole.cs b/OpenSim/Region/Application/OpenSimMainConsole.cs
index e727d63..586e2cb 100644
--- a/OpenSim/Region/Application/OpenSimMainConsole.cs
+++ b/OpenSim/Region/Application/OpenSimMainConsole.cs
@@ -32,14 +32,13 @@ using System.IO;
32using System.Net; 32using System.Net;
33using System.Reflection; 33using System.Reflection;
34using System.Threading; 34using System.Threading;
35using System.Timers;
36using libsecondlife; 35using libsecondlife;
37using log4net; 36using log4net;
38using Nini.Config; 37using Nini.Config;
39using OpenSim.Framework; 38using OpenSim.Framework;
40using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
41using OpenSim.Framework.Statistics; 40using OpenSim.Framework.Statistics;
42using OpenSim.Region.ClientStack; 41using OpenSim.Region.ClientStack.LindenUDP;
43using OpenSim.Region.Environment.Interfaces; 42using OpenSim.Region.Environment.Interfaces;
44using OpenSim.Region.Environment.Scenes; 43using OpenSim.Region.Environment.Scenes;
45using Timer=System.Timers.Timer; 44using Timer=System.Timers.Timer;
@@ -111,8 +110,8 @@ namespace OpenSim
111 { 110 {
112 m_scriptTimer = new Timer(); 111 m_scriptTimer = new Timer();
113 m_scriptTimer.Enabled = true; 112 m_scriptTimer.Enabled = true;
114 m_scriptTimer.Interval = (int)(1200 * 1000); 113 m_scriptTimer.Interval = 1200 * 1000;
115 m_scriptTimer.Elapsed += new ElapsedEventHandler(RunAutoTimerScript); 114 m_scriptTimer.Elapsed += RunAutoTimerScript;
116 } 115 }
117 PrintFileToConsole("startuplogo.txt"); 116 PrintFileToConsole("startuplogo.txt");
118 } 117 }
@@ -156,7 +155,7 @@ namespace OpenSim
156 if (File.Exists(fileName)) 155 if (File.Exists(fileName))
157 { 156 {
158 StreamReader readFile = File.OpenText(fileName); 157 StreamReader readFile = File.OpenText(fileName);
159 string currentCommand = String.Empty; 158 string currentCommand;
160 while ((currentCommand = readFile.ReadLine()) != null) 159 while ((currentCommand = readFile.ReadLine()) != null)
161 { 160 {
162 if (currentCommand != String.Empty) 161 if (currentCommand != String.Empty)
@@ -177,7 +176,7 @@ namespace OpenSim
177 if (File.Exists(fileName)) 176 if (File.Exists(fileName))
178 { 177 {
179 StreamReader readFile = File.OpenText(fileName); 178 StreamReader readFile = File.OpenText(fileName);
180 string currentLine = String.Empty; 179 string currentLine;
181 while ((currentLine = readFile.ReadLine()) != null) 180 while ((currentLine = readFile.ReadLine()) != null)
182 { 181 {
183 m_log.Info("[!]" + currentLine); 182 m_log.Info("[!]" + currentLine);
@@ -609,55 +608,6 @@ namespace OpenSim
609 m_assetCache.ShowState(); 608 m_assetCache.ShowState();
610 break; 609 break;
611 610
612 case "users":
613 IList agents = m_sceneManager.GetCurrentSceneAvatars();
614
615 m_console.Notice(String.Format("\nAgents connected: {0}\n", agents.Count));
616
617 m_console.Notice(
618 String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}{6,-15}", "Firstname", "Lastname",
619 "Agent ID", "Circuit", "IP", "Region", "Status"));
620
621 foreach (ScenePresence presence in agents)
622 {
623 RegionInfo regionInfo = m_sceneManager.GetRegionInfo(presence.RegionHandle);
624 string regionName;
625 EndPoint ep = null;
626
627 if (regionInfo == null)
628 {
629 regionName = "Unresolvable";
630 }
631 else
632 {
633 regionName = regionInfo.RegionName;
634 }
635
636 for (int i = 0; i < m_udpServers.Count; i++)
637 {
638 if (m_udpServers[i].RegionHandle == presence.RegionHandle)
639 {
640
641 m_udpServers[i].clientCircuits_reverse.TryGetValue(presence.ControllingClient.CircuitCode, out ep);
642 }
643 }
644
645 m_console.Notice(
646 String.Format(
647 "{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}{6,-15}",
648 presence.Firstname,
649 presence.Lastname,
650 presence.UUID,
651 presence.ControllingClient.CircuitCode,
652 ep,
653 regionName,
654 ((((ClientView)presence.ControllingClient).PacketProcessingEnabled)
655 ?"Active client":"Standby client")));
656 }
657
658 m_console.Notice("");
659
660 break;
661 case "modules": 611 case "modules":
662 m_console.Notice("The currently loaded shared modules are:"); 612 m_console.Notice("The currently loaded shared modules are:");
663 foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) 613 foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)