From 2f2ec10172a5a68caa909cc153ebcf7a14192892 Mon Sep 17 00:00:00 2001
From: MW
Date: Mon, 11 Jun 2007 16:13:52 +0000
Subject: 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).
---
OpenSim/OpenSim.Region/World/Primitive.cs | 2 +-
OpenSim/OpenSim.Region/World/World.cs | 21 ++++++++++++++
OpenSim/OpenSim.RegionServer/ClientView.API.cs | 40 ++++++++++++++++++++++----
3 files changed, 56 insertions(+), 7 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/OpenSim.Region/World/Primitive.cs b/OpenSim/OpenSim.Region/World/Primitive.cs
index 99e349d..d7c1e8d 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 e316e27..3415f08 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 780035c..f7d98bb 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;
--
cgit v1.1