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.cs12
3 files changed, 56 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 c4117f5..9739e5a 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -277,7 +277,7 @@ namespace OpenSim.Server.Handlers.Simulation
277 //responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead 277 //responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead
278 } 278 }
279 279
280 // subclasses cab override this 280 // subclasses can override this
281 protected virtual bool UpdateAgent(GridRegion destination, AgentData agent) 281 protected virtual bool UpdateAgent(GridRegion destination, AgentData agent)
282 { 282 {
283 return m_SimulationService.UpdateAgent(destination, agent); 283 return m_SimulationService.UpdateAgent(destination, agent);
@@ -285,6 +285,16 @@ namespace OpenSim.Server.Handlers.Simulation
285 285
286 protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) 286 protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
287 { 287 {
288 if (m_SimulationService == null)
289 {
290 m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless.");
291 responsedata["content_type"] = "application/json";
292 responsedata["int_response_code"] = HttpStatusCode.NotImplemented;
293 responsedata["str_response_string"] = string.Empty;
294
295 return;
296 }
297
288 GridRegion destination = new GridRegion(); 298 GridRegion destination = new GridRegion();
289 destination.RegionID = regionID; 299 destination.RegionID = regionID;
290 300