From 7f007d8ed056359d1e391cb73d9ff5c3b6852a26 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 3 Oct 2008 12:00:13 +0000 Subject: Mantis #1360 Thank you, idb, for a patch to implement the packet and plumbing for the material settings. --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 14 +++++++++++++- OpenSim/Region/Environment/Scenes/Scene.cs | 1 + OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 3be1592..d63544a 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -1258,7 +1258,19 @@ namespace OpenSim.Region.Environment.Scenes } } - + protected internal void PrimMaterial(IClientAPI remoteClient, uint primLocalID, string material) + { + SceneObjectGroup group = GetGroupByPrim(primLocalID); + if (group != null) + { + if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId)) + { + SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); + part.Material = Convert.ToByte(material); + group.HasGroupChanged = true; + } + } + } protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) { diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index bbc50e6..8f8c89e 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2158,6 +2158,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnObjectDescription += m_innerScene.PrimDescription; client.OnObjectName += m_innerScene.PrimName; client.OnObjectClickAction += m_innerScene.PrimClickAction; + client.OnObjectMaterial += m_innerScene.PrimMaterial; client.OnLinkObjects += m_innerScene.LinkObjects; client.OnDelinkObjects += m_innerScene.DelinkObjects; client.OnObjectDuplicate += m_innerScene.DuplicateObject; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index c887b78..9458908 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Scenes //unkown if this will be kept, added as a way of removing the group position from the group class protected Vector3 m_groupPosition; protected uint m_localId; - protected Material m_material = 0; + protected Material m_material = (Material)3; // Wood protected string m_name; protected Vector3 m_offsetPosition; @@ -2106,7 +2106,7 @@ namespace OpenSim.Region.Environment.Scenes byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, _ownerID, - m_text, color, _parentID, m_particleSystem, m_clickAction, m_TextureAnimation, IsAttachment, + m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, AttachmentPoint,FromAssetID, Sound, SoundGain, SoundFlags, SoundRadius); } -- cgit v1.1