/// <summary> /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions /// or a different, to get a brand new scene with new shared region modules. /// </summary> /// <param name="name">Name of the region</param> /// <param name="id">ID of the region</param> /// <param name="x">X co-ordinate of the region</param> /// <param name="y">Y co-ordinate of the region</param> /// <param name="cm">This should be the same if simulating two scenes within a standalone</param> /// <returns></returns> public static TestScene SetupScene(string name, UUID id, uint x, uint y, CoreAssetCache cache) { Console.WriteLine("Setting up test scene {0}", name); // We must set up a console otherwise setup of some modules may fail MainConsole.Instance = new MockConsole("TEST PROMPT"); RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); regInfo.RegionName = name; regInfo.RegionID = id; AgentCircuitManager acm = new AgentCircuitManager(); SceneCommunicationService scs = new SceneCommunicationService(); 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, simDataService, estateDataService, null, false, configSource, null); IRegionModule godsModule = new GodsModule(); godsModule.Initialise(testScene, new IniConfigSource()); testScene.AddModule(godsModule.Name, godsModule); LocalAssetServicesConnector assetService = StartAssetService(testScene, cache); StartAuthenticationService(testScene); LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene); StartGridService(testScene); LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); inventoryService.PostInitialise(); assetService.PostInitialise(); userAccountService.PostInitialise(); presenceService.PostInitialise(); testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); testScene.SetModuleInterfaces(); testScene.LandChannel = new TestLandChannel(testScene); testScene.LoadWorldMap(); PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); testScene.PhysicsScene = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test"); testScene.RegionInfo.EstateSettings = new EstateSettings(); testScene.LoginsDisabled = false; testScene.RegisterRegionWithGrid(); return(testScene); }
private void SetUp() { IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.AddConfig("PresenceService"); config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 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> /// Start a presence service /// </summary> /// <param name="testScene"></param> private static LocalPresenceServicesConnector StartPresenceService() { IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.AddConfig("PresenceService"); config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); config.Configs["PresenceService"].Set( "LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); presenceService.Initialise(config); return presenceService; }
public SceneHelpers(CoreAssetCache cache) { SceneManager = new SceneManager(); m_assetService = StartAssetService(cache); m_authenticationService = StartAuthenticationService(); m_inventoryService = StartInventoryService(); m_gridService = StartGridService(); m_userAccountService = StartUserAccountService(); m_presenceService = StartPresenceService(); m_inventoryService.PostInitialise(); m_assetService.PostInitialise(); m_userAccountService.PostInitialise(); m_presenceService.PostInitialise(); m_cache = cache; }
/// <summary> /// Add a root agent. /// </summary> /// <remarks> /// This function /// /// 1) Tells the scene that an agent is coming. Normally, the login service (local if standalone, from the /// userserver if grid) would give initial login data back to the client and separately tell the scene that the /// agent was coming. /// /// 2) Connects the agent with the scene /// /// This function performs actions equivalent with notifying the scene that an agent is /// coming and then actually connecting the agent to the scene. The one step missed out is the very first /// </remarks> /// <param name="scene"></param> /// <param name="agentData"></param> /// <param name="sceneManager"></param> /// <returns></returns> public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData, SceneManager sceneManager) { // We emulate the proper login sequence here by doing things in four stages // Stage 0: login // We need to punch through to the underlying service because scene will not, correctly, let us call it // through it's reference to the LPSC LocalPresenceServicesConnector lpsc = (LocalPresenceServicesConnector)scene.PresenceService; lpsc.m_PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID); // Stages 1 & 2 ScenePresence sp = IntroduceClientToScene(scene, sceneManager, agentData, TeleportFlags.ViaLogin); // Stage 3: Complete the entrance into the region. This converts the child agent into a root agent. sp.CompleteMovement(sp.ControllingClient, true); return sp; }
/// <summary> /// Start a presence service /// </summary> /// <param name="testScene"></param> private static LocalPresenceServicesConnector StartPresenceService(Scene testScene) { IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.AddConfig("PresenceService"); config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); config.Configs["PresenceService"].Set( "LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); presenceService.Initialise(config); presenceService.AddRegion(testScene); presenceService.RegionLoaded(testScene); testScene.AddRegionModule(presenceService.Name, presenceService); return(presenceService); }
public SceneHelpers(CoreAssetCache cache) { SceneManager = new SceneManager(); m_assetService = StartAssetService(cache); m_authenticationService = StartAuthenticationService(); m_inventoryService = StartInventoryService(); m_gridService = StartGridService(); m_userAccountService = StartUserAccountService(); m_presenceService = StartPresenceService(); m_inventoryService.PostInitialise(); m_assetService.PostInitialise(); m_userAccountService.PostInitialise(); m_presenceService.PostInitialise(); m_cache = cache; SimDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin <ISimulationDataService>("OpenSim.Tests.Common.dll", null); }
/// <summary> /// Start a presence service /// </summary> /// <param name="testScene"></param> private static LocalPresenceServicesConnector StartPresenceService() { // Unfortunately, some services share data via statics, so we need to null every time to stop interference // between tests. // This is a massive non-obvious pita. NullPresenceData.Instance = null; IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.AddConfig("PresenceService"); config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); config.Configs["PresenceService"].Set( "LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); presenceService.Initialise(config); return(presenceService); }