diff options
author | Melanie Thielker | 2008-10-03 12:00:13 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-10-03 12:00:13 +0000 |
commit | 7f007d8ed056359d1e391cb73d9ff5c3b6852a26 (patch) | |
tree | 3241b8ea7d97fb9b1ca094217172d7f38cb75b2d /OpenSim/Region | |
parent | * EventQueueGet is now working. (diff) | |
download | opensim-SC-7f007d8ed056359d1e391cb73d9ff5c3b6852a26.zip opensim-SC-7f007d8ed056359d1e391cb73d9ff5c3b6852a26.tar.gz opensim-SC-7f007d8ed056359d1e391cb73d9ff5c3b6852a26.tar.bz2 opensim-SC-7f007d8ed056359d1e391cb73d9ff5c3b6852a26.tar.xz |
Mantis #1360
Thank you, idb, for a patch to implement the packet and plumbing for
the material settings.
Diffstat (limited to '')
6 files changed, 43 insertions, 10 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index aae41fe..1c7bbec 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -172,6 +172,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
172 | private GenericCall7 handlerObjectDescription = null; | 172 | private GenericCall7 handlerObjectDescription = null; |
173 | private GenericCall7 handlerObjectName = null; | 173 | private GenericCall7 handlerObjectName = null; |
174 | private GenericCall7 handlerObjectClickAction = null; | 174 | private GenericCall7 handlerObjectClickAction = null; |
175 | private GenericCall7 handlerObjectMaterial = null; | ||
175 | private ObjectPermissions handlerObjectPermissions = null; | 176 | private ObjectPermissions handlerObjectPermissions = null; |
176 | private RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = null; //OnRequestObjectPropertiesFamily; | 177 | private RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = null; //OnRequestObjectPropertiesFamily; |
177 | private TextureRequest handlerTextureRequest = null; | 178 | private TextureRequest handlerTextureRequest = null; |
@@ -870,6 +871,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
870 | public event GenericCall7 OnObjectDescription; | 871 | public event GenericCall7 OnObjectDescription; |
871 | public event GenericCall7 OnObjectName; | 872 | public event GenericCall7 OnObjectName; |
872 | public event GenericCall7 OnObjectClickAction; | 873 | public event GenericCall7 OnObjectClickAction; |
874 | public event GenericCall7 OnObjectMaterial; | ||
873 | public event ObjectIncludeInSearch OnObjectIncludeInSearch; | 875 | public event ObjectIncludeInSearch OnObjectIncludeInSearch; |
874 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; | 876 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; |
875 | public event UpdatePrimFlags OnUpdatePrimFlags; | 877 | public event UpdatePrimFlags OnUpdatePrimFlags; |
@@ -2395,14 +2397,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2395 | ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, | 2397 | ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, |
2396 | Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, | 2398 | Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, |
2397 | uint flags, UUID objectID, UUID ownerID, string text, byte[] color, | 2399 | uint flags, UUID objectID, UUID ownerID, string text, byte[] color, |
2398 | uint parentID, byte[] particleSystem, byte clickAction) | 2400 | uint parentID, byte[] particleSystem, byte clickAction, byte material) |
2399 | { | 2401 | { |
2400 | byte[] textureanim = new byte[0]; | 2402 | byte[] textureanim = new byte[0]; |
2401 | 2403 | ||
2402 | SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel, | 2404 | SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel, |
2403 | acc, rotation, rvel, flags, | 2405 | acc, rotation, rvel, flags, |
2404 | objectID, ownerID, text, color, parentID, particleSystem, | 2406 | objectID, ownerID, text, color, parentID, particleSystem, |
2405 | clickAction, textureanim, false, (uint)0, UUID.Zero, UUID.Zero, 0, 0, 0); | 2407 | clickAction, material, textureanim, false, (uint)0, UUID.Zero, UUID.Zero, 0, 0, 0); |
2406 | } | 2408 | } |
2407 | 2409 | ||
2408 | public void SendPrimitiveToClient( | 2410 | public void SendPrimitiveToClient( |
@@ -2410,7 +2412,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2410 | Vector3 pos, Vector3 velocity, Vector3 acceleration, Quaternion rotation, Vector3 rotational_velocity, | 2412 | Vector3 pos, Vector3 velocity, Vector3 acceleration, Quaternion rotation, Vector3 rotational_velocity, |
2411 | uint flags, | 2413 | uint flags, |
2412 | UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, | 2414 | UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, |
2413 | byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, UUID AssetId, UUID SoundId, double SoundGain, byte SoundFlags, double SoundRadius) | 2415 | byte clickAction, byte material, byte[] textureanim, bool attachment, uint AttachPoint, UUID AssetId, UUID SoundId, double SoundGain, byte SoundFlags, double SoundRadius) |
2414 | { | 2416 | { |
2415 | 2417 | ||
2416 | if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) | 2418 | if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) |
@@ -2447,6 +2449,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2447 | outPacket.ObjectData[0].ParentID = parentID; | 2449 | outPacket.ObjectData[0].ParentID = parentID; |
2448 | outPacket.ObjectData[0].PSBlock = particleSystem; | 2450 | outPacket.ObjectData[0].PSBlock = particleSystem; |
2449 | outPacket.ObjectData[0].ClickAction = clickAction; | 2451 | outPacket.ObjectData[0].ClickAction = clickAction; |
2452 | outPacket.ObjectData[0].Material = material; | ||
2450 | outPacket.ObjectData[0].Flags = 0; | 2453 | outPacket.ObjectData[0].Flags = 0; |
2451 | 2454 | ||
2452 | if (attachment) | 2455 | if (attachment) |
@@ -4865,6 +4868,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4865 | } | 4868 | } |
4866 | break; | 4869 | break; |
4867 | 4870 | ||
4871 | case PacketType.ObjectMaterial: | ||
4872 | ObjectMaterialPacket ompacket = (ObjectMaterialPacket)Pack; | ||
4873 | |||
4874 | handlerObjectMaterial = OnObjectMaterial; | ||
4875 | if (handlerObjectMaterial != null) | ||
4876 | { | ||
4877 | foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData) | ||
4878 | { | ||
4879 | byte material = odata.Material; | ||
4880 | uint localID = odata.ObjectLocalID; | ||
4881 | handlerObjectMaterial(this, localID, material.ToString()); | ||
4882 | } | ||
4883 | } | ||
4884 | break; | ||
4885 | |||
4868 | #endregion | 4886 | #endregion |
4869 | 4887 | ||
4870 | #region Inventory/Asset/Other related packets | 4888 | #region Inventory/Asset/Other related packets |
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 9300b92..78aee92 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -212,6 +212,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
212 | public event GenericCall7 OnObjectDescription; | 212 | public event GenericCall7 OnObjectDescription; |
213 | public event GenericCall7 OnObjectName; | 213 | public event GenericCall7 OnObjectName; |
214 | public event GenericCall7 OnObjectClickAction; | 214 | public event GenericCall7 OnObjectClickAction; |
215 | public event GenericCall7 OnObjectMaterial; | ||
215 | public event UpdatePrimFlags OnUpdatePrimFlags; | 216 | public event UpdatePrimFlags OnUpdatePrimFlags; |
216 | public event UpdatePrimTexture OnUpdatePrimTexture; | 217 | public event UpdatePrimTexture OnUpdatePrimTexture; |
217 | public event UpdateVector OnUpdatePrimGroupPosition; | 218 | public event UpdateVector OnUpdatePrimGroupPosition; |
@@ -559,7 +560,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
559 | Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, | 560 | Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, |
560 | UUID objectID, UUID ownerID, string text, byte[] color, | 561 | UUID objectID, UUID ownerID, string text, byte[] color, |
561 | uint parentID, | 562 | uint parentID, |
562 | byte[] particleSystem, byte clickAction) | 563 | byte[] particleSystem, byte clickAction, byte material) |
563 | { | 564 | { |
564 | } | 565 | } |
565 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, | 566 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, |
@@ -567,7 +568,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
567 | Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, | 568 | Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, |
568 | UUID objectID, UUID ownerID, string text, byte[] color, | 569 | UUID objectID, UUID ownerID, string text, byte[] color, |
569 | uint parentID, | 570 | uint parentID, |
570 | byte[] particleSystem, byte clickAction, byte[] textureanimation, | 571 | byte[] particleSystem, byte clickAction, byte material, byte[] textureanimation, |
571 | bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) | 572 | bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) |
572 | { | 573 | { |
573 | } | 574 | } |
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 | |||
1258 | } | 1258 | } |
1259 | } | 1259 | } |
1260 | 1260 | ||
1261 | 1261 | protected internal void PrimMaterial(IClientAPI remoteClient, uint primLocalID, string material) | |
1262 | { | ||
1263 | SceneObjectGroup group = GetGroupByPrim(primLocalID); | ||
1264 | if (group != null) | ||
1265 | { | ||
1266 | if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId)) | ||
1267 | { | ||
1268 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); | ||
1269 | part.Material = Convert.ToByte(material); | ||
1270 | group.HasGroupChanged = true; | ||
1271 | } | ||
1272 | } | ||
1273 | } | ||
1262 | 1274 | ||
1263 | protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) | 1275 | protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data) |
1264 | { | 1276 | { |
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 | |||
2158 | client.OnObjectDescription += m_innerScene.PrimDescription; | 2158 | client.OnObjectDescription += m_innerScene.PrimDescription; |
2159 | client.OnObjectName += m_innerScene.PrimName; | 2159 | client.OnObjectName += m_innerScene.PrimName; |
2160 | client.OnObjectClickAction += m_innerScene.PrimClickAction; | 2160 | client.OnObjectClickAction += m_innerScene.PrimClickAction; |
2161 | client.OnObjectMaterial += m_innerScene.PrimMaterial; | ||
2161 | client.OnLinkObjects += m_innerScene.LinkObjects; | 2162 | client.OnLinkObjects += m_innerScene.LinkObjects; |
2162 | client.OnDelinkObjects += m_innerScene.DelinkObjects; | 2163 | client.OnDelinkObjects += m_innerScene.DelinkObjects; |
2163 | client.OnObjectDuplicate += m_innerScene.DuplicateObject; | 2164 | 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 | |||
181 | //unkown if this will be kept, added as a way of removing the group position from the group class | 181 | //unkown if this will be kept, added as a way of removing the group position from the group class |
182 | protected Vector3 m_groupPosition; | 182 | protected Vector3 m_groupPosition; |
183 | protected uint m_localId; | 183 | protected uint m_localId; |
184 | protected Material m_material = 0; | 184 | protected Material m_material = (Material)3; // Wood |
185 | protected string m_name; | 185 | protected string m_name; |
186 | protected Vector3 m_offsetPosition; | 186 | protected Vector3 m_offsetPosition; |
187 | 187 | ||
@@ -2106,7 +2106,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2106 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; | 2106 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; |
2107 | remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, | 2107 | remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, |
2108 | lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, _ownerID, | 2108 | lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, _ownerID, |
2109 | m_text, color, _parentID, m_particleSystem, m_clickAction, m_TextureAnimation, IsAttachment, | 2109 | m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, |
2110 | AttachmentPoint,FromAssetID, Sound, SoundGain, SoundFlags, SoundRadius); | 2110 | AttachmentPoint,FromAssetID, Sound, SoundGain, SoundFlags, SoundRadius); |
2111 | } | 2111 | } |
2112 | 2112 | ||
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 2b8bcb1..6d69247 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -107,6 +107,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
107 | public event GenericCall7 OnObjectDescription; | 107 | public event GenericCall7 OnObjectDescription; |
108 | public event GenericCall7 OnObjectName; | 108 | public event GenericCall7 OnObjectName; |
109 | public event GenericCall7 OnObjectClickAction; | 109 | public event GenericCall7 OnObjectClickAction; |
110 | public event GenericCall7 OnObjectMaterial; | ||
110 | public event UpdatePrimFlags OnUpdatePrimFlags; | 111 | public event UpdatePrimFlags OnUpdatePrimFlags; |
111 | public event UpdatePrimTexture OnUpdatePrimTexture; | 112 | public event UpdatePrimTexture OnUpdatePrimTexture; |
112 | public event UpdateVector OnUpdatePrimGroupPosition; | 113 | public event UpdateVector OnUpdatePrimGroupPosition; |
@@ -473,7 +474,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
473 | Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, | 474 | Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, |
474 | UUID objectID, UUID ownerID, string text, byte[] color, | 475 | UUID objectID, UUID ownerID, string text, byte[] color, |
475 | uint parentID, | 476 | uint parentID, |
476 | byte[] particleSystem, byte clickAction) | 477 | byte[] particleSystem, byte clickAction, byte material) |
477 | { | 478 | { |
478 | } | 479 | } |
479 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, | 480 | public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, |
@@ -481,7 +482,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
481 | Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, | 482 | Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, |
482 | UUID objectID, UUID ownerID, string text, byte[] color, | 483 | UUID objectID, UUID ownerID, string text, byte[] color, |
483 | uint parentID, | 484 | uint parentID, |
484 | byte[] particleSystem, byte clickAction, byte[] textureanimation, | 485 | byte[] particleSystem, byte clickAction, byte material, byte[] textureanimation, |
485 | bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) | 486 | bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) |
486 | { | 487 | { |
487 | } | 488 | } |