Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
commit
b8d14fcc4a
|
@ -46,7 +46,7 @@ namespace OpenSim.Framework
|
||||||
case AssetType.Texture:
|
case AssetType.Texture:
|
||||||
return "image/x-j2c";
|
return "image/x-j2c";
|
||||||
case AssetType.Sound:
|
case AssetType.Sound:
|
||||||
return "application/ogg";
|
return "audio/ogg";
|
||||||
case AssetType.CallingCard:
|
case AssetType.CallingCard:
|
||||||
return "application/vnd.ll.callingcard";
|
return "application/vnd.ll.callingcard";
|
||||||
case AssetType.Landmark:
|
case AssetType.Landmark:
|
||||||
|
@ -98,8 +98,6 @@ namespace OpenSim.Framework
|
||||||
return "application/vnd.ll.outfitfolder";
|
return "application/vnd.ll.outfitfolder";
|
||||||
case AssetType.MyOutfitsFolder:
|
case AssetType.MyOutfitsFolder:
|
||||||
return "application/vnd.ll.myoutfitsfolder";
|
return "application/vnd.ll.myoutfitsfolder";
|
||||||
case AssetType.InboxFolder:
|
|
||||||
return "application/vnd.ll.inboxfolder";
|
|
||||||
case AssetType.Unknown:
|
case AssetType.Unknown:
|
||||||
default:
|
default:
|
||||||
return "application/octet-stream";
|
return "application/octet-stream";
|
||||||
|
@ -128,7 +126,7 @@ namespace OpenSim.Framework
|
||||||
case InventoryType.Object:
|
case InventoryType.Object:
|
||||||
return "application/vnd.ll.primitive";
|
return "application/vnd.ll.primitive";
|
||||||
case InventoryType.Sound:
|
case InventoryType.Sound:
|
||||||
return "application/ogg";
|
return "audio/ogg";
|
||||||
case InventoryType.Snapshot:
|
case InventoryType.Snapshot:
|
||||||
case InventoryType.Texture:
|
case InventoryType.Texture:
|
||||||
return "image/x-j2c";
|
return "image/x-j2c";
|
||||||
|
@ -147,6 +145,7 @@ namespace OpenSim.Framework
|
||||||
case "image/jp2":
|
case "image/jp2":
|
||||||
return (sbyte)AssetType.Texture;
|
return (sbyte)AssetType.Texture;
|
||||||
case "application/ogg":
|
case "application/ogg":
|
||||||
|
case "audio/ogg":
|
||||||
return (sbyte)AssetType.Sound;
|
return (sbyte)AssetType.Sound;
|
||||||
case "application/vnd.ll.callingcard":
|
case "application/vnd.ll.callingcard":
|
||||||
case "application/x-metaverse-callingcard":
|
case "application/x-metaverse-callingcard":
|
||||||
|
@ -209,8 +208,6 @@ namespace OpenSim.Framework
|
||||||
return (sbyte)AssetType.OutfitFolder;
|
return (sbyte)AssetType.OutfitFolder;
|
||||||
case "application/vnd.ll.myoutfitsfolder":
|
case "application/vnd.ll.myoutfitsfolder":
|
||||||
return (sbyte)AssetType.MyOutfitsFolder;
|
return (sbyte)AssetType.MyOutfitsFolder;
|
||||||
case "application/vnd.ll.inboxfolder":
|
|
||||||
return (sbyte)AssetType.InboxFolder;
|
|
||||||
case "application/octet-stream":
|
case "application/octet-stream":
|
||||||
default:
|
default:
|
||||||
return (sbyte)AssetType.Unknown;
|
return (sbyte)AssetType.Unknown;
|
||||||
|
@ -227,6 +224,7 @@ namespace OpenSim.Framework
|
||||||
case "image/jpeg":
|
case "image/jpeg":
|
||||||
return (sbyte)InventoryType.Texture;
|
return (sbyte)InventoryType.Texture;
|
||||||
case "application/ogg":
|
case "application/ogg":
|
||||||
|
case "audio/ogg":
|
||||||
case "audio/x-wav":
|
case "audio/x-wav":
|
||||||
return (sbyte)InventoryType.Sound;
|
return (sbyte)InventoryType.Sound;
|
||||||
case "application/vnd.ll.callingcard":
|
case "application/vnd.ll.callingcard":
|
||||||
|
|
|
@ -3529,9 +3529,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
private void ProcessEntityUpdates(int maxUpdates)
|
private void ProcessEntityUpdates(int maxUpdates)
|
||||||
{
|
{
|
||||||
Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
|
OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
|
||||||
Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>();
|
OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>();
|
||||||
Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
|
OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>> terseUpdateBlocks = new OpenSim.Framework.Lazy<List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>>();
|
||||||
|
|
||||||
if (maxUpdates <= 0) maxUpdates = Int32.MaxValue;
|
if (maxUpdates <= 0) maxUpdates = Int32.MaxValue;
|
||||||
int updatesThisCall = 0;
|
int updatesThisCall = 0;
|
||||||
|
|
|
@ -36,6 +36,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
{
|
{
|
||||||
public class UserAccountCache
|
public class UserAccountCache
|
||||||
{
|
{
|
||||||
|
private const double CACHE_EXPIRATION_SECONDS = 120.0;
|
||||||
|
|
||||||
private static readonly ILog m_log =
|
private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(
|
LogManager.GetLogger(
|
||||||
MethodBase.GetCurrentMethod().DeclaringType);
|
MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
@ -51,9 +53,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||||
public void Cache(UUID userID, UserAccount account)
|
public void Cache(UUID userID, UserAccount account)
|
||||||
{
|
{
|
||||||
// Cache even null accounts
|
// Cache even null accounts
|
||||||
m_UUIDCache.AddOrUpdate(userID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d));
|
m_UUIDCache.AddOrUpdate(userID, account, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS));
|
||||||
if (account != null)
|
if (account != null)
|
||||||
m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d));
|
m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS));
|
||||||
|
|
||||||
m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
|
m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ using OpenSim.Tests.Common.Setup;
|
||||||
using ArchiveConstants = OpenSim.Framework.Serialization.ArchiveConstants;
|
using ArchiveConstants = OpenSim.Framework.Serialization.ArchiveConstants;
|
||||||
using TarArchiveReader = OpenSim.Framework.Serialization.TarArchiveReader;
|
using TarArchiveReader = OpenSim.Framework.Serialization.TarArchiveReader;
|
||||||
using TarArchiveWriter = OpenSim.Framework.Serialization.TarArchiveWriter;
|
using TarArchiveWriter = OpenSim.Framework.Serialization.TarArchiveWriter;
|
||||||
|
using RegionSettings = OpenSim.Framework.RegionSettings;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
{
|
{
|
||||||
|
@ -135,7 +136,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||||
|
|
||||||
SceneObjectPart part2 = CreateSceneObjectPart2();
|
SceneObjectPart part2 = CreateSceneObjectPart2();
|
||||||
|
|
||||||
AssetNotecard nc = new AssetNotecard("Hello World!");
|
AssetNotecard nc = new AssetNotecard();
|
||||||
|
nc.BodyText = "Hello World!";
|
||||||
|
nc.Encode();
|
||||||
UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
|
UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
|
||||||
UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
|
UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
|
||||||
AssetBase ncAsset
|
AssetBase ncAsset
|
||||||
|
|
|
@ -1632,6 +1632,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Unlink all child parts from their groups
|
// Unlink all child parts from their groups
|
||||||
//
|
//
|
||||||
child.ParentGroup.DelinkFromGroup(child, true);
|
child.ParentGroup.DelinkFromGroup(child, true);
|
||||||
|
|
||||||
|
// These are not in affected groups and will not be
|
||||||
|
// handled further. Do the honors here.
|
||||||
|
child.ParentGroup.HasGroupChanged = true;
|
||||||
|
child.ParentGroup.ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (SceneObjectPart root in rootParts)
|
foreach (SceneObjectPart root in rootParts)
|
||||||
|
|
|
@ -307,7 +307,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
public void TestDelinkPersistence()
|
public void TestDelinkPersistence()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelper.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
//log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
TestScene scene = SceneSetupHelpers.SetupScene();
|
TestScene scene = SceneSetupHelpers.SetupScene();
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,9 @@ namespace OpenSim.Region.Framework.Tests
|
||||||
|
|
||||||
protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part)
|
protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part)
|
||||||
{
|
{
|
||||||
AssetNotecard nc = new AssetNotecard("Hello World!");
|
AssetNotecard nc = new AssetNotecard();
|
||||||
|
nc.BodyText = "Hello World!";
|
||||||
|
nc.Encode();
|
||||||
UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
|
UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
|
||||||
UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
|
UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
|
||||||
AssetBase ncAsset
|
AssetBase ncAsset
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
public SimianAssetServiceConnector(IConfigSource source)
|
public SimianAssetServiceConnector(IConfigSource source)
|
||||||
{
|
{
|
||||||
Initialise(source);
|
CommonInit(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
|
@ -91,31 +91,40 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("AssetServices", "");
|
string name = moduleConfig.GetString("AssetServices", "");
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
CommonInit(source);
|
||||||
IConfig gridConfig = source.Configs["AssetService"];
|
}
|
||||||
if (gridConfig != null)
|
}
|
||||||
{
|
|
||||||
string serviceUrl = gridConfig.GetString("AssetServerURI");
|
|
||||||
if (!String.IsNullOrEmpty(serviceUrl))
|
|
||||||
{
|
|
||||||
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
|
||||||
serviceUrl = serviceUrl + '/';
|
|
||||||
m_serverUrl = serviceUrl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(m_serverUrl))
|
private void CommonInit(IConfigSource source)
|
||||||
m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector");
|
{
|
||||||
else
|
IConfig gridConfig = source.Configs["AssetService"];
|
||||||
m_Enabled = true;
|
if (gridConfig != null)
|
||||||
|
{
|
||||||
|
string serviceUrl = gridConfig.GetString("AssetServerURI");
|
||||||
|
if (!String.IsNullOrEmpty(serviceUrl))
|
||||||
|
{
|
||||||
|
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
||||||
|
serviceUrl = serviceUrl + '/';
|
||||||
|
m_serverUrl = serviceUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector");
|
||||||
|
else
|
||||||
|
m_Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IAssetService
|
#region IAssetService
|
||||||
|
|
||||||
public AssetBase Get(string id)
|
public AssetBase Get(string id)
|
||||||
{
|
{
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
{
|
||||||
|
m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
// Cache fetch
|
// Cache fetch
|
||||||
if (m_cache != null)
|
if (m_cache != null)
|
||||||
{
|
{
|
||||||
|
@ -142,6 +151,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public AssetMetadata GetMetadata(string id)
|
public AssetMetadata GetMetadata(string id)
|
||||||
{
|
{
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
{
|
||||||
|
m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
AssetMetadata metadata = null;
|
AssetMetadata metadata = null;
|
||||||
|
|
||||||
// Cache fetch
|
// Cache fetch
|
||||||
|
@ -213,6 +228,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
/// <returns>True if the id was parseable, false otherwise</returns>
|
/// <returns>True if the id was parseable, false otherwise</returns>
|
||||||
public bool Get(string id, Object sender, AssetRetrieved handler)
|
public bool Get(string id, Object sender, AssetRetrieved handler)
|
||||||
{
|
{
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
{
|
||||||
|
m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
// Cache fetch
|
// Cache fetch
|
||||||
if (m_cache != null)
|
if (m_cache != null)
|
||||||
{
|
{
|
||||||
|
@ -243,6 +264,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string Store(AssetBase asset)
|
public string Store(AssetBase asset)
|
||||||
{
|
{
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
{
|
||||||
|
m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
bool storedInCache = false;
|
bool storedInCache = false;
|
||||||
string errorMessage = null;
|
string errorMessage = null;
|
||||||
|
|
||||||
|
@ -375,6 +402,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool Delete(string id)
|
public bool Delete(string id)
|
||||||
{
|
{
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
{
|
||||||
|
m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured");
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
//string errorMessage = String.Empty;
|
//string errorMessage = String.Empty;
|
||||||
string url = m_serverUrl + id;
|
string url = m_serverUrl + id;
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
public SimianAuthenticationServiceConnector(IConfigSource source)
|
public SimianAuthenticationServiceConnector(IConfigSource source)
|
||||||
{
|
{
|
||||||
Initialise(source);
|
CommonInit(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
|
@ -79,24 +79,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("AuthenticationServices", "");
|
string name = moduleConfig.GetString("AuthenticationServices", "");
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
CommonInit(source);
|
||||||
IConfig gridConfig = source.Configs["AuthenticationService"];
|
}
|
||||||
if (gridConfig != null)
|
}
|
||||||
{
|
|
||||||
string serviceUrl = gridConfig.GetString("AuthenticationServerURI");
|
|
||||||
if (!String.IsNullOrEmpty(serviceUrl))
|
|
||||||
{
|
|
||||||
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
|
||||||
serviceUrl = serviceUrl + '/';
|
|
||||||
m_serverUrl = serviceUrl;
|
|
||||||
m_Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(m_serverUrl))
|
private void CommonInit(IConfigSource source)
|
||||||
m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
|
{
|
||||||
|
IConfig gridConfig = source.Configs["AuthenticationService"];
|
||||||
|
if (gridConfig != null)
|
||||||
|
{
|
||||||
|
string serviceUrl = gridConfig.GetString("AuthenticationServerURI");
|
||||||
|
if (!String.IsNullOrEmpty(serviceUrl))
|
||||||
|
{
|
||||||
|
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
||||||
|
serviceUrl = serviceUrl + '/';
|
||||||
|
m_serverUrl = serviceUrl;
|
||||||
|
m_Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Authenticate(UUID principalID, string password, int lifetime)
|
public string Authenticate(UUID principalID, string password, int lifetime)
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
public SimianAvatarServiceConnector(IConfigSource source)
|
public SimianAvatarServiceConnector(IConfigSource source)
|
||||||
{
|
{
|
||||||
Initialise(source);
|
CommonInit(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
|
@ -84,24 +84,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("AvatarServices", "");
|
string name = moduleConfig.GetString("AvatarServices", "");
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
CommonInit(source);
|
||||||
IConfig gridConfig = source.Configs["AvatarService"];
|
}
|
||||||
if (gridConfig != null)
|
}
|
||||||
{
|
|
||||||
string serviceUrl = gridConfig.GetString("AvatarServerURI");
|
|
||||||
if (!String.IsNullOrEmpty(serviceUrl))
|
|
||||||
{
|
|
||||||
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
|
||||||
serviceUrl = serviceUrl + '/';
|
|
||||||
m_serverUrl = serviceUrl;
|
|
||||||
m_Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(m_serverUrl))
|
private void CommonInit(IConfigSource source)
|
||||||
m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector");
|
{
|
||||||
|
IConfig gridConfig = source.Configs["AvatarService"];
|
||||||
|
if (gridConfig != null)
|
||||||
|
{
|
||||||
|
string serviceUrl = gridConfig.GetString("AvatarServerURI");
|
||||||
|
if (!String.IsNullOrEmpty(serviceUrl))
|
||||||
|
{
|
||||||
|
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
||||||
|
serviceUrl = serviceUrl + '/';
|
||||||
|
m_serverUrl = serviceUrl;
|
||||||
|
m_Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector");
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IAvatarService
|
#region IAvatarService
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
public SimianGridServiceConnector(IConfigSource source)
|
public SimianGridServiceConnector(IConfigSource source)
|
||||||
{
|
{
|
||||||
Initialise(source);
|
CommonInit(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
|
@ -108,24 +108,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("GridServices", "");
|
string name = moduleConfig.GetString("GridServices", "");
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
CommonInit(source);
|
||||||
IConfig gridConfig = source.Configs["GridService"];
|
}
|
||||||
if (gridConfig != null)
|
}
|
||||||
{
|
|
||||||
string serviceUrl = gridConfig.GetString("GridServerURI");
|
|
||||||
if (!String.IsNullOrEmpty(serviceUrl))
|
|
||||||
{
|
|
||||||
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
|
||||||
serviceUrl = serviceUrl + '/';
|
|
||||||
m_serverUrl = serviceUrl;
|
|
||||||
m_Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(m_serverUrl))
|
private void CommonInit(IConfigSource source)
|
||||||
m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector");
|
{
|
||||||
|
IConfig gridConfig = source.Configs["GridService"];
|
||||||
|
if (gridConfig != null)
|
||||||
|
{
|
||||||
|
string serviceUrl = gridConfig.GetString("GridServerURI");
|
||||||
|
if (!String.IsNullOrEmpty(serviceUrl))
|
||||||
|
{
|
||||||
|
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
||||||
|
serviceUrl = serviceUrl + '/';
|
||||||
|
m_serverUrl = serviceUrl;
|
||||||
|
m_Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector");
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IGridService
|
#region IGridService
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
public SimianInventoryServiceConnector(IConfigSource source)
|
public SimianInventoryServiceConnector(IConfigSource source)
|
||||||
{
|
{
|
||||||
Initialise(source);
|
CommonInit(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
|
@ -98,36 +98,39 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("InventoryServices", "");
|
string name = moduleConfig.GetString("InventoryServices", "");
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
|
CommonInit(source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CommonInit(IConfigSource source)
|
||||||
|
{
|
||||||
|
IConfig gridConfig = source.Configs["InventoryService"];
|
||||||
|
if (gridConfig != null)
|
||||||
|
{
|
||||||
|
string serviceUrl = gridConfig.GetString("InventoryServerURI");
|
||||||
|
if (!String.IsNullOrEmpty(serviceUrl))
|
||||||
{
|
{
|
||||||
IConfig gridConfig = source.Configs["InventoryService"];
|
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
||||||
|
serviceUrl = serviceUrl + '/';
|
||||||
|
m_serverUrl = serviceUrl;
|
||||||
|
|
||||||
|
gridConfig = source.Configs["UserAccountService"];
|
||||||
if (gridConfig != null)
|
if (gridConfig != null)
|
||||||
{
|
{
|
||||||
string serviceUrl = gridConfig.GetString("InventoryServerURI");
|
serviceUrl = gridConfig.GetString("UserAccountServerURI");
|
||||||
if (!String.IsNullOrEmpty(serviceUrl))
|
if (!String.IsNullOrEmpty(serviceUrl))
|
||||||
{
|
{
|
||||||
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
m_userServerUrl = serviceUrl;
|
||||||
serviceUrl = serviceUrl + '/';
|
m_Enabled = true;
|
||||||
m_serverUrl = serviceUrl;
|
|
||||||
|
|
||||||
gridConfig = source.Configs["UserAccountService"];
|
|
||||||
if (gridConfig != null)
|
|
||||||
{
|
|
||||||
serviceUrl = gridConfig.GetString("UserAccountServerURI");
|
|
||||||
if (!String.IsNullOrEmpty(serviceUrl))
|
|
||||||
{
|
|
||||||
m_userServerUrl = serviceUrl;
|
|
||||||
m_Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(m_serverUrl))
|
|
||||||
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector");
|
|
||||||
else if (String.IsNullOrEmpty(m_userServerUrl))
|
|
||||||
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector");
|
||||||
|
else if (String.IsNullOrEmpty(m_userServerUrl))
|
||||||
|
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -99,7 +99,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
public SimianPresenceServiceConnector(IConfigSource source)
|
public SimianPresenceServiceConnector(IConfigSource source)
|
||||||
{
|
{
|
||||||
Initialise(source);
|
CommonInit(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
|
@ -109,24 +109,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("PresenceServices", "");
|
string name = moduleConfig.GetString("PresenceServices", "");
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
CommonInit(source);
|
||||||
IConfig gridConfig = source.Configs["PresenceService"];
|
}
|
||||||
if (gridConfig != null)
|
}
|
||||||
{
|
|
||||||
string serviceUrl = gridConfig.GetString("PresenceServerURI");
|
|
||||||
if (!String.IsNullOrEmpty(serviceUrl))
|
|
||||||
{
|
|
||||||
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
|
||||||
serviceUrl = serviceUrl + '/';
|
|
||||||
m_serverUrl = serviceUrl;
|
|
||||||
m_Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(m_serverUrl))
|
private void CommonInit(IConfigSource source)
|
||||||
m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector");
|
{
|
||||||
|
IConfig gridConfig = source.Configs["PresenceService"];
|
||||||
|
if (gridConfig != null)
|
||||||
|
{
|
||||||
|
string serviceUrl = gridConfig.GetString("PresenceServerURI");
|
||||||
|
if (!String.IsNullOrEmpty(serviceUrl))
|
||||||
|
{
|
||||||
|
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
||||||
|
serviceUrl = serviceUrl + '/';
|
||||||
|
m_serverUrl = serviceUrl;
|
||||||
|
m_Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector");
|
||||||
}
|
}
|
||||||
|
|
||||||
#region IPresenceService
|
#region IPresenceService
|
||||||
|
|
|
@ -49,13 +49,15 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||||
public class SimianUserAccountServiceConnector : IUserAccountService, ISharedRegionModule
|
public class SimianUserAccountServiceConnector : IUserAccountService, ISharedRegionModule
|
||||||
{
|
{
|
||||||
|
private const double CACHE_EXPIRATION_SECONDS = 120.0;
|
||||||
|
|
||||||
private static readonly ILog m_log =
|
private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(
|
LogManager.GetLogger(
|
||||||
MethodBase.GetCurrentMethod().DeclaringType);
|
MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private string m_serverUrl = String.Empty;
|
private string m_serverUrl = String.Empty;
|
||||||
private ExpiringCache<UUID, UserAccount> m_accountCache;
|
private ExpiringCache<UUID, UserAccount> m_accountCache = new ExpiringCache<UUID,UserAccount>();
|
||||||
private bool m_Enabled = false;
|
private bool m_Enabled;
|
||||||
|
|
||||||
#region ISharedRegionModule
|
#region ISharedRegionModule
|
||||||
|
|
||||||
|
@ -73,7 +75,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
|
|
||||||
public SimianUserAccountServiceConnector(IConfigSource source)
|
public SimianUserAccountServiceConnector(IConfigSource source)
|
||||||
{
|
{
|
||||||
Initialise(source);
|
CommonInit(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(IConfigSource source)
|
public void Initialise(IConfigSource source)
|
||||||
|
@ -83,24 +85,27 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
{
|
{
|
||||||
string name = moduleConfig.GetString("UserAccountServices", "");
|
string name = moduleConfig.GetString("UserAccountServices", "");
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
CommonInit(source);
|
||||||
IConfig gridConfig = source.Configs["UserAccountService"];
|
}
|
||||||
if (gridConfig != null)
|
}
|
||||||
{
|
|
||||||
string serviceUrl = gridConfig.GetString("UserAccountServerURI");
|
|
||||||
if (!String.IsNullOrEmpty(serviceUrl))
|
|
||||||
{
|
|
||||||
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
|
||||||
serviceUrl = serviceUrl + '/';
|
|
||||||
m_serverUrl = serviceUrl;
|
|
||||||
m_Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(m_serverUrl))
|
private void CommonInit(IConfigSource source)
|
||||||
m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
|
{
|
||||||
|
IConfig gridConfig = source.Configs["UserAccountService"];
|
||||||
|
if (gridConfig != null)
|
||||||
|
{
|
||||||
|
string serviceUrl = gridConfig.GetString("UserAccountServerURI");
|
||||||
|
if (!String.IsNullOrEmpty(serviceUrl))
|
||||||
|
{
|
||||||
|
if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
|
||||||
|
serviceUrl = serviceUrl + '/';
|
||||||
|
m_serverUrl = serviceUrl;
|
||||||
|
m_Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(m_serverUrl))
|
||||||
|
m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
|
public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
|
||||||
|
@ -138,7 +143,15 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
{ "UserID", userID.ToString() }
|
{ "UserID", userID.ToString() }
|
||||||
};
|
};
|
||||||
|
|
||||||
return GetUser(requestArgs);
|
account = GetUser(requestArgs);
|
||||||
|
|
||||||
|
if (account == null)
|
||||||
|
{
|
||||||
|
// Store null responses too, to avoid repeated lookups for missing accounts
|
||||||
|
m_accountCache.AddOrUpdate(userID, null, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS));
|
||||||
|
}
|
||||||
|
|
||||||
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
|
public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
|
||||||
|
@ -213,7 +226,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
// Cache the user account info
|
// Cache the user account info
|
||||||
m_accountCache.AddOrUpdate(data.PrincipalID, data, DateTime.Now + TimeSpan.FromMinutes(2.0d));
|
m_accountCache.AddOrUpdate(data.PrincipalID, data, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -278,7 +291,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName);
|
GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName);
|
||||||
|
|
||||||
// Cache the user account info
|
// Cache the user account info
|
||||||
m_accountCache.AddOrUpdate(account.PrincipalID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d));
|
m_accountCache.AddOrUpdate(account.PrincipalID, account, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS));
|
||||||
|
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,13 +21,13 @@
|
||||||
Include-Common = "config-include/GridCommon.ini"
|
Include-Common = "config-include/GridCommon.ini"
|
||||||
|
|
||||||
[Modules]
|
[Modules]
|
||||||
GridServices = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector"
|
GridServices = "SimianGridServiceConnector"
|
||||||
PresenceServices = "OpenSim.Services.Connectors.dll:SimianPresenceServiceConnector"
|
PresenceServices = "SimianPresenceServiceConnector"
|
||||||
UserAccountServices = "OpenSim.Services.Connectors.dll:SimianUserAccountServiceConnector"
|
UserAccountServices = "SimianUserAccountServiceConnector"
|
||||||
AuthenticationServices = "OpenSim.Services.Connectors.dll:SimianAuthenticationServiceConnector"
|
AuthenticationServices = "SimianAuthenticationServiceConnector"
|
||||||
AssetServices = "HGAssetBroker"
|
AssetServices = "HGAssetBroker"
|
||||||
InventoryServices = "HGInventoryBroker"
|
InventoryServices = "HGInventoryBroker"
|
||||||
AvatarServices = "OpenSim.Services.Connectors.dll:SimianAvatarServiceConnector"
|
AvatarServices = "SimianAvatarServiceConnector"
|
||||||
|
|
||||||
NeighbourServices = "RemoteNeighbourServicesConnector"
|
NeighbourServices = "RemoteNeighbourServicesConnector"
|
||||||
SimulationServices = "RemoteSimulationConnectorModule"
|
SimulationServices = "RemoteSimulationConnectorModule"
|
||||||
|
@ -74,4 +74,4 @@
|
||||||
ServicesConnectorModule = SimianGroupsServicesConnector
|
ServicesConnectorModule = SimianGroupsServicesConnector
|
||||||
|
|
||||||
[Profiles]
|
[Profiles]
|
||||||
Module = SimianProfiles
|
Module = "SimianProfiles"
|
||||||
|
|
|
@ -21,13 +21,13 @@
|
||||||
Include-Common = "config-include/GridCommon.ini"
|
Include-Common = "config-include/GridCommon.ini"
|
||||||
|
|
||||||
[Modules]
|
[Modules]
|
||||||
GridServices = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector"
|
GridServices = "SimianGridServiceConnector"
|
||||||
PresenceServices = "OpenSim.Services.Connectors.dll:SimianPresenceServiceConnector"
|
PresenceServices = "SimianPresenceServiceConnector"
|
||||||
UserAccountServices = "OpenSim.Services.Connectors.dll:SimianUserAccountServiceConnector"
|
UserAccountServices = "SimianUserAccountServiceConnector"
|
||||||
AuthenticationServices = "OpenSim.Services.Connectors.dll:SimianAuthenticationServiceConnector"
|
AuthenticationServices = "SimianAuthenticationServiceConnector"
|
||||||
AssetServices = "OpenSim.Services.Connectors.dll:SimianAssetServiceConnector"
|
AssetServices = "SimianAssetServiceConnector"
|
||||||
InventoryServices = "OpenSim.Services.Connectors.dll:SimianInventoryServiceConnector"
|
InventoryServices = "SimianInventoryServiceConnector"
|
||||||
AvatarServices = "OpenSim.Services.Connectors.dll:SimianAvatarServiceConnector"
|
AvatarServices = "SimianAvatarServiceConnector"
|
||||||
|
|
||||||
NeighbourServices = "RemoteNeighbourServicesConnector"
|
NeighbourServices = "RemoteNeighbourServicesConnector"
|
||||||
SimulationServices = "RemoteSimulationConnectorModule"
|
SimulationServices = "RemoteSimulationConnectorModule"
|
||||||
|
@ -67,4 +67,4 @@
|
||||||
ServicesConnectorModule = SimianGroupsServicesConnector
|
ServicesConnectorModule = SimianGroupsServicesConnector
|
||||||
|
|
||||||
[Profiles]
|
[Profiles]
|
||||||
Module = SimianProfiles
|
Module = "SimianProfiles"
|
||||||
|
|
Loading…
Reference in New Issue