Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c03418e06 | ||
|
|
6a69c3ac04 | ||
|
|
e8909703ae | ||
|
|
3e546ebbc5 | ||
|
|
bd0dfc1d6d | ||
|
|
05b369965e | ||
|
|
e76fa4c5aa | ||
|
|
027d313703 | ||
|
|
9b1741da0d | ||
|
|
2122748af1 | ||
|
|
040412857c | ||
|
|
70808d6d54 | ||
|
|
083dd0c17c | ||
|
|
b6f6f05e1a | ||
|
|
3d6f9f9cec | ||
|
|
28f0bf7f08 | ||
|
|
0f96b9f41b | ||
|
|
f3f85c3106 | ||
|
|
7bcd6a6842 | ||
|
|
30fff0e78e | ||
|
|
9babd79a66 | ||
|
|
ffc1f6a656 | ||
|
|
e0c4f8ed76 | ||
|
|
a57ec18fb5 | ||
|
|
0a949a20ca | ||
|
|
bb3aa1440d | ||
|
|
1d4bee454e | ||
|
|
d95e6ca0c6 | ||
|
|
3e6043bb47 | ||
|
|
679533f632 | ||
|
|
a798b98f85 | ||
|
|
0838c5288f | ||
|
|
35fa8b454d | ||
|
|
4b278c64d6 | ||
|
|
27845de7ea | ||
|
|
fb18476032 | ||
|
|
74776c4ee0 | ||
|
|
952ad59c1f | ||
|
|
c066f528ef | ||
|
|
0591a85787 | ||
|
|
7a686ef124 | ||
|
|
931c28888b | ||
|
|
d4a6ed3d98 | ||
|
|
b8eafc6280 | ||
|
|
5509d981d4 | ||
|
|
4f4ca1625f | ||
|
|
90a2296983 | ||
|
|
1aab096a83 | ||
|
|
de1d213117 | ||
|
|
f494e6b086 | ||
|
|
2d9971ea93 | ||
|
|
f266e19243 | ||
|
|
e4a69297f6 | ||
|
|
4fa5fa5e08 | ||
|
|
d2cd39d0d8 | ||
|
|
a4cb9639cc | ||
|
|
639c6bdd62 | ||
|
|
b3ecf935cd | ||
|
|
4c5b3adb96 | ||
|
|
335d167ead | ||
|
|
36daea4480 | ||
|
|
5c92aa262a | ||
|
|
445caca18b | ||
|
|
4b90dcfb73 | ||
|
|
ade1acc9d4 | ||
|
|
e8eb9b7e84 |
@@ -135,7 +135,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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -51,10 +51,12 @@ namespace OpenSim.Framework
|
||||
protected object m_senderObject;
|
||||
protected ChatTypeEnum m_type;
|
||||
protected UUID m_fromID;
|
||||
protected UUID m_toID;
|
||||
|
||||
public OSChatMessage()
|
||||
{
|
||||
m_position = new Vector3();
|
||||
m_toID = UUID.Zero;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -102,6 +104,15 @@ namespace OpenSim.Framework
|
||||
set { m_from = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The name of the sender (needed for scripts)
|
||||
/// </summary>
|
||||
public string To
|
||||
{
|
||||
get { return m_from; }
|
||||
set { m_from = value; }
|
||||
}
|
||||
|
||||
#region IEventArgs Members
|
||||
|
||||
/// TODO: Sender and SenderObject should just be Sender and of
|
||||
@@ -131,6 +142,15 @@ namespace OpenSim.Framework
|
||||
set { m_fromID = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The single recipient or all if not set.
|
||||
/// </summary>
|
||||
public UUID TargetUUID
|
||||
{
|
||||
get { return m_toID; }
|
||||
set { m_toID = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
@@ -186,6 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
{
|
||||
string fromName = c.From;
|
||||
UUID fromID = UUID.Zero;
|
||||
UUID targetID = c.TargetUUID;
|
||||
string message = c.Message;
|
||||
IScene scene = c.Scene;
|
||||
Vector3 fromPos = c.Position;
|
||||
@@ -221,24 +222,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
message = message.Substring(0, 1000);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}",
|
||||
// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType);
|
||||
// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}, targetID {5}",
|
||||
// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType, targetID);
|
||||
|
||||
HashSet<UUID> receiverIDs = new HashSet<UUID>();
|
||||
|
||||
|
||||
foreach (Scene s in m_scenes)
|
||||
{
|
||||
// This should use ForEachClient, but clients don't have a position.
|
||||
// If camera is moved into client, then camera position can be used
|
||||
s.ForEachRootScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
if (targetID == UUID.Zero)
|
||||
{
|
||||
// This should use ForEachClient, but clients don't have a position.
|
||||
// If camera is moved into client, then camera position can be used
|
||||
s.ForEachRootScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType, false))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is a send to a specific client eg from llRegionSayTo
|
||||
// no need to check distance etc, jand send is as say
|
||||
ScenePresence presence = s.GetScenePresence(targetID);
|
||||
if (presence != null && !presence.IsChildAgent)
|
||||
{
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, ChatTypeEnum.Say, message, sourceType, true))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(scene as Scene).EventManager.TriggerOnChatToClients(
|
||||
fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
|
||||
}
|
||||
@@ -315,7 +330,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
/// precondition</returns>
|
||||
protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
|
||||
UUID fromAgentID, string fromName, ChatTypeEnum type,
|
||||
string message, ChatSourceType src)
|
||||
string message, ChatSourceType src, bool ignoreDistance)
|
||||
{
|
||||
// don't send stuff to child agents
|
||||
if (presence.IsChildAgent) return false;
|
||||
@@ -326,12 +341,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
|
||||
|
||||
int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos);
|
||||
|
||||
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
|
||||
type == ChatTypeEnum.Say && dis > m_saydistance ||
|
||||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
|
||||
|
||||
if (!ignoreDistance)
|
||||
{
|
||||
return false;
|
||||
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
|
||||
type == ChatTypeEnum.Say && dis > m_saydistance ||
|
||||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
|
||||
|
||||
@@ -308,56 +308,56 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||
/// <param name='msg'>
|
||||
/// Message.
|
||||
/// </param>
|
||||
public bool DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg, out string error)
|
||||
public void DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg)
|
||||
{
|
||||
error = null;
|
||||
// Is id an avatar?
|
||||
ScenePresence sp = m_scene.GetScenePresence(target);
|
||||
|
||||
if (sp != null)
|
||||
{
|
||||
// Send message to avatar
|
||||
// ignore if a child agent this is restricted to inside one region
|
||||
if (sp.IsChildAgent)
|
||||
return;
|
||||
|
||||
// Send message to the avatar.
|
||||
// Channel zero only goes to the avatar
|
||||
// non zero channel messages only go to the attachments
|
||||
if (channel == 0)
|
||||
{
|
||||
m_scene.SimChatBroadcast(Utils.StringToBytes(msg), ChatTypeEnum.Broadcast, 0, pos, name, id, false);
|
||||
}
|
||||
|
||||
List<SceneObjectGroup> attachments = sp.GetAttachments();
|
||||
|
||||
if (attachments.Count == 0)
|
||||
return true;
|
||||
|
||||
// Get uuid of attachments
|
||||
List<UUID> targets = new List<UUID>();
|
||||
foreach (SceneObjectGroup sog in attachments)
|
||||
m_scene.SimChatToAgent(target, Utils.StringToBytes(msg), pos, name, id, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sog.IsDeleted)
|
||||
targets.Add(sog.UUID);
|
||||
List<SceneObjectGroup> attachments = sp.GetAttachments();
|
||||
if (attachments.Count == 0)
|
||||
return;
|
||||
|
||||
// Get uuid of attachments
|
||||
List<UUID> targets = new List<UUID>();
|
||||
foreach (SceneObjectGroup sog in attachments)
|
||||
{
|
||||
if (!sog.IsDeleted)
|
||||
targets.Add(sog.UUID);
|
||||
}
|
||||
|
||||
// Need to check each attachment
|
||||
foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg))
|
||||
{
|
||||
if (li.GetHostID().Equals(id))
|
||||
continue;
|
||||
|
||||
if (m_scene.GetSceneObjectPart(li.GetHostID()) == null)
|
||||
continue;
|
||||
|
||||
if (targets.Contains(li.GetHostID()))
|
||||
QueueMessage(new ListenerInfo(li, name, id, msg));
|
||||
}
|
||||
}
|
||||
|
||||
// Need to check each attachment
|
||||
foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg))
|
||||
{
|
||||
if (li.GetHostID().Equals(id))
|
||||
continue;
|
||||
|
||||
if (m_scene.GetSceneObjectPart(li.GetHostID()) == null)
|
||||
continue;
|
||||
|
||||
if (targets.Contains(li.GetHostID()))
|
||||
QueueMessage(new ListenerInfo(li, name, id, msg));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Need to toss an error here
|
||||
if (channel == 0)
|
||||
{
|
||||
error = "Cannot use llRegionSayTo to message objects on channel 0";
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
// No avatar found so look for an object
|
||||
foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg))
|
||||
{
|
||||
// Dont process if this message is from yourself!
|
||||
@@ -375,7 +375,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
protected void QueueMessage(ListenerInfo li)
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <param name='msg'>
|
||||
/// Message.
|
||||
/// </param>
|
||||
bool DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg, out string error);
|
||||
void DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg);
|
||||
|
||||
/// <summary>
|
||||
/// Are there any listen events ready to be dispatched?
|
||||
|
||||
@@ -38,8 +38,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
public partial class Scene
|
||||
{
|
||||
|
||||
protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
|
||||
UUID fromID, bool fromAgent, bool broadcast)
|
||||
UUID fromID, UUID targetID, bool fromAgent, bool broadcast)
|
||||
{
|
||||
OSChatMessage args = new OSChatMessage();
|
||||
|
||||
@@ -63,14 +64,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
args.From = fromName;
|
||||
//args.
|
||||
args.TargetUUID = targetID;
|
||||
|
||||
if (broadcast)
|
||||
EventManager.TriggerOnChatBroadcast(this, args);
|
||||
else
|
||||
EventManager.TriggerOnChatFromWorld(this, args);
|
||||
}
|
||||
|
||||
|
||||
protected void SimChat(byte[] message, ChatTypeEnum type, int channel, Vector3 fromPos, string fromName,
|
||||
UUID fromID, bool fromAgent, bool broadcast)
|
||||
{
|
||||
SimChat(message, type, channel, fromPos, fromName, fromID, UUID.Zero, fromAgent, broadcast);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -108,6 +115,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
SimChat(message, type, channel, fromPos, fromName, fromID, fromAgent, true);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="fromPos"></param>
|
||||
/// <param name="fromName"></param>
|
||||
/// <param name="fromAgentID"></param>
|
||||
/// <param name="targetID"></param>
|
||||
public void SimChatToAgent(UUID targetID, byte[] message, Vector3 fromPos, string fromName, UUID fromID, bool fromAgent)
|
||||
{
|
||||
SimChat(message, ChatTypeEnum.Say, 0, fromPos, fromName, fromID, targetID, fromAgent, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the client requests a prim.
|
||||
|
||||
@@ -839,13 +839,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (channel == ScriptBaseClass.DEBUG_CHANNEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UUID TargetID;
|
||||
UUID.TryParse(target, out TargetID);
|
||||
|
||||
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
|
||||
if (wComm != null)
|
||||
if (!wComm.DeliverMessageTo(TargetID, channel, m_host.AbsolutePosition, m_host.Name, m_host.UUID, msg, out error))
|
||||
LSLError(error);
|
||||
wComm.DeliverMessageTo(TargetID, channel, m_host.AbsolutePosition, m_host.Name, m_host.UUID, msg);
|
||||
}
|
||||
|
||||
public LSL_Integer llListen(int channelID, string name, string ID, string msg)
|
||||
|
||||
@@ -35,6 +35,7 @@ using System.Collections.Generic;
|
||||
using log4net;
|
||||
using OpenSim.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
namespace OpenSim.Server.Base
|
||||
{
|
||||
@@ -330,5 +331,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<IIntegrationService>(service, args);
|
||||
|
||||
server.AddStreamHandler(new IntegrationServerHandler(m_IntegrationService));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
231
OpenSim/Server/Handlers/Integration/IntegrationServerHandler.cs
Normal file
231
OpenSim/Server/Handlers/Integration/IntegrationServerHandler.cs
Normal file
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* 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 "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
|
||||
}
|
||||
}
|
||||
@@ -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,6 @@ namespace OpenSim.Server.Handlers.Presence
|
||||
UTF8Encoding encoding = new UTF8Encoding();
|
||||
return encoding.GetBytes(xmlString);
|
||||
}
|
||||
|
||||
|
||||
private byte[] SuccessResult()
|
||||
{
|
||||
|
||||
@@ -371,6 +371,49 @@ namespace OpenSim.Services.Connectors
|
||||
return rinfos.ToArray();
|
||||
}
|
||||
|
||||
public PresenceInfo VerifyAgent(UUID s_sessionID)
|
||||
{
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
//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<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||
PresenceInfo pinfo = null;
|
||||
|
||||
if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null))
|
||||
{
|
||||
if (replyData["result"] is Dictionary<string, object>)
|
||||
{
|
||||
pinfo = new PresenceInfo((Dictionary<string, object>)replyData["result"]);
|
||||
}
|
||||
}
|
||||
|
||||
return pinfo;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
341
OpenSim/Services/IntegrationService/IntegrationService.cs
Normal file
341
OpenSim/Services/IntegrationService/IntegrationService.cs
Normal file
@@ -0,0 +1,341 @@
|
||||
/*
|
||||
* 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 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.IUtils;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
private void HandleConsoleInstallPlugin(string module, string[] cmd)
|
||||
{
|
||||
MainConsole.Instance.Output(m_PluginManager.InstallPlugin(cmd));
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleUnInstallPlugin(string module, string[] cmd)
|
||||
{
|
||||
if (cmd.Length == 2)
|
||||
{
|
||||
m_PluginManager.UnInstall(cmd);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleCheckInstalledPlugin(string module, string[] cmd)
|
||||
{
|
||||
MainConsole.Instance.Output(m_PluginManager.CheckInstalled());
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleListInstalledPlugin(string module, string[] cmd)
|
||||
{
|
||||
m_PluginManager.ListInstalledAddins();
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleListAvailablePlugin(string module, string[] cmd)
|
||||
{
|
||||
ArrayList list = m_PluginManager.ListAvailable();
|
||||
foreach (string entry in list)
|
||||
MainConsole.Instance.Output(entry);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleListUpdates(string module, string[] cmd)
|
||||
{
|
||||
m_PluginManager.ListUpdates();
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleUpdatePlugin(string module, string[] cmd)
|
||||
{
|
||||
MainConsole.Instance.Output(m_PluginManager.Update());
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleAddRepo(string module, string[] cmd)
|
||||
{
|
||||
if ( cmd.Length == 3)
|
||||
{
|
||||
m_PluginManager.AddRepository(cmd);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleGetRepo(string module, string[] cmd)
|
||||
{
|
||||
m_PluginManager.GetRepository();
|
||||
return;
|
||||
}
|
||||
|
||||
private void HandleConsoleRemoveRepo(string module, string[] cmd)
|
||||
{
|
||||
if (cmd.Length == 3)
|
||||
m_PluginManager.RemoveRepository(cmd);
|
||||
return;
|
||||
}
|
||||
|
||||
// Enable repo
|
||||
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)
|
||||
{
|
||||
ArrayList list = m_PluginManager.ListRepositories();
|
||||
foreach (string entry in list)
|
||||
MainConsole.Instance.Output(entry);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Show description information
|
||||
private void HandleConsoleShowAddinInfo(string module, string[] cmd)
|
||||
{
|
||||
if ( cmd.Length >= 3 )
|
||||
{
|
||||
m_PluginManager.AddinInfo(cmd);
|
||||
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
|
||||
|
||||
// #region web handlers
|
||||
// public byte[] HandleWebListPlugins(OSDMap request)
|
||||
// {
|
||||
// return Ux.FailureResult("Not Implemented");
|
||||
// }
|
||||
//
|
||||
// public byte[] HandleWebPluginInfo(OSDMap request)
|
||||
// {
|
||||
// return Ux.FailureResult("Not Implemented");
|
||||
// }
|
||||
//
|
||||
// public byte[] HandleWebListAvailablePlugins(OSDMap request)
|
||||
// {
|
||||
// return Ux.FailureResult("Not Implemented");
|
||||
// }
|
||||
//
|
||||
// public byte[] HandleWebInstallPlugin(OSDMap request)
|
||||
// {
|
||||
// return Ux.FailureResult("Not Implemented");
|
||||
// }
|
||||
//
|
||||
// public byte[] HandleWebUnInstallPlugin(OSDMap request)
|
||||
// {
|
||||
// return Ux.FailureResult("Not Implemented");
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
#region IIntegrationService implementation
|
||||
public byte[] HandleWebListRepositories (OSDMap request)
|
||||
{
|
||||
return Ux.FailureResult("Not Implemented");
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return Ux.FailureResult("Not Implemented");
|
||||
}
|
||||
|
||||
public byte[] HandleWebPluginInfo (OSDMap request)
|
||||
{
|
||||
return Ux.FailureResult("Not Implemented");
|
||||
}
|
||||
|
||||
public byte[] HandleWebListAvailablePlugins (OSDMap request)
|
||||
{
|
||||
return Ux.FailureResult("Not Implemented");
|
||||
}
|
||||
|
||||
public byte[] HandleWebInstallPlugin (OSDMap request)
|
||||
{
|
||||
return Ux.FailureResult("Not Implemented");
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
260
OpenSim/Services/IntegrationService/IntegrationServiceBase.cs
Normal file
260
OpenSim/Services/IntegrationService/IntegrationServiceBase.cs
Normal file
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
* 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.IUtils;
|
||||
|
||||
[assembly:AddinRoot ("IntegrationService", "2.0")]
|
||||
namespace OpenSim.Services.IntegrationService
|
||||
{
|
||||
[TypeExtensionPoint (Path="/OpenSim/IntegrationService", Name="IntegrationService")]
|
||||
public interface IntegrationPlugin
|
||||
{
|
||||
void Init(IConfigSource PluginConfig, IHttpServer server, ServiceBase service);
|
||||
void Unload();
|
||||
string Name { 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 IPresenceService m_PresenceService;
|
||||
// protected IGridService m_GridService;
|
||||
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);
|
||||
|
||||
// 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.Name);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
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);
|
||||
}
|
||||
|
||||
// This is our init
|
||||
// We can do build-up and tear-down of our plugin
|
||||
void OnExtensionChanged (object s, ExtensionNodeEventArgs args)
|
||||
{
|
||||
IntegrationPlugin ip = (IntegrationPlugin) args.ExtensionObject;
|
||||
m_log.Info ("[INTEGRATION SERVICE]: Plugin Change");
|
||||
|
||||
switch (args.Change)
|
||||
{
|
||||
// Build up
|
||||
case ExtensionChange.Add:
|
||||
|
||||
m_log.DebugFormat("[INTEGRATION SERVICE]: Plugin Added {0}", ip.Name);
|
||||
LoadingPlugin(ip);
|
||||
return;
|
||||
|
||||
// Tear down
|
||||
case ExtensionChange.Remove:
|
||||
|
||||
m_log.DebugFormat("[INTEGRATION SERVICE]: Plugin Remove {0}", ip.Name);
|
||||
UnLoadingPlugin(ip);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void on_addinloaded_(object sender, AddinEventArgs args)
|
||||
{
|
||||
m_log.Info ("[INTEGRATION SERVICE]: Plugin Loaded: " + args.AddinId);
|
||||
}
|
||||
#endregion addin-event handlers
|
||||
|
||||
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.Name, 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.Name);
|
||||
plugin.Init(PlugConfig, m_Server, this);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
152
OpenSim/Services/IntegrationService/IntegrationUtils.cs
Normal file
152
OpenSim/Services/IntegrationService/IntegrationUtils.cs
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* 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 IUtils
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
#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));
|
||||
}
|
||||
#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<T>(string dllName, Object[] args) where T:class
|
||||
{
|
||||
return OpenSim.Server.Base.ServerUtils.LoadPlugin<T>(dllName, args);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
413
OpenSim/Services/IntegrationService/PluginManager.cs
Normal file
413
OpenSim/Services/IntegrationService/PluginManager.cs
Normal file
@@ -0,0 +1,413 @@
|
||||
/*
|
||||
* 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.IUtils;
|
||||
|
||||
namespace OpenSim.Services.IntegrationService
|
||||
{
|
||||
// This will maintain the plugin repositories and plugins
|
||||
public class PluginManager : SetupService
|
||||
{
|
||||
protected AddinRegistry m_Registry;
|
||||
|
||||
internal PluginManager( AddinRegistry r): base (r)
|
||||
{
|
||||
m_Registry = r;
|
||||
m_Registry.Update();
|
||||
}
|
||||
|
||||
public string InstallPlugin(string[] args)
|
||||
{
|
||||
PackageCollection pack = new PackageCollection();
|
||||
PackageCollection toUninstall;
|
||||
DependencyCollection unresolved;
|
||||
|
||||
IProgressStatus ps = new ConsoleProgressStatus(false);
|
||||
|
||||
string name = Addin.GetIdName(args[1]);
|
||||
string version = Addin.GetIdVersion(args[1]);
|
||||
|
||||
AddinRepositoryEntry[] available = GetSortedAvailbleAddins();
|
||||
|
||||
int n = Convert.ToInt16(args[1]);
|
||||
if (n > (available.Length -1))
|
||||
{
|
||||
MainConsole.Instance.Output("Selection out of range");
|
||||
return "Error";
|
||||
}
|
||||
|
||||
AddinRepositoryEntry aentry = available[n];
|
||||
|
||||
Package p = Package.FromRepository(aentry);
|
||||
pack.Add(p);
|
||||
|
||||
ResolveDependencies(ps, pack, out toUninstall, out unresolved);
|
||||
|
||||
if(Install(ps, pack) == true)
|
||||
{
|
||||
m_Registry.Update(ps);
|
||||
return "Install";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Bomb";
|
||||
}
|
||||
}
|
||||
|
||||
// Remove plugin
|
||||
public void UnInstall(string[] args)
|
||||
{
|
||||
Addin[] addins = GetSortedAddinList("IntegrationPlugin");
|
||||
|
||||
int n = Convert.ToInt16(args[1]);
|
||||
if (n > (addins.Length -1))
|
||||
{
|
||||
MainConsole.Instance.Output("Selection out of range");
|
||||
return;
|
||||
}
|
||||
|
||||
Addin addin = addins[n];
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
||||
public string CheckInstalled()
|
||||
{
|
||||
return "CheckInstall";
|
||||
}
|
||||
|
||||
// List instaled addins
|
||||
public void ListInstalledAddins()
|
||||
{
|
||||
Addin[] addins = GetSortedAddinList("IntegrationPlugin");
|
||||
|
||||
MainConsole.Instance.Output("Installed Plugins");
|
||||
|
||||
int count = 0;
|
||||
foreach (Addin addin in addins)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}", count.ToString(),
|
||||
addin.Enabled == false ? "[X]" : "[ ]",
|
||||
addin.Name, addin.Version );
|
||||
count++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// List compatible plugins in registered repositories
|
||||
public ArrayList ListAvailable()
|
||||
{
|
||||
AddinRepositoryEntry[] addins = GetSortedAvailbleAddins();
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
int count = 0;
|
||||
foreach (AddinRepositoryEntry addin in addins)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(String.Format("{0}) {1} rev. {2}, repo {3}", count.ToString(), addin.Addin.Name, addin.Addin.Version, addin.RepositoryName));
|
||||
list.Add(sb.ToString());
|
||||
count++;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
// List available 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
|
||||
public string Update()
|
||||
{
|
||||
IProgressStatus ps = new ConsoleProgressStatus(true);
|
||||
Repositories.UpdateAllRepositories (ps);
|
||||
return "Update";
|
||||
}
|
||||
|
||||
// Register a repository
|
||||
public string AddRepository(string[] args)
|
||||
{
|
||||
Repositories.RegisterRepository(null, args[2].ToString(), true);
|
||||
return "AddRepository";
|
||||
}
|
||||
|
||||
public void GetRepository()
|
||||
{
|
||||
Repositories.UpdateAllRepositories(new ConsoleProgressStatus(false));
|
||||
}
|
||||
|
||||
// Remove a repository from the list
|
||||
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
|
||||
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
|
||||
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
|
||||
public ArrayList ListRepositories()
|
||||
{
|
||||
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 null;
|
||||
}
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
int n = 0;
|
||||
foreach (AddinRepository rep in reps)
|
||||
{
|
||||
list.Add(String.Format("{0}) {1} {2} {3}",n.ToString(), rep.Enabled == true ? "[ ]" : "[X]", rep.Name, rep.Url));
|
||||
n++;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public void UpdateRegistry()
|
||||
{
|
||||
m_Registry.Update();
|
||||
}
|
||||
|
||||
// Show plugin info
|
||||
public string AddinInfo(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 "XXX";
|
||||
}
|
||||
|
||||
Addin addin = addins[n];
|
||||
MainConsole.Instance.OutputFormat("Name: {0}\nURL: {1}\n{2}",
|
||||
addin.Name, addin.Description.Url,
|
||||
addin.Description.FileName);
|
||||
|
||||
return "AddinInfo";
|
||||
}
|
||||
|
||||
// Disable a plugin
|
||||
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
|
||||
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
|
||||
}
|
||||
}
|
||||
55
OpenSim/Services/Interfaces/IIntegrationService.cs
Normal file
55
OpenSim/Services/Interfaces/IIntegrationService.cs
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -21,7 +21,7 @@
|
||||
; * [[<ConfigName>@]<port>/]<dll name>[:<class name>]
|
||||
; *
|
||||
[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:IntegrationServiceConnector"
|
||||
|
||||
; * This is common for all services, it's the network setup for the entire
|
||||
; * server instance, if none is specified above
|
||||
@@ -434,3 +434,9 @@ 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"
|
||||
|
||||
GridService = "OpenSim.Services.GridService.dll:GridService"
|
||||
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
; * [[<ConfigName>@]<port>/]<dll name>[:<class name>]
|
||||
; *
|
||||
[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:IntegrationServiceConnector"
|
||||
|
||||
; * This is common for all services, it's the network setup for the entire
|
||||
; * server instance, if none is specified above
|
||||
@@ -294,3 +294,10 @@ 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"
|
||||
|
||||
GridService = "OpenSim.Services.GridService.dll:GridService"
|
||||
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
39
prebuild.xml
39
prebuild.xml
@@ -787,6 +787,7 @@
|
||||
<Reference name="System.Xml"/>
|
||||
<Reference name="System.Web"/>
|
||||
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
||||
<Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
|
||||
<Reference name="OpenMetaverse" path="../../../bin/"/>
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Framework.Console"/>
|
||||
@@ -1150,6 +1151,44 @@
|
||||
</Files>
|
||||
</Project>
|
||||
|
||||
<Project frameworkVersion="v3_5" name="OpenSim.Services.IntegrationService" path="OpenSim/Services/IntegrationService" type="Library">
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>../../../bin/</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>../../../bin/</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<ReferencePath>../../../bin/</ReferencePath>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Core"/>
|
||||
<Reference name="System.Xml"/>
|
||||
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
||||
<Reference name="OpenMetaverse" path="../../../bin/"/>
|
||||
<Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Framework.Console"/>
|
||||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||
<Reference name="OpenSim.Services.Interfaces"/>
|
||||
<Reference name="OpenSim.Services.Base"/>
|
||||
<Reference name="OpenSim.Services.Connectors"/>
|
||||
<Reference name="OpenSim.Data"/>
|
||||
<Reference name="OpenSim.Server.Base"/>
|
||||
<Reference name="Nini" path="../../../bin/"/>
|
||||
<Reference name="log4net" path="../../../bin/"/>
|
||||
<Reference name="Mono.Addins" path="../../../bin/"/>
|
||||
<Reference name="Mono.Addins.Setup" path="../../../bin/"/>
|
||||
<Reference name="Mono.Addins" path="../../../bin/"/>
|
||||
|
||||
<Files>
|
||||
<Match pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
</Project>
|
||||
|
||||
<Project frameworkVersion="v3_5" name="OpenSim.Services.InventoryService" path="OpenSim/Services/InventoryService" type="Library">
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
|
||||
Reference in New Issue
Block a user