当前位置: 首页>>代码示例>>C#>>正文


C# Framework.RegionInfo类代码示例

本文整理汇总了C#中Aurora.Framework.RegionInfo的典型用法代码示例。如果您正苦于以下问题:C# RegionInfo类的具体用法?C# RegionInfo怎么用?C# RegionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RegionInfo类属于Aurora.Framework命名空间,在下文中一共展示了RegionInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateRegionInfo

 public void UpdateRegionInfo(RegionInfo region)
 {
     RegionInfo oldRegion = GetRegionInfo(region.RegionID);
     if (oldRegion != null)
     {
         m_registry.RequestModuleInterface<ISimulationBase>().EventManager.FireGenericEventHandler("RegionInfoChanged", new[] 
         {
             oldRegion,
             region
         });
     }
     Dictionary<string, object> row = new Dictionary<string, object>(4);
     row["RegionID"] = region.RegionID;
     row["RegionName"] = region.RegionName.MySqlEscape(50);
     row["RegionInfo"] = OSDParser.SerializeJsonString(region.PackRegionInfoData(true));
     row["DisableD"] = region.Disabled ? 1 : 0;
     GD.Replace("simulator", row);
 }
开发者ID:TechplexEngineer,项目名称:Aurora-Sim,代码行数:18,代码来源:LocalRegionInfoConnector.cs

