public AvatarConnectionManager(ICapabilitiesModule capsModule, AvatarTransit.AvatarTransitController controller)
        {
            _capsModule        = capsModule;
            _transitController = controller;

            _transitController.OnTransitStateChanged += _transitController_OnTransitStateChanged;
        }
Beispiel #2
0
        public void TestSimpleNotNeighboursTeleport()
        {
            TestHelper.InMethod();

            // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod());

            log4net.Config.XmlConfigurator.Configure();

            UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
            UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");
            TestCommunicationsManager cm = new TestCommunicationsManager();

            // shared module
            IRegionModule interregionComms = new RESTInterregionComms();

            Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);

            SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
            sceneA.RegisterRegionWithGrid();

            Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm);

            SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
            sceneB.RegisterRegionWithGrid();

            UUID       agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
            TestClient client  = SceneSetupHelpers.AddRootAgent(sceneA, agentId);

            ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface <ICapabilitiesModule>();

            Assert.That(
                sceneACapsModule.GetCapsPath(agentId),
                Is.EqualTo(client.CapsSeedUrl),
                "Incorrect caps object path set up in sceneA");

            // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used.
            client.TeleportTargetScene = sceneB;
            client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));

            Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB");
            Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA");

            ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface <ICapabilitiesModule>();

            // Temporary assertion - caps url construction should at least be doable through a method.
            Assert.That(
                "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/",
                Is.EqualTo(client.CapsSeedUrl),
                "Incorrect caps object path set up in sceneB");

            // This assertion will currently fail since we don't remove the caps paths when no longer needed
            //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path");

            // TODO: Check that more of everything is as it should be

            // TODO: test what happens if we try to teleport to a region that doesn't exist
        }
        public virtual AgentCircuitData RequestClientInfo()
        {
            AgentCircuitData agentData = new AgentCircuitData();

            agentData.AgentID         = AgentId;
            agentData.SessionID       = UUID.Zero;
            agentData.SecureSessionID = UUID.Zero;
            agentData.circuitcode     = m_circuitCode;
            agentData.child           = false;
            agentData.firstname       = m_firstName;
            agentData.lastname        = m_lastName;

            ICapabilitiesModule capsModule = m_scene.RequestModuleInterface <ICapabilitiesModule>();

            agentData.CapsPath         = capsModule.GetCapsPath(m_agentId);
            agentData.ChildrenCapSeeds = new Dictionary <ulong, string>(capsModule.GetChildrenSeeds(m_agentId));

            return(agentData);
        }
Beispiel #4
0
 /// <summary>
 /// Sets up references to modules required by the scene
 /// </summary>
 public void SetModuleInterfaces()
 {
     m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
     m_worldCommModule = RequestModuleInterface<IWorldComm>();
     XferManager = RequestModuleInterface<IXfer>();
     m_AvatarFactory = RequestModuleInterface<IAvatarFactoryModule>();
     AttachmentsModule = RequestModuleInterface<IAttachmentsModule>();
     m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
     m_dialogModule = RequestModuleInterface<IDialogModule>();
     m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
     EntityTransferModule = RequestModuleInterface<IEntityTransferModule>();
     m_groupsModule = RequestModuleInterface<IGroupsModule>();
     AgentTransactionsModule = RequestModuleInterface<IAgentAssetTransactions>();
     UserManagementModule = RequestModuleInterface<IUserManagement>();
 }
Beispiel #5
0
        public void run(object o)
        {
            //results.Result = true;
            log4net.Config.XmlConfigurator.Configure();

            UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
            UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");

            // shared module
            ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();


            Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, "grid");

            SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
            sceneB.RegisterRegionWithGrid();

            Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, "grid");

            SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
            sceneA.RegisterRegionWithGrid();

            UUID       agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
            TestClient client  = SceneSetupHelpers.AddRootAgent(sceneA, agentId);

            ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface <ICapabilitiesModule>();

            results.Result = (sceneACapsModule.GetCapsPath(agentId) == client.CapsSeedUrl);

            if (!results.Result)
            {
                results.Message = "Incorrect caps object path set up in sceneA";
                return;
            }

            /*
             * Assert.That(
             *  sceneACapsModule.GetCapsPath(agentId),
             *  Is.EqualTo(client.CapsSeedUrl),
             *  "Incorrect caps object path set up in sceneA");
             */
            // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used.


            client.TeleportTargetScene = sceneB;
            client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40));

            results.Result = (sceneB.GetScenePresence(agentId) != null);
            if (!results.Result)
            {
                results.Message = "Client does not have an agent in sceneB";
                return;
            }

            //Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB");

            //Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA");

            results.Result = (sceneA.GetScenePresence(agentId) == null);
            if (!results.Result)
            {
                results.Message = "Client still had an agent in sceneA";
                return;
            }

            ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface <ICapabilitiesModule>();


            results.Result = ("http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort +
                              "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/" == client.CapsSeedUrl);
            if (!results.Result)
            {
                results.Message = "Incorrect caps object path set up in sceneB";
                return;
            }

            // Temporary assertion - caps url construction should at least be doable through a method.

            /*
             * Assert.That(
             *  "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/",
             *  Is.EqualTo(client.CapsSeedUrl),
             *  "Incorrect caps object path set up in sceneB");
             */
            // This assertion will currently fail since we don't remove the caps paths when no longer needed
            //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path");

            // TODO: Check that more of everything is as it should be

            // TODO: test what happens if we try to teleport to a region that doesn't exist
        }
