aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server')
-rw-r--r--OpenSim/Server/Base/ServicesServerBase.cs41
-rw-r--r--OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs4
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs8
3 files changed, 52 insertions, 1 deletions
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index a5bebb8..dee31bd 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -230,6 +230,12 @@ namespace OpenSim.Server.Base
230 "shutdown", 230 "shutdown",
231 "Quit the application", HandleQuit); 231 "Quit the application", HandleQuit);
232 232
233 // Register a command to read other commands from a file
234 MainConsole.Instance.Commands.AddCommand("base", false, "command-script",
235 "command-script <script>",
236 "Run a command script from file", HandleScript);
237
238
233 // Allow derived classes to perform initialization that 239 // Allow derived classes to perform initialization that
234 // needs to be done after the console has opened 240 // needs to be done after the console has opened
235 // 241 //
@@ -259,6 +265,41 @@ namespace OpenSim.Server.Base
259 m_log.Info("[CONSOLE] Quitting"); 265 m_log.Info("[CONSOLE] Quitting");
260 } 266 }
261 267
268 protected virtual void HandleScript(string module, string[] parms)
269 {
270 if (parms.Length != 2)
271 {
272 return;
273 }
274 RunCommandScript(parms[1]);
275 }
276
277 /// <summary>
278 /// Run an optional startup list of commands
279 /// </summary>
280 /// <param name="fileName"></param>
281 private void RunCommandScript(string fileName)
282 {
283 if (File.Exists(fileName))
284 {
285 m_log.Info("[COMMANDFILE]: Running " + fileName);
286
287 using (StreamReader readFile = File.OpenText(fileName))
288 {
289 string currentCommand;
290 while ((currentCommand = readFile.ReadLine()) != null)
291 {
292 if (currentCommand != String.Empty)
293 {
294 m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
295 MainConsole.Instance.RunCommand(currentCommand);
296 }
297 }
298 }
299 }
300 }
301
302
262 protected virtual void ReadConfig() 303 protected virtual void ReadConfig()
263 { 304 {
264 } 305 }
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 6e580f1..ac6a3ab 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Server.Handlers.Asset
44{ 44{
45 public class XInventoryInConnector : ServiceConnector 45 public class XInventoryInConnector : ServiceConnector
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48
47 private IInventoryService m_InventoryService; 49 private IInventoryService m_InventoryService;
48 private string m_ConfigName = "InventoryService"; 50 private string m_ConfigName = "InventoryService";
49 51
@@ -53,6 +55,8 @@ namespace OpenSim.Server.Handlers.Asset
53 if (configName != String.Empty) 55 if (configName != String.Empty)
54 m_ConfigName = configName; 56 m_ConfigName = configName;
55 57
58 m_log.DebugFormat("[XInventoryInConnector]: Starting with config name {0}", m_ConfigName);
59
56 IConfig serverConfig = config.Configs[m_ConfigName]; 60 IConfig serverConfig = config.Configs[m_ConfigName];
57 if (serverConfig == null) 61 if (serverConfig == null)
58 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); 62 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 191acc9..bc31815 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -272,7 +272,7 @@ namespace OpenSim.Server.Handlers.Simulation
272 //responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead 272 //responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead
273 } 273 }
274 274
275 // subclasses cab override this 275 // subclasses can override this
276 protected virtual bool UpdateAgent(GridRegion destination, AgentData agent) 276 protected virtual bool UpdateAgent(GridRegion destination, AgentData agent)
277 { 277 {
278 return m_SimulationService.UpdateAgent(destination, agent); 278 return m_SimulationService.UpdateAgent(destination, agent);
@@ -280,6 +280,12 @@ namespace OpenSim.Server.Handlers.Simulation
280 280
281 protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) 281 protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
282 { 282 {
283 if (m_SimulationService == null)
284 {
285 m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless.");
286 return;
287 }
288
283 GridRegion destination = new GridRegion(); 289 GridRegion destination = new GridRegion();
284 destination.RegionID = regionID; 290 destination.RegionID = regionID;
285 291