Merge branch 'master' into careminster-presence-refactor

The modules will need to be updated for this to compile and run again. Please
don't use until I do the companion commit to modules later on.
This commit is contained in:
Melanie
2010-09-13 16:16:40 +01:00
216 changed files with 6585 additions and 4483 deletions

View File

@@ -35,11 +35,86 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Data.Null
{
public class NullDataService : ISimulationDataService
{
private NullDataStore m_store;
public NullDataService()
{
m_store = new NullDataStore();
}
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
{
m_store.StoreObject(obj, regionUUID);
}
public void RemoveObject(UUID uuid, UUID regionUUID)
{
m_store.RemoveObject(uuid, regionUUID);
}
public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
{
m_store.StorePrimInventory(primID, items);
}
public List<SceneObjectGroup> LoadObjects(UUID regionUUID)
{
return m_store.LoadObjects(regionUUID);
}
public void StoreTerrain(double[,] terrain, UUID regionID)
{
m_store.StoreTerrain(terrain, regionID);
}
public double[,] LoadTerrain(UUID regionID)
{
return m_store.LoadTerrain(regionID);
}
public void StoreLandObject(ILandObject Parcel)
{
m_store.StoreLandObject(Parcel);
}
public void RemoveLandObject(UUID globalID)
{
m_store.RemoveLandObject(globalID);
}
public List<LandData> LoadLandObjects(UUID regionUUID)
{
return m_store.LoadLandObjects(regionUUID);
}
public void StoreRegionSettings(RegionSettings rs)
{
m_store.StoreRegionSettings(rs);
}
public RegionSettings LoadRegionSettings(UUID regionUUID)
{
return m_store.LoadRegionSettings(regionUUID);
}
public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
{
return m_store.LoadRegionWindlightSettings(regionUUID);
}
public void StoreRegionWindlightSettings(RegionLightShareData wl)
{
m_store.StoreRegionWindlightSettings(wl);
}
}
/// <summary>
/// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that
/// tests can check correct persistence.
/// </summary>
public class NullDataStore : IRegionDataStore
public class NullDataStore : ISimulationDataStore
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -99,7 +174,7 @@ namespace OpenSim.Data.Null
}
public void RemoveObject(UUID obj, UUID regionUUID)
{
{
// All parts belonging to the object with the uuid are removed.
List<SceneObjectPart> parts = new List<SceneObjectPart>(m_sceneObjectParts.Values);
foreach (SceneObjectPart part in parts)
@@ -108,13 +183,12 @@ namespace OpenSim.Data.Null
{
m_log.DebugFormat(
"[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}",
part.Name, part.UUID, obj, regionUUID);
part.Name, part.UUID, obj, regionUUID);
m_sceneObjectParts.Remove(part.UUID);
}
}
}
// see IRegionDatastore
public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
{
m_primItems[primID] = items;
@@ -130,7 +204,7 @@ namespace OpenSim.Data.Null
if (prim.IsRoot)
{
m_log.DebugFormat(
"[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID);
"[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID);
objects[prim.UUID] = new SceneObjectGroup(prim);
}
}

View File

@@ -31,6 +31,7 @@ using OpenSim.Framework;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Tests.Common.Mock
@@ -39,19 +40,14 @@ namespace OpenSim.Tests.Common.Mock
{
public TestScene(
RegionInfo regInfo, AgentCircuitManager authen,
SceneCommunicationService sceneGridService, StorageManager storeManager,
SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService,
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
: base(regInfo, authen, sceneGridService, storeManager, moduleLoader,
: base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader,
dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion)
{
}
/// <summary>
/// Allow retrieval for test check purposes
/// </summary>
public StorageManager StorageManager { get { return m_storageManager; } }
/// <summary>
/// Temporarily override session authentication for tests (namely teleport).
/// </summary>
@@ -69,6 +65,6 @@ namespace OpenSim.Tests.Common.Mock
public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter
{
get { return m_asyncSceneObjectDeleter; }
}
}
}
}

View File

@@ -54,8 +54,8 @@ namespace OpenSim.Tests.Common
{
AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
scene.AssetService.Store(asset);
return asset;
}
return asset;
}
/// <summary>
/// Create an asset from the given scene object.

View File

