From 2f2ec10172a5a68caa909cc153ebcf7a14192892 Mon Sep 17 00:00:00 2001 From: MW Date: Mon, 11 Jun 2007 16:13:52 +0000 Subject: [PATCH] A few small changes and hopefully fixed the nant build problem (OpenSim.Framework came before OpenSim.Framework.Console, so was causing a problem as OpenSim.Framework references OpenSim.Framework.Console). --- .../Interfaces/IClientAPI.cs | 1 + OpenSim.build | 2 +- OpenSim/OpenSim.Region/World/Primitive.cs | 2 +- OpenSim/OpenSim.Region/World/World.cs | 21 ++++++++++ .../OpenSim.RegionServer/ClientView.API.cs | 40 ++++++++++++++++--- prebuild.xml | 37 ++++++++--------- 6 files changed, 77 insertions(+), 26 deletions(-) diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs index 8a9b59868f..b26a0894c9 100644 --- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs +++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs @@ -103,6 +103,7 @@ namespace OpenSim.Framework.Interfaces AgentCircuitData RequestClientInfo(); void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID); void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID); void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation); } diff --git a/OpenSim.build b/OpenSim.build index 9134ac3d66..6a0a8db32d 100644 --- a/OpenSim.build +++ b/OpenSim.build @@ -70,8 +70,8 @@ - + diff --git a/OpenSim/OpenSim.Region/World/Primitive.cs b/OpenSim/OpenSim.Region/World/Primitive.cs index 99e349d2f2..d7c1e8d47c 100644 --- a/OpenSim/OpenSim.Region/World/Primitive.cs +++ b/OpenSim/OpenSim.Region/World/Primitive.cs @@ -440,7 +440,7 @@ namespace OpenSim.Region PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; LLVector3 pos1 = addPacket.ObjectData.RayEnd; this.primData.FullID = this.uuid = LLUUID.Random(); - this.localid = (uint)(localID); + this.primData.LocalID = this.localid = (uint)(localID); this.primData.Position = this.Pos = pos1; this.updateFlag = 1; diff --git a/OpenSim/OpenSim.Region/World/World.cs b/OpenSim/OpenSim.Region/World/World.cs index e316e271fb..3415f08670 100644 --- a/OpenSim/OpenSim.Region/World/World.cs +++ b/OpenSim/OpenSim.Region/World/World.cs @@ -20,6 +20,8 @@ using OpenSim.Region.Estate; namespace OpenSim.Region { + public delegate bool FilterAvatarList(Avatar avatar); + public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI { protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); @@ -592,6 +594,25 @@ namespace OpenSim.Region return result; } + /// + /// Request a filtered list of Avatars in this World + /// + /// + public List RequestAvatarList(FilterAvatarList filter) + { + List result = new List(); + + foreach (Avatar avatar in Avatars.Values) + { + if (filter(avatar)) + { + result.Add(avatar); + } + } + + return result; + } + public Avatar RequestAvatar(LLUUID avatarID) { if (this.Avatars.ContainsKey(avatarID)) diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs index 780035cb62..f7d98bbdb5 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs @@ -448,6 +448,34 @@ namespace OpenSim /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive /// or big changes to a existing primitive. /// + /// + /// + /// + /// + /// + /// + /// + public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID) + { + ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); + outPacket.RegionData.RegionHandle = regionHandle; + outPacket.RegionData.TimeDilation = timeDilation; + outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; + outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID); + outPacket.ObjectData[0].ID = localID; + outPacket.ObjectData[0].FullID = primData.FullID; + byte[] pb = pos.GetBytes(); + Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); + byte[] rot = rotation.GetBytes(); + Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 48, rot.Length); + OutPacket(outPacket); + } + + /// + /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive + /// or big changes to a existing primitive. + /// uses default rotation + /// /// /// public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID) @@ -473,9 +501,9 @@ namespace OpenSim protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID) { ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); - this.SetDefaultPrimPacketValues(objupdate, textureID); + this.SetDefaultPrimPacketValues(objupdate); objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; - this.SetPrimPacketShapeData(objupdate, primData); + this.SetPrimPacketShapeData(objupdate, primData, textureID); return objupdate; } @@ -484,7 +512,7 @@ namespace OpenSim /// Set some default values in a ObjectUpdatePacket /// /// - protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata, LLUUID textureID) + protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) { objdata.PSBlock = new byte[0]; objdata.ExtraParams = new byte[1]; @@ -497,8 +525,6 @@ namespace OpenSim objdata.Material = 3; objdata.TextureAnim = new byte[0]; objdata.Sound = LLUUID.Zero; - LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID); - objdata.TextureEntry = ntex.ToBytes(); objdata.State = 0; objdata.Data = new byte[0]; @@ -512,8 +538,10 @@ namespace OpenSim /// /// /// - protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData) + protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData, LLUUID textureID) { + LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID); + objectData.TextureEntry = ntex.ToBytes(); objectData.OwnerID = primData.OwnerID; objectData.PCode = primData.PCode; objectData.PathBegin =primData.PathBegin; diff --git a/prebuild.xml b/prebuild.xml index b878263cf6..2aa8a37b73 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -56,6 +56,25 @@ + + + + ../../bin/ + + + + + ../../bin/ + + + + ../../bin/ + + + + + + @@ -80,24 +99,6 @@ - - - - ../../bin/ - - - - - ../../bin/ - - - - ../../bin/ - - - - -