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


C# RegionInfo.SaveRegionToFile方法代码示例

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


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

示例1: XmlRpcCreateRegionMethod


//.........这里部分代码省略.........
                    catch (Exception)
                    {
                        // No INI setting recorded.
                    }

                    string regionIniPath;

                    if (requestData.Contains("region_file"))
                    {
                        // Make sure that the file to be created is in a subdirectory of the region storage directory.
                        string requestedFilePath = Path.Combine(regionConfigPath, (string)requestData["region_file"]);
                        string requestedDirectory = Path.GetDirectoryName(Util.BasePathCombine(requestedFilePath));
                        if (requestedDirectory != null && requestedDirectory.StartsWith(Util.BasePathCombine(regionConfigPath)))
                            regionIniPath = requestedFilePath;
                        else
                            throw new Exception("Invalid location for region file.");
                    }
                    else
                    {
                        regionIniPath = Path.Combine(regionConfigPath,
                                                        String.Format(
                                                            m_config.GetString("region_file_template",
                                                                               "{0}x{1}-{2}.ini"),
                                                            (region.RegionLocX / Constants.RegionSize).ToString(),
                                                            (region.RegionLocY / Constants.RegionSize).ToString(),
                                                            regionID.ToString(),
                                                            region.InternalEndPoint.Port.ToString(),
                                                            region.RegionName.Replace(" ", "_").Replace(":", "_").
                                                                Replace("/", "_")));
                    }

                    MainConsole.Instance.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
                                      region.RegionID, regionIniPath);
                    region.SaveRegionToFile("dynamic region", regionIniPath);

                    // Set the estate

                    // Check for an existing estate
                    Aurora.Framework.IEstateConnector estateService = Aurora.DataManager.DataManager.RequestPlugin<Aurora.Framework.IEstateConnector>();
                    if (estateService == null)
                        throw new Exception("No estate service available.");
                    UUID userID = UUID.Zero;
                    if (requestData.ContainsKey("estate_owner_uuid"))
                    {
                        // ok, client wants us to use an explicit UUID
                        // regardless of what the avatar name provided
                        userID = new UUID((string)requestData["estate_owner_uuid"]);
                    }
                    else if (requestData.ContainsKey("estate_owner_first") & requestData.ContainsKey("estate_owner_last"))
                    {
                        // We need to look up the UUID for the avatar with the provided name.
                        string ownerFirst = (string)requestData["estate_owner_first"];
                        string ownerLast = (string)requestData["estate_owner_last"];

                        IScene currentOrFirst = manager.CurrentOrFirstScene;
                        IUserAccountService accountService = currentOrFirst.UserAccountService;
                        UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID,
                                                                           ownerFirst, ownerLast);
                        userID = user.PrincipalID;
                    }
                    else
                    {
                        throw new Exception("Estate owner details not provided.");
                    }
                    int estateID = estateService.GetEstate(userID, (string)requestData["estate_name"]);
                    if (estateID != 0)
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:67,代码来源:RemoteAdminPlugin.cs


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