clear parcels uglysky on clearing override flag

master
UbitUmarov 2020-06-17 21:08:52 +01:00
parent e7807d4359
commit 369a2e1453
8 changed files with 38 additions and 14 deletions

View File

@ -99,5 +99,6 @@ namespace OpenSim.Region.Framework.Interfaces
void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id);
void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id);
void sendClientInitialLandInfo(IClientAPI remoteClient, bool overlay);
void ClearAllEnviroments();
}
}

View File

@ -1095,8 +1095,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
currentRegionSettings.CacheID = UUID.Random();
currentRegionSettings.Save();
scene.TriggerEstateSunUpdate();
IEstateModule estateModule = scene.RequestModuleInterface<IEstateModule>();
if (estateModule != null)
estateModule.sendRegionHandshakeToAll();

View File

@ -119,10 +119,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
public void RegionLoaded(Scene scene)
{
// Sets up the sun module based no the saved Estate and Region Settings
// DO NOT REMOVE or the sun will stop working
scene.TriggerEstateSunUpdate();
UserManager = scene.RequestModuleInterface<IUserManagement>();
scene.RegionInfo.EstateSettings.DoDenyMinors = !m_ignoreEstateMinorAccessControl;
@ -605,8 +601,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (Scene.PhysicsEnabled && Scene.PhysicsScene != null && lastwaterlevel != WaterHeight)
Scene.PhysicsScene.SetWaterLevel(WaterHeight);
Scene.TriggerEstateSunUpdate();
//m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
//m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString());
@ -1529,6 +1523,8 @@ namespace OpenSim.Region.CoreModules.World.Estate
public void handleEstateChangeInfo(IClientAPI remoteClient, UUID invoice, UUID senderID, UInt32 parms1, UInt32 parms2)
{
bool lastallowEnvOvr = Scene.RegionInfo.EstateSettings.AllowEnviromentOverride;
if ((parms1 & 0x00008000) != 0)
Scene.RegionInfo.EstateSettings.PublicAccess = true;
else
@ -1578,6 +1574,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
Scene.RegionInfo.EstateSettings.DenyMinors = false;
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
if (lastallowEnvOvr && Scene.LandChannel != null && !Scene.RegionInfo.EstateSettings.AllowEnviromentOverride)
{
Scene.ClearAllParcelEnviroments();
}
TriggerEstateInfoChange();
sendDetailedEstateData(remoteClient, invoice);
@ -1590,6 +1592,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
bool alloVoiceChat, bool overridePublicAccess,
bool allowEnviromentOverride)
{
bool lastallowEnvOvr = Scene.RegionInfo.EstateSettings.AllowEnviromentOverride;
Scene.RegionInfo.EstateSettings.PublicAccess = externallyVisible;
Scene.RegionInfo.EstateSettings.AllowDirectTeleport = allowDirectTeleport;
@ -1603,6 +1606,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
Scene.RegionInfo.EstateSettings.AllowEnviromentOverride = allowEnviromentOverride;
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
if(lastallowEnvOvr && !allowEnviromentOverride)
Scene.ClearAllParcelEnviroments();
TriggerEstateInfoChange();
return true;

View File

@ -254,6 +254,13 @@ namespace OpenSim.Region.CoreModules.World.Land
m_landManagementModule.sendClientInitialLandInfo(remoteClient, overlay);
}
}
public void ClearAllEnviroments()
{
List<ILandObject> parcels = AllParcels();
for(int i=0; i< parcels.Count; ++i)
parcels[i].StoreEnviroment(null);
}
#endregion
}
}

View File

@ -1984,6 +1984,7 @@ namespace OpenSim.Region.CoreModules.World.Land
public void StoreEnviroment(ViewerEnviroment VEnv)
{
int lastVersion = LandData.EnviromentVersion;
LandData.Enviroment = VEnv;
if (VEnv == null)
LandData.EnviromentVersion = -1;
@ -1992,8 +1993,11 @@ namespace OpenSim.Region.CoreModules.World.Land
++LandData.EnviromentVersion;
VEnv.version = LandData.EnviromentVersion;
}
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, LandData);
SendLandUpdateToAvatarsOverMe();
if(lastVersion != LandData.EnviromentVersion)
{
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, LandData);
SendLandUpdateToAvatarsOverMe();
}
}
}
}

View File

@ -36,6 +36,7 @@ namespace OpenSim.Region.Framework.Interfaces
void FromLightShare(RegionLightShareData wl);
RegionLightShareData ToLightShare();
byte[] GetDefaultAssetData(int type);
void WindlightRefresh(int interpolate, bool notforparcel = true);
float GetRegionDayFractionTime();
int GetRegionDayLength();

View File

@ -5884,16 +5884,22 @@ Environment.Exit(1);
IEstateDataService estateDataService = EstateDataService;
if (estateDataService != null)
{
bool parcelEnvOvr = RegionInfo.EstateSettings.AllowEnviromentOverride;
RegionInfo.EstateSettings = estateDataService.LoadEstateSettings(RegionInfo.RegionID, false);
TriggerEstateSunUpdate();
if(parcelEnvOvr && !RegionInfo.EstateSettings.AllowEnviromentOverride)
ClearAllParcelEnviroments();
}
}
public void TriggerEstateSunUpdate()
public void ClearAllParcelEnviroments()
{
EventManager.TriggerEstateToolsSunUpdate(RegionInfo.RegionHandle);
IEnvironmentModule envM = RequestModuleInterface<IEnvironmentModule>();
if(LandChannel != null && envM != null)
{
LandChannel.ClearAllEnviroments();
envM.WindlightRefresh(1,false);
}
}
private void HandleReloadEstate(string module, string[] cmd)
{
if (MainConsole.Instance.ConsoleScene == null ||

View File

@ -120,5 +120,6 @@ namespace OpenSim.Tests.Common
public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {}
public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) {}
public void sendClientInitialLandInfo(IClientAPI remoteClient, bool overlay) { }
public void ClearAllEnviroments(){ }
}
}