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
0
 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());
 }
        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);
            }
        }