aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
authorJeff Ames2008-11-25 16:00:55 +0000
committerJeff Ames2008-11-25 16:00:55 +0000
commit518a8b9f2ac09a5060e2e59c913dfbe7faf397ef (patch)
tree8b3e39fbd54452e031873d31ff099e7db064cdee /OpenSim/Region/Application
parent* minor: eliminate mono compiler warnings (diff)
downloadopensim-SC_OLD-518a8b9f2ac09a5060e2e59c913dfbe7faf397ef.zip
opensim-SC_OLD-518a8b9f2ac09a5060e2e59c913dfbe7faf397ef.tar.gz
opensim-SC_OLD-518a8b9f2ac09a5060e2e59c913dfbe7faf397ef.tar.bz2
opensim-SC_OLD-518a8b9f2ac09a5060e2e59c913dfbe7faf397ef.tar.xz
Update svn properties.
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/HGOpenSimNode.cs368
1 files changed, 184 insertions, 184 deletions
diff --git a/OpenSim/Region/Application/HGOpenSimNode.cs b/OpenSim/Region/Application/HGOpenSimNode.cs
index 8bb93a6..ef23adc 100644
--- a/OpenSim/Region/Application/HGOpenSimNode.cs
+++ b/OpenSim/Region/Application/HGOpenSimNode.cs
@@ -1,184 +1,184 @@
1using System; 1using System;
2using System.Collections; 2using System.Collections;
3using System.Collections.Generic; 3using System.Collections.Generic;
4using System.IO; 4using System.IO;
5using System.Net; 5using System.Net;
6using System.Reflection; 6using System.Reflection;
7using log4net; 7using log4net;
8using Nini.Config; 8using Nini.Config;
9using OpenSim.Framework; 9using OpenSim.Framework;
10using OpenSim.Framework.Console; 10using OpenSim.Framework.Console;
11using OpenSim.Framework.Servers; 11using OpenSim.Framework.Servers;
12using OpenSim.Framework.Statistics; 12using OpenSim.Framework.Statistics;
13using OpenSim.Region.ClientStack; 13using OpenSim.Region.ClientStack;
14using OpenSim.Framework.Communications; 14using OpenSim.Framework.Communications;
15using OpenSim.Framework.Communications.Cache; 15using OpenSim.Framework.Communications.Cache;
16using OpenSim.Region.Communications.Local; 16using OpenSim.Region.Communications.Local;
17using OpenSim.Region.Communications.Hypergrid; 17using OpenSim.Region.Communications.Hypergrid;
18using OpenSim.Region.Environment; 18using OpenSim.Region.Environment;
19using OpenSim.Region.Environment.Interfaces; 19using OpenSim.Region.Environment.Interfaces;
20using OpenSim.Region.Environment.Scenes; 20using OpenSim.Region.Environment.Scenes;
21using OpenSim.Region.Environment.Scenes.Hypergrid; 21using OpenSim.Region.Environment.Scenes.Hypergrid;
22 22
23using Timer = System.Timers.Timer; 23using Timer = System.Timers.Timer;
24 24
25namespace OpenSim 25namespace OpenSim
26{ 26{
27 public class HGOpenSimNode : OpenSim 27 public class HGOpenSimNode : OpenSim
28 { 28 {
29 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 29 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
30 private IHyperlink HGServices = null; 30 private IHyperlink HGServices = null;
31 31
32 public HGOpenSimNode(IConfigSource configSource) : base(configSource) 32 public HGOpenSimNode(IConfigSource configSource) : base(configSource)
33 { 33 {
34 } 34 }
35 35
36 36
37 /// <summary> 37 /// <summary>
38 /// Performs initialisation of the scene, such as loading configuration from disk. 38 /// Performs initialisation of the scene, such as loading configuration from disk.
39 /// </summary> 39 /// </summary>
40 protected override void StartupSpecific() 40 protected override void StartupSpecific()
41 { 41 {
42 m_log.Info("===================================================================="); 42 m_log.Info("====================================================================");
43 m_log.Info("=================== STARTING HYPERGRID NODE ========================"); 43 m_log.Info("=================== STARTING HYPERGRID NODE ========================");
44 m_log.Info("===================================================================="); 44 m_log.Info("====================================================================");
45 45
46 base.StartupSpecific(); 46 base.StartupSpecific();
47 } 47 }
48 48
49 49
50 protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) 50 protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder)
51 { 51 {
52 // Standalone mode 52 // Standalone mode
53 53
54 HGInventoryService inventoryService = new HGInventoryService(m_networkServersInfo.InventoryURL, null, false); 54 HGInventoryService inventoryService = new HGInventoryService(m_networkServersInfo.InventoryURL, null, false);
55 inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource); 55 inventoryService.AddPlugin(m_configSettings.StandaloneInventoryPlugin, m_configSettings.StandaloneInventorySource);
56 56
57 LocalUserServices userService = 57 LocalUserServices userService =
58 new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, 58 new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX,
59 m_networkServersInfo.DefaultHomeLocY, inventoryService); 59 m_networkServersInfo.DefaultHomeLocY, inventoryService);
60 userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource); 60 userService.AddPlugin(m_configSettings.StandaloneUserPlugin, m_configSettings.StandaloneUserSource);
61 61
62 //LocalBackEndServices backendService = new LocalBackEndServices(); 62 //LocalBackEndServices backendService = new LocalBackEndServices();
63 HGGridServicesStandalone gridService = new HGGridServicesStandalone(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager); 63 HGGridServicesStandalone gridService = new HGGridServicesStandalone(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager);
64 64
65 LocalLoginService loginService = 65 LocalLoginService loginService =
66 new LocalLoginService( 66 new LocalLoginService(
67 userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, gridService.LocalBackend, m_networkServersInfo, 67 userService, m_configSettings.StandaloneWelcomeMessage, inventoryService, gridService.LocalBackend, m_networkServersInfo,
68 m_configSettings.StandaloneAuthenticate, libraryRootFolder); 68 m_configSettings.StandaloneAuthenticate, libraryRootFolder);
69 69
70 70
71 m_commsManager = new HGCommunicationsStandalone(m_networkServersInfo, m_httpServer, m_assetCache, 71 m_commsManager = new HGCommunicationsStandalone(m_networkServersInfo, m_httpServer, m_assetCache,
72 userService, userService, inventoryService, gridService, gridService, userService, libraryRootFolder, m_configSettings.DumpAssetsToFile); 72 userService, userService, inventoryService, gridService, gridService, userService, libraryRootFolder, m_configSettings.DumpAssetsToFile);
73 73
74 inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService; 74 inventoryService.UserProfileCache = m_commsManager.UserProfileCacheService;
75 HGServices = gridService; 75 HGServices = gridService;
76 76
77 // set up XMLRPC handler for client's initial login request message 77 // set up XMLRPC handler for client's initial login request message
78 m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); 78 m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod);
79 79
80 // provides the web form login 80 // provides the web form login
81 m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); 81 m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin);
82 82
83 // Provides the LLSD login 83 // Provides the LLSD login
84 m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); 84 m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod);
85 85
86 // provide grid info 86 // provide grid info
87 // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); 87 // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini")));
88 m_gridInfoService = new GridInfoService(m_config.Source); 88 m_gridInfoService = new GridInfoService(m_config.Source);
89 m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); 89 m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
90 m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); 90 m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));
91 } 91 }
92 92
93 protected override void InitialiseGridServices(LibraryRootFolder libraryRootFolder) 93 protected override void InitialiseGridServices(LibraryRootFolder libraryRootFolder)
94 { 94 {
95 m_commsManager = new HGCommunicationsGridMode(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager, libraryRootFolder); 95 m_commsManager = new HGCommunicationsGridMode(m_networkServersInfo, m_httpServer, m_assetCache, m_sceneManager, libraryRootFolder);
96 96
97 HGServices = ((HGCommunicationsGridMode)m_commsManager).HGServices; 97 HGServices = ((HGCommunicationsGridMode)m_commsManager).HGServices;
98 98
99 m_httpServer.AddStreamHandler(new SimStatusHandler()); 99 m_httpServer.AddStreamHandler(new SimStatusHandler());
100 } 100 }
101 101
102 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, 102 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
103 AgentCircuitManager circuitManager) 103 AgentCircuitManager circuitManager)
104 { 104 {
105 HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices); 105 HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager, HGServices);
106 return 106 return
107 new HGScene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, 107 new HGScene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache,
108 storageManager, m_httpServer, 108 storageManager, m_httpServer,
109 m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, m_configSettings.See_into_region_from_neighbor, m_config.Source, 109 m_moduleLoader, m_configSettings.DumpAssetsToFile, m_configSettings.PhysicalPrim, m_configSettings.See_into_region_from_neighbor, m_config.Source,
110 m_version); 110 m_version);
111 } 111 }
112 112
113 public override void RunCmd(string command, string[] cmdparams) 113 public override void RunCmd(string command, string[] cmdparams)
114 { 114 {
115 if (command.Equals("link-region")) 115 if (command.Equals("link-region"))
116 { 116 {
117 // link-region <Xloc> <Yloc> <HostName> <HttpPort> <LocalName> 117 // link-region <Xloc> <Yloc> <HostName> <HttpPort> <LocalName>
118 if (cmdparams.Length < 4) 118 if (cmdparams.Length < 4)
119 { 119 {
120 LinkRegionCmdUsage(); 120 LinkRegionCmdUsage();
121 return; 121 return;
122 } 122 }
123 123
124 RegionInfo regInfo = new RegionInfo(); 124 RegionInfo regInfo = new RegionInfo();
125 uint xloc, yloc; 125 uint xloc, yloc;
126 uint externalPort; 126 uint externalPort;
127 try 127 try
128 { 128 {
129 xloc = Convert.ToUInt32(cmdparams[0]); 129 xloc = Convert.ToUInt32(cmdparams[0]);
130 yloc = Convert.ToUInt32(cmdparams[1]); 130 yloc = Convert.ToUInt32(cmdparams[1]);
131 externalPort = Convert.ToUInt32(cmdparams[3]); 131 externalPort = Convert.ToUInt32(cmdparams[3]);
132 //internalPort = Convert.ToUInt32(cmdparams[4]); 132 //internalPort = Convert.ToUInt32(cmdparams[4]);
133 //remotingPort = Convert.ToUInt32(cmdparams[5]); 133 //remotingPort = Convert.ToUInt32(cmdparams[5]);
134 } 134 }
135 catch (Exception e) 135 catch (Exception e)
136 { 136 {
137 m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message); 137 m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message);
138 LinkRegionCmdUsage(); 138 LinkRegionCmdUsage();
139 return; 139 return;
140 } 140 }
141 regInfo.RegionLocX = xloc; 141 regInfo.RegionLocX = xloc;
142 regInfo.RegionLocY = yloc; 142 regInfo.RegionLocY = yloc;
143 regInfo.ExternalHostName = cmdparams[2]; 143 regInfo.ExternalHostName = cmdparams[2];
144 regInfo.HttpPort = externalPort; 144 regInfo.HttpPort = externalPort;
145 //regInfo.RemotingPort = remotingPort; 145 //regInfo.RemotingPort = remotingPort;
146 try 146 try
147 { 147 {
148 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0); 148 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);
149 } 149 }
150 catch (Exception e) 150 catch (Exception e)
151 { 151 {
152 m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message); 152 m_log.Warn("[HGrid] Wrong format for link-region command: " + e.Message);
153 LinkRegionCmdUsage(); 153 LinkRegionCmdUsage();
154 return; 154 return;
155 } 155 }
156 regInfo.RemotingAddress = regInfo.ExternalEndPoint.Address.ToString(); 156 regInfo.RemotingAddress = regInfo.ExternalEndPoint.Address.ToString();
157 157
158 // Finally, link it 158 // Finally, link it
159 try 159 try
160 { 160 {
161 m_sceneManager.CurrentOrFirstScene.CommsManager.GridService.RegisterRegion(regInfo); 161 m_sceneManager.CurrentOrFirstScene.CommsManager.GridService.RegisterRegion(regInfo);
162 } 162 }
163 catch (Exception e) 163 catch (Exception e)
164 { 164 {
165 m_log.Warn("[HGrid] Unable to link region: " + e.StackTrace); 165 m_log.Warn("[HGrid] Unable to link region: " + e.StackTrace);
166 } 166 }
167 if (cmdparams.Length >= 5) 167 if (cmdparams.Length >= 5)
168 { 168 {
169 regInfo.RegionName = ""; 169 regInfo.RegionName = "";
170 for (int i = 4; i < cmdparams.Length; i++) 170 for (int i = 4; i < cmdparams.Length; i++)
171 regInfo.RegionName += cmdparams[i] + " "; 171 regInfo.RegionName += cmdparams[i] + " ";
172 } 172 }
173 } 173 }
174 174
175 base.RunCmd(command, cmdparams); 175 base.RunCmd(command, cmdparams);
176 176
177 } 177 }
178 178
179 private void LinkRegionCmdUsage() 179 private void LinkRegionCmdUsage()
180 { 180 {
181 Console.WriteLine("Usage: link-region <Xloc> <Yloc> <HostName> <HttpPort> [<LocalName>]"); 181 Console.WriteLine("Usage: link-region <Xloc> <Yloc> <HostName> <HttpPort> [<LocalName>]");
182 } 182 }
183 } 183 }
184} 184}