@@ -58,7 +58,7 @@ namespace OpenSim.Tests.Common.Setup
public class SceneSetupHelpers
{
// These static variables in order to allow regions to be linked by shared modules and same
// CommunicationsManager.
// CommunicationsManager.
private static ISharedRegionModule m_assetService = null;
// private static ISharedRegionModule m_authenticationService = null;
private static ISharedRegionModule m_inventoryService = null;
@@ -69,19 +69,19 @@ namespace OpenSim.Tests.Common.Setup
/// <summary>
/// Set up a test scene
/// </summary>
///
///
/// Automatically starts service threads, as would the normal runtime.
///
///
/// <returns></returns>
public static TestScene SetupScene()
{
return SetupScene("");
}
/// <summary>
/// Set up a test scene
/// </summary>
///
///
/// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
/// <returns></returns>
public static TestScene SetupScene(String realServices)
@@ -94,7 +94,7 @@ namespace OpenSim.Tests.Common.Setup
///// <summary>
///// Set up a test scene
///// </summary>
/////
/////
///// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
///// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
///// <returns></returns>
@@ -157,23 +157,24 @@ namespace OpenSim.Tests.Common.Setup
AgentCircuitManager acm = new AgentCircuitManager();
SceneCommunicationService scs = new SceneCommunicationService();
StorageManager sm = new StorageManager("OpenSim.Tests.Common.dll", "", "");
ISimulationDataService simDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
IEstateDataService estateDataService = null;
IConfigSource configSource = new IniConfigSource();
TestScene testScene = new TestScene(
regInfo, acm, scs, sm, null, false, false, false, configSource, null);
regInfo, acm, scs, simDataService, estateDataService, null, false, false, false, configSource, null);
INonSharedRegionModule capsModule = new CapabilitiesModule();
capsModule.Initialise(new IniConfigSource());
testScene.AddRegionModule(capsModule.Name, capsModule);
capsModule.AddRegion(testScene);
IRegionModule godsModule = new GodsModule();
godsModule.Initialise(testScene, new IniConfigSource());
testScene.AddModule(godsModule.Name, godsModule);
realServices = realServices.ToLower();
// IConfigSource config = new IniConfigSource();
// If we have a brand new scene, need to initialize shared region modules
if ((m_assetService == null && m_inventoryService == null) || newScene)
{
@@ -184,13 +185,13 @@ namespace OpenSim.Tests.Common.Setup
// For now, always started a 'real' authentication service
StartAuthenticationService(testScene, true);
if (realServices.Contains("inventory"))
StartInventoryService(testScene, true);
else
StartInventoryService(testScene, false);
StartGridService(testScene, true);
StartGridService(testScene, true);
StartUserAccountService(testScene);
StartPresenceService(testScene);
}
@@ -207,7 +208,7 @@ namespace OpenSim.Tests.Common.Setup
m_presenceService.RegionLoaded(testScene);
}
m_inventoryService.PostInitialise();
m_assetService.PostInitialise();
m_userAccountService.PostInitialise();
@@ -250,7 +251,7 @@ namespace OpenSim.Tests.Common.Setup
else
config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService");
config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
assetService.Initialise(config);
assetService.Initialise(config);
assetService.AddRegion(testScene);
assetService.RegionLoaded(testScene);
testScene.AddRegionModule(assetService.Name, assetService);
@@ -277,7 +278,7 @@ namespace OpenSim.Tests.Common.Setup
testScene.AddRegionModule(service.Name, service);
//m_authenticationService = service;
}
private static void StartInventoryService(Scene testScene, bool real)
{
ISharedRegionModule inventoryService = new LocalInventoryServicesConnector();
@@ -285,7 +286,7 @@ namespace OpenSim.Tests.Common.Setup
config.AddConfig("Modules");
config.AddConfig("InventoryService");
config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
if (real)
{
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
@@ -294,7 +295,7 @@ namespace OpenSim.Tests.Common.Setup
{
config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService");
}
config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
inventoryService.Initialise(config);
inventoryService.AddRegion(testScene);
@@ -338,14 +339,14 @@ namespace OpenSim.Tests.Common.Setup
config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
config.Configs["UserAccountService"].Set(
"LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService");
if (m_userAccountService == null)
{
ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector();
userAccountService.Initialise(config);
m_userAccountService = userAccountService;
}
m_userAccountService.AddRegion(testScene);
m_userAccountService.RegionLoaded(testScene);
testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);
@@ -559,5 +560,4 @@ namespace OpenSim.Tests.Common.Setup
sogd.InventoryDeQueueAndDelete();
}
}
}

View File

@@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common
public static InventoryItemBase CreateInventoryItem(
Scene scene, string itemName, UUID itemId, string folderPath, UUID userId)
{
{
InventoryItemBase item = new InventoryItemBase();
item.Name = itemName;
item.AssetID = AssetHelpers.CreateAsset(scene, userId).FullID;
@@ -52,7 +52,7 @@ namespace OpenSim.Tests.Common
InventoryFolderBase objsFolder = scene.InventoryService.GetFolderForType(userId, AssetType.Object);
item.Folder = objsFolder.ID;
scene.AddInventoryItem(item);
scene.AddInventoryItem(item);
return item;
}

View File

@@ -53,7 +53,7 @@ namespace OpenSim.Tests.Common.Setup
// UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099");
// return CreateUserWithInventory(commsManager, userId, callback);
// }
//
//
// /// <summary>
// /// Create a test user with a standard inventory
// /// </summary>
@@ -108,11 +108,11 @@ namespace OpenSim.Tests.Common.Setup
// {
// LocalUserServices lus = (LocalUserServices)commsManager.UserService;
// lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId);
//
//
// CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
// userInfo.OnInventoryReceived += callback;
// userInfo.FetchInventory();
//
//
// return userInfo;
// }
@@ -140,6 +140,6 @@ namespace OpenSim.Tests.Common.Setup
scene.UserAccountService.StoreUserAccount(ua);
scene.InventoryService.CreateUserInventory(ua.PrincipalID);
scene.AuthenticationService.SetPassword(ua.PrincipalID, pw);
}
}
}
}