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