2first dirty version and non persistent parcel uglysky
parent
7a9e03876a
commit
e538628dec
|
@ -173,6 +173,8 @@ namespace OpenSim.Framework
|
|||
void SetParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
|
||||
void SetSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
|
||||
|
||||
void StoreEnviroment(ViewerEnviroment VEnv);
|
||||
|
||||
/// <summary>
|
||||
/// Set the media url for this land parcel
|
||||
/// </summary>
|
||||
|
|
|
@ -732,6 +732,11 @@ namespace OpenSim.Framework
|
|||
}
|
||||
}
|
||||
|
||||
public int EnviromentVersion = -1;
|
||||
|
||||
[XmlIgnore] //this needs to be added by hand
|
||||
public ViewerEnviroment Enviroment { get; set;}
|
||||
|
||||
public LandData()
|
||||
{
|
||||
_globalID = UUID.Random();
|
||||
|
@ -739,6 +744,8 @@ namespace OpenSim.Framework
|
|||
AnyAVSounds = true;
|
||||
GroupAVSounds = true;
|
||||
LastDwellTimeMS = Util.GetTimeStampMS();
|
||||
EnviromentVersion = -1;
|
||||
Enviroment = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -804,6 +811,17 @@ namespace OpenSim.Framework
|
|||
landData._parcelAccessList.Add(newEntry);
|
||||
}
|
||||
|
||||
if (Enviroment == null)
|
||||
{
|
||||
landData.Enviroment = null;
|
||||
landData.EnviromentVersion = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
landData.Enviroment = Enviroment.Clone();
|
||||
landData.EnviromentVersion = EnviromentVersion;
|
||||
}
|
||||
|
||||
return landData;
|
||||
}
|
||||
|
||||
|
|
|
@ -6566,7 +6566,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
bool allowenvovr = (regionFlags & (uint)RegionFlags.AllowEnviromentOverride) != 0;
|
||||
LLSDxmlEncode.AddArrayAndMap("ParcelEnvironmentBlock", sb);
|
||||
LLSDxmlEncode.AddElem("ParcelEnvironmentVersion", allowenvovr ? -1: -1, sb);
|
||||
LLSDxmlEncode.AddElem("ParcelEnvironmentVersion", allowenvovr ? -1: landData.EnviromentVersion, sb);
|
||||
LLSDxmlEncode.AddElem("RegionAllowEnvironmentOverride", allowenvovr, sb);
|
||||
LLSDxmlEncode.AddEndMapAndArray(sb);
|
||||
|
||||
|
|
|
@ -168,8 +168,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
if (Scene.RegionInfo.RegionSettings.Casino)
|
||||
flags |= (RegionFlags)(1 << 10);
|
||||
|
||||
if (Scene.RegionInfo.RegionSettings.FixedSun)
|
||||
flags |= RegionFlags.SunFixed;
|
||||
// if (Scene.RegionInfo.RegionSettings.FixedSun)
|
||||
// flags |= RegionFlags.SunFixed;
|
||||
|
||||
if (Scene.RegionInfo.RegionSettings.Sandbox)
|
||||
flags |= RegionFlags.Sandbox;
|
||||
if (Scene.RegionInfo.EstateSettings.AllowVoice)
|
||||
|
@ -190,7 +191,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
|
||||
// Omitted
|
||||
//
|
||||
// Omitted: NullLayer (what is that?)
|
||||
// Omitted: SkipAgentAction (what does it do?)
|
||||
|
||||
return (uint)flags;
|
||||
|
@ -428,10 +428,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
|
||||
private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
|
||||
{
|
||||
uint sun = 0;
|
||||
//uint sun = 0;
|
||||
|
||||
if (Scene.RegionInfo.EstateSettings.FixedSun)
|
||||
sun = (uint)(Scene.RegionInfo.EstateSettings.SunPosition * 1024.0) + 0x1800;
|
||||
//if (Scene.RegionInfo.EstateSettings.FixedSun)
|
||||
// sun = (uint)(Scene.RegionInfo.EstateSettings.SunPosition * 1024.0) + 0x1800;
|
||||
UUID estateOwner;
|
||||
estateOwner = Scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
|
@ -443,7 +443,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
Scene.RegionInfo.EstateSettings.EstateID,
|
||||
Scene.RegionInfo.EstateSettings.ParentEstateID,
|
||||
GetEstateFlags(),
|
||||
sun,
|
||||
0,
|
||||
Scene.RegionInfo.RegionSettings.Covenant,
|
||||
(uint) Scene.RegionInfo.RegionSettings.CovenantChangedDateTime,
|
||||
Scene.RegionInfo.EstateSettings.AbuseEmail,
|
||||
|
@ -598,9 +598,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
Scene.RegionInfo.RegionSettings.TerrainLowerLimit = TerrainLowerLimit;
|
||||
|
||||
// Time of day / fixed sun
|
||||
Scene.RegionInfo.RegionSettings.UseEstateSun = UseEstateSun;
|
||||
Scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
|
||||
Scene.RegionInfo.RegionSettings.SunPosition = SunHour;
|
||||
//Scene.RegionInfo.RegionSettings.UseEstateSun = UseEstateSun;
|
||||
//Scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
|
||||
//Scene.RegionInfo.RegionSettings.SunPosition = SunHour;
|
||||
|
||||
if (Scene.PhysicsEnabled && Scene.PhysicsScene != null && lastwaterlevel != WaterHeight)
|
||||
Scene.PhysicsScene.SetWaterLevel(WaterHeight);
|
||||
|
@ -1416,10 +1416,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
args.redirectGridY = Scene.RegionInfo.EstateSettings.RedirectGridY;
|
||||
args.regionFlags = GetRegionFlags();
|
||||
args.simAccess = Scene.RegionInfo.AccessLevel;
|
||||
args.sunHour = (float)Scene.RegionInfo.RegionSettings.SunPosition;
|
||||
args.sunHour = 0;
|
||||
args.terrainLowerLimit = (float)Scene.RegionInfo.RegionSettings.TerrainLowerLimit;
|
||||
args.terrainRaiseLimit = (float)Scene.RegionInfo.RegionSettings.TerrainRaiseLimit;
|
||||
args.useEstateSun = Scene.RegionInfo.RegionSettings.UseEstateSun;
|
||||
args.useEstateSun = false;
|
||||
args.waterHeight = (float)Scene.RegionInfo.RegionSettings.WaterHeight;
|
||||
args.simName = Scene.RegionInfo.RegionName;
|
||||
args.regionType = Scene.RegionInfo.RegionType;
|
||||
|
@ -1529,28 +1529,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
|
||||
public void handleEstateChangeInfo(IClientAPI remoteClient, UUID invoice, UUID senderID, UInt32 parms1, UInt32 parms2)
|
||||
{
|
||||
if (parms2 == 0)
|
||||
{
|
||||
Scene.RegionInfo.EstateSettings.UseGlobalTime = true;
|
||||
Scene.RegionInfo.EstateSettings.SunPosition = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Scene.RegionInfo.EstateSettings.UseGlobalTime = false;
|
||||
Scene.RegionInfo.EstateSettings.SunPosition = (parms2 - 0x1800)/1024.0;
|
||||
// Warning: FixedSun should be set to True, otherwise this sun position won't be used.
|
||||
}
|
||||
|
||||
if ((parms1 & 0x00008000) != 0)
|
||||
Scene.RegionInfo.EstateSettings.PublicAccess = true;
|
||||
else
|
||||
Scene.RegionInfo.EstateSettings.PublicAccess = false;
|
||||
|
||||
if ((parms1 & 0x00000010) != 0)
|
||||
Scene.RegionInfo.EstateSettings.FixedSun = true;
|
||||
else
|
||||
Scene.RegionInfo.EstateSettings.FixedSun = false;
|
||||
|
||||
// taxfree is now !AllowAccessOverride (note the negate)
|
||||
if ((parms1 & 0x00000020) != 0)
|
||||
Scene.RegionInfo.EstateSettings.TaxFree = false;
|
||||
|
@ -1597,33 +1580,18 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
TriggerEstateInfoChange();
|
||||
|
||||
Scene.TriggerEstateSunUpdate();
|
||||
|
||||
sendDetailedEstateData(remoteClient, invoice);
|
||||
}
|
||||
|
||||
public bool handleEstateChangeInfoCap(string estateName, UUID invoice,
|
||||
int sunHour, bool sunFixed,
|
||||
bool externallyVisible,
|
||||
bool allowDirectTeleport,
|
||||
bool denyAnonymous, bool denyAgeUnverified,
|
||||
bool alloVoiceChat, bool overridePublicAccess,
|
||||
bool allowEnviromentOverride)
|
||||
{
|
||||
if (sunHour == 0)
|
||||
{
|
||||
Scene.RegionInfo.EstateSettings.UseGlobalTime = true;
|
||||
Scene.RegionInfo.EstateSettings.SunPosition = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Scene.RegionInfo.EstateSettings.UseGlobalTime = false;
|
||||
Scene.RegionInfo.EstateSettings.SunPosition = (sunHour - 0x1800) / 1024.0;
|
||||
// Warning: FixedSun should be set to True, otherwise this sun position won't be used.
|
||||
}
|
||||
|
||||
Scene.RegionInfo.EstateSettings.PublicAccess = externallyVisible;
|
||||
Scene.RegionInfo.EstateSettings.FixedSun = sunFixed;
|
||||
Scene.RegionInfo.EstateSettings.AllowDirectTeleport = allowDirectTeleport;
|
||||
|
||||
Scene.RegionInfo.EstateSettings.DenyAnonymous = denyAnonymous;
|
||||
|
@ -1637,8 +1605,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
TriggerEstateInfoChange();
|
||||
|
||||
Scene.TriggerEstateSunUpdate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1654,8 +1620,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
Scene.RegionInfo.RegionSettings.UseEstateSun,
|
||||
Scene.RegionInfo.RegionSettings.FixedSun,
|
||||
(float)Scene.RegionInfo.RegionSettings.SunPosition,
|
||||
Scene.RegionInfo.EstateSettings.UseGlobalTime,
|
||||
Scene.RegionInfo.EstateSettings.FixedSun,
|
||||
//Scene.RegionInfo.EstateSettings.UseGlobalTime,
|
||||
false,
|
||||
//Scene.RegionInfo.EstateSettings.FixedSun,
|
||||
false,
|
||||
(float)Scene.RegionInfo.EstateSettings.SunPosition);
|
||||
|
||||
// sendRegionInfoPacketToAll(); already done by setRegionTerrainSettings
|
||||
|
@ -1691,7 +1659,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
client.OnLandStatRequest += HandleLandStatRequest;
|
||||
}
|
||||
|
||||
|
||||
public uint GetEstateFlags()
|
||||
{
|
||||
RegionFlags flags = RegionFlags.None;
|
||||
|
@ -1702,13 +1669,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
flags |= RegionFlags.AllowSetHome;
|
||||
if (Scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
|
||||
flags |= RegionFlags.ResetHomeOnTeleport;
|
||||
if (Scene.RegionInfo.EstateSettings.FixedSun)
|
||||
flags |= RegionFlags.SunFixed;
|
||||
//if (Scene.RegionInfo.EstateSettings.FixedSun)
|
||||
// flags |= RegionFlags.SunFixed;
|
||||
if (!Scene.RegionInfo.EstateSettings.TaxFree) // this is now wrong means !ALLOW_ACCESS_OVERRIDE
|
||||
flags |= RegionFlags.AllowParcelAccessOverride;
|
||||
|
||||
if(Scene.RegionInfo.EstateSettings.AllowEnviromentOverride)
|
||||
flags |= RegionFlags.AllowEnviromentOverride;
|
||||
if (Scene.RegionInfo.EstateSettings.PublicAccess) //??
|
||||
flags |= (RegionFlags.PublicAllowed | RegionFlags.ExternallyVisible);
|
||||
|
||||
|
@ -1732,10 +1697,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
|||
if (Scene.RegionInfo.EstateSettings.AllowVoice)
|
||||
flags |= RegionFlags.AllowVoice;
|
||||
|
||||
|
||||
if (Scene.RegionInfo.EstateSettings.DenyMinors)
|
||||
flags |= RegionFlags.DenyAgeUnverified;
|
||||
|
||||
if (Scene.RegionInfo.EstateSettings.AllowEnviromentOverride)
|
||||
flags |= RegionFlags.AllowEnviromentOverride;
|
||||
|
||||
return (uint)flags;
|
||||
}
|
||||
|
||||
|
|
|
@ -1981,5 +1981,19 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
if (delete.Count > 0)
|
||||
m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this);
|
||||
}
|
||||
|
||||
public void StoreEnviroment(ViewerEnviroment VEnv)
|
||||
{
|
||||
LandData.Enviroment = VEnv;
|
||||
if (VEnv == null)
|
||||
LandData.EnviromentVersion = -1;
|
||||
else
|
||||
{
|
||||
++LandData.EnviromentVersion;
|
||||
VEnv.version = LandData.EnviromentVersion;
|
||||
}
|
||||
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, LandData);
|
||||
SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
private IEstateModule m_estateModule;
|
||||
private IEventQueue m_eventQueue;
|
||||
private IAssetService m_assetService;
|
||||
private ILandChannel m_landChannel;
|
||||
|
||||
private static ViewerEnviroment m_DefaultEnv = null;
|
||||
private static readonly string m_defaultDayAssetID = "5646d39e-d3d7-6aff-ed71-30fc87d64a91";
|
||||
|
@ -140,6 +141,13 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
return;
|
||||
}
|
||||
|
||||
m_landChannel = m_scene.LandChannel;
|
||||
if (m_landChannel == null)
|
||||
{
|
||||
Enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_DefaultEnv == null)
|
||||
{
|
||||
AssetBase defEnv = m_assetService.Get(m_defaultDayAssetID);
|
||||
|
@ -193,6 +201,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
UpdateEnvTime();
|
||||
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||
scene.EventManager.OnFrame += UpdateEnvTime;
|
||||
scene.EventManager.OnAvatarEnteringNewParcel += OnAvatarEnteringNewParcel;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
|
@ -243,7 +252,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
WindlightRefresh(0);
|
||||
}
|
||||
|
||||
public void WindlightRefresh(int interpolate)
|
||||
public void WindlightRefresh(int interpolate, bool notforparcel = true)
|
||||
{
|
||||
List<byte[]> ls = null;
|
||||
m_scene.ForEachClient(delegate (IClientAPI client)
|
||||
|
@ -253,7 +262,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
|
||||
uint vflags = client.GetViewerCaps();
|
||||
|
||||
if ((vflags & 0x8000) != 0)
|
||||
if (notforparcel && (vflags & 0x8000) != 0 )
|
||||
m_estateModule.HandleRegionInfoRequest(client);
|
||||
|
||||
else if ((vflags & 0x4000) != 0)
|
||||
|
@ -343,7 +352,6 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private void processExtEnv(IOSHttpRequest request, IOSHttpResponse response, UUID agentID, Caps caps)
|
||||
{
|
||||
switch(request.HttpMethod)
|
||||
|
@ -379,9 +387,19 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
}
|
||||
|
||||
if(parcel == -1)
|
||||
{
|
||||
StoreOnRegion(null);
|
||||
|
||||
WindlightRefresh(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(parcel);
|
||||
if (land != null && land.LandData != null)
|
||||
{
|
||||
land.StoreEnviroment(null);
|
||||
WindlightRefresh(0, false);
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
|
@ -395,19 +413,26 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
|
||||
private void GetExtEnvironmentSettings(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, UUID agentID)
|
||||
{
|
||||
int parcel = -1;
|
||||
if (httpRequest.Query.Count > 0)
|
||||
{
|
||||
int parcel = -1;
|
||||
if (httpRequest.Query.ContainsKey("parcelid"))
|
||||
{
|
||||
Int32.TryParse((string)httpRequest.Query["parcelid"], out parcel);
|
||||
}
|
||||
OSD oenv = ViewerEnviroment.DefaultToOSD(regionID, parcel);
|
||||
httpResponse.RawBuffer = Util.UTF8NBGetbytes(OSDParser.SerializeLLSDXmlString(oenv));
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
ViewerEnviroment VEnv = GetRegionEnviroment();
|
||||
ViewerEnviroment VEnv;
|
||||
if (parcel == -1)
|
||||
VEnv = GetRegionEnviroment();
|
||||
else
|
||||
{
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(parcel);
|
||||
if (land != null && land.LandData != null && land.LandData.Enviroment != null)
|
||||
VEnv = land.LandData.Enviroment;
|
||||
else
|
||||
VEnv = GetRegionEnviroment();
|
||||
}
|
||||
|
||||
OSDMap map = new OSDMap();
|
||||
map["environment"] = VEnv.ToOSD();
|
||||
|
@ -439,50 +464,79 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
if (sp == null || sp.IsChildAgent || sp.IsNPC)
|
||||
{
|
||||
message = "Could not locate your avatar";
|
||||
goto Error;
|
||||
}
|
||||
|
||||
if (httpRequest.Query.Count > 0)
|
||||
{
|
||||
if (httpRequest.Query.ContainsKey("parcelid"))
|
||||
{
|
||||
Int32.TryParse((string)httpRequest.Query["parcelid"], out parcel);
|
||||
if (!Int32.TryParse((string)httpRequest.Query["parcelid"], out parcel))
|
||||
{
|
||||
message = "Failed to decode request";
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
if (httpRequest.Query.ContainsKey("trackno"))
|
||||
{
|
||||
Int32.TryParse((string)httpRequest.Query["trackno"], out track);
|
||||
}
|
||||
|
||||
message = "Parcel Enviroment not supported";
|
||||
goto skiped;
|
||||
if (!Int32.TryParse((string)httpRequest.Query["trackno"], out track))
|
||||
{
|
||||
message = "Failed to decode request";
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
if (track != -1)
|
||||
{
|
||||
message = "Enviroment Track not suported";
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
|
||||
ViewerEnviroment VEnv = m_scene.RegionEnviroment;
|
||||
ILandObject lchannel;
|
||||
if (parcel == -1)
|
||||
{
|
||||
if (!m_scene.Permissions.CanIssueEstateCommand(agentID, false))
|
||||
{
|
||||
message = "Insufficient estate permissions, settings has not been saved.";
|
||||
goto skiped;
|
||||
goto Error;
|
||||
}
|
||||
VEnv = m_scene.RegionEnviroment;
|
||||
lchannel = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
lchannel = m_landChannel.GetLandObject(parcel);
|
||||
if(lchannel == null || lchannel.LandData == null)
|
||||
{
|
||||
message = "Could not locate requested parcel";
|
||||
goto Error;
|
||||
}
|
||||
|
||||
if(track == -1)
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(agentID, lchannel, 0, true)) // wrong
|
||||
{
|
||||
message = "No permission to change parcel enviroment";
|
||||
goto Error;
|
||||
}
|
||||
VEnv = lchannel.LandData.Enviroment;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
OSD req = OSDParser.Deserialize(httpRequest.InputStream);
|
||||
if(req is OpenMetaverse.StructuredData.OSDMap)
|
||||
{
|
||||
OpenMetaverse.StructuredData.OSDMap map = req as OpenMetaverse.StructuredData.OSDMap;
|
||||
OSDMap map = req as OpenMetaverse.StructuredData.OSDMap;
|
||||
if(map.TryGetValue("environment", out OSD env))
|
||||
{
|
||||
ViewerEnviroment VEnv = m_scene.RegionEnviroment;
|
||||
if (VEnv == null)
|
||||
{
|
||||
// need a proper clone
|
||||
VEnv = new ViewerEnviroment();
|
||||
OSD otmp = m_DefaultEnv.ToOSD();
|
||||
string tmpstr = OSDParser.SerializeLLSDXmlString(otmp);
|
||||
otmp = OSDParser.DeserializeLLSDXml(tmpstr);
|
||||
VEnv.FromOSD(otmp);
|
||||
}
|
||||
VEnv = m_DefaultEnv.Clone();
|
||||
|
||||
OSDMap evmap = (OSDMap)env;
|
||||
if(evmap.TryGetValue("day_asset", out OSD tmp) && !evmap.ContainsKey("day_cycle"))
|
||||
{
|
||||
|
@ -505,26 +559,34 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
}
|
||||
}
|
||||
VEnv.FromOSD(env);
|
||||
if(lchannel == null)
|
||||
{
|
||||
StoreOnRegion(VEnv);
|
||||
m_log.InfoFormat("[{0}]: ExtEnviroment region {1} settings from agentID {2} saved",
|
||||
Name, caps.RegionName, agentID);
|
||||
}
|
||||
else
|
||||
{
|
||||
lchannel.StoreEnviroment(VEnv);
|
||||
m_log.InfoFormat("[{0}]: ExtEnviroment parcel {1} of region {2} settings from agentID {3} saved",
|
||||
Name, parcel, caps.RegionName, agentID);
|
||||
}
|
||||
|
||||
WindlightRefresh(0);
|
||||
|
||||
WindlightRefresh(0, lchannel == null);
|
||||
success = true;
|
||||
m_log.InfoFormat("[{0}]: ExtEnviromet settings saved from agentID {1} in region {2}",
|
||||
Name, agentID, caps.RegionName);
|
||||
}
|
||||
}
|
||||
else if (req is OSDArray)
|
||||
{
|
||||
ViewerEnviroment VEnv = new ViewerEnviroment();
|
||||
VEnv = new ViewerEnviroment();
|
||||
VEnv.FromWLOSD(req);
|
||||
StoreOnRegion(VEnv);
|
||||
success = true;
|
||||
|
||||
WindlightRefresh(0);
|
||||
|
||||
m_log.InfoFormat("[{0}]: New Environment settings has been saved from agentID {1} in region {2}",
|
||||
Name, agentID, caps.RegionName);
|
||||
m_log.InfoFormat("[{0}]: ExtEnviroment region {1} settings from agentID {2} saved",
|
||||
Name, caps.RegionName, agentID);
|
||||
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb);
|
||||
|
@ -544,9 +606,8 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
success = false;
|
||||
message = String.Format("ExtEnvironment Set for region {0} has failed, settings not saved.", caps.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
skiped:
|
||||
Error:
|
||||
string response;
|
||||
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
|
@ -565,7 +626,19 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
// m_log.DebugFormat("[{0}]: Environment GET handle for agentID {1} in region {2}",
|
||||
// Name, agentID, caps.RegionName);
|
||||
|
||||
ViewerEnviroment VEnv = GetRegionEnviroment();
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
if (sp == null || sp.IsChildAgent || sp.IsNPC)
|
||||
{
|
||||
response.StatusCode = (int)HttpStatusCode.NotFound;
|
||||
return;
|
||||
}
|
||||
|
||||
ViewerEnviroment VEnv;
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(sp.AbsolutePosition.X, sp.AbsolutePosition.Y);
|
||||
if (land != null && land.LandData != null && land.LandData.Enviroment != null)
|
||||
VEnv = land.LandData.Enviroment;
|
||||
else
|
||||
VEnv = GetRegionEnviroment();
|
||||
|
||||
OSD d = VEnv.ToWLOSD(UUID.Zero, regionID);
|
||||
string env = OSDParser.SerializeLLSDXmlString(d);
|
||||
|
@ -586,7 +659,6 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
|
||||
private void SetEnvironmentSettings(IOSHttpRequest request, IOSHttpResponse response, UUID agentID)
|
||||
{
|
||||
// m_log.DebugFormat("[{0}]: Environment SET handle from agentID {1} in region {2}",
|
||||
|
@ -598,9 +670,22 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
if (!m_scene.Permissions.CanIssueEstateCommand(agentID, false))
|
||||
{
|
||||
fail_reason = "Insufficient estate permissions, settings has not been saved.";
|
||||
goto Error;
|
||||
}
|
||||
else
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
if (sp == null || sp.IsChildAgent || sp.IsNPC)
|
||||
{
|
||||
response.StatusCode = (int)HttpStatusCode.NotFound;
|
||||
return;
|
||||
}
|
||||
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(sp.AbsolutePosition.X, sp.AbsolutePosition.Y);
|
||||
if (land != null && land.LandData != null && land.LandData.Enviroment != null)
|
||||
{
|
||||
fail_reason = "The parcel where you are has own enviroment set. You need a updated viewer to change enviroment";
|
||||
goto Error;
|
||||
}
|
||||
try
|
||||
{
|
||||
ViewerEnviroment VEnv = new ViewerEnviroment();
|
||||
|
@ -622,8 +707,8 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
success = false;
|
||||
fail_reason = String.Format("Environment Set for region {0} has failed, settings not saved.", m_scene.Name);
|
||||
}
|
||||
}
|
||||
|
||||
Error:
|
||||
StringBuilder sb = LLSDxmlEncode.Start();
|
||||
LLSDxmlEncode.AddMap(sb);
|
||||
LLSDxmlEncode.AddElem("messageID", UUID.Zero, sb);
|
||||
|
@ -738,6 +823,16 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
client.SendGenericMessage("Windlight", UUID.Random(), param);
|
||||
}
|
||||
|
||||
private void OnAvatarEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID)
|
||||
{
|
||||
IClientAPI client = sp.ControllingClient;
|
||||
uint vflags = client.GetViewerCaps();
|
||||
if((vflags & 0x8000) != 0)
|
||||
return;
|
||||
if(m_scene.RegionInfo.EstateSettings.AllowEnviromentOverride)
|
||||
m_eventQueue.WindlightRefreshEvent(1, client.AgentId);
|
||||
}
|
||||
|
||||
private void UpdateEnvTime()
|
||||
{
|
||||
double now = Util.GetTimeStamp();
|
||||
|
@ -770,6 +865,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
|||
wldayFrac = Utils.Clamp(wldayFrac, 0, 2f);
|
||||
wldayFrac *= Utils.PI;
|
||||
|
||||
|
||||
float eepDayFrac = dayFrac * Utils.TWO_PI;
|
||||
|
||||
m_scene.ForEachRootScenePresence(delegate (ScenePresence sp)
|
||||
|
|
|
@ -178,7 +178,6 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
|||
dispList.AddRow("Restrict pushing", rs.RestrictPushing);
|
||||
dispList.AddRow("Fixed sun", rs.FixedSun);
|
||||
dispList.AddRow("Sun position", rs.SunPosition);
|
||||
dispList.AddRow("Sun vector", rs.SunVector);
|
||||
dispList.AddRow("Use estate sun", rs.UseEstateSun);
|
||||
dispList.AddRow("Telehub UUID", rs.TelehubObject);
|
||||
dispList.AddRow("Terrain lower limit", string.Format("{0} m", rs.TerrainLowerLimit));
|
||||
|
|
Loading…
Reference in New Issue