Beispiel #6
0
 /// <summary>
 /// Sets up references to modules required by the scene
 /// </summary>
 public void SetModuleInterfaces()
 {
     m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
     m_worldCommModule = RequestModuleInterface<IWorldComm>();
     XferManager = RequestModuleInterface<IXfer>();
     m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
     m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
     m_interregionCommsOut = RequestModuleInterface<IInterregionCommsOut>();
     m_interregionCommsIn = RequestModuleInterface<IInterregionCommsIn>();
     m_dialogModule = RequestModuleInterface<IDialogModule>();
     m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
     m_teleportModule = RequestModuleInterface<ITeleportModule>();
 }
Beispiel #7
0
        /// <summary>
        /// Sets up references to modules required by the scene
        /// </summary>
        public void SetModuleInterfaces()
        {
            m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
            m_worldCommModule = RequestModuleInterface<IWorldComm>();
            XferManager = RequestModuleInterface<IXfer>();
            m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
            AttachmentsModule = RequestModuleInterface<IAttachmentsModule>();
            m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
            m_dialogModule = RequestModuleInterface<IDialogModule>();
            m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
            m_teleportModule = RequestModuleInterface<IEntityTransferModule>();

            // Shoving this in here for now, because we have the needed
            // interfaces at this point
            //
            // TODO: Find a better place for this
            //
            while (m_regInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
            {
                MainConsole.Instance.Output("The current estate " + m_regInfo.EstateSettings.EstateName + " has no owner set.");
                List<char> excluded = new List<char>(new char[1] { ' ' });
                string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
                string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);

                UserAccount account = UserAccountService.GetUserAccount(m_regInfo.ScopeID, first, last);

                if (account == null)
                {
                    // Create a new account
                    account = new UserAccount(m_regInfo.ScopeID, first, last, String.Empty);
                    if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0))
                    {
                        account.ServiceURLs = new Dictionary<string, object>();
                        account.ServiceURLs["HomeURI"] = string.Empty;
                        account.ServiceURLs["GatekeeperURI"] = string.Empty;
                        account.ServiceURLs["InventoryServerURI"] = string.Empty;
                        account.ServiceURLs["AssetServerURI"] = string.Empty;
                    }

                    if (UserAccountService.StoreUserAccount(account))
                    {
                        string password = MainConsole.Instance.PasswdPrompt("Password");
                        string email = MainConsole.Instance.CmdPrompt("Email", "");

                        account.Email = email;
                        UserAccountService.StoreUserAccount(account);

                        bool success = false;
                        success = AuthenticationService.SetPassword(account.PrincipalID, password);
                        if (!success)
                            m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.",
                               first, last);

                        GridRegion home = null;
                        if (GridService != null)
                        {
                            List<GridRegion> defaultRegions = GridService.GetDefaultRegions(UUID.Zero);
                            if (defaultRegions != null && defaultRegions.Count >= 1)
                                home = defaultRegions[0];

                            if (GridUserService != null && home != null)
                                GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0));
                            else
                                m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.",
                                   first, last);

                        }
                        else
                            m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.",
                               first, last);

                        if (InventoryService != null)
                            success = InventoryService.CreateUserInventory(account.PrincipalID);
                        if (!success)
                            m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.",
                               first, last);


                        m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", first, last);

                        m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
                        m_regInfo.EstateSettings.Save();
                    }
                    else
                        m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first.");
                }
                else
                {
                    m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
                    m_regInfo.EstateSettings.Save();
                }
            }
        }
Beispiel #8
0
 public void PostInitialise()
 {
     m_capsmodule = m_scene.RequestModuleInterface<ICapabilitiesModule>();
     m_scene.EventManager.OnRegisterCaps += OnClientRegisterCaps;
 }
Beispiel #9
0
 /// <summary>
 /// Sets up references to modules required by the scene
 /// </summary>
 public void SetModuleInterfaces()
 {
     m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
     m_worldCommModule = RequestModuleInterface<IWorldComm>();
     XferManager = RequestModuleInterface<IXfer>();
     m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
     AttachmentsModule = RequestModuleInterface<IAttachmentsModule>();
     m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
     m_dialogModule = RequestModuleInterface<IDialogModule>();
     m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
     m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
 }