本文整理汇总了C#中Aurora.Framework.RegionInfo.PackRegionInfoData方法的典型用法代码示例。如果您正苦于以下问题:C# RegionInfo.PackRegionInfoData方法的具体用法?C# RegionInfo.PackRegionInfoData怎么用?C# RegionInfo.PackRegionInfoData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aurora.Framework.RegionInfo
的用法示例。
在下文中一共展示了RegionInfo.PackRegionInfoData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: 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());
}
示例3: 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);
}
}