From 179695909a8967bcdb092720a19c264d52fb4515 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 15 Nov 2007 07:32:24 +0000 Subject: * Implemented the little friendly pop tooltip messages that appear when you hover your mouse over prim with the object name, description, ownerid.. etc. --- OpenSim/Framework/IClientAPI.cs | 3 ++ OpenSim/Region/ClientStack/ClientView.API.cs | 1 + .../ClientStack/ClientView.ProcessPackets.cs | 28 ++++++++++++++++++ OpenSim/Region/Environment/Scenes/InnerScene.cs | 17 +++++++++++ OpenSim/Region/Environment/Scenes/Scene.cs | 2 +- .../Region/Environment/Scenes/SceneObjectGroup.cs | 34 ++++++++++++++++++++++ .../Region/Environment/Scenes/SceneObjectPart.cs | 34 +++++++++++++++++++--- .../Region/Examples/SimpleApp/MyNpcCharacter.cs | 1 + 8 files changed, 115 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 451984c..06a8bab 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -203,6 +203,8 @@ namespace OpenSim.Framework public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); + public delegate void RequestObjectPropertiesFamily(IClientAPI remoteClient,LLUUID AgentID, uint RequestFlags, LLUUID TaskID); + public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient); public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient); @@ -320,6 +322,7 @@ namespace OpenSim.Framework event ObjectDeselect OnObjectDeselect; event GenericCall7 OnObjectDescription; event GenericCall7 OnObjectName; + event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; event UpdatePrimFlags OnUpdatePrimFlags; event UpdatePrimTexture OnUpdatePrimTexture; event UpdateVector OnUpdatePrimGroupPosition; diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 77c1701..f0ebf03 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -71,6 +71,7 @@ namespace OpenSim.Region.ClientStack public event ObjectDeselect OnObjectDeselect; public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectName; + public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; public event UpdatePrimFlags OnUpdatePrimFlags; public event UpdatePrimTexture OnUpdatePrimTexture; public event UpdateVector OnUpdatePrimGroupPosition; diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index da4f830..d3ef88b 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -395,6 +395,22 @@ namespace OpenSim.Region.ClientStack OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString()); break; + case PacketType.RequestObjectPropertiesFamily: + //This powers the little tooltip that appears when you move your mouse over an object + RequestObjectPropertiesFamilyPacket packToolTip = (RequestObjectPropertiesFamilyPacket)Pack; + + + RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData; + + if (OnRequestObjectPropertiesFamily != null) + { + OnRequestObjectPropertiesFamily(this, this.m_agentId, packObjBlock.RequestFlags, packObjBlock.ObjectID); + + + } + + break; + #endregion #region Inventory/Asset/Other related packets @@ -725,6 +741,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ParcelObjectOwnersRequest: + //System.Console.WriteLine(Pack.ToString()); ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket) Pack; if (OnParcelObjectOwnerRequest != null) { @@ -747,7 +764,18 @@ namespace OpenSim.Region.ClientStack #endregion #region unimplemented handlers + case PacketType.StartPingCheck: + // Send the client the ping response back + // Pass the same PingID in the matching packet + // Handled In the packet processing + OpenSim.Framework.Console.MainLog.Instance.Debug("CLIENT", "possibly unhandled packet " + Pack.ToString()); + break; + case PacketType.CompletePingCheck: + // Parhaps this should be processed on the Sim to determine whether or not to drop a dead client + // Dumping it to the verbose console until it's handled properly. + OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString()); + break; case PacketType.AgentIsNowWearing: // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack; OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString()); diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index c436b89..1625e80 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -354,6 +354,23 @@ namespace OpenSim.Region.Environment.Scenes } /// + /// This handles the nifty little tool tip that you get when you drag your mouse over an object + /// Send to the Object Group to process. We don't know enough to service the request + /// + /// + /// + /// + /// + public void RequestObjectPropertiesFamily(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags, LLUUID ObjectID) + { + SceneObjectGroup group = GetGroupByPrim(ObjectID); + if (group != null) + group.ServiceObjectPropertiesFamilyRequest(remoteClient, AgentID, RequestFlags); + + + } + + /// /// /// /// diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d7e36c5..0f1642f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -708,7 +708,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnDelinkObjects += m_innerScene.DelinkObjects; client.OnObjectDuplicate += m_innerScene.DuplicateObject; client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags; - + client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily; client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_LandManager.handleParcelPropertiesRequest); client.OnParcelDivideRequest += new ParcelDivideRequest(m_LandManager.handleParcelDivideRequest); client.OnParcelJoinRequest += new ParcelJoinRequest(m_LandManager.handleParcelJoinRequest); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index c9b6e9f..38e1609 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -462,6 +462,7 @@ namespace OpenSim.Region.Environment.Scenes dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); dupe.m_scene = m_scene; dupe.m_regionHandle = m_regionHandle; + dupe.CopyRootPart(m_rootPart, OwnerID, GroupID); @@ -519,6 +520,7 @@ namespace OpenSim.Region.Environment.Scenes SetPartAsRoot(newPart); } public void SetRootPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) { + part.LastOwnerID = part.OwnerID; part.OwnerID = cAgentID; part.GroupID = cGroupID; part.ScheduleFullUpdate(); @@ -535,6 +537,38 @@ namespace OpenSim.Region.Environment.Scenes m_parts.Add(newPart.UUID, newPart); SetPartAsNonRoot(newPart); } + + /// + /// + /// + /// + public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient,LLUUID AgentID, uint RequestFlags) + { + //RootPart.ServiceObjectPropertiesFamilyRequest(remoteClient, AgentID, RequestFlags); + ObjectPropertiesFamilyPacket objPropFamilyPack = new ObjectPropertiesFamilyPacket(); + ObjectPropertiesFamilyPacket.ObjectDataBlock objPropDB = new ObjectPropertiesFamilyPacket.ObjectDataBlock(); + objPropDB.RequestFlags = RequestFlags; + objPropDB.ObjectID = RootPart.UUID; + objPropDB.OwnerID = RootPart.ObjectOwner; + objPropDB.GroupID = RootPart.GroupID; + objPropDB.BaseMask = RootPart.BaseMask; + objPropDB.OwnerMask = RootPart.OwnerMask; + objPropDB.GroupMask = RootPart.GroupMask; + objPropDB.EveryoneMask = RootPart.EveryoneMask; + objPropDB.NextOwnerMask = RootPart.NextOwnerMask; + + // TODO: More properties are needed in SceneObjectPart! + objPropDB.OwnershipCost = RootPart.OwnershipCost; + objPropDB.SaleType = RootPart.ObjectSaleType; + objPropDB.SalePrice = RootPart.SalePrice; + objPropDB.Category = RootPart.Category; + objPropDB.LastOwnerID = RootPart.CreatorID; + objPropDB.Name = Helpers.StringToField(RootPart.Name); + objPropDB.Description = Helpers.StringToField(RootPart.Description); + objPropFamilyPack.ObjectData = objPropDB; + remoteClient.OutPacket(objPropFamilyPack); + + } public void SetPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) { part.OwnerID = cAgentID; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 70b8829..727ebb0 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -51,13 +51,18 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public PhysicsActor PhysActor = null; protected Dictionary TaskInventory = new Dictionary(); - + public LLUUID LastOwnerID; public LLUUID OwnerID; public LLUUID GroupID; - public LLUUID LastOwnerID; + public int OwnershipCost; + public byte ObjectSaleType; + public int SalePrice; + public uint Category; + public Int32 CreationDate; public uint ParentID = 0; + public uint OwnerMask = FULL_MASK_PERMISSIONS; public uint NextOwnerMask = FULL_MASK_PERMISSIONS; public uint GroupMask = FULL_MASK_PERMISSIONS; @@ -68,6 +73,7 @@ namespace OpenSim.Region.Environment.Scenes [XmlIgnore] public uint TimeStampFull = 0; [XmlIgnore] public uint TimeStampTerse = 0; + [XmlIgnore] public uint TimeStampLastActivity = 0; // Will be used for AutoReturn protected SceneObjectGroup m_parentGroup; @@ -418,7 +424,13 @@ namespace OpenSim.Region.Environment.Scenes UUID = LLUUID.Random(); LocalID = (uint) (localID); Shape = shape; - + // Todo: Add More Object Parameter from above! + OwnershipCost = 0; + ObjectSaleType = (byte)0; + SalePrice = 0; + Category = (uint)0; + LastOwnerID = CreatorID; + // End Todo: /// GroupPosition = groupPosition; OffsetPosition = offsetPosition; RotationOffset = rotationOffset; @@ -467,8 +479,14 @@ namespace OpenSim.Region.Environment.Scenes LastOwnerID = lastOwnerID; UUID = LLUUID.Random(); LocalID = (uint) (localID); + // Todo: Add More parameters from above Shape = shape; - + OwnershipCost = 0; + ObjectSaleType = (byte)0; + SalePrice = 0; + Category = (uint)0; + // End Todo: /// + LastOwnerID = CreatorID; OffsetPosition = position; RotationOffset = rotation; ObjectFlags = flags; @@ -538,6 +556,14 @@ namespace OpenSim.Region.Environment.Scenes dupe.AngularVelocity = new LLVector3(0, 0, 0); dupe.ObjectFlags = ObjectFlags; + dupe.OwnershipCost = OwnershipCost; + dupe.ObjectSaleType = ObjectSaleType; + dupe.SalePrice = SalePrice; + dupe.Category = Category; + + // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. + dupe.LastOwnerID = ObjectOwner; + byte[] extraP = new byte[Shape.ExtraParams.Length]; Array.Copy(Shape.ExtraParams, extraP, extraP.Length); dupe.Shape.ExtraParams = extraP; diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 61402be..07d43b8 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs @@ -83,6 +83,7 @@ namespace SimpleApp public event UpdateShape OnUpdatePrimShape; public event ObjectExtraParams OnUpdateExtraParams; + public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; public event ObjectSelect OnObjectSelect; public event GenericCall7 OnObjectDescription; public event GenericCall7 OnObjectName; -- cgit v1.1