Fix LocalPresenceServiceConnector test now that the hardcoded test data has been removed from Data.Null.NullPresenceData
Unfortunately, this meant publicly exposing the underlying service for the connector. The other solution would be to create alternative initializers for services and connectors where objects could be given directly rather than loaded indirectly through config. Unfortunately, this would require a lot of work in this case but might be the better way forward.slimupdates
parent
8bd114b4df
commit
e39fc95659
|
@ -51,15 +51,6 @@ namespace OpenSim.Data.Null
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
|
||||||
//Console.WriteLine("[XXX] NullRegionData constructor");
|
//Console.WriteLine("[XXX] NullRegionData constructor");
|
||||||
// Let's stick in a test presence
|
|
||||||
/*
|
|
||||||
PresenceData p = new PresenceData();
|
|
||||||
p.SessionID = UUID.Zero;
|
|
||||||
p.UserID = UUID.Zero.ToString();
|
|
||||||
p.Data = new Dictionary<string, string>();
|
|
||||||
p.Data["Online"] = true.ToString();
|
|
||||||
m_presenceData.Add(UUID.Zero, p);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
|
using log4net;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Framework
|
namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
public static class SLUtil
|
public static class SLUtil
|
||||||
{
|
{
|
||||||
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
#region SL / file extension / content-type conversions
|
#region SL / file extension / content-type conversions
|
||||||
|
|
||||||
public static string SLAssetTypeToContentType(int assetType)
|
public static string SLAssetTypeToContentType(int assetType)
|
||||||
|
@ -190,7 +194,12 @@ namespace OpenSim.Framework
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string ParseNotecardToString(string rawInput)
|
public static string ParseNotecardToString(string rawInput)
|
||||||
{
|
{
|
||||||
return string.Join("\n", ParseNotecardToList(rawInput).ToArray());
|
string[] output = ParseNotecardToList(rawInput).ToArray();
|
||||||
|
|
||||||
|
// foreach (string line in output)
|
||||||
|
// m_log.DebugFormat("[PARSE NOTECARD]: ParseNotecardToString got line {0}", line);
|
||||||
|
|
||||||
|
return string.Join("\n", output);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -254,6 +263,7 @@ namespace OpenSim.Framework
|
||||||
if (ln.Length > need)
|
if (ln.Length > need)
|
||||||
ln = ln.Substring(0, need);
|
ln = ln.Substring(0, need);
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[PARSE NOTECARD]: Adding line {0}", ln);
|
||||||
output.Add(ln);
|
output.Add(ln);
|
||||||
count += ln.Length + 1;
|
count += ln.Length + 1;
|
||||||
idx++;
|
idx++;
|
||||||
|
|
|
@ -42,6 +42,8 @@ namespace OpenSim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ConfigurationLoader
|
public class ConfigurationLoader
|
||||||
{
|
{
|
||||||
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Various Config settings the region needs to start
|
/// Various Config settings the region needs to start
|
||||||
/// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor,
|
/// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor,
|
||||||
|
@ -60,17 +62,6 @@ namespace OpenSim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected NetworkServersInfo m_networkServersInfo;
|
protected NetworkServersInfo m_networkServersInfo;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Console logger
|
|
||||||
/// </summary>
|
|
||||||
private static readonly ILog m_log =
|
|
||||||
LogManager.GetLogger(
|
|
||||||
MethodBase.GetCurrentMethod().DeclaringType);
|
|
||||||
|
|
||||||
public ConfigurationLoader()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the region configuration
|
/// Loads the region configuration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -188,7 +179,6 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure command line options take precedence
|
// Make sure command line options take precedence
|
||||||
//
|
|
||||||
m_config.Source.Merge(argvSource);
|
m_config.Source.Merge(argvSource);
|
||||||
|
|
||||||
ReadConfigSettings();
|
ReadConfigSettings();
|
||||||
|
|
|
@ -47,7 +47,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
|
||||||
private bool m_Enabled = false;
|
private bool m_Enabled = false;
|
||||||
|
|
||||||
private PresenceDetector m_PresenceDetector;
|
private PresenceDetector m_PresenceDetector;
|
||||||
private IPresenceService m_PresenceService;
|
|
||||||
|
/// <summary>
|
||||||
|
/// Underlying presence service. Do not use directly.
|
||||||
|
/// </summary>
|
||||||
|
public IPresenceService m_PresenceService;
|
||||||
|
|
||||||
public LocalPresenceServicesConnector()
|
public LocalPresenceServicesConnector()
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,6 +59,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests
|
||||||
config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
|
config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
|
||||||
|
|
||||||
m_LocalConnector = new LocalPresenceServicesConnector(config);
|
m_LocalConnector = new LocalPresenceServicesConnector(config);
|
||||||
|
|
||||||
|
// Let's stick in a test presence
|
||||||
|
m_LocalConnector.m_PresenceService.LoginAgent(UUID.Zero.ToString(), UUID.Zero, UUID.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -68,6 +71,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests
|
||||||
public void TestPresenceV0_1()
|
public void TestPresenceV0_1()
|
||||||
{
|
{
|
||||||
SetUp();
|
SetUp();
|
||||||
|
|
||||||
|
// Let's stick in a test presence
|
||||||
|
/*
|
||||||
|
PresenceData p = new PresenceData();
|
||||||
|
p.SessionID = UUID.Zero;
|
||||||
|
p.UserID = UUID.Zero.ToString();
|
||||||
|
p.Data = new Dictionary<string, string>();
|
||||||
|
p.Data["Online"] = true.ToString();
|
||||||
|
m_presenceData.Add(UUID.Zero, p);
|
||||||
|
*/
|
||||||
|
|
||||||
string user1 = UUID.Zero.ToString();
|
string user1 = UUID.Zero.ToString();
|
||||||
UUID session1 = UUID.Zero;
|
UUID session1 = UUID.Zero;
|
||||||
|
|
|
@ -52,7 +52,6 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
|
||||||
using OpenSim.Region.ScriptEngine.Interfaces;
|
using OpenSim.Region.ScriptEngine.Interfaces;
|
||||||
using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
|
using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using OpenSim.Services.Interfaces;
|
|
||||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||||
using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
|
using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
|
||||||
using PrimType = OpenSim.Region.Framework.Scenes.PrimType;
|
using PrimType = OpenSim.Region.Framework.Scenes.PrimType;
|
||||||
|
|
Loading…
Reference in New Issue