Thank you, idb, for a patch to implement the packet and plumbing for
the material settings.
0.6.0-stable
Melanie Thielker 2008-10-03 12:00:13 +00:00
parent 8de395d379
commit 7f007d8ed0
7 changed files with 46 additions and 12 deletions

View File

@ -422,6 +422,7 @@ namespace OpenSim.Framework
event GenericCall7 OnObjectDescription; event GenericCall7 OnObjectDescription;
event GenericCall7 OnObjectName; event GenericCall7 OnObjectName;
event GenericCall7 OnObjectClickAction; event GenericCall7 OnObjectClickAction;
event GenericCall7 OnObjectMaterial;
event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
event UpdatePrimFlags OnUpdatePrimFlags; event UpdatePrimFlags OnUpdatePrimFlags;
event UpdatePrimTexture OnUpdatePrimTexture; event UpdatePrimTexture OnUpdatePrimTexture;
@ -593,13 +594,13 @@ namespace OpenSim.Framework
Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel,
uint flags, uint flags,
UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius); byte clickAction, byte material, byte[] textureanim, bool attachment, uint AttachPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel,
uint flags, UUID objectID, UUID ownerID, string text, byte[] color, uint flags, UUID objectID, UUID ownerID, string text, byte[] color,
uint parentID, byte[] particleSystem, byte clickAction); uint parentID, byte[] particleSystem, byte clickAction, byte material);
void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position,

View File

@ -172,6 +172,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private GenericCall7 handlerObjectDescription = null; private GenericCall7 handlerObjectDescription = null;
private GenericCall7 handlerObjectName = null; private GenericCall7 handlerObjectName = null;
private GenericCall7 handlerObjectClickAction = null; private GenericCall7 handlerObjectClickAction = null;
private GenericCall7 handlerObjectMaterial = null;
private ObjectPermissions handlerObjectPermissions = null; private ObjectPermissions handlerObjectPermissions = null;
private RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = null; //OnRequestObjectPropertiesFamily; private RequestObjectPropertiesFamily handlerRequestObjectPropertiesFamily = null; //OnRequestObjectPropertiesFamily;
private TextureRequest handlerTextureRequest = null; private TextureRequest handlerTextureRequest = null;
@ -870,6 +871,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;
public event GenericCall7 OnObjectName; public event GenericCall7 OnObjectName;
public event GenericCall7 OnObjectClickAction; public event GenericCall7 OnObjectClickAction;
public event GenericCall7 OnObjectMaterial;
public event ObjectIncludeInSearch OnObjectIncludeInSearch; public event ObjectIncludeInSearch OnObjectIncludeInSearch;
public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
public event UpdatePrimFlags OnUpdatePrimFlags; public event UpdatePrimFlags OnUpdatePrimFlags;
@ -2395,14 +2397,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel,
uint flags, UUID objectID, UUID ownerID, string text, byte[] color, uint flags, UUID objectID, UUID ownerID, string text, byte[] color,
uint parentID, byte[] particleSystem, byte clickAction) uint parentID, byte[] particleSystem, byte clickAction, byte material)
{ {
byte[] textureanim = new byte[0]; byte[] textureanim = new byte[0];
SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel, SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel,
acc, rotation, rvel, flags, acc, rotation, rvel, flags,
objectID, ownerID, text, color, parentID, particleSystem, objectID, ownerID, text, color, parentID, particleSystem,
clickAction, textureanim, false, (uint)0, UUID.Zero, UUID.Zero, 0, 0, 0); clickAction, material, textureanim, false, (uint)0, UUID.Zero, UUID.Zero, 0, 0, 0);
} }
public void SendPrimitiveToClient( public void SendPrimitiveToClient(
@ -2410,7 +2412,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
Vector3 pos, Vector3 velocity, Vector3 acceleration, Quaternion rotation, Vector3 rotational_velocity, Vector3 pos, Vector3 velocity, Vector3 acceleration, Quaternion rotation, Vector3 rotational_velocity,
uint flags, uint flags,
UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, UUID AssetId, UUID SoundId, double SoundGain, byte SoundFlags, double SoundRadius) byte clickAction, byte material, byte[] textureanim, bool attachment, uint AttachPoint, UUID AssetId, UUID SoundId, double SoundGain, byte SoundFlags, double SoundRadius)
{ {
if (rotation.X == rotation.Y && rotation.Y == rotation.Z && rotation.Z == rotation.W && rotation.W == 0) 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
outPacket.ObjectData[0].ParentID = parentID; outPacket.ObjectData[0].ParentID = parentID;
outPacket.ObjectData[0].PSBlock = particleSystem; outPacket.ObjectData[0].PSBlock = particleSystem;
outPacket.ObjectData[0].ClickAction = clickAction; outPacket.ObjectData[0].ClickAction = clickAction;
outPacket.ObjectData[0].Material = material;
outPacket.ObjectData[0].Flags = 0; outPacket.ObjectData[0].Flags = 0;
if (attachment) if (attachment)
@ -4865,6 +4868,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
break; break;
case PacketType.ObjectMaterial:
ObjectMaterialPacket ompacket = (ObjectMaterialPacket)Pack;
handlerObjectMaterial = OnObjectMaterial;
if (handlerObjectMaterial != null)
{
foreach (ObjectMaterialPacket.ObjectDataBlock odata in ompacket.ObjectData)
{
byte material = odata.Material;
uint localID = odata.ObjectLocalID;
handlerObjectMaterial(this, localID, material.ToString());
}
}
break;
#endregion #endregion
#region Inventory/Asset/Other related packets #region Inventory/Asset/Other related packets

View File

@ -212,6 +212,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;
public event GenericCall7 OnObjectName; public event GenericCall7 OnObjectName;
public event GenericCall7 OnObjectClickAction; public event GenericCall7 OnObjectClickAction;
public event GenericCall7 OnObjectMaterial;
public event UpdatePrimFlags OnUpdatePrimFlags; public event UpdatePrimFlags OnUpdatePrimFlags;
public event UpdatePrimTexture OnUpdatePrimTexture; public event UpdatePrimTexture OnUpdatePrimTexture;
public event UpdateVector OnUpdatePrimGroupPosition; public event UpdateVector OnUpdatePrimGroupPosition;
@ -559,7 +560,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags,
UUID objectID, UUID ownerID, string text, byte[] color, UUID objectID, UUID ownerID, string text, byte[] color,
uint parentID, uint parentID,
byte[] particleSystem, byte clickAction) byte[] particleSystem, byte clickAction, byte material)
{ {
} }
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID,
@ -567,7 +568,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags,
UUID objectID, UUID ownerID, string text, byte[] color, UUID objectID, UUID ownerID, string text, byte[] color,
uint parentID, uint parentID,
byte[] particleSystem, byte clickAction, byte[] textureanimation, byte[] particleSystem, byte clickAction, byte material, byte[] textureanimation,
bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius)
{ {
} }

View File

@ -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) protected internal void UpdateExtraParam(UUID agentID, uint primLocalID, ushort type, bool inUse, byte[] data)
{ {

View File

@ -2158,6 +2158,7 @@ namespace OpenSim.Region.Environment.Scenes
client.OnObjectDescription += m_innerScene.PrimDescription; client.OnObjectDescription += m_innerScene.PrimDescription;
client.OnObjectName += m_innerScene.PrimName; client.OnObjectName += m_innerScene.PrimName;
client.OnObjectClickAction += m_innerScene.PrimClickAction; client.OnObjectClickAction += m_innerScene.PrimClickAction;
client.OnObjectMaterial += m_innerScene.PrimMaterial;
client.OnLinkObjects += m_innerScene.LinkObjects; client.OnLinkObjects += m_innerScene.LinkObjects;
client.OnDelinkObjects += m_innerScene.DelinkObjects; client.OnDelinkObjects += m_innerScene.DelinkObjects;
client.OnObjectDuplicate += m_innerScene.DuplicateObject; client.OnObjectDuplicate += m_innerScene.DuplicateObject;

View File

@ -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 //unkown if this will be kept, added as a way of removing the group position from the group class
protected Vector3 m_groupPosition; protected Vector3 m_groupPosition;
protected uint m_localId; protected uint m_localId;
protected Material m_material = 0; protected Material m_material = (Material)3; // Wood
protected string m_name; protected string m_name;
protected Vector3 m_offsetPosition; 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}; 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, remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape,
lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, _ownerID, 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); AttachmentPoint,FromAssetID, Sound, SoundGain, SoundFlags, SoundRadius);
} }

View File

@ -107,6 +107,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectDescription;
public event GenericCall7 OnObjectName; public event GenericCall7 OnObjectName;
public event GenericCall7 OnObjectClickAction; public event GenericCall7 OnObjectClickAction;
public event GenericCall7 OnObjectMaterial;
public event UpdatePrimFlags OnUpdatePrimFlags; public event UpdatePrimFlags OnUpdatePrimFlags;
public event UpdatePrimTexture OnUpdatePrimTexture; public event UpdatePrimTexture OnUpdatePrimTexture;
public event UpdateVector OnUpdatePrimGroupPosition; public event UpdateVector OnUpdatePrimGroupPosition;
@ -473,7 +474,7 @@ namespace OpenSim.Region.Examples.SimpleModule
Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags,
UUID objectID, UUID ownerID, string text, byte[] color, UUID objectID, UUID ownerID, string text, byte[] color,
uint parentID, uint parentID,
byte[] particleSystem, byte clickAction) byte[] particleSystem, byte clickAction, byte material)
{ {
} }
public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, public virtual void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID,
@ -481,7 +482,7 @@ namespace OpenSim.Region.Examples.SimpleModule
Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags,
UUID objectID, UUID ownerID, string text, byte[] color, UUID objectID, UUID ownerID, string text, byte[] color,
uint parentID, uint parentID,
byte[] particleSystem, byte clickAction, byte[] textureanimation, byte[] particleSystem, byte clickAction, byte material, byte[] textureanimation,
bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius) bool attachment, uint AttachmentPoint, UUID AssetId, UUID SoundId, double SoundVolume, byte SoundFlags, double SoundRadius)
{ {
} }