mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
avoid sending pbr lludp messages to older viewers
This commit is contained in:
@@ -35,7 +35,6 @@ using System.Net;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
@@ -82,8 +81,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
public partial class BunchOfCaps
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Scene m_Scene;
|
||||
private UUID m_AgentID;
|
||||
@@ -421,7 +419,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> validCaps = new List<string>();
|
||||
HashSet<string> validCaps = new();
|
||||
|
||||
foreach (OSD c in capsRequested)
|
||||
{
|
||||
@@ -432,10 +430,12 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
m_HostCapsObj.Flags |= Caps.CapsFlags.WLEnv;
|
||||
else if (cstr.Equals("ExtEnvironment"))
|
||||
m_HostCapsObj.Flags |= Caps.CapsFlags.AdvEnv;
|
||||
else if(cstr.Equals("ModifyMaterialParams"))
|
||||
m_HostCapsObj.Flags |= Caps.CapsFlags.PBR;
|
||||
validCaps.Add(cstr);
|
||||
}
|
||||
|
||||
string result = LLSDHelpers.SerialiseLLSDReply(m_HostCapsObj.GetCapsDetails(true, validCaps));
|
||||
string result = LLSDHelpers.SerialiseLLSDReply(m_HostCapsObj.GetCapsDetails2(true, validCaps));
|
||||
httpResponse.RawBuffer = Util.UTF8NBGetbytes(result);
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||
//m_log.DebugFormat("[CAPS] CapsRequest {0}", result);
|
||||
|
||||
@@ -334,8 +334,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
obj.InvalidateDeepEffectivePerms();
|
||||
|
||||
m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
|
||||
|
||||
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||
httpResponse.RawBuffer = Util.UTF8NBGetbytes(String.Format("<llsd><map><key>local_id</key>{0}</map></llsd>", ConvertUintToBytes(obj.LocalId)));
|
||||
}
|
||||
@@ -348,7 +346,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
return Utils.BytesToUInt(tmp);
|
||||
|
||||
}
|
||||
private string ConvertUintToBytes(uint val)
|
||||
private static string ConvertUintToBytes(uint val)
|
||||
{
|
||||
byte[] resultbytes = Utils.UIntToBytes(val);
|
||||
if (BitConverter.IsLittleEndian)
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Runtime;
|
||||
@@ -348,6 +346,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
private const uint MaxTransferBytesPerPacket = 600;
|
||||
|
||||
private bool m_SupportObjectAnimations;
|
||||
private bool m_SupportPBR;
|
||||
|
||||
/// <value>
|
||||
/// Maintain a record of all the objects killed. This allows us to stop an update being sent from the
|
||||
@@ -4969,7 +4968,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
useCompressUpdate = grp.IsViewerCachable;
|
||||
|
||||
istree = (part.Shape.PCode == (byte)PCode.Grass || part.Shape.PCode == (byte)PCode.NewTree || part.Shape.PCode == (byte)PCode.Tree);
|
||||
if((updateFlags & PrimUpdateFlags.MaterialOvr) != 0)
|
||||
if((m_SupportPBR && (updateFlags & PrimUpdateFlags.MaterialOvr) != 0))
|
||||
hasMaterialOverride = !istree && part.Shape.RenderMaterials is not null;
|
||||
}
|
||||
else if (update.Entity is ScenePresence presence)
|
||||
@@ -5490,8 +5489,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
|
||||
if (needMaterials is not null && eq is not null)
|
||||
if (needMaterials is not null)
|
||||
{
|
||||
foreach (SceneObjectPart sop in needMaterials)
|
||||
{
|
||||
@@ -13993,6 +13991,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
ret |= 0x4000;
|
||||
if ((cap.Flags & Caps.CapsFlags.AdvEnv) != 0)
|
||||
ret |= 0x8000;
|
||||
if ((cap.Flags & Caps.CapsFlags.PBR) != 0)
|
||||
m_SupportPBR = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user