本文整理汇总了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();
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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();
}
示例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;
}