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


C# RegionInfo.UnpackRegionInfoData方法代码示例

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


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

示例1: GetRegionInfos

 public RegionInfo[] GetRegionInfos(bool nonDisabledOnly)
 {
     List<RegionInfo> Infos = new List<RegionInfo>();
     List<string> RetVal = nonDisabledOnly ?
         GD.Query("Disabled", 0, "simulator", "RegionInfo") :
         GD.Query("", "", "simulator", "RegionInfo");
     if (RetVal.Count == 0)
         return Infos.ToArray();
     RegionInfo replyData = new RegionInfo();
     for (int i = 0; i < RetVal.Count; i++)
     {
         replyData.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeJson(RetVal[i]));
         if (replyData.ExternalHostName == "DEFAULT" || replyData.FindExternalAutomatically)
         {
             replyData.ExternalHostName = Aurora.Framework.Utilities.GetExternalIp();
         }
         else
             replyData.ExternalHostName = Util.ResolveEndPoint(replyData.ExternalHostName, replyData.InternalEndPoint.Port).Address.ToString();
         Infos.Add(replyData);
         replyData = new RegionInfo();
     }
     //Sort by startup number
     Infos.Sort(RegionInfoStartupSorter);
     return Infos.ToArray();
 }
开发者ID:kow,项目名称:Aurora-Sim,代码行数:25,代码来源:LocalRegionInfoConnector.cs

示例2: 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.CmdPrompt("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:rknop,项目名称:Aurora-Sim,代码行数:24,代码来源:EstateInitializer.cs

示例3: GetRegionInfo

 public RegionInfo GetRegionInfo(string regionName)
 {
     List<string> RetVal = GD.Query("RegionName", regionName, "simulator", "RegionInfo");
     RegionInfo replyData = new RegionInfo();
     if (RetVal.Count == 0)
         return null;
     replyData.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeJson(RetVal[0]));
     if (replyData.ExternalHostName == "DEFAULT" || replyData.FindExternalAutomatically)
     {
         replyData.ExternalHostName = Aurora.Framework.Utilities.GetExternalIp();
     }
     else
         replyData.ExternalHostName = Util.ResolveEndPoint(replyData.ExternalHostName, replyData.InternalEndPoint.Port).Address.ToString();
     return replyData;
 }
开发者ID:HGExchange,项目名称:Aurora-Sim,代码行数:15,代码来源:LocalRegionInfoConnector.cs

示例4: UpdateRegionInfo

        public void UpdateRegionInfo(string oldName, RegionInfo regionInfo)
        {
            IRegionInfoConnector connector = Aurora.DataManager.DataManager.RequestPlugin<IRegionInfoConnector>();
            if (connector != null)
            {
                //Make sure we have this region in the database
                if (connector.GetRegionInfo(oldName, false) == 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:NickyPerian,项目名称:Aurora-Sim,代码行数:19,代码来源:RegionLoaderDataBaseSystem.cs

示例5: GetRegionInfo

        public RegionInfo GetRegionInfo (UUID regionID, bool convertDNSNames)
        {
            List<string> RetVal = GD.Query("RegionID", regionID, "simulator", "RegionInfo");
            RegionInfo replyData = new RegionInfo();
            if (RetVal.Count == 0)
                return null;
            replyData.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeJson(RetVal[0]));
            if(convertDNSNames)
            {
                try
                {
                    if(replyData.ExternalHostName == "DEFAULT" || replyData.FindExternalAutomatically)
                        replyData.ExternalHostName = Aurora.Framework.Utilities.GetExternalIp();
                    else
                        replyData.ExternalHostName = NetworkUtils.ResolveEndPoint(replyData.ExternalHostName, replyData.InternalEndPoint.Port).Address.ToString();
                }
                catch
                {
                    if(replyData.ExternalHostName == "DEFAULT" || replyData.FindExternalAutomatically)
                        replyData.ExternalHostName = "127.0.0.1";//Bad fallback, but we need something
                }
            }

            return replyData;
        }
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:25,代码来源:LocalRegionInfoConnector.cs

示例6: GetRegionInfos

 public RegionInfo[] GetRegionInfos(bool nonDisabledOnly)
 {
     List<RegionInfo> Infos = new List<RegionInfo>();
     List<string> RetVal = nonDisabledOnly ?
         GD.Query("Disabled", 0, "simulator", "RegionInfo") :
         GD.Query("", "", "simulator", "RegionInfo");
     if (RetVal.Count == 0)
         return Infos.ToArray();
     RegionInfo replyData = new RegionInfo();
     foreach (string t in RetVal)
     {
         replyData.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeJson(t));
         Infos.Add(replyData);
         replyData = new RegionInfo();
     }
     //Sort by startup number
     Infos.Sort(RegionInfoStartupSorter);
     return Infos.ToArray();
 }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:19,代码来源:LocalRegionInfoConnector.cs

示例7: GetRegionInfo

 public RegionInfo GetRegionInfo (string regionName)
 {
     List<string> RetVal = GD.Query("RegionName", regionName.MySqlEscape(50), "simulator", "RegionInfo");
     RegionInfo replyData = new RegionInfo();
     if (RetVal.Count == 0)
         return null;
     replyData.UnpackRegionInfoData((OSDMap)OSDParser.DeserializeJson(RetVal[0]));
     return replyData;
 }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:9,代码来源:LocalRegionInfoConnector.cs


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