示例2: RegionManager

 public RegionManager(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement, RegionInfo startingRegionInfo)
 {
     _regionManager = regionManagement;
     _config = config;
     _startingRegionInfo = startingRegionInfo;
     RegionInfo = _startingRegionInfo;
     KillAfterRegionCreation = killWindowOnRegionCreation;
     _pageToStart = page;
     InitializeComponent();
     ChangeRegionInfo(_startingRegionInfo);
     if (_startingRegionInfo == null)
         groupBox5.Visible = false;
     tabControl1.SelectedIndex = (int)_pageToStart;
     changeEstateBox.Visible = false;
     _timer.Interval = 100;
     _timer.Tick += m_timer_Tick;
     _timer.Start ();
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:18,代码来源:RegionManager.cs

示例3: SceneGraph

        protected internal SceneGraph(IScene parent, RegionInfo regInfo)
        {
            Random random = new Random();
            m_lastAllocatedLocalId = (uint)(random.NextDouble() * (uint.MaxValue / 2)) + uint.MaxValue / 4;
            m_parentScene = parent;
            m_regInfo = regInfo;

            //Subscript to the scene events
            m_parentScene.EventManager.OnNewClient += SubscribeToClientEvents;
            m_parentScene.EventManager.OnClosingClient += UnSubscribeToClientEvents;

            IConfig aurorastartupConfig = parent.Config.Configs["AuroraStartup"];
            if (aurorastartupConfig != null)
            {
                m_DefaultObjectName = aurorastartupConfig.GetString("DefaultObjectName", m_DefaultObjectName);
                EnableFakeRaycasting = aurorastartupConfig.GetBoolean("EnableFakeRaycasting", false);
            }
        }
开发者ID:EnricoNirvana,项目名称:Aurora-Sim,代码行数:18,代码来源:SceneGraph.cs

示例4: SetupScene

        /// <summary>
        ///   Create a scene and its initial base structures.
        /// </summary>
        /// <param name = "regionInfo"></param>
        /// <param name = "proxyOffset"></param>
        /// <param name = "configSource"></param>
        /// <param name = "clientServer"> </param>
        /// <returns></returns>
        protected IScene SetupScene(RegionInfo regionInfo, IConfigSource configSource)
        {
            AgentCircuitManager circuitManager = new AgentCircuitManager();
            List<IClientNetworkServer> clientServers = AuroraModuleLoader.PickupModules<IClientNetworkServer>();
            List<IClientNetworkServer> allClientServers = new List<IClientNetworkServer>();
            foreach (IClientNetworkServer clientServer in clientServers)
            {
                foreach (int port in regionInfo.UDPPorts)
                {
                    IClientNetworkServer copy = clientServer.Copy();
                    copy.Initialise(port, m_configSource, circuitManager);
                    allClientServers.Add(copy);
                }
            }

            Scene scene = new Scene();
            scene.AddModuleInterfaces(m_openSimBase.ApplicationRegistry.GetInterfaces());
            scene.Initialize(regionInfo, circuitManager, allClientServers);

            return scene;
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:29,代码来源:SceneLoader.cs

示例5: UpdateRegionInfo

 public void UpdateRegionInfo(RegionInfo region)
 {
     RegionInfo oldRegion = GetRegionInfo(region.RegionID);
     if (oldRegion != null)
     {
         m_registry.RequestModuleInterface<ISimulationBase>().EventManager.FireGenericEventHandler("RegionInfoChanged", new[] 
         {
             oldRegion,
             region
         });
     }
     List<object> Values = new List<object>
                               {
                                   region.RegionID,
                                   region.RegionName.MySqlEscape(50),
                                   OSDParser.SerializeJsonString(region.PackRegionInfoData(true)),
                                   region.Disabled ? 1 : 0
                               };
     GD.Replace("simulator", new[]{"RegionID","RegionName",
         "RegionInfo","Disabled"}, Values.ToArray());
 }
开发者ID:djphil,项目名称:Aurora-Sim,代码行数:21,代码来源:LocalRegionInfoConnector.cs

示例6: GetPhysicsScene

        /// <summary>
        ///   Get a physics scene for the given physics engine and mesher.
        /// </summary>
        /// <param name = "physEngineName"></param>
        /// <param name = "meshEngineName"></param>
        /// <param name = "config"></param>
        /// <returns></returns>
        public PhysicsScene GetPhysicsScene(string physEngineName, string meshEngineName, IConfigSource config,
                                            RegionInfo region, IRegistryCore registry)
        {
            if (String.IsNullOrEmpty(physEngineName))
            {
                return new NullPhysicsScene();
            }

            if (String.IsNullOrEmpty(meshEngineName))
            {
                return new NullPhysicsScene();
            }

            IMesher meshEngine = null;
            if (_MeshPlugins.ContainsKey(meshEngineName))
            {
                MainConsole.Instance.Debug("[Physics]: Loading meshing engine: " + meshEngineName);
                meshEngine = _MeshPlugins[meshEngineName].GetMesher(config);
            }
            else
            {
                MainConsole.Instance.WarnFormat("[Physics]: Couldn't find meshing engine: {0}", meshEngineName);
                throw new ArgumentException(String.Format("couldn't find meshing engine: {0}", meshEngineName));
            }

            if (_PhysPlugins.ContainsKey(physEngineName))
            {
                MainConsole.Instance.Debug("[Physics]: Loading physics engine: " + physEngineName);
                PhysicsScene result = _PhysPlugins[physEngineName].GetScene(region.RegionName);
                result.Initialise(meshEngine, region, registry);
                result.PostInitialise(config);
                return result;
            }
            else
            {
                MainConsole.Instance.WarnFormat("[Physics]: Couldn't find physics engine: {0}", physEngineName);
                throw new ArgumentException(String.Format("couldn't find physics engine: {0}", physEngineName));
            }
        }
开发者ID:Gnu32,项目名称:Silverfin,代码行数:46,代码来源:PhysicsPluginManager.cs

示例7: UpdateRegionInfo

        public void UpdateRegionInfo(string oldName, RegionInfo regionInfo)
        {
            IRegionInfoConnector connector = DataManager.RequestPlugin<IRegionInfoConnector>();
            if (connector != null)
            {
                //Make sure we have this region in the database
                if (connector.GetRegionInfo(oldName) == null)
                    return;
                RegionInfo copy = new RegionInfo();
                //Make an exact copy
                copy.UnpackRegionInfoData(regionInfo.PackRegionInfoData(true));

                //Fix the name of the region so we can delete the old one
                copy.RegionName = oldName;
                DeleteRegion(copy);
                //Now add the new one
                connector.UpdateRegionInfo(regionInfo);
            }
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:19,代码来源:RegionLoaderDataBaseSystem.cs

示例8: Initialise

 // Initialize the mesh plugin
 public override void Initialise(IMesher meshmerizer, RegionInfo region, IRegistryCore registry)
 {
     mesher = meshmerizer;
     m_region = region;
     m_registry = registry;
     WorldExtents = new Vector2(region.RegionSizeX, region.RegionSizeY);
 }
开发者ID:EnricoNirvana,项目名称:Aurora-Sim,代码行数:8,代码来源:AODEPhysicsScene.cs

示例9: DeleteRegion

 public void DeleteRegion(RegionInfo regionInfo)
 {
     IRegionInfoConnector connector = DataManager.RequestPlugin<IRegionInfoConnector>();
     if (connector != null)
     {
         connector.Delete(regionInfo);
     }
 }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:8,代码来源:RegionLoaderDataBaseSystem.cs

示例10: LoadModuleFromArchive

 public void LoadModuleFromArchive(byte[] data, string filePath, TarArchiveReader.TarEntryType type, IScene scene)
 {
     if (filePath.StartsWith("estate/"))
     {
         string estateData = Encoding.UTF8.GetString(data);
         EstateSettings settings = new EstateSettings(WebUtils.ParseXmlResponse(estateData));
         scene.RegionInfo.EstateSettings = settings;
     }
     else if (filePath.StartsWith("regioninfo/"))
     {
         string m_merge = MainConsole.Instance.Prompt("Should we load the region information from the archive (region name, region position, etc)?", "false");
         RegionInfo settings = new RegionInfo();
         settings.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeLLSDBinary(data));
         if (m_merge == "false")
         {
             //Still load the region settings though
             scene.RegionInfo.RegionSettings = settings.RegionSettings;
             return;
         }
         settings.RegionSettings = scene.RegionInfo.RegionSettings;
         settings.EstateSettings = scene.RegionInfo.EstateSettings;
         scene.RegionInfo = settings;
     }
 }
开发者ID:Gnu32,项目名称:Silverfin,代码行数:24,代码来源:EstateInitializer.cs

示例11: LoadLibraries

        /// <summary>
        ///   Use the asset set information at path to load assets
        /// </summary>
        /// <param name = "path"></param>
        /// <param name = "assets"></param>
        protected void LoadLibraries(string iarFileName)
        {
            RegionInfo regInfo = new RegionInfo();
            IScene m_MockScene = null;
            //Make the scene for the IAR loader
            if (m_registry is IScene)
                m_MockScene = (IScene)m_registry;
            else
            {
                m_MockScene = new Scene();
                m_MockScene.Initialize(regInfo);
                m_MockScene.AddModuleInterfaces(m_registry.GetInterfaces());
            }

            UserAccount uinfo = m_MockScene.UserAccountService.GetUserAccount(UUID.Zero, m_service.LibraryOwner);
            //Make the user account for the default IAR
            if (uinfo == null)
            {
                MainConsole.Instance.Warn("Creating user " + m_service.LibraryOwnerName);
                m_MockScene.UserAccountService.CreateUser(m_service.LibraryOwner, UUID.Zero, m_service.LibraryOwnerName, "", "");
                uinfo = m_MockScene.UserAccountService.GetUserAccount(UUID.Zero, m_service.LibraryOwner);
                m_MockScene.InventoryService.CreateUserInventory(uinfo.PrincipalID, false);
            }
            if (m_MockScene.InventoryService.GetRootFolder(m_service.LibraryOwner) == null)
                m_MockScene.InventoryService.CreateUserInventory(uinfo.PrincipalID, false);

            List<InventoryFolderBase> rootFolders = m_MockScene.InventoryService.GetFolderFolders(uinfo.PrincipalID,
                                                                                                  UUID.Zero);
#if (!ISWIN)
            bool alreadyExists = false;
            foreach (InventoryFolderBase folder in rootFolders)
            {
                if (folder.Name == iarFileName)
                {
                    alreadyExists = true;
                    break;
                }
            }
#else
            bool alreadyExists = rootFolders.Any(folder => folder.Name == iarFileName);
#endif
            if (alreadyExists)
            {
                MainConsole.Instance.InfoFormat("[LIBRARY INVENTORY]: Found previously loaded iar file {0}, ignoring.", iarFileName);
                return;
            }

            MainConsole.Instance.InfoFormat("[LIBRARY INVENTORY]: Loading iar file {0}", iarFileName);
            InventoryFolderBase rootFolder = m_MockScene.InventoryService.GetRootFolder(uinfo.PrincipalID);

            if (null == rootFolder)
            {
                //We need to create the root folder, otherwise the IAR freaks
                m_MockScene.InventoryService.CreateUserInventory(uinfo.PrincipalID, false);
            }

            InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName,
                                                                                   false, m_service.LibraryOwner);

            try
            {
                archread.ReplaceAssets = true;//Replace any old assets
                List<InventoryNodeBase> nodes = new List<InventoryNodeBase>(archread.Execute(true));
                if (nodes.Count == 0)
                    return;
                InventoryFolderBase f = (InventoryFolderBase)nodes[0];
                UUID IARRootID = f.ID;

                TraverseFolders(IARRootID, m_MockScene);
                FixParent(IARRootID, m_MockScene, m_service.LibraryRootFolderID);
                f.Name = iarFileName;
                f.ParentID = UUID.Zero;
                f.ID = m_service.LibraryRootFolderID;
                f.Type = (int)AssetType.RootFolder;
                f.Version = 1;
                m_MockScene.InventoryService.UpdateFolder(f);
            }
            catch (Exception e)
            {
                MainConsole.Instance.DebugFormat("[LIBRARY MODULE]: Exception when processing archive {0}: {1}", iarFileName,
                                  e.StackTrace);
            }
            finally
            {
                archread.Close();
            }
        }
开发者ID:JAllard,项目名称:Aurora-Sim,代码行数:92,代码来源:DefaultInventoryIARLoader.cs

示例12: RegionInfoStartupSorter

 private int RegionInfoStartupSorter(RegionInfo A, RegionInfo B)
 {
     return A.NumberStartup.CompareTo(B.NumberStartup);
 }
开发者ID:jbomhold3,项目名称:Aurora-Sim,代码行数:4,代码来源:LocalRegionInfoConnector.cs

示例13: GetRegionInfo

        public RegionInfo GetRegionInfo(string regionName)
        {
            QueryFilter filter = new QueryFilter();
            filter.andFilters["RegionName"] = regionName.MySqlEscape(50);
            List<string> RetVal = GD.Query(new[] { "RegionInfo" }, "simulator", filter, null, null, null);

            if (RetVal.Count == 0)
            {
                return null;
            }

            RegionInfo replyData = new RegionInfo();
            replyData.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeJson(RetVal[0]));
            return replyData;
        }
开发者ID:jbomhold3,项目名称:Aurora-Sim,代码行数:15,代码来源:LocalRegionInfoConnector.cs

示例14: FixVariableSizedRegionTerrainSize

 private Bitmap FixVariableSizedRegionTerrainSize(RegionInfo region, Bitmap image)
 {
     if(region.RegionSizeX == Constants.RegionSize && region.RegionSizeY == Constants.RegionSize)
         return image;
     Bitmap destImage = new Bitmap(region.RegionSizeX, region.RegionSizeY);
     using (TextureBrush brush = new TextureBrush(image, WrapMode.Tile))
     using (Graphics g = Graphics.FromImage(destImage))
     {
         // do your painting in here
         g.FillRectangle(brush, 0, 0, destImage.Width, destImage.Height);
     }
     image.Dispose();
     return destImage;
 }
开发者ID:rjspence,项目名称:YourSim,代码行数:14,代码来源:WarpTileRenderer.cs

示例15: ChangeRegionInfo

        private void ChangeRegionInfo (RegionInfo region)
        {
            m_changingRegion = true;
            if (region == null)
            {
                button20.Enabled = false;
                CurrentRegionID = UUID.Zero;
                m_changingRegion = false;
                textBox11.Text = "";
                textBox6.Text = ""; 
                textBox4.Text = "";
                DisabledEdit.Checked = false;
                textBox7.Text = "";
                textBox3.Text = "";
                textBox5.Text = "";
                textBox1.Text = "";
                RegionSizeX.Text = "";
                RegionSizeY.Text = "";
                startupType.SelectedIndex = 0;
                einfiniteRegion.Checked = false;
                return;
            }
            button20.Enabled = true;
            CurrentRegionID = region.RegionID;
            textBox11.Text = region.RegionType;
            textBox6.Text = region.ObjectCapacity.ToString ();
            uint maturityLevel = Util.ConvertAccessLevelToMaturity (region.AccessLevel);
            if (maturityLevel == 0)
                textBox4.Text = "PG";
            else if (maturityLevel == 1)
                textBox4.Text = "Mature";
            else
                textBox4.Text = "Adult";
            DisabledEdit.Checked = region.Disabled;
#if (!ISWIN)
            textBox7.Text = string.Join(", ", region.UDPPorts.ConvertAll<string>(delegate(int i) { return i.ToString(); }).ToArray());
#else
            textBox7.Text = string.Join (", ", region.UDPPorts.ConvertAll (i => i.ToString()).ToArray ());
#endif
            textBox3.Text = (region.RegionLocX / Constants.RegionSize).ToString ();
            textBox5.Text = (region.RegionLocY / Constants.RegionSize).ToString ();
            textBox1.Text = region.RegionName;
            RegionSizeX.Text = region.RegionSizeX.ToString ();
            RegionSizeY.Text = region.RegionSizeY.ToString ();
            startupType.SelectedIndex = ConvertStartupType (region.Startup);
            einfiniteRegion.Checked = region.InfiniteRegion;
            IScene scene;
            if (m_sceneManager.TryGetScene (region.RegionID, out scene))
                SetOnlineStatus ();
            else
                SetOfflineStatus ();

            m_changingRegion = false;
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:54,代码来源:RegionManager.cs


注:本文中的Aurora.Framework.RegionInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。