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


C# RegionInfo.UnpackRegionInfoData方法代码示例

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


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

示例1: 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

示例2: GetRegionInfos

        public RegionInfo[] GetRegionInfos(bool nonDisabledOnly)
        {
            QueryFilter filter = new QueryFilter();
            if (nonDisabledOnly)
            {
                filter.andFilters["Disabled"] = 0;
            }

            List<string> RetVal = GD.Query(new[] { "RegionInfo" }, "simulator", filter, null, null, null);

            if (RetVal.Count == 0)
            {
                return new RegionInfo[]{};
            }

            List<RegionInfo> Infos = new List<RegionInfo>();
            foreach (string t in RetVal)
            {
                RegionInfo replyData = new RegionInfo();
                replyData.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeJson(t));
                Infos.Add(replyData);
            }
            //Sort by startup number
            Infos.Sort(RegionInfoStartupSorter);
            return Infos.ToArray();
        }
开发者ID:jbomhold3,项目名称:Aurora-Sim,代码行数:26,代码来源:LocalRegionInfoConnector.cs

示例3: 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

示例4: 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

示例5: LoadFromFile

        public void LoadFromFile()
        {
            GZipStream m_loadStream = new GZipStream(ArchiveHelpers.GetStream(m_fileName), CompressionMode.Decompress);
            TarArchiveReader reader = new TarArchiveReader(m_loadStream);

            byte[] data;
            string filePath;
            TarArchiveReader.TarEntryType entryType;

            #region Our Region Info

            IParcelServiceConnector parcelService = Aurora.DataManager.DataManager.RequestPlugin<IParcelServiceConnector>();

            SceneManager sceneManager = m_simulationBase.ApplicationRegistry.RequestModuleInterface<SceneManager>();
            RegionInfo regionInfo = new RegionInfo();
            IScene fakeScene = new Scene();
            fakeScene.AddModuleInterfaces(m_simulationBase.ApplicationRegistry.GetInterfaces());

            #endregion

            while ((data = reader.ReadEntry(out filePath, out entryType)) != null)
            {
                if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType)
                    continue;

                if (filePath.StartsWith("estate/"))
                {
                    string estateData = Encoding.UTF8.GetString(data);
                    EstateSettings settings = new EstateSettings(WebUtils.ParseXmlResponse(estateData));
                    regionInfo.EstateSettings = settings;
                }
                else if (filePath.StartsWith("regioninfo/"))
                {
                    regionInfo.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeLLSDBinary(data));
                }
            }

            if (!m_useExistingRegionInfo)
            {
                regionInfo.RegionID = UUID.Random();
                regionInfo.RegionName = MainConsole.Instance.Prompt("Region Name: ", regionInfo.RegionName);
                regionInfo.RegionLocX = int.Parse(MainConsole.Instance.Prompt("Region Position X: ", regionInfo.RegionLocX.ToString()));
                regionInfo.RegionLocY = int.Parse(MainConsole.Instance.Prompt("Region Position Y: ", regionInfo.RegionLocY.ToString()));
                regionInfo.InternalEndPoint.Port = int.Parse(MainConsole.Instance.Prompt("HTTP Port: ", regionInfo.InternalEndPoint.Port.ToString()));
            }

            //ISimulationDataStore simulationStore = sceneManager.SimulationDataService;
            //Hijack the old simulation service and replace it with ours
            sceneManager.SimulationDataService = new OverridenFileBasedSimulationData (m_fileName, m_saveNewArchiveAtClose);

            ///Now load the region!
            sceneManager.AllRegions++;
            sceneManager.StartNewRegion (regionInfo);
        }
开发者ID:nhede,项目名称:Aurora-Sim-Optional-Modules,代码行数:54,代码来源:Loader.cs


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