mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Massive tab and trailing space cleanup
This commit is contained in:
@@ -41,117 +41,117 @@ namespace OpenSim.Server.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Command manager -
|
||||
/// Wrapper for OpenSim.Framework.PluginManager to allow
|
||||
/// Wrapper for OpenSim.Framework.PluginManager to allow
|
||||
/// us to add commands to the console to perform operations
|
||||
/// on our repos and plugins
|
||||
/// </summary>
|
||||
public class CommandManager
|
||||
{
|
||||
public AddinRegistry PluginRegistry;
|
||||
protected PluginManager PluginManager;
|
||||
public class CommandManager
|
||||
{
|
||||
public AddinRegistry PluginRegistry;
|
||||
protected PluginManager PluginManager;
|
||||
|
||||
public CommandManager(AddinRegistry registry)
|
||||
public CommandManager(AddinRegistry registry)
|
||||
{
|
||||
PluginRegistry = registry;
|
||||
PluginManager = new PluginManager(PluginRegistry);
|
||||
AddManagementCommands();
|
||||
}
|
||||
PluginRegistry = registry;
|
||||
PluginManager = new PluginManager(PluginRegistry);
|
||||
AddManagementCommands();
|
||||
}
|
||||
|
||||
private void AddManagementCommands()
|
||||
{
|
||||
// add plugin
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
private void AddManagementCommands()
|
||||
{
|
||||
// add plugin
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin add", "plugin add \"plugin index\"",
|
||||
"Install plugin from repository.",
|
||||
"Install plugin from repository.",
|
||||
HandleConsoleInstallPlugin);
|
||||
|
||||
// remove plugin
|
||||
// remove plugin
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin remove", "plugin remove \"plugin index\"",
|
||||
"Remove plugin from repository",
|
||||
"Remove plugin from repository",
|
||||
HandleConsoleUnInstallPlugin);
|
||||
|
||||
// list installed plugins
|
||||
// list installed plugins
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin list installed",
|
||||
"plugin list installed","List install plugins",
|
||||
"plugin list installed",
|
||||
"plugin list installed","List install plugins",
|
||||
HandleConsoleListInstalledPlugin);
|
||||
|
||||
// list plugins available from registered repositories
|
||||
// list plugins available from registered repositories
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin list available",
|
||||
"plugin list available","List available plugins",
|
||||
"plugin list available","List available plugins",
|
||||
HandleConsoleListAvailablePlugin);
|
||||
// List available updates
|
||||
// List available updates
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin updates", "plugin updates","List availble updates",
|
||||
HandleConsoleListUpdates);
|
||||
|
||||
// Update plugin
|
||||
// Update plugin
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin update", "plugin update \"plugin index\"","Update the plugin",
|
||||
HandleConsoleUpdatePlugin);
|
||||
|
||||
// Add repository
|
||||
// Add repository
|
||||
MainConsole.Instance.Commands.AddCommand("Repository", true,
|
||||
"repo add", "repo add \"url\"","Add repository",
|
||||
HandleConsoleAddRepo);
|
||||
|
||||
// Refresh repo
|
||||
// Refresh repo
|
||||
MainConsole.Instance.Commands.AddCommand("Repository", true,
|
||||
"repo refresh", "repo refresh \"url\"", "Sync with a registered repository",
|
||||
HandleConsoleGetRepo);
|
||||
|
||||
// Remove repository from registry
|
||||
// Remove repository from registry
|
||||
MainConsole.Instance.Commands.AddCommand("Repository", true,
|
||||
"repo remove",
|
||||
"repo remove \"[url | index]\"",
|
||||
"Remove repository from registry",
|
||||
"repo remove \"[url | index]\"",
|
||||
"Remove repository from registry",
|
||||
HandleConsoleRemoveRepo);
|
||||
|
||||
// Enable repo
|
||||
// Enable repo
|
||||
MainConsole.Instance.Commands.AddCommand("Repository", true,
|
||||
"repo enable", "repo enable \"[url | index]\"",
|
||||
"Enable registered repository",
|
||||
"Enable registered repository",
|
||||
HandleConsoleEnableRepo);
|
||||
|
||||
// Disable repo
|
||||
// Disable repo
|
||||
MainConsole.Instance.Commands.AddCommand("Repository", true,
|
||||
"repo disable", "repo disable\"[url | index]\"",
|
||||
"Disable registered repository",
|
||||
"Disable registered repository",
|
||||
HandleConsoleDisableRepo);
|
||||
|
||||
// List registered repositories
|
||||
// List registered repositories
|
||||
MainConsole.Instance.Commands.AddCommand("Repository", true,
|
||||
"repo list", "repo list",
|
||||
"List registered repositories",
|
||||
"List registered repositories",
|
||||
HandleConsoleListRepos);
|
||||
|
||||
// *
|
||||
// *
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin info", "plugin info \"plugin index\"","Show detailed information for plugin",
|
||||
HandleConsoleShowAddinInfo);
|
||||
|
||||
// Plugin disable
|
||||
// Plugin disable
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin disable", "plugin disable \"plugin index\"",
|
||||
"Disable a plugin",
|
||||
"Disable a plugin",
|
||||
HandleConsoleDisablePlugin);
|
||||
|
||||
// Enable plugin
|
||||
// Enable plugin
|
||||
MainConsole.Instance.Commands.AddCommand("Plugin", true,
|
||||
"plugin enable", "plugin enable \"plugin index\"",
|
||||
"Enable the selected plugin plugin",
|
||||
"Enable the selected plugin plugin",
|
||||
HandleConsoleEnablePlugin);
|
||||
}
|
||||
|
||||
|
||||
#region console handlers
|
||||
// Handle our console commands
|
||||
//
|
||||
// Install plugin from registered repository
|
||||
/// <summary>
|
||||
/// Handles the console install plugin command. Attempts to install the selected plugin
|
||||
/// and
|
||||
/// and
|
||||
/// </summary>
|
||||
/// <param name='module'>
|
||||
/// Module.
|
||||
@@ -323,7 +323,7 @@ namespace OpenSim.Server.Base
|
||||
{
|
||||
if (cmd.Length >= 3)
|
||||
{
|
||||
|
||||
|
||||
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||
|
||||
int ndx = Convert.ToInt16(cmd[2]);
|
||||
@@ -355,5 +355,5 @@ namespace OpenSim.Server.Base
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ namespace OpenSim.Server.Base
|
||||
MainServer.Instance = httpServer;
|
||||
|
||||
// If https_listener = true, then add an ssl listener on the https_port...
|
||||
if (ssl_listener == true)
|
||||
if (ssl_listener == true)
|
||||
{
|
||||
uint https_port = (uint)networkConfig.GetInt("https_port", 0);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenSim.Server.Base")]
|
||||
@@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
@@ -25,7 +25,7 @@ using System.Runtime.InteropServices;
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
|
||||
@@ -31,20 +31,20 @@ namespace OpenSim.Server.Base
|
||||
{
|
||||
/// <value>
|
||||
/// This is the external protocol versions. It is separate from the OpenSimulator project version.
|
||||
///
|
||||
///
|
||||
/// These version numbers should be increased by 1 every time a code
|
||||
/// change in the Service.Connectors and Server.Handlers, espectively,
|
||||
/// change in the Service.Connectors and Server.Handlers, espectively,
|
||||
/// makes the previous OpenSimulator revision incompatible
|
||||
/// with the new revision.
|
||||
///
|
||||
/// with the new revision.
|
||||
///
|
||||
/// Changes which are compatible with an older revision (e.g. older revisions experience degraded functionality
|
||||
/// but not outright failure) do not need a version number increment.
|
||||
///
|
||||
///
|
||||
/// Having this version number allows the grid service to reject connections from regions running a version
|
||||
/// of the code that is too old.
|
||||
/// of the code that is too old.
|
||||
///
|
||||
/// </value>
|
||||
|
||||
|
||||
// The range of acceptable servers for client-side connectors
|
||||
public readonly static int ClientProtocolVersionMin = 1;
|
||||
public readonly static int ClientProtocolVersionMax = 1;
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace OpenSim.Server.Base
|
||||
// libomv, which has a hard-coded path to "." for pinvoke
|
||||
// to load the openjpeg dll
|
||||
//
|
||||
// Will look for a way to fix, but for now this keeps the
|
||||
// Will look for a way to fix, but for now this keeps the
|
||||
// confusion to a minimum. this was copied from our region
|
||||
// plugin loader, we have been doing this in there for a long time.
|
||||
//
|
||||
@@ -183,7 +183,7 @@ namespace OpenSim.Server.Base
|
||||
|
||||
if(port != 0)
|
||||
server = MainServer.GetHttpServer(port);
|
||||
else
|
||||
else
|
||||
server = MainServer.Instance;
|
||||
|
||||
return server;
|
||||
@@ -222,19 +222,19 @@ namespace OpenSim.Server.Base
|
||||
// This is good to debug configuration problems
|
||||
//if (dllName == string.Empty)
|
||||
// Util.PrintCallStack();
|
||||
|
||||
|
||||
string className = String.Empty;
|
||||
|
||||
// The path for a dynamic plugin will contain ":" on Windows
|
||||
string[] parts = dllName.Split (new char[] {':'});
|
||||
|
||||
if (parts [0].Length > 1)
|
||||
if (parts [0].Length > 1)
|
||||
{
|
||||
dllName = parts [0];
|
||||
if (parts.Length > 1)
|
||||
className = parts[1];
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is Windows - we must replace the ":" in the path
|
||||
dllName = String.Format ("{0}:{1}", parts [0], parts [1]);
|
||||
@@ -242,17 +242,17 @@ namespace OpenSim.Server.Base
|
||||
className = parts[2];
|
||||
}
|
||||
|
||||
// Handle extra string arguments in a more generic way
|
||||
if (dllName.Contains("@"))
|
||||
{
|
||||
string[] dllNameParts = dllName.Split(new char[] {'@'});
|
||||
dllName = dllNameParts[dllNameParts.Length - 1];
|
||||
List<Object> argList = new List<Object>(args);
|
||||
for (int i = 0 ; i < dllNameParts.Length - 1 ; ++i)
|
||||
argList.Add(dllNameParts[i]);
|
||||
// Handle extra string arguments in a more generic way
|
||||
if (dllName.Contains("@"))
|
||||
{
|
||||
string[] dllNameParts = dllName.Split(new char[] {'@'});
|
||||
dllName = dllNameParts[dllNameParts.Length - 1];
|
||||
List<Object> argList = new List<Object>(args);
|
||||
for (int i = 0 ; i < dllNameParts.Length - 1 ; ++i)
|
||||
argList.Add(dllNameParts[i]);
|
||||
|
||||
args = argList.ToArray();
|
||||
}
|
||||
args = argList.ToArray();
|
||||
}
|
||||
|
||||
return LoadPlugin<T>(dllName, className, args);
|
||||
}
|
||||
@@ -276,10 +276,10 @@ namespace OpenSim.Server.Base
|
||||
{
|
||||
if (pluginType.IsPublic)
|
||||
{
|
||||
if (className != String.Empty
|
||||
if (className != String.Empty
|
||||
&& pluginType.ToString() != pluginType.Namespace + "." + className)
|
||||
continue;
|
||||
|
||||
|
||||
Type typeInterface = pluginType.GetInterface(interfaceName);
|
||||
|
||||
if (typeInterface != null)
|
||||
@@ -295,8 +295,8 @@ namespace OpenSim.Server.Base
|
||||
if (!(e is System.MissingMethodException))
|
||||
{
|
||||
m_log.Error(string.Format("[SERVER UTILS]: Error loading plugin {0} from {1}. Exception: {2}",
|
||||
interfaceName,
|
||||
dllName,
|
||||
interfaceName,
|
||||
dllName,
|
||||
e.InnerException == null ? e.Message : e.InnerException.Message),
|
||||
e);
|
||||
}
|
||||
@@ -479,7 +479,7 @@ namespace OpenSim.Server.Base
|
||||
XmlDocument doc = new XmlDocument();
|
||||
|
||||
doc.LoadXml(data);
|
||||
|
||||
|
||||
XmlNodeList rootL = doc.GetElementsByTagName("ServerResponse");
|
||||
|
||||
if (rootL.Count != 1)
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenSim.Server.Base
|
||||
|
||||
// Check if a prompt was given on the command line
|
||||
prompt = startupConfig.GetString("prompt", prompt);
|
||||
|
||||
|
||||
// Check for a Log4Net config file on the command line
|
||||
logConfig =startupConfig.GetString("logconfig", logConfig);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace OpenSim.Server.Base
|
||||
// Merge OpSys env vars
|
||||
Console.WriteLine("[CONFIG]: Loading environment variables for Config");
|
||||
Util.MergeEnvironmentToConfig(Config);
|
||||
|
||||
|
||||
// Merge the configuration from the command line into the loaded file
|
||||
Config.Merge(argvConfig);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user