Interactive OpenSim region server
Inheritance: OpenSimBase
Ejemplo n.º 1
0
        public LLUUID AddNewInventoryItem(SimClient remoteClient, LLUUID folderID, OpenSim.Framework.Types.AssetBase asset)
        {
            LLUUID newItem = null;
            if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
            {
                newItem = this._agentsInventory[remoteClient.AgentID].AddToInventory(folderID, asset);
                if (newItem != null)
                {
                    InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[newItem];
                    this.SendItemUpdateCreate(remoteClient, Item);
                }
            }

            return newItem;
        }
Ejemplo n.º 2
0
        public void Initialize(OpenSim.Framework.IOpenSimBase openSim)
        {
            try
            {
                m_log.Info("[AURORAUPDATOR]: Checking for updates...");
                IConfig updateConfig = openSim.ConfigSource.Configs["Update"];
                if (updateConfig == null)
                    return;

                if (!updateConfig.GetBoolean("Enabled", false))
                    return;
                float CurrentVersion = float.Parse(openSim.Version.Split(' ')[1]);
                float LastestVersionToBlock = updateConfig.GetFloat("LatestRelease", 0);

                string WebSite = updateConfig.GetString("URLToCheckForUpdates", "http://auroraserver.ath.cx:8080/updater.xml");

                string XmlData = ReadExternalWebsite(WebSite);

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(XmlData);
                XmlNodeList parts = doc.GetElementsByTagName("Updater");
                XmlNode UpdaterNode = parts[0];
                if (float.Parse(UpdaterNode.ChildNodes[2].InnerText) > CurrentVersion && LastestVersionToBlock < float.Parse(UpdaterNode.ChildNodes[2].InnerText))
                {
                    //This version is not supported anymore
                    System.Windows.Forms.MessageBox.Show("A new version of Aurora has been released, version " + UpdaterNode.ChildNodes[2].InnerText + " released " + UpdaterNode.ChildNodes[3].InnerText + ". Release notes: " + UpdaterNode.ChildNodes[4].InnerText, "Aurora Update");
                    updateConfig.Set("LatestRelease", UpdaterNode.ChildNodes[2].InnerText);
                    updateConfig.ConfigSource.Save();
                }
                else if (float.Parse(UpdaterNode.ChildNodes[0].InnerText) > CurrentVersion && LastestVersionToBlock < float.Parse(UpdaterNode.ChildNodes[2].InnerText))
                {
                    //This version is not supported anymore
                    System.Windows.Forms.MessageBox.Show("Your version of Aurora (" + CurrentVersion + ", Released " + UpdaterNode.ChildNodes[1].InnerText + ") is not supported anymore.", "Aurora Update");
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 3
0
        public void Initialize(OpenSim.Framework.IOpenSimBase openSim)
        {
            try
            {
                //Check whether this is enabled
                IConfig updateConfig = openSim.ConfigSource.Configs["Update"];
                if (updateConfig == null)
                    return;

                if (!updateConfig.GetBoolean("Enabled", false))
                    return;
                
                m_log.Info("[AURORAUPDATOR]: Checking for updates...");

                float CurrentVersion = float.Parse(openSim.Version.Split(' ')[1]);
                float LastestVersionToBlock = updateConfig.GetFloat("LatestRelease", 0);

                string WebSite = updateConfig.GetString("URLToCheckForUpdates", "http://auroraserver.ath.cx:8080/updater.xml");
                //Pull the xml from the website
                string XmlData = Utilities.ReadExternalWebsite(WebSite);

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(XmlData);

                XmlNodeList parts = doc.GetElementsByTagName("Updater");
                XmlNode UpdaterNode = parts[0];

                //[0] - Minimum supported release #
                //[1] - Minimum supported release date
                //[2] - Newest version #
                //[3] - Date released
                //[4] - Release notes
                //[5] - Download link

                //Read the newest version [2] and see if it is higher than the current version and less than the version the user last told us to block
                if (float.Parse(UpdaterNode.ChildNodes[2].InnerText) > CurrentVersion && LastestVersionToBlock < float.Parse(UpdaterNode.ChildNodes[2].InnerText))
                {
                    //Ask if they would like to update
                    DialogResult result = MessageBox.Show("Aurora Update",
                        "A new version of Aurora has been released, version " +
                        UpdaterNode.ChildNodes[2].InnerText +
                        " released " + UpdaterNode.ChildNodes[3].InnerText +
                        ". Release notes: " + UpdaterNode.ChildNodes[4].InnerText +
                        ", do you want to download the update?",
                        System.Windows.Forms.MessageBoxButtons.YesNo);

                    //If so, download the new version
                    if (result == DialogResult.Yes)
                    {
                        Utilities.DownloadFile(UpdaterNode.ChildNodes[5].InnerText,
                            "AuroraVersion" + UpdaterNode.ChildNodes[2].InnerText + ".zip");
                    }
                    //Update the config so that we do not ask again
                    updateConfig.Set("LatestRelease", UpdaterNode.ChildNodes[2].InnerText);
                    updateConfig.ConfigSource.Save();
                }
                else if (float.Parse(UpdaterNode.ChildNodes[0].InnerText) > CurrentVersion && LastestVersionToBlock < float.Parse(UpdaterNode.ChildNodes[2].InnerText))
                {
                    //This version is not supported anymore
                    MessageBox.Show("Your version of Aurora (" + CurrentVersion + ", Released " + UpdaterNode.ChildNodes[1].InnerText + ") is not supported anymore.", "Aurora Update");
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 4
0
//        [Test]
        public void TestLifecycle()
        {
            TestHelpers.InMethod();
            TestHelpers.EnableLogging();

            UUID estateOwnerId = TestHelpers.ParseTail(0x1);
            UUID regionId = TestHelpers.ParseTail(0x10);

            IConfigSource configSource = new IniConfigSource();
            configSource.AddConfig("Startup");
            configSource.AddConfig("Modules");

//            // We use this to skip estate questions
            // Turns out not to be needed is estate owner id is pre-set in region information.
//            IConfig estateConfig = configSource.AddConfig(OpenSimBase.ESTATE_SECTION_NAME);
//            estateConfig.Set("DefaultEstateOwnerName", "Zaphod Beeblebrox");
//            estateConfig.Set("DefaultEstateOwnerUUID", estateOwnerId);
//            estateConfig.Set("DefaultEstateOwnerEMail", "*****@*****.**");
//            estateConfig.Set("DefaultEstateOwnerPassword", "two heads");

            // For grid servic
            configSource.AddConfig("GridService");
            configSource.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
            configSource.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
            configSource.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
            configSource.Configs["GridService"].Set("ConnectionString", "!static");

            LocalGridServicesConnector gridService = new LocalGridServicesConnector();
//
            OpenSim sim = new OpenSim(configSource);

            sim.SuppressExit = true;
            sim.EnableInitialPluginLoad = false;
            sim.LoadEstateDataService = false;
            sim.NetServersInfo.HttpListenerPort = 0;

            IRegistryCore reg = sim.ApplicationRegistry;

            RegionInfo ri = new RegionInfo();
            ri.RegionID = regionId;
            ri.EstateSettings.EstateOwner = estateOwnerId;
            ri.InternalEndPoint = new IPEndPoint(0, 0);

            MockRegionModulesControllerPlugin rmcp = new MockRegionModulesControllerPlugin();
            sim.m_plugins = new List<IApplicationPlugin>() { rmcp };
            reg.RegisterInterface<IRegionModulesController>(rmcp);

            // XXX: Have to initialize directly for now
            rmcp.Initialise(sim);

            rmcp.AddNode(gridService);

            TestSharedRegion tsr = new TestSharedRegion();
            rmcp.AddNode(tsr);

            // FIXME: Want to use the real one eventually but this is currently directly tied into Mono.Addins
            // which has been written in such a way that makes it impossible to use for regression tests.
//            RegionModulesControllerPlugin rmcp = new RegionModulesControllerPlugin();
//            rmcp.LoadModulesFromAddins = false;
////            reg.RegisterInterface<IRegionModulesController>(rmcp);
//            rmcp.Initialise(sim);
//            rmcp.PostInitialise();           
//            TypeExtensionNode node = new TypeExtensionNode();
//            node.
//            rmcp.AddNode(node, configSource.Configs["Modules"], new Dictionary<RuntimeAddin, IList<int>>());

            sim.Startup();
            IScene scene;
            sim.CreateRegion(ri, out scene);

            sim.Shutdown();

            List<string> co = tsr.CallOrder;
            int expectedEventCount = 6;

            Assert.AreEqual(
                expectedEventCount, 
                co.Count, 
                "Expected {0} events but only got {1} ({2})", 
                expectedEventCount, co.Count, string.Join(",", co));
            Assert.AreEqual("Initialise",       co[0]);
            Assert.AreEqual("PostInitialise",   co[1]);
            Assert.AreEqual("AddRegion",        co[2]);
            Assert.AreEqual("RegionLoaded",     co[3]);
            Assert.AreEqual("RemoveRegion",     co[4]);
            Assert.AreEqual("Close",            co[5]);
        }
Ejemplo n.º 5
0
        public bool UpdateInventoryItemAsset(SimClient remoteClient, LLUUID itemID, OpenSim.Framework.Types.AssetBase asset)
        {
            if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
            {
                bool res = _agentsInventory[remoteClient.AgentID].UpdateItemAsset(itemID, asset);
                if (res)
                {
                    InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID];
                    this.SendItemUpdateCreate(remoteClient, Item);
                }
                return res;
            }

            return false;
        }