mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -230,6 +230,12 @@ namespace OpenSim.Server.Base
|
||||
"shutdown",
|
||||
"Quit the application", HandleQuit);
|
||||
|
||||
// Register a command to read other commands from a file
|
||||
MainConsole.Instance.Commands.AddCommand("base", false, "command-script",
|
||||
"command-script <script>",
|
||||
"Run a command script from file", HandleScript);
|
||||
|
||||
|
||||
// Allow derived classes to perform initialization that
|
||||
// needs to be done after the console has opened
|
||||
//
|
||||
@@ -259,6 +265,41 @@ namespace OpenSim.Server.Base
|
||||
m_log.Info("[CONSOLE] Quitting");
|
||||
}
|
||||
|
||||
protected virtual void HandleScript(string module, string[] parms)
|
||||
{
|
||||
if (parms.Length != 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
RunCommandScript(parms[1]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run an optional startup list of commands
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
private void RunCommandScript(string fileName)
|
||||
{
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
m_log.Info("[COMMANDFILE]: Running " + fileName);
|
||||
|
||||
using (StreamReader readFile = File.OpenText(fileName))
|
||||
{
|
||||
string currentCommand;
|
||||
while ((currentCommand = readFile.ReadLine()) != null)
|
||||
{
|
||||
if (currentCommand != String.Empty)
|
||||
{
|
||||
m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
|
||||
MainConsole.Instance.RunCommand(currentCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected virtual void ReadConfig()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ namespace OpenSim.Server.Handlers.Asset
|
||||
{
|
||||
public class XInventoryInConnector : ServiceConnector
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IInventoryService m_InventoryService;
|
||||
private string m_ConfigName = "InventoryService";
|
||||
|
||||
@@ -53,6 +55,8 @@ namespace OpenSim.Server.Handlers.Asset
|
||||
if (configName != String.Empty)
|
||||
m_ConfigName = configName;
|
||||
|
||||
m_log.DebugFormat("[XInventoryInConnector]: Starting with config name {0}", m_ConfigName);
|
||||
|
||||
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||
if (serverConfig == null)
|
||||
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||
|
||||
@@ -277,7 +277,7 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
//responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); ??? instead
|
||||
}
|
||||
|
||||
// subclasses cab override this
|
||||
// subclasses can override this
|
||||
protected virtual bool UpdateAgent(GridRegion destination, AgentData agent)
|
||||
{
|
||||
return m_SimulationService.UpdateAgent(destination, agent);
|
||||
@@ -285,6 +285,16 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
|
||||
protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
|
||||
{
|
||||
if (m_SimulationService == null)
|
||||
{
|
||||
m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless.");
|
||||
responsedata["content_type"] = "application/json";
|
||||
responsedata["int_response_code"] = HttpStatusCode.NotImplemented;
|
||||
responsedata["str_response_string"] = string.Empty;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GridRegion destination = new GridRegion();
|
||||
destination.RegionID = regionID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user