diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-19 14:43:18 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-19 14:43:18 -0400 |
commit | 289439c8329d992251769aa83e3d7809f651de26 (patch) | |
tree | 8a1e596190f197fa5f70f21a8c968d2c55004cde /OpenSim/Grid | |
parent | Add Border (a virtual border management class) (diff) | |
parent | Added MoveItems, which is most useful upon viewer-delete inventory operation.... (diff) | |
download | opensim-SC-289439c8329d992251769aa83e3d7809f651de26.zip opensim-SC-289439c8329d992251769aa83e3d7809f651de26.tar.gz opensim-SC-289439c8329d992251769aa83e3d7809f651de26.tar.bz2 opensim-SC-289439c8329d992251769aa83e3d7809f651de26.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r-- | OpenSim/Grid/GridServer/GridServerBase.cs | 27 | ||||
-rw-r--r-- | OpenSim/Grid/GridServer/Program.cs | 12 | ||||
-rw-r--r-- | OpenSim/Grid/MessagingServer/Main.cs | 79 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/Main.cs | 38 |
4 files changed, 133 insertions, 23 deletions
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index c41a728..e3ad52a 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs | |||
@@ -31,6 +31,7 @@ using System.IO; | |||
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Timers; | 32 | using System.Timers; |
33 | using log4net; | 33 | using log4net; |
34 | using Nini.Config; | ||
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
36 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
@@ -46,6 +47,8 @@ namespace OpenSim.Grid.GridServer | |||
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 48 | ||
48 | protected GridConfig m_config; | 49 | protected GridConfig m_config; |
50 | public string m_consoleType = "local"; | ||
51 | public IConfigSource m_configSource = null; | ||
49 | 52 | ||
50 | public GridConfig Config | 53 | public GridConfig Config |
51 | { | 54 | { |
@@ -71,16 +74,36 @@ namespace OpenSim.Grid.GridServer | |||
71 | 74 | ||
72 | public GridServerBase() | 75 | public GridServerBase() |
73 | { | 76 | { |
74 | m_console = new LocalConsole("Grid"); | ||
75 | MainConsole.Instance = m_console; | ||
76 | } | 77 | } |
77 | 78 | ||
78 | protected override void StartupSpecific() | 79 | protected override void StartupSpecific() |
79 | { | 80 | { |
81 | switch (m_consoleType) | ||
82 | { | ||
83 | case "rest": | ||
84 | m_console = new RemoteConsole("Grid"); | ||
85 | break; | ||
86 | case "basic": | ||
87 | m_console = new CommandConsole("Grid"); | ||
88 | break; | ||
89 | default: | ||
90 | m_console = new LocalConsole("Grid"); | ||
91 | break; | ||
92 | } | ||
93 | MainConsole.Instance = m_console; | ||
80 | m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); | 94 | m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); |
81 | 95 | ||
82 | m_log.Info("[GRID]: Starting HTTP process"); | 96 | m_log.Info("[GRID]: Starting HTTP process"); |
83 | m_httpServer = new BaseHttpServer(m_config.HttpPort); | 97 | m_httpServer = new BaseHttpServer(m_config.HttpPort); |
98 | if (m_console is RemoteConsole) | ||
99 | { | ||
100 | RemoteConsole c = (RemoteConsole)m_console; | ||
101 | c.SetServer(m_httpServer); | ||
102 | IConfig netConfig = m_configSource.AddConfig("Network"); | ||
103 | netConfig.Set("ConsoleUser", m_config.ConsoleUser); | ||
104 | netConfig.Set("ConsolePass", m_config.ConsolePass); | ||
105 | c.ReadConfig(m_configSource); | ||
106 | } | ||
84 | 107 | ||
85 | LoadPlugins(); | 108 | LoadPlugins(); |
86 | 109 | ||
diff --git a/OpenSim/Grid/GridServer/Program.cs b/OpenSim/Grid/GridServer/Program.cs index 9618b85..c7ba897 100644 --- a/OpenSim/Grid/GridServer/Program.cs +++ b/OpenSim/Grid/GridServer/Program.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net.Config; | 28 | using log4net.Config; |
29 | using Nini.Config; | ||
29 | 30 | ||
30 | namespace OpenSim.Grid.GridServer | 31 | namespace OpenSim.Grid.GridServer |
31 | { | 32 | { |
@@ -33,10 +34,21 @@ namespace OpenSim.Grid.GridServer | |||
33 | { | 34 | { |
34 | public static void Main(string[] args) | 35 | public static void Main(string[] args) |
35 | { | 36 | { |
37 | ArgvConfigSource argvSource = new ArgvConfigSource(args); | ||
38 | argvSource.AddSwitch("Startup", "console", "c"); | ||
39 | |||
36 | XmlConfigurator.Configure(); | 40 | XmlConfigurator.Configure(); |
37 | 41 | ||
38 | GridServerBase app = new GridServerBase(); | 42 | GridServerBase app = new GridServerBase(); |
39 | 43 | ||
44 | IConfig startupConfig = argvSource.Configs["Startup"]; | ||
45 | if (startupConfig != null) | ||
46 | { | ||
47 | app.m_consoleType = startupConfig.GetString("console", "local"); | ||
48 | } | ||
49 | |||
50 | app.m_configSource = argvSource; | ||
51 | |||
40 | // if (args.Length > 0 && args[0] == "-setuponly") | 52 | // if (args.Length > 0 && args[0] == "-setuponly") |
41 | // { | 53 | // { |
42 | // app.Config(); | 54 | // app.Config(); |
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index dcefeea..654e770 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using log4net; | 32 | using log4net; |
33 | using Nini.Config; | ||
33 | using log4net.Config; | 34 | using log4net.Config; |
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
@@ -56,8 +57,22 @@ namespace OpenSim.Grid.MessagingServer | |||
56 | 57 | ||
57 | // private UUID m_lastCreatedUser = UUID.Random(); | 58 | // private UUID m_lastCreatedUser = UUID.Random(); |
58 | 59 | ||
60 | protected static string m_consoleType = "local"; | ||
61 | protected static IConfigSource m_config = null; | ||
62 | |||
59 | public static void Main(string[] args) | 63 | public static void Main(string[] args) |
60 | { | 64 | { |
65 | ArgvConfigSource argvSource = new ArgvConfigSource(args); | ||
66 | argvSource.AddSwitch("Startup", "console", "c"); | ||
67 | |||
68 | IConfig startupConfig = argvSource.Configs["Startup"]; | ||
69 | if (startupConfig != null) | ||
70 | { | ||
71 | m_consoleType = startupConfig.GetString("console", "local"); | ||
72 | } | ||
73 | |||
74 | m_config = argvSource; | ||
75 | |||
61 | XmlConfigurator.Configure(); | 76 | XmlConfigurator.Configure(); |
62 | 77 | ||
63 | m_log.Info("[SERVER]: Launching MessagingServer..."); | 78 | m_log.Info("[SERVER]: Launching MessagingServer..."); |
@@ -70,7 +85,18 @@ namespace OpenSim.Grid.MessagingServer | |||
70 | 85 | ||
71 | public OpenMessage_Main() | 86 | public OpenMessage_Main() |
72 | { | 87 | { |
73 | m_console = new LocalConsole("Messaging"); | 88 | switch (m_consoleType) |
89 | { | ||
90 | case "rest": | ||
91 | m_console = new RemoteConsole("Messaging"); | ||
92 | break; | ||
93 | case "basic": | ||
94 | m_console = new CommandConsole("Messaging"); | ||
95 | break; | ||
96 | default: | ||
97 | m_console = new LocalConsole("Messaging"); | ||
98 | break; | ||
99 | } | ||
74 | MainConsole.Instance = m_console; | 100 | MainConsole.Instance = m_console; |
75 | } | 101 | } |
76 | 102 | ||
@@ -88,20 +114,33 @@ namespace OpenSim.Grid.MessagingServer | |||
88 | { | 114 | { |
89 | if (m_userServerModule.registerWithUserServer()) | 115 | if (m_userServerModule.registerWithUserServer()) |
90 | { | 116 | { |
91 | m_log.Info("[SERVER]: Starting HTTP process"); | 117 | if (m_httpServer == null) |
92 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); | 118 | { |
93 | 119 | m_log.Info("[SERVER]: Starting HTTP process"); | |
94 | m_httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn); | 120 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); |
95 | m_httpServer.AddXmlRPCHandler("logout_of_simulator", msgsvc.UserLoggedOff); | 121 | |
96 | m_httpServer.AddXmlRPCHandler("get_presence_info_bulk", msgsvc.GetPresenceInfoBulk); | 122 | if (m_console is RemoteConsole) |
97 | m_httpServer.AddXmlRPCHandler("process_region_shutdown", msgsvc.ProcessRegionShutdown); | 123 | { |
98 | m_httpServer.AddXmlRPCHandler("agent_location", msgsvc.AgentLocation); | 124 | RemoteConsole c = (RemoteConsole)m_console; |
99 | m_httpServer.AddXmlRPCHandler("agent_leaving", msgsvc.AgentLeaving); | 125 | c.SetServer(m_httpServer); |
100 | 126 | IConfig netConfig = m_config.AddConfig("Network"); | |
101 | m_httpServer.AddXmlRPCHandler("region_startup", m_regionModule.RegionStartup); | 127 | netConfig.Set("ConsoleUser", Cfg.ConsoleUser); |
102 | m_httpServer.AddXmlRPCHandler("region_shutdown", m_regionModule.RegionShutdown); | 128 | netConfig.Set("ConsolePass", Cfg.ConsolePass); |
103 | 129 | c.ReadConfig(m_config); | |
104 | m_httpServer.Start(); | 130 | } |
131 | |||
132 | m_httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn); | ||
133 | m_httpServer.AddXmlRPCHandler("logout_of_simulator", msgsvc.UserLoggedOff); | ||
134 | m_httpServer.AddXmlRPCHandler("get_presence_info_bulk", msgsvc.GetPresenceInfoBulk); | ||
135 | m_httpServer.AddXmlRPCHandler("process_region_shutdown", msgsvc.ProcessRegionShutdown); | ||
136 | m_httpServer.AddXmlRPCHandler("agent_location", msgsvc.AgentLocation); | ||
137 | m_httpServer.AddXmlRPCHandler("agent_leaving", msgsvc.AgentLeaving); | ||
138 | |||
139 | m_httpServer.AddXmlRPCHandler("region_startup", m_regionModule.RegionStartup); | ||
140 | m_httpServer.AddXmlRPCHandler("region_shutdown", m_regionModule.RegionShutdown); | ||
141 | |||
142 | m_httpServer.Start(); | ||
143 | } | ||
105 | m_log.Info("[SERVER]: Userserver registration was successful"); | 144 | m_log.Info("[SERVER]: Userserver registration was successful"); |
106 | } | 145 | } |
107 | else | 146 | else |
@@ -114,12 +153,12 @@ namespace OpenSim.Grid.MessagingServer | |||
114 | private void deregisterFromUserServer() | 153 | private void deregisterFromUserServer() |
115 | { | 154 | { |
116 | m_userServerModule.deregisterWithUserServer(); | 155 | m_userServerModule.deregisterWithUserServer(); |
117 | if (m_httpServer != null) | 156 | // if (m_httpServer != null) |
118 | { | 157 | // { |
119 | // try a completely fresh registration, with fresh handlers, too | 158 | // try a completely fresh registration, with fresh handlers, too |
120 | m_httpServer.Stop(); | 159 | // m_httpServer.Stop(); |
121 | m_httpServer = null; | 160 | // m_httpServer = null; |
122 | } | 161 | // } |
123 | m_console.Output("[SERVER]: Deregistered from userserver."); | 162 | m_console.Output("[SERVER]: Deregistered from userserver."); |
124 | } | 163 | } |
125 | 164 | ||
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 86c2abb..1ee53ef 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -43,6 +43,7 @@ using OpenSim.Framework.Statistics; | |||
43 | using OpenSim.Grid.Communications.OGS1; | 43 | using OpenSim.Grid.Communications.OGS1; |
44 | using OpenSim.Grid.Framework; | 44 | using OpenSim.Grid.Framework; |
45 | using OpenSim.Grid.UserServer.Modules; | 45 | using OpenSim.Grid.UserServer.Modules; |
46 | using Nini.Config; | ||
46 | 47 | ||
47 | namespace OpenSim.Grid.UserServer | 48 | namespace OpenSim.Grid.UserServer |
48 | { | 49 | { |
@@ -73,8 +74,22 @@ namespace OpenSim.Grid.UserServer | |||
73 | 74 | ||
74 | protected AvatarCreationModule m_appearanceModule; | 75 | protected AvatarCreationModule m_appearanceModule; |
75 | 76 | ||
77 | protected static string m_consoleType = "local"; | ||
78 | protected static IConfigSource m_config = null; | ||
79 | |||
76 | public static void Main(string[] args) | 80 | public static void Main(string[] args) |
77 | { | 81 | { |
82 | ArgvConfigSource argvSource = new ArgvConfigSource(args); | ||
83 | argvSource.AddSwitch("Startup", "console", "c"); | ||
84 | |||
85 | IConfig startupConfig = argvSource.Configs["Startup"]; | ||
86 | if (startupConfig != null) | ||
87 | { | ||
88 | m_consoleType = startupConfig.GetString("console", "local"); | ||
89 | } | ||
90 | |||
91 | m_config = argvSource; | ||
92 | |||
78 | XmlConfigurator.Configure(); | 93 | XmlConfigurator.Configure(); |
79 | 94 | ||
80 | m_log.Info("Launching UserServer..."); | 95 | m_log.Info("Launching UserServer..."); |
@@ -87,7 +102,18 @@ namespace OpenSim.Grid.UserServer | |||
87 | 102 | ||
88 | public OpenUser_Main() | 103 | public OpenUser_Main() |
89 | { | 104 | { |
90 | m_console = new LocalConsole("User"); | 105 | switch (m_consoleType) |
106 | { | ||
107 | case "rest": | ||
108 | m_console = new RemoteConsole("User"); | ||
109 | break; | ||
110 | case "basic": | ||
111 | m_console = new CommandConsole("User"); | ||
112 | break; | ||
113 | default: | ||
114 | m_console = new LocalConsole("User"); | ||
115 | break; | ||
116 | } | ||
91 | MainConsole.Instance = m_console; | 117 | MainConsole.Instance = m_console; |
92 | } | 118 | } |
93 | 119 | ||
@@ -129,6 +155,16 @@ namespace OpenSim.Grid.UserServer | |||
129 | 155 | ||
130 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); | 156 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); |
131 | 157 | ||
158 | if (m_console is RemoteConsole) | ||
159 | { | ||
160 | RemoteConsole c = (RemoteConsole)m_console; | ||
161 | c.SetServer(m_httpServer); | ||
162 | IConfig netConfig = m_config.AddConfig("Network"); | ||
163 | netConfig.Set("ConsoleUser", Cfg.ConsoleUser); | ||
164 | netConfig.Set("ConsolePass", Cfg.ConsolePass); | ||
165 | c.ReadConfig(m_config); | ||
166 | } | ||
167 | |||
132 | RegisterInterface<CommandConsole>(m_console); | 168 | RegisterInterface<CommandConsole>(m_console); |
133 | RegisterInterface<UserConfig>(Cfg); | 169 | RegisterInterface<UserConfig>(Cfg); |
134 | 170 | ||