diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 00657028e4..427dca59f9 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -125,7 +125,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); m_openSim.CreateRegion(regionsToLoad[i], true, out scene); if (changed) - regionsToLoad[i].EstateSettings.Save(); + regionsToLoad[i].EstateSettings.Save(); if (scene != null) { @@ -136,7 +136,11 @@ namespace OpenSim.ApplicationPlugins.LoadRegions } } } - + + //[TODO]: Temporary fix for an issue after the mono-addis upgrade + // PostInilise can fire before the region is loaded, so need to + // track down the cause of that + Thread.Sleep(300); m_openSim.ModuleLoader.PostInitialise(); m_openSim.ModuleLoader.ClearCache(); } diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs index b871f5636c..70d3fd9129 100644 --- a/OpenSim/Data/IPresenceData.cs +++ b/OpenSim/Data/IPresenceData.cs @@ -49,6 +49,7 @@ namespace OpenSim.Data bool Store(PresenceData data); PresenceData Get(UUID sessionID); + PresenceData Verify(UUID s_sessionID); void LogoutRegionAgents(UUID regionID); bool ReportAgent(UUID sessionID, UUID regionID); PresenceData[] Get(string field, string data); diff --git a/OpenSim/Data/MSSQL/MSSQLPresenceData.cs b/OpenSim/Data/MSSQL/MSSQLPresenceData.cs index 8068d23bb1..358549bc97 100644 --- a/OpenSim/Data/MSSQL/MSSQLPresenceData.cs +++ b/OpenSim/Data/MSSQL/MSSQLPresenceData.cs @@ -61,6 +61,17 @@ namespace OpenSim.Data.MSSQL return ret[0]; } + public PresenceData Verify(UUID s_sessionID) + { + PresenceData[] ret = Get("SecureSessionID", + s_sessionID.ToString()); + + if (ret.Length == 0) + return null; + + return ret[0]; + } + public void LogoutRegionAgents(UUID regionID) { using (SqlConnection conn = new SqlConnection(m_ConnectionString)) diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs index 780806087f..93e8bcf0f9 100644 --- a/OpenSim/Data/MySQL/MySQLPresenceData.cs +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs @@ -61,6 +61,17 @@ namespace OpenSim.Data.MySQL return ret[0]; } + public PresenceData Verify(UUID s_sessionID) + { + PresenceData[] ret = Get("SecureSessionID", + s_sessionID.ToString()); + + if (ret.Length == 0) + return null; + + return ret[0]; + } + public void LogoutRegionAgents(UUID regionID) { using (MySqlCommand cmd = new MySqlCommand()) @@ -96,4 +107,4 @@ namespace OpenSim.Data.MySQL return true; } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs index c06c223a81..a39134d39f 100644 --- a/OpenSim/Data/Null/NullPresenceData.cs +++ b/OpenSim/Data/Null/NullPresenceData.cs @@ -79,6 +79,19 @@ namespace OpenSim.Data.Null return null; } + public PresenceData Verify(UUID s_sessionID) + { + if (Instance != this) + return Instance.Verify(s_sessionID); + + if (m_presenceData.ContainsKey(s_sessionID)) + { + return m_presenceData[s_sessionID]; + } + + return null; + } + public void LogoutRegionAgents(UUID regionID) { if (Instance != this) diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index d82551efe7..987bcf8af2 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -658,14 +658,9 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender } break; case "R": - // We need to place this newFont inside its own context so that the .NET compiler - // doesn't complain about a redefinition of an existing newFont, even though there is none - // The mono compiler doesn't produce this error. - { - Font newFont = new Font(myFont, FontStyle.Regular); - myFont.Dispose(); - myFont = newFont; - } +// Font newFont = new Font(myFont, FontStyle.Regular); + myFont.Dispose(); + myFont = new Font(myFont, FontStyle.Regular); break; } } @@ -835,4 +830,4 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender return null; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs index 49dd633be4..be7c33ff9d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs @@ -193,6 +193,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence return m_PresenceService.GetAgents(userIDs); } + public PresenceInfo VerifyAgent(UUID s_sessionID) + { + return m_PresenceService.VerifyAgent(s_sessionID); + } + #endregion } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs index bf4e9abf0d..2486085dea 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs @@ -153,6 +153,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence return m_RemoteConnector.GetAgents(userIDs); } + public PresenceInfo VerifyAgent(UUID sessionID) + { + return m_RemoteConnector.VerifyAgent(sessionID); + } + #endregion } diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 42c82cf34c..e2ed008484 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -35,6 +35,7 @@ using System.Collections.Generic; using log4net; using OpenSim.Framework; using OpenMetaverse; +using OpenMetaverse.StructuredData; namespace OpenSim.Server.Base { @@ -333,5 +334,36 @@ namespace OpenSim.Server.Base return ret; } + + public static bool ParseStringToOSDMap(string input, out OSDMap map) + { + try + { + map = null; + OSD tmpbuff = null; + try + { + tmpbuff = OSDParser.DeserializeJson(input); + } + catch + { + m_log.DebugFormat("[ServerUtils]: Parse Caught Error Deserializei {0} ", input); + return false; + } + if (tmpbuff.Type == OSDType.Map) + { + map = (OSDMap)tmpbuff; + return true; + } + else + return false; + } + catch (NullReferenceException e) + { + m_log.ErrorFormat("[ServerUtils]: exception on ParseStringToJson {0}", e.Message); + map = null; + return false; + } + } } } diff --git a/OpenSim/Server/Handlers/Integration/IntegrationServerConnector.cs b/OpenSim/Server/Handlers/Integration/IntegrationServerConnector.cs new file mode 100644 index 0000000000..2b30ac9d40 --- /dev/null +++ b/OpenSim/Server/Handlers/Integration/IntegrationServerConnector.cs @@ -0,0 +1,66 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +using System; +using Nini.Config; +using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Server.Handlers.Base; +using OpenSim.Framework; + + +namespace OpenSim.Server.Handlers.Integration +{ + public class IntegrationServiceConnector : ServiceConnector + { + + private IIntegrationService m_IntegrationService; + private string m_ConfigName = "IntegrationService"; + + public IntegrationServiceConnector(IConfigSource config, IHttpServer server, string configName) : + base(config, server, configName) + { + IConfig serverConfig = config.Configs[m_ConfigName]; + if (serverConfig == null) + throw new Exception(String.Format("No section {0} in config file", m_ConfigName)); + + string service = serverConfig.GetString("LocalServiceModule", + String.Empty); + + if (service == String.Empty) + throw new Exception("No LocalServiceModule in config file"); + + Object[] args = new Object[] { config, server }; + m_IntegrationService = ServerUtils.LoadPlugin(service, args); + + server.AddStreamHandler(new IntegrationServerHandler(m_IntegrationService)); + + } + } +} diff --git a/OpenSim/Server/Handlers/Integration/IntegrationServerHandler.cs b/OpenSim/Server/Handlers/Integration/IntegrationServerHandler.cs new file mode 100644 index 0000000000..3fb2cab9c8 --- /dev/null +++ b/OpenSim/Server/Handlers/Integration/IntegrationServerHandler.cs @@ -0,0 +1,234 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Framework; +using OpenSim.Framework.Servers.HttpServer; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using log4net; +using System; +using System.Reflection; +using System.IO; +using System.Net; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; + +namespace OpenSim.Server.Handlers.Integration +{ + public class IntegrationServerHandler : BaseStreamHandler + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private IIntegrationService m_IntegrationService; + + public IntegrationServerHandler(IIntegrationService service) : + base("POST", "/integration") + { + m_IntegrationService = service; + } + + public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) + { + StreamReader sr = new StreamReader(requestData); + string body = sr.ReadToEnd(); + sr.Close(); + body = body.Trim(); + + try + { + OSDMap request = null; + if (ServerUtils.ParseStringToOSDMap(body, out request) == false) + { + return FailureResult(); + } + + if (!request.ContainsKey("command")) + { + return FailureResult("Error, no command defined!"); + } + + string command = request["command"].AsString(); + + switch (command) + { + case "list_plugins": + return HandleListPlugins(request); + + case "list_available": + return HandleListAvailablePlugins(request); + + case "show_info": + return HandlePluginInfo(request); + + case "install_plugin": + return HandleInstallPlugin(request); + + case "uninstall_plugin": + return HandleUnInstallPlugin(request); + + case "enable_plugin": + return HandleEnablePlugin(request); + + case "disable_plugin": + return HandleDisblePlugin(request); + + case "plugin_info": + return HandlePluginInfo(request); + + case "list_repos": + return HandleListRepositories(request); + + case "add_repo": + return HandleAddRepository(request); + + case "remove_repo": + return HandleRemoveRepository(request); + + case "enable_repo": + return HandleEnablePlugin(request); + + case "disable_repo": + return HandleDisableRepository(request); + + default: + m_log.DebugFormat( + "[INTEGRATION HANDLER]: unknown method {0} request {1}", + command.Length, + command + ); + return FailureResult("IntegrationHandler: Unrecognized method requested!"); + } + } + catch (Exception e) + { + m_log.DebugFormat("[INTEGRATION HANDLER]: Exception {0}", e); + } + + return FailureResult(); + } + + #region web handlers + // List installed plugins + private byte[] HandleListPlugins(OSDMap request) + { + return m_IntegrationService.HandleWebListPlugins(request); + } + + // Show plugin info + private byte[] HandlePluginInfo(OSDMap request) + { + return m_IntegrationService.HandleWebPluginInfo(request); + } + + // Enable plugin + private byte[] HandleEnablePlugin(OSDMap request) + { + return m_IntegrationService.HandleWebEnablePlugin(request); + } + + // Disable plugin + private byte[] HandleDisblePlugin(OSDMap request) + { + return m_IntegrationService.HandleWebDisablePlugin(request); + } + + // Install plugin + public byte[] HandleInstallPlugin(OSDMap request) + { + return m_IntegrationService.HandleWebInstallPlugin(request); + } + + // Uninstall plugin + public byte[] HandleUnInstallPlugin(OSDMap request) + { + return m_IntegrationService.HandleWebUnInstallPlugin(request); + } + + // List available plugins + public byte[] HandleListAvailablePlugins(OSDMap request) + { + return m_IntegrationService.HandleWebListAvailablePlugins(request); + } + + // List repositories + public byte[] HandleListRepositories(OSDMap request) + { + return m_IntegrationService.HandleWebListRepositories(request); + } + + // Add repository + public byte[] HandleAddRepository(OSDMap request) + { + return m_IntegrationService.HandleWebAddRepository(request); + } + + // Remove repository + public byte[] HandleRemoveRepository(OSDMap request) + { + return m_IntegrationService.HandleWebRemoveRepositroy(request); + } + + // Enable repository + public byte[] HandleEnableRepository(OSDMap request) + { + return m_IntegrationService.HandleEnableRepository(request); + } + + // Disable repository + public byte[] HandleDisableRepository(OSDMap request) + { + return m_IntegrationService.HandleWebDisableRepository(request); + } + #endregion web handlers + + #region utility + // These are in IntegrationUtils.cs for plugins + private byte[] FailureResult() + { + return FailureResult(String.Empty); + } + + private byte[] FailureResult(string msg) + { + OSDMap doc = new OSDMap(2); + doc["Result"] = OSD.FromString("Failure"); + doc["Message"] = OSD.FromString(msg); + + return DocToBytes(doc); + } + + private byte[] DocToBytes(OSDMap doc) + { + return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(doc)); + } + #endregion utility + } +} diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 2d67c6db0c..708971a272 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs @@ -41,6 +41,7 @@ using OpenSim.Services.Interfaces; using OpenSim.Framework; using OpenSim.Framework.Servers.HttpServer; using OpenMetaverse; +using OpenMetaverse.StructuredData; namespace OpenSim.Server.Handlers.Presence { @@ -244,7 +245,7 @@ namespace OpenSim.Server.Handlers.Presence //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); return Util.UTF8NoBomEncoding.GetBytes(xmlString); } - + private byte[] SuccessResult() { XmlDocument doc = new XmlDocument(); diff --git a/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs index f7d8c5379c..91153f1736 100644 --- a/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs +++ b/OpenSim/Services/Connectors/Presence/PresenceServicesConnector.cs @@ -371,6 +371,49 @@ namespace OpenSim.Services.Connectors return rinfos.ToArray(); } + public PresenceInfo VerifyAgent(UUID s_sessionID) + { + Dictionary sendData = new Dictionary(); + //sendData["SCOPEID"] = scopeID.ToString(); + sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); + sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString(); + sendData["METHOD"] = "verifyagent"; + + sendData["SecureSessionID"] = s_sessionID.ToString(); + + string reply = string.Empty; + string reqString = ServerUtils.BuildQueryString(sendData); + string uri = m_ServerURI + "/presence"; + // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); + try + { + reply = SynchronousRestFormsRequester.MakeRequest("POST", + uri, + reqString); + if (reply == null || (reply != null && reply == string.Empty)) + { + m_log.DebugFormat("[PRESENCE CONNECTOR]: VerifyAgent received null or empty reply"); + return null; + } + } + catch (Exception e) + { + m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message); + } + + Dictionary replyData = ServerUtils.ParseXmlResponse(reply); + PresenceInfo pinfo = null; + + if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null)) + { + if (replyData["result"] is Dictionary) + { + pinfo = new PresenceInfo((Dictionary)replyData["result"]); + } + } + + return pinfo; + } #endregion diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index ca1b64f2b7..e10b29c3f4 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -260,6 +260,12 @@ namespace OpenSim.Services.Connectors.SimianGrid return null; } + public PresenceInfo VerifyAgent(UUID s_sessionID) + { + // Not implemented + return null; + } + public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { // m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Logging out user " + userID); diff --git a/OpenSim/Services/IntegrationService/IntegrationService.cs b/OpenSim/Services/IntegrationService/IntegrationService.cs new file mode 100644 index 0000000000..80367beba9 --- /dev/null +++ b/OpenSim/Services/IntegrationService/IntegrationService.cs @@ -0,0 +1,458 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using System.Linq; +using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Framework; +using OpenSim.Framework.Servers.HttpServer; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using Nini.Config; +using log4net; +using Mono.Addins; +using Ux = OpenSim.Services.IntegrationService.IntegrationUtils; + +// ****[ Robust ] Keep the core services here and rebrand it as a more generic +// ****[ Robust ] service for use in buthe OpenSim.exe and Robust.exe +// +namespace OpenSim.Services.IntegrationService +{ + public class IntegrationService : IntegrationServiceBase, IIntegrationService + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public IntegrationService(IConfigSource config, IHttpServer server) + : base(config, server) + { + m_log.DebugFormat("[INTEGRATION SERVICE]: Loaded"); + + // Add commands to the console + if (MainConsole.Instance != null) + { + AddConsoleCommands(); + } + } + + // ****[ Robust ] We have console commands to manage the repositories and modules. + // ****[ Robust ] We can add/remove/enable/disable repositories and modules + // ****[ Robust ] We can query repositories for available modules and updates + // ****[ Robust ] The manager needs to be moved to OpenSim.Framework so we can + // ****[ Robust ] use it to complete the region module loader + // + // Our console commands + private void AddConsoleCommands() + { + MainConsole.Instance.Commands.AddCommand("Integration", true, + "install", "install \"plugin name\"", "Install plugin from repository", + HandleConsoleInstallPlugin); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "uninstall", "uninstall \"plugin name\"", "Remove plugin from repository", + HandleConsoleUnInstallPlugin); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "check installed", "check installed \"plugin name=\"","Check installed plugin", + HandleConsoleCheckInstalledPlugin); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "list installed", "list installed \"plugin name=\"","List install plugins", + HandleConsoleListInstalledPlugin); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "list available", "list available \"plugin name=\"","List available plugins", + HandleConsoleListAvailablePlugin); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "list updates", "list updates","List availble updates", + HandleConsoleListUpdates); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "update", "update \"plugin name=\"","Update the plugin", + HandleConsoleUpdatePlugin); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "add repo", "add repo \"url\"","Add repository", + HandleConsoleAddRepo); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "get repo", "get repo \"url\"", "Sync with a registered repository", + HandleConsoleGetRepo); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "remove repo", "remove repo \"[url | index]\"","Remove registered repository", + HandleConsoleRemoveRepo); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "enable repo", "enable repo \"[url | index]\"","Enable registered repository", + HandleConsoleEnableRepo); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "disable repo", "disable repo \"[url | index]\"","Disable registered repository", + HandleConsoleDisableRepo); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "list repos", "list repos","List registered repositories", + HandleConsoleListRepos); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "show info", "show info \"plugin name\"","Show detailed information for plugin", + HandleConsoleShowAddinInfo); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "disable plugin", "disable plugin \"plugin name\"","disable the plugin", + HandleConsoleDisablePlugin); + + MainConsole.Instance.Commands.AddCommand("Integration", true, + "enable plugin", "enable plugin \"plugin name\"","enable the plugin", + HandleConsoleEnablePlugin); + } + + #region console handlers + // Handle our console commands + // + // Install plugin from registered repository + /// + /// Handles the console install plugin command. Attempts to install the selected plugin + /// and + /// + /// + /// Module. + /// + /// + /// Cmd. + /// + private void HandleConsoleInstallPlugin(string module, string[] cmd) + { + Dictionary result = new Dictionary(); + + if (cmd.Length == 2) + { + int ndx = Convert.ToInt16(cmd[1]); + if (m_PluginManager.InstallPlugin(ndx, out result) == true) + { + ArrayList s = new ArrayList(); + s.AddRange(result.Keys); + s.Sort(); + + var list = result.Keys.ToList(); + list.Sort(); + foreach (var k in list) + { + Dictionary plugin = (Dictionary)result[k]; + bool enabled = (bool)plugin["enabled"]; + MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}", + k, + enabled == true ? "[ ]" : "[X]", + plugin["name"], plugin["version"]); + } + } + } + return; + } + + // Remove installed plugin + private void HandleConsoleUnInstallPlugin(string module, string[] cmd) + { + if (cmd.Length == 2) + { + int ndx = Convert.ToInt16(cmd[1]); + m_PluginManager.UnInstall(ndx); + } + return; + } + + // Check installed plugins **not working + private void HandleConsoleCheckInstalledPlugin(string module, string[] cmd) + { + MainConsole.Instance.Output(m_PluginManager.CheckInstalled()); + return; + } + + // List installed plugins + private void HandleConsoleListInstalledPlugin(string module, string[] cmd) + { + Dictionary result = new Dictionary(); + m_PluginManager.ListInstalledAddins(out result); + + ArrayList s = new ArrayList(); + s.AddRange(result.Keys); + s.Sort(); + + var list = result.Keys.ToList(); + list.Sort(); + foreach (var k in list) + { + Dictionary plugin = (Dictionary)result[k]; + bool enabled = (bool)plugin["enabled"]; + MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}", + k, + enabled == true ? "[ ]" : "[X]", + plugin["name"], plugin["version"]); + } + return; + } + + // List available plugins on registered repositories + private void HandleConsoleListAvailablePlugin(string module, string[] cmd) + { + Dictionary result = new Dictionary(); + m_PluginManager.ListAvailable(out result); + + var list = result.Keys.ToList(); + list.Sort(); + foreach (var k in list) + { + // name, version, repository + Dictionary plugin = (Dictionary)result[k]; + MainConsole.Instance.OutputFormat("{0}) {1} rev. {2} {3}", + k, + plugin["name"], + plugin["version"], + plugin["repository"]); + } + return; + } + + // List available updates **not ready + private void HandleConsoleListUpdates(string module, string[] cmd) + { + m_PluginManager.ListUpdates(); + return; + } + + // Update plugin **not ready + private void HandleConsoleUpdatePlugin(string module, string[] cmd) + { + MainConsole.Instance.Output(m_PluginManager.Update()); + return; + } + + // Register repository + private void HandleConsoleAddRepo(string module, string[] cmd) + { + if ( cmd.Length == 3) + { + m_PluginManager.AddRepository(cmd[2]); + } + return; + } + + // Get repository status **not working + private void HandleConsoleGetRepo(string module, string[] cmd) + { + m_PluginManager.GetRepository(); + return; + } + + // Remove registered repository + private void HandleConsoleRemoveRepo(string module, string[] cmd) + { + if (cmd.Length == 3) + m_PluginManager.RemoveRepository(cmd); + return; + } + + // Enable repository + private void HandleConsoleEnableRepo(string module, string[] cmd) + { + m_PluginManager.EnableRepository(cmd); + return; + } + + // Disable repository + private void HandleConsoleDisableRepo(string module, string[] cmd) + { + m_PluginManager.DisableRepository(cmd); + return; + } + + // List repositories + private void HandleConsoleListRepos(string module, string[] cmd) + { + Dictionary result = new Dictionary(); + m_PluginManager.ListRepositories(out result); + + var list = result.Keys.ToList(); + list.Sort(); + foreach (var k in list) + { + Dictionary repo = (Dictionary)result[k]; + bool enabled = (bool)repo["enabled"]; + MainConsole.Instance.OutputFormat("{0}) {1} {2}", + k, + enabled == true ? "[ ]" : "[X]", + repo["name"], repo["url"]); + } + + return; + } + + // Show description information + private void HandleConsoleShowAddinInfo(string module, string[] cmd) + { + if (cmd.Length >= 3) + { + + Dictionary result = new Dictionary(); + + int ndx = Convert.ToInt16(cmd[2]); + m_PluginManager.AddinInfo(ndx, out result); + + MainConsole.Instance.OutputFormat("Name: {0}\nURL: {1}\nFile: {2}\nAuthor: {3}\nCategory: {4}\nDesc: {5}", + result["name"], + result["url"], + result["file_name"], + result["author"], + result["category"], + result["description"]); + + return; + } + } + + // Disable plugin + private void HandleConsoleDisablePlugin(string module, string[] cmd) + { + m_PluginManager.DisablePlugin(cmd); + return; + } + + // Enable plugin + private void HandleConsoleEnablePlugin(string module, string[] cmd) + { + m_PluginManager.EnablePlugin(cmd); + return; + } + #endregion + + // ****[ Robust ] These are handlers that relate to the console commands, but + // ****[ Robust ] are connecting to remote applications. It would be ok to do + // ****[ Robust ] this later in a separate module + // + #region IIntegrationService implementation + // Will hold back on implementing things here that can actually make changes + // Need to secure it first + public byte[] HandleWebListRepositories(OSDMap request) + { + Dictionary result = new Dictionary(); + m_PluginManager.ListRepositories(out result); + string json = LitJson.JsonMapper.ToJson(result); + return Ux.DocToBytes(json); + } + + public byte[] HandleWebAddRepository(OSDMap request) + { + return Ux.FailureResult("Not Implemented"); + } + + public byte[] HandleWebRemoveRepositroy(OSDMap request) + { + return Ux.FailureResult("Not Implemented"); + } + + public byte[] HandleEnableRepository(OSDMap request) + { + return Ux.FailureResult("Not Implemented"); + } + + public byte[] HandleWebDisableRepository(OSDMap request) + { + return Ux.FailureResult("Not Implemented"); + } + + public byte[] HandleWebListPlugins(OSDMap request) + { + Dictionary result = new Dictionary(); + m_PluginManager.ListInstalledAddins(out result); + string json = LitJson.JsonMapper.ToJson(result); + return Ux.DocToBytes(json); + } + + public byte[] HandleWebPluginInfo(OSDMap request) + { + Dictionary result = new Dictionary(); + + if(!String.IsNullOrEmpty(request["index"].ToString())) + { + int ndx = Convert.ToInt16(request["index"].ToString()); + m_PluginManager.AddinInfo(ndx, out result); + string json = LitJson.JsonMapper.ToJson(result); + return Ux.DocToBytes(json); + } + else + { + return Ux.FailureResult("No index supplied"); + } + } + + public byte[] HandleWebListAvailablePlugins(OSDMap request) + { + Dictionary result = new Dictionary(); + m_PluginManager.ListAvailable(out result); + string json = LitJson.JsonMapper.ToJson(result); + return Ux.DocToBytes(json); + } + + public byte[] HandleWebInstallPlugin(OSDMap request) + { + Dictionary result = new Dictionary(); + int ndx = Convert.ToInt16(request["index"].ToString()); + if (m_PluginManager.InstallPlugin(ndx, out result) == true) + { + string json = LitJson.JsonMapper.ToJson(result); + return Ux.DocToBytes(json); + } + else + { + return Ux.FailureResult("No index supplied"); + } + } + + public byte[] HandleWebUnInstallPlugin(OSDMap request) + { + return Ux.FailureResult("Not Implemented"); + } + + public byte[] HandleWebEnablePlugin(OSDMap request) + { + return Ux.FailureResult("Not Implemented"); + } + + public byte[] HandleWebDisablePlugin(OSDMap request) + { + return Ux.FailureResult("Not Implemented"); + } + #endregion + } +} \ No newline at end of file diff --git a/OpenSim/Services/IntegrationService/IntegrationServiceBase.cs b/OpenSim/Services/IntegrationService/IntegrationServiceBase.cs new file mode 100644 index 0000000000..82a5930896 --- /dev/null +++ b/OpenSim/Services/IntegrationService/IntegrationServiceBase.cs @@ -0,0 +1,301 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +using System; +using System.IO; +using OpenSim.Services.Interfaces; +using OpenSim.Services.Base; +using OpenSim.Framework.Servers.HttpServer; +using System.Reflection; +using Nini.Config; +using OpenSim.Framework; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; +using Mono.Addins; +using log4net; +using Ux = OpenSim.Services.IntegrationService.IntegrationUtils; + + +// ****[ Robust ] Re-factor to use in both OpenSim.exe and Robust.exe +// ****[ Robust ] ** Loading can be done in modules that overide a base +// ****[ Robust ] ** class that provides the base services for the +// ****[ Robust ] ** discovery, loading and event queing of the modules + + +// ****[ Robust ] We need to define our root to graft our modules into +[assembly:AddinRoot("IntegrationService", "2.1")] +namespace OpenSim.Services.IntegrationService +{ + // ****[ Robust ] The name our modules look for as a dependency + [TypeExtensionPoint(Path="/OpenSim/IntegrationService", Name="IntegrationService")] + public interface IntegrationPlugin + { + void Init(IConfigSource MainConfig, IConfigSource PluginConfig, IHttpServer server, ServiceBase service); + void Unload(); + string PluginName { get; } + string ConfigName { get; } + string DefaultConfig { get; } + } + + // Hide the nasty stuff in here, let the IntegrationService be clean for + // our command and request handlers + public class IntegrationServiceBase : ServiceBase + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private string m_ConfigName = "IntegrationService"; + + protected IHttpServer m_Server; + + protected string m_IntegrationConfig; + protected PluginManager m_PluginManager; + AddinManager am; + + protected IConfig m_IntegrationServerConfig; + protected string m_IntegrationConfigLoc; + IConfigSource m_ConfigSource; + + public IntegrationServiceBase(IConfigSource config, IHttpServer server) + : base(config) + { + m_ConfigSource = config; + m_Server = server; + + IConfig serverConfig = m_ConfigSource.Configs[m_ConfigName]; + if (serverConfig == null) + throw new Exception(String.Format("No section {0} in config file", m_ConfigName)); + + m_IntegrationConfigLoc = serverConfig.GetString("IntegrationConfig", String.Empty); + AddinRegistry registry ; + bool DEVELOPMENT = serverConfig.GetBoolean("DevelopmentMode", false); + + // ****[ Robust ] Would be able to load as a local Robust module, + // ****[ Robust ] during development, by adding the info to the + // ****[ Robust ] ServiceConnectors. Also allows modules to be + // ****[ Robust ] loaded locally under normal operations + // + // Are we developing plugins? We will load them now. + // This will allow debugging of the modules and will + // use the runtime directory for the registry. Will not + // be able to use the repo/registry commands ... + if (DEVELOPMENT == true) + { + AddinManager.Initialize("."); + registry = new AddinRegistry(".", "."); + registry.Update(); + + AddinManager.AddinLoaded += on_addinloaded_; + AddinManager.AddinLoadError += on_addinloaderror_; + AddinManager.AddinUnloaded += HandleAddinManagerAddinUnloaded; + AddinManager.AddinEngine.ExtensionChanged += HandleAddinManagerAddinEngineExtensionChanged; + + registry.Update(); + foreach (IntegrationPlugin cmd in AddinManager.GetExtensionObjects("/OpenSim/IntegrationService")) + { + m_log.DebugFormat("[INTEGRATION SERVICE]: Processing Addin {0}", cmd.PluginName); + LoadingPlugin(cmd); + } + + Addin[] addins = registry.GetAddins(); + foreach (Addin addin in addins) + { + if (addin.Description.Category == "IntegrationPlugin") + { + m_log.DebugFormat("[INTEGRATION SERVICE]: Processing O Addin {0}", addin.Name); + addin.Enabled = true; + registry.EnableAddin(addin.Id); + registry.Update(); + AddinManager.AddinEngine.LoadAddin(null, addin.Id); + } + } + } + // ****[ Robust ] Place this in a loader that getsd called from + // Robust after the main server is running + // + // ****[ Robust ] Make generic version of this to be overridden + // ****[ Robust ] by OpenSim.exe and Robust.exe + // + else + { + // defaults to the ./bin directory + string RegistryLocation = serverConfig.GetString("PluginRegistryLocation", "."); + + registry = new AddinRegistry(RegistryLocation, "."); + m_PluginManager = new PluginManager(registry); + + // Deal with files only for now - will add url/environment later + m_IntegrationConfigLoc = serverConfig.GetString("IntegrationConfig", String.Empty); + if(String.IsNullOrEmpty(m_IntegrationConfigLoc)) + m_log.Error("[INTEGRATION SERVICE]: No IntegrationConfig defined in the Robust.ini"); + + + m_IntegrationServerConfig = m_ConfigSource.Configs["IntegrationService"]; + if (m_IntegrationServerConfig == null) + { + throw new Exception("[INTEGRATION SERVICE]: Missing configuration"); + return; + } + + AddinManager.Initialize(RegistryLocation); + AddinManager.Registry.Update(); + + AddinManager.AddinLoaded += on_addinloaded_; + AddinManager.AddinLoadError += on_addinloaderror_; + AddinManager.AddinUnloaded += HandleAddinManagerAddinUnloaded; + + // Installed extensions are queried here and cause the registered events to fire + AddinManager.AddExtensionNodeHandler("/OpenSim/IntegrationService", OnExtensionChanged); + + + + } + } + + #region addin event handlers + void HandleAddinManagerAddinEngineExtensionChanged(object sender, ExtensionEventArgs args) + { + MainConsole.Instance.Output(String.Format("Plugin Extension Change Path:{0}", args.Path)); + } + + private IConfigSource GetConfig(string configName) + { + return new IniConfigSource(); + } + + void HandleAddinManagerAddinUnloaded(object sender, AddinEventArgs args) + { + MainConsole.Instance.Output("Plugin Unloaded"); + } + + private void on_addinloaderror_(object sender, AddinErrorEventArgs args) + { + if (args.Exception == null) + m_log.Error("[INTEGRATION SERVICE]: Plugin Error: " + + args.Message); + else + m_log.Error("[INTEGRATION SERVICE]: Plugin Error: " + + args.Exception.Message + "\n" + + args.Exception.StackTrace); + } + + // ****[ Robust ] This is where we get control of the plugin during + // ****[ Robust ] the loading and unloading + // + // This is our init + // We can do build-up and tear-down of our plugin + void OnExtensionChanged(object s, ExtensionNodeEventArgs args) + { + // This is our plugin + IntegrationPlugin ip = (IntegrationPlugin) args.ExtensionObject; + // We will need to get the name and path of the dll for the connector to + // be able to load the service in the refactored version... + // Might also use this to check for updates to alert the user + Addin a = m_PluginManager.Registry.GetAddin(args.ExtensionNode.Addin.Id); + m_log.InfoFormat("[INTEGRATION SERVICE]: Plugin Change {0}",a.AddinFile); + + switch (args.Change) + { + // Build up + case ExtensionChange.Add: + + m_log.DebugFormat("[INTEGRATION SERVICE]: Plugin Added {0}", ip.PluginName); + LoadingPlugin(ip); + return; + + // Tear down + case ExtensionChange.Remove: + + m_log.DebugFormat("[INTEGRATION SERVICE]: Plugin Remove {0}", ip.PluginName); + UnLoadingPlugin(ip); + return; + } + } + + private void on_addinloaded_(object sender, AddinEventArgs args) + { + m_log.Info("[INTEGRATION SERVICE]: Plugin Loaded: " + args.AddinId); + } + #endregion addin-event handlers + + // ****[ Robust ] We are taking the module from the event handler and + // ****[ Robust ] taking it through the initialization process + // ****[ Robust ] This is using a mixture of the user's existing ini + // ****[ Robust ] and the developer supplied initial configuration + // ****[ Robust ] + // ****[ Robust ] We should first check the user's ini for existing entries + // ****[ Robust ] in case they have configured the module ahead of time. + // + private void LoadingPlugin(IntegrationPlugin plugin) + { + string ConfigPath = String.Format("{0}/(1)", m_IntegrationConfigLoc,plugin.ConfigName); + IConfigSource PlugConfig = Ux.GetConfigSource(m_IntegrationConfigLoc, plugin.ConfigName); + + // We maintain a configuration per-plugin to enhance modularity + // If ConfigSource is null, we will get the default from the repo + // and write it to our directory + // Fetch the starter ini + if (PlugConfig == null) + { + m_log.DebugFormat("[INTEGRATION SERVICE]: Fetching starter config for {0} from {1}", plugin.PluginName, plugin.DefaultConfig); + + // Send the default data service + IConfig DataService = m_ConfigSource.Configs["DatabaseService"]; + m_log.DebugFormat("[INTEGRATION SERVICE]: Writing initial config to {0}", plugin.ConfigName); + + IniConfigSource source = new IniConfigSource(); + IConfig Init = source.AddConfig("DatabaseService"); + Init.Set("StorageProvider",(string)DataService.GetString("StorageProvider")); + Init.Set("ConnectionString", String.Format("\"{0}\"",DataService.GetString("ConnectionString"))); + + PlugConfig = Ux.LoadInitialConfig(plugin.DefaultConfig); + source.Merge(PlugConfig); + source.Save(Path.Combine(m_IntegrationConfigLoc, plugin.ConfigName)); + PlugConfig = Ux.GetConfigSource(m_IntegrationConfigLoc, plugin.ConfigName); + } + + m_log.DebugFormat("[INTEGRATION SERVICE]: ****** In Loading Plugin {0}", plugin.PluginName); + plugin.Init(m_ConfigSource, PlugConfig, m_Server, this); + } + + // ****[ Robust ] We are taking the plugin from the event handler to unload it + // ****[ Robust ] and we need to tear down to release all objects. + // + private void UnLoadingPlugin(IntegrationPlugin plugin) + { + try + { + plugin.Unload(); + } + catch(Exception e) + { + // Getting some "Error Object reference not set to an instance of an object" + // when the plugins are unloaded. This keeps things quiet for now + // m_log.DebugFormat("[INTEGRATION SERVICE]: Error {0}", e.Message); + } + } + } +} diff --git a/OpenSim/Services/IntegrationService/IntegrationUtils.cs b/OpenSim/Services/IntegrationService/IntegrationUtils.cs new file mode 100644 index 0000000000..70ae9074d3 --- /dev/null +++ b/OpenSim/Services/IntegrationService/IntegrationUtils.cs @@ -0,0 +1,161 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +using System; +using System.IO; +using System.Reflection; +using System.Text; +using System.Xml; +using log4net; +using Nini.Config; +using OpenMetaverse.StructuredData; + + +namespace OpenSim.Services.IntegrationService +{ + public static class IntegrationUtils + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + // ****[ Robust ] Only a couple of these are needed in the core management system + // ****[ Robust ] These could be moved to the implementation instead of being in + // ****[ Robust ] a separate file + // + #region web utils + public static bool ParseStringToOSDMap(string input, out OSDMap json) + { + try + { + json = null; + OSD tmpbuff = null; + + try + { + tmpbuff = OSDParser.DeserializeJson(input.ToString()); + } + catch + { + return false; + } + + if (tmpbuff.Type == OSDType.Map) + { + json = (OSDMap)tmpbuff; + return true; + } else + return false; + } + catch (NullReferenceException e) + { + m_log.ErrorFormat("[IUtil]: exception on ParseStringToJson {0}", e.Message); + json = null; + return false; + } + } + + public static byte[] FailureResult() + { + return FailureResult(String.Empty); + } + + public static byte[] FailureResult(string msg) + { + OSDMap doc = new OSDMap(2); + doc["result"] = OSD.FromString("failure"); + doc["message"] = OSD.FromString(msg); + + return DocToBytes(doc); + } + + public static byte[] ResponseMessage(string message) + { + OSDMap doc = new OSDMap(2); + doc["result"] = OSD.FromString("success"); + doc["message"] = OSD.FromString(message); + + return DocToBytes(doc); + } + + public static byte[] DocToBytes(OSDMap doc) + { + return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(doc)); + } + + public static byte[] DocToBytes(string json) + { + return Encoding.UTF8.GetBytes(json); + } + #endregion web utils + + #region config utils + public static IConfigSource GetConfigSource(string IniPath, string IniName) + { + string configFilePath = Path.GetFullPath( + Path.Combine(IniPath, IniName)); + + if (File.Exists(configFilePath)) + { + IConfigSource config = new IniConfigSource(configFilePath); + return config; + } + else + { + return null; + } + } + + public static IConfigSource LoadInitialConfig(string url) + { + IConfigSource source = new XmlConfigSource(); + m_log.InfoFormat("[CONFIG]: {0} is a http:// URI, fetching ...", url); + + // The ini file path is a http URI + // Try to read it + try + { + XmlReader r = XmlReader.Create(url); + IConfigSource cs = new XmlConfigSource(r); + source.Merge(cs); + } + catch (Exception e) + { + m_log.FatalFormat("[CONFIG]: Exception reading config from URI {0}\n" + e.ToString(), url); + Environment.Exit(1); + } + + return source; + } + #endregion config utils + + public static T LoadPlugin(string dllName, Object[] args) where T:class + { + return OpenSim.Server.Base.ServerUtils.LoadPlugin(dllName, args); + + } + } +} diff --git a/OpenSim/Services/IntegrationService/PluginManager.cs b/OpenSim/Services/IntegrationService/PluginManager.cs new file mode 100644 index 0000000000..4c1db4bc6b --- /dev/null +++ b/OpenSim/Services/IntegrationService/PluginManager.cs @@ -0,0 +1,561 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Text; +using System.Linq; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Mono.Addins; +using Mono.Addins.Setup; +using Mono.Addins.Description; +using OpenSim.Framework; +using Ux = OpenSim.Services.IntegrationService.IntegrationUtils; + +namespace OpenSim.Services.IntegrationService +{ + // ****[ Robust ] These are the functions that connect our console + // ****[ Robust ] commands to the addin management. This needs to + // ****[ Robust ] be maintained in a file separately from the main + // ****[ Robust ] implementation in the same namespace. Any generaly + // ****[ Robust ] usefull methods can be located in one of the existing + // ****[ Robust ] places + // ****[ Robust ] + // ****[ Robust ] This needs to be in OpenSim.Framework so it can be + // ****[ Robust ] used to complete the region module management + // + // This will maintain the plugin repositories and plugins + public class PluginManager : SetupService + { + protected AddinRegistry m_Registry; + + /// + /// Initializes a new instance of the class. + /// + /// + /// R. + /// + internal PluginManager(AddinRegistry r): base (r) + { + m_Registry = r; + m_Registry.Update(); + } + + /// + /// Installs the plugin. + /// + /// + /// The plugin. + /// + /// + /// Arguments. + /// + public bool InstallPlugin(int ndx, out Dictionary result) + { + Dictionary res = new Dictionary(); + + PackageCollection pack = new PackageCollection(); + PackageCollection toUninstall; + DependencyCollection unresolved; + + IProgressStatus ps = new ConsoleProgressStatus(false); + + AddinRepositoryEntry[] available = GetSortedAvailbleAddins(); + + if (ndx > (available.Length - 1)) + { + MainConsole.Instance.Output("Selection out of range"); + result = res; + return false; + } + + AddinRepositoryEntry aentry = available[ndx]; + + Package p = Package.FromRepository(aentry); + pack.Add(p); + + ResolveDependencies(ps, pack, out toUninstall, out unresolved); + + // Attempt to install the plugin disabled + if (Install(ps, pack) == true) + { + m_Registry.Update(ps); + Addin addin = m_Registry.GetAddin(aentry.Addin.Id); + m_Registry.DisableAddin(addin.Id); + addin.Enabled = false; + + MainConsole.Instance.Output("Installation Success"); + ListInstalledAddins(out res); + result = res; + return true; + } + else + { + MainConsole.Instance.Output("Installation Failed"); + result = res; + return false; + } + } + + // Remove plugin + /// + /// Uns the install. + /// + /// + /// Arguments. + /// + public void UnInstall(int ndx) + { + Addin[] addins = GetSortedAddinList("IntegrationPlugin"); + + if (ndx > (addins.Length -1)) + { + MainConsole.Instance.Output("Selection out of range"); + return; + } + + Addin addin = addins[ndx]; + MainConsole.Instance.OutputFormat("Uninstalling plugin {0}", addin.Id); + AddinManager.Registry.DisableAddin(addin.Id); + addin.Enabled = false; + IProgressStatus ps = new ConsoleProgressStatus(false); + Uninstall(ps, addin.Id); + MainConsole.Instance.Output("Uninstall Success - restart to complete operation"); + return; + } + + /// + /// Checks the installed. + /// + /// + /// The installed. + /// + public string CheckInstalled() + { + return "CheckInstall"; + } + + /// + /// Lists the installed addins. + /// + /// + /// Result. + /// + public void ListInstalledAddins(out Dictionary result) + { + Dictionary res = new Dictionary(); + + Addin[] addins = GetSortedAddinList("IntegrationPlugin"); + + int count = 0; + foreach (Addin addin in addins) + { + Dictionary r = new Dictionary(); + r["enabled"] = addin.Enabled == true ? true : false; + r["name"] = addin.LocalId; + r["version"] = addin.Version; + + res.Add(count.ToString(), r); + + count++; + } + result = res; + return; + } + + // List compatible plugins in registered repositories + /// + /// Lists the available. + /// + /// + /// Result. + /// + public void ListAvailable(out Dictionary result) + { + Dictionary res = new Dictionary(); + + AddinRepositoryEntry[] addins = GetSortedAvailbleAddins(); + + int count = 0; + foreach (AddinRepositoryEntry addin in addins) + { + Dictionary r = new Dictionary(); + r["name"] = addin.Addin.Name; + r["version"] = addin.Addin.Version; + r["repository"] = addin.RepositoryName; + + res.Add(count.ToString(), r); + count++; + } + result = res; + return; + } + + // List available updates ** 1 + /// + /// Lists the updates. + /// + public void ListUpdates() + { + IProgressStatus ps = new ConsoleProgressStatus(true); + Console.WriteLine ("Looking for updates..."); + Repositories.UpdateAllRepositories (ps); + Console.WriteLine ("Available add-in updates:"); + bool found = false; + AddinRepositoryEntry[] entries = Repositories.GetAvailableUpdates(); + + foreach (AddinRepositoryEntry entry in entries) + { + Console.WriteLine(String.Format("{0}",entry.Addin.Id)); + } + } + + // Sync to repositories + /// + /// Update this instance. + /// + public string Update() + { + IProgressStatus ps = new ConsoleProgressStatus(true); + Repositories.UpdateAllRepositories(ps); + return "Update"; + } + + // Register a repository + /// + /// Register a repository with our server. + /// + /// + /// result of the action + /// + /// + /// The URL of the repository we want to add + /// + public bool AddRepository(string repo) + { + Repositories.RegisterRepository(null, repo, true); + return true; + } + + /// + /// Gets the repository. + /// + public void GetRepository() + { + Repositories.UpdateAllRepositories(new ConsoleProgressStatus(false)); + } + + // Remove a repository from the list + /// + /// Removes the repository. + /// + /// + /// Arguments. + /// + public void RemoveRepository(string[] args) + { + AddinRepository[] reps = Repositories.GetRepositories(); + Array.Sort(reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); + if (reps.Length == 0) + { + MainConsole.Instance.Output("No repositories have been registered."); + return; + } + + int n = Convert.ToInt16(args[2]); + if (n > (reps.Length -1)) + { + MainConsole.Instance.Output("Selection out of range"); + return; + } + + AddinRepository rep = reps[n]; + Repositories.RemoveRepository(rep.Url); + return; + } + + // Enable repository + /// + /// Enables the repository. + /// + /// + /// Arguments. + /// + public void EnableRepository(string[] args) + { + AddinRepository[] reps = Repositories.GetRepositories(); + Array.Sort(reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); + if (reps.Length == 0) + { + MainConsole.Instance.Output("No repositories have been registered."); + return; + } + + int n = Convert.ToInt16(args[2]); + if (n > (reps.Length -1)) + { + MainConsole.Instance.Output("Selection out of range"); + return; + } + + AddinRepository rep = reps[n]; + Repositories.SetRepositoryEnabled(rep.Url, true); + return; + } + + // Disable a repository + /// + /// Disables the repository. + /// + /// + /// Arguments. + /// + public void DisableRepository(string[] args) + { + AddinRepository[] reps = Repositories.GetRepositories(); + Array.Sort(reps, (r1,r2) => r1.Title.CompareTo(r2.Title)); + if (reps.Length == 0) + { + MainConsole.Instance.Output("No repositories have been registered."); + return; + } + + int n = Convert.ToInt16(args[2]); + if (n > (reps.Length -1)) + { + MainConsole.Instance.Output("Selection out of range"); + return; + } + + AddinRepository rep = reps[n]; + Repositories.SetRepositoryEnabled(rep.Url, false); + return; + } + + // List registered repositories + /// + /// Lists the repositories. + /// + /// + /// Result. + /// + public void ListRepositories(out Dictionary result) + { + Dictionary res = new Dictionary(); + result = res; + + AddinRepository[] reps = GetSortedAddinRepo(); + if (reps.Length == 0) + { + MainConsole.Instance.Output("No repositories have been registered."); + return; + } + + int count = 0; + foreach (AddinRepository rep in reps) + { + Dictionary r = new Dictionary(); + r["enabled"] = rep.Enabled == true ? true : false; + r["name"] = rep.Name; + r["url"] = rep.Url; + + res.Add(count.ToString(), r); + count++; + } + return; + } + + /// + /// Updates the registry. + /// + public void UpdateRegistry() + { + m_Registry.Update(); + } + + // Show plugin info + /// + /// Addins the info. + /// + /// + /// The info. + /// + /// + /// Arguments. + /// + public bool AddinInfo(int ndx, out Dictionary result) + { + Dictionary res = new Dictionary(); + result = res; + + Addin[] addins = GetSortedAddinList("IntegrationPlugin"); + + if (ndx > (addins.Length - 1)) + { + MainConsole.Instance.Output("Selection out of range"); + return false; + } + // author category description + Addin addin = addins[ndx]; + + res["author"] = addin.Description.Author; + res["category"] = addin.Description.Category; + res["description"] = addin.Description.Description; + res["name"] = addin.Name; + res["url"] = addin.Description.Url; + res["file_name"] = addin.Description.FileName; + + result = res; + return true; + } + + // Disable a plugin + /// + /// Disables the plugin. + /// + /// + /// Arguments. + /// + public void DisablePlugin(string[] args) + { + Addin[] addins = GetSortedAddinList("IntegrationPlugin"); + + int n = Convert.ToInt16(args[2]); + if (n > (addins.Length -1)) + { + MainConsole.Instance.Output("Selection out of range"); + return; + } + + Addin addin = addins[n]; + AddinManager.Registry.DisableAddin(addin.Id); + addin.Enabled = false; + return; + } + + // Enable plugin + /// + /// Enables the plugin. + /// + /// + /// Arguments. + /// + public void EnablePlugin(string[] args) + { + Addin[] addins = GetSortedAddinList("IntegrationPlugin"); + + int n = Convert.ToInt16(args[2]); + if (n > (addins.Length -1)) + { + MainConsole.Instance.Output("Selection out of range"); + return; + } + + Addin addin = addins[n]; + + addin.Enabled = true; + AddinManager.Registry.EnableAddin(addin.Id); + // AddinManager.Registry.Update(); + if(m_Registry.IsAddinEnabled(addin.Id)) + { + ConsoleProgressStatus ps = new ConsoleProgressStatus(false); + if (!AddinManager.AddinEngine.IsAddinLoaded(addin.Id)) + { + AddinManager.Registry.Rebuild(ps); + AddinManager.AddinEngine.LoadAddin(ps, addin.Id); + } + } + else + { + MainConsole.Instance.OutputFormat("Not Enabled in this domain {0}", addin.Name); + } + return; + } + + #region Util + private void Testing() + { + Addin[] list = Registry.GetAddins(); + + var addins = list.Where( a => a.Description.Category == "IntegrationPlugin"); + + foreach (Addin addin in addins) + { + MainConsole.Instance.OutputFormat("Addin {0}", addin.Name); + } + } + + // These will let us deal with numbered lists instead + // of needing to type in the full ids + private AddinRepositoryEntry[] GetSortedAvailbleAddins() + { + ArrayList list = new ArrayList(); + list.AddRange(Repositories.GetAvailableAddins()); + + AddinRepositoryEntry[] addins = list.ToArray(typeof(AddinRepositoryEntry)) as AddinRepositoryEntry[]; + + Array.Sort(addins,(r1,r2) => r1.Addin.Id.CompareTo(r2.Addin.Id)); + + return addins; + } + + private AddinRepository[] GetSortedAddinRepo() + { + ArrayList list = new ArrayList(); + list.AddRange(Repositories.GetRepositories()); + + AddinRepository[] repos = list.ToArray(typeof(AddinRepository)) as AddinRepository[]; + Array.Sort (repos,(r1,r2) => r1.Name.CompareTo(r2.Name)); + + return repos; + } + + private Addin[] GetSortedAddinList(string category) + { + ArrayList list = new ArrayList(); + list.AddRange(m_Registry.GetAddins()); + ArrayList xlist = new ArrayList(); + + foreach (Addin addin in list) + { + if (addin.Description.Category == category) + xlist.Add(addin); + } + + Addin[] addins = xlist.ToArray(typeof(Addin)) as Addin[]; + Array.Sort(addins,(r1,r2) => r1.Id.CompareTo(r2.Id)); + + return addins; + } + #endregion Util + + #region Notes + // ** 1 Not working + #endregion Notes + } +} \ No newline at end of file diff --git a/OpenSim/Services/Interfaces/IIntegrationService.cs b/OpenSim/Services/Interfaces/IIntegrationService.cs new file mode 100644 index 0000000000..1b5e803ba3 --- /dev/null +++ b/OpenSim/Services/Interfaces/IIntegrationService.cs @@ -0,0 +1,55 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; + +namespace OpenSim.Services.Interfaces +{ + public interface IIntegrationService + { + #region Web handlers + byte[] HandleWebListRepositories(OSDMap request); + byte[] HandleWebAddRepository(OSDMap request); + byte[] HandleWebRemoveRepositroy(OSDMap request); + byte[] HandleEnableRepository(OSDMap request); + byte[] HandleWebDisableRepository(OSDMap request); + byte[] HandleWebListPlugins(OSDMap request); + byte[] HandleWebPluginInfo(OSDMap request); + byte[] HandleWebListAvailablePlugins(OSDMap request); + byte[] HandleWebInstallPlugin(OSDMap request); + byte[] HandleWebUnInstallPlugin(OSDMap request); + byte[] HandleWebEnablePlugin(OSDMap request); + byte[] HandleWebDisablePlugin(OSDMap request); + #endregion + } +} + diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs index 8d583fff73..c87a5644b7 100644 --- a/OpenSim/Services/Interfaces/IPresenceService.cs +++ b/OpenSim/Services/Interfaces/IPresenceService.cs @@ -68,6 +68,7 @@ namespace OpenSim.Services.Interfaces bool ReportAgent(UUID sessionID, UUID regionID); PresenceInfo GetAgent(UUID sessionID); + PresenceInfo VerifyAgent(UUID s_sessionID); PresenceInfo[] GetAgents(string[] userIDs); } } diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index ed2703eda5..550fe48496 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -158,5 +158,19 @@ namespace OpenSim.Services.PresenceService return info.ToArray(); } + + public PresenceInfo VerifyAgent(UUID s_sessionID) + { + PresenceInfo ret = new PresenceInfo(); + + PresenceData data = m_Database.Verify(s_sessionID); + if (data == null) + return null; + + ret.UserID = data.UserID; + ret.RegionID = data.RegionID; + + return ret; + } } } \ No newline at end of file diff --git a/bin/DevDefined.OAuth.dll b/bin/DevDefined.OAuth.dll new file mode 100755 index 0000000000..3754489920 Binary files /dev/null and b/bin/DevDefined.OAuth.dll differ diff --git a/bin/Mono.Addins.CecilReflector.dll b/bin/Mono.Addins.CecilReflector.dll index a1a638265c..0a61eaae17 100755 Binary files a/bin/Mono.Addins.CecilReflector.dll and b/bin/Mono.Addins.CecilReflector.dll differ diff --git a/bin/Mono.Addins.Setup.dll b/bin/Mono.Addins.Setup.dll index 8aa6d5f2cf..37ce9e7cb3 100755 Binary files a/bin/Mono.Addins.Setup.dll and b/bin/Mono.Addins.Setup.dll differ diff --git a/bin/Mono.Addins.dll b/bin/Mono.Addins.dll index ea330fdc9b..9a6b7d4e82 100755 Binary files a/bin/Mono.Addins.dll and b/bin/Mono.Addins.dll differ diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index f5e6bc62b0..29e0b18676 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -21,7 +21,7 @@ ; * [[@]/][:] ; * [Startup] -ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,HGAssetService@8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector,8002/OpenSim.Server.Handlers.dll:HGFriendsServerConnector,8002/OpenSim.Server.Handlers.dll:InstantMessageServerConnector,8003/OpenSim.Server.Handlers.dll:MapAddServiceConnector,8002/OpenSim.Server.Handlers.dll:MapGetServiceConnector" +ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,HGAssetService@8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector,8002/OpenSim.Server.Handlers.dll:HGFriendsServerConnector,8002/OpenSim.Server.Handlers.dll:InstantMessageServerConnector,8003/OpenSim.Server.Handlers.dll:MapAddServiceConnector,8002/OpenSim.Server.Handlers.dll:MapGetServiceConnector,8002/OpenSim.Server.Handlers.dll:IntegrationServiceConnector" ; * This is common for all services, it's the network setup for the entire ; * server instance, if none is specified above @@ -465,3 +465,18 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ;; This applies to the core groups module (Flotsam) only. ; ForwardOfflineGroupMessages = true +[IntegrationService] + + LocalServiceModule = "OpenSim.Services.IntegrationService.dll:IntegrationService" + + ;; Location for plugin management data, default is "." + PluginRegistryLocation="/home/opensim/var/run/addin/Integration" + ;; + ;; Each plugin uses it's own ini (for now these are files only) + ;; The initial files are supplied by the plugin when it is installed + ;; and this is the location for the directory for these. + IntegrationConfig = "/home/opensim/etc/Integration" + + GridService = "OpenSim.Services.GridService.dll:GridService" + PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" + diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example index 5a9d61341c..36863dc90b 100644 --- a/bin/Robust.ini.example +++ b/bin/Robust.ini.example @@ -13,7 +13,7 @@ ; * [[@]/][:] ; * [Startup] -ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8003/OpenSim.Server.Handlers.dll:MapAddServiceConnector,8002/OpenSim.Server.Handlers.dll:MapGetServiceConnector" +ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8003/OpenSim.Server.Handlers.dll:MapAddServiceConnector,8002/OpenSim.Server.Handlers.dll:MapGetServiceConnector,8002/OpenSim.Server.Handlers.dll:IntegrationServiceConnector" ; * This is common for all services, it's the network setup for the entire ; * server instance, if none is specified above @@ -327,3 +327,19 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; password help: optional: page providing password assistance for users of your grid ;password = http://127.0.0.1/password + +[IntegrationService] + + LocalServiceModule = "OpenSim.Services.IntegrationService.dll:IntegrationService" + + ;; Location for plugin management data, default is "." + PluginRegistryLocation="/home/opensim/var/run/addin/Integration" + ;; + ;; Each plugin uses it's own ini (for now these are files only) + ;; The initial files are supplied by the plugin when it is installed + ;; and this is the location for the directory for these. + IntegrationConfig = "/home/opensim/etc/Integration" + + GridService = "OpenSim.Services.GridService.dll:GridService" + PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" + diff --git a/bin/openjpeg-dotnet-x86_64.dll b/bin/openjpeg-dotnet-x86_64.dll deleted file mode 100755 index 97729fffa0..0000000000 Binary files a/bin/openjpeg-dotnet-x86_64.dll and /dev/null differ diff --git a/bin/openjpeg-dotnet.dll b/bin/openjpeg-dotnet.dll deleted file mode 100755 index 64b2557ece..0000000000 Binary files a/bin/openjpeg-dotnet.dll and /dev/null differ diff --git a/prebuild.xml b/prebuild.xml index f10607d39e..b9830decbd 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -733,6 +733,7 @@ + @@ -1096,6 +1097,44 @@ + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + + + + + + + + + + + + + + + + + +