aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2007-06-11 16:13:52 +0000
committerMW2007-06-11 16:13:52 +0000
commit2f2ec10172a5a68caa909cc153ebcf7a14192892 (patch)
tree219b3a5d2373ff17dc9567b19b77f9faeac0161b /OpenSim
parentAdded AttachObject method to IClientAPI. (diff)
downloadopensim-SC_OLD-2f2ec10172a5a68caa909cc153ebcf7a14192892.zip
opensim-SC_OLD-2f2ec10172a5a68caa909cc153ebcf7a14192892.tar.gz
opensim-SC_OLD-2f2ec10172a5a68caa909cc153ebcf7a14192892.tar.bz2
opensim-SC_OLD-2f2ec10172a5a68caa909cc153ebcf7a14192892.tar.xz
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).
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/OpenSim.Region/World/Primitive.cs2
-rw-r--r--OpenSim/OpenSim.Region/World/World.cs21
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.API.cs40
3 files changed, 56 insertions, 7 deletions
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
440 PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; 440 PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
441 LLVector3 pos1 = addPacket.ObjectData.RayEnd; 441 LLVector3 pos1 = addPacket.ObjectData.RayEnd;
442 this.primData.FullID = this.uuid = LLUUID.Random(); 442 this.primData.FullID = this.uuid = LLUUID.Random();
443 this.localid = (uint)(localID); 443 this.primData.LocalID = this.localid = (uint)(localID);
444 this.primData.Position = this.Pos = pos1; 444 this.primData.Position = this.Pos = pos1;
445 445
446 this.updateFlag = 1; 446 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;
20 20
21namespace OpenSim.Region 21namespace OpenSim.Region
22{ 22{
23 public delegate bool FilterAvatarList(Avatar avatar);
24
23 public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI 25 public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI
24 { 26 {
25 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); 27 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
@@ -592,6 +594,25 @@ namespace OpenSim.Region
592 return result; 594 return result;
593 } 595 }
594 596
597 /// <summary>
598 /// Request a filtered list of Avatars in this World
599 /// </summary>
600 /// <returns></returns>
601 public List<Avatar> RequestAvatarList(FilterAvatarList filter)
602 {
603 List<Avatar> result = new List<Avatar>();
604
605 foreach (Avatar avatar in Avatars.Values)
606 {
607 if (filter(avatar))
608 {
609 result.Add(avatar);
610 }
611 }
612
613 return result;
614 }
615
595 public Avatar RequestAvatar(LLUUID avatarID) 616 public Avatar RequestAvatar(LLUUID avatarID)
596 { 617 {
597 if (this.Avatars.ContainsKey(avatarID)) 618 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
448 /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive 448 /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive
449 /// or big changes to a existing primitive. 449 /// or big changes to a existing primitive.
450 /// </summary> 450 /// </summary>
451 /// <param name="regionHandle"></param>
452 /// <param name="timeDilation"></param>
453 /// <param name="localID"></param>
454 /// <param name="primData"></param>
455 /// <param name="pos"></param>
456 /// <param name="rotation"></param>
457 /// <param name="textureID"></param>
458 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID)
459 {
460 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
461 outPacket.RegionData.RegionHandle = regionHandle;
462 outPacket.RegionData.TimeDilation = timeDilation;
463 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
464 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID);
465 outPacket.ObjectData[0].ID = localID;
466 outPacket.ObjectData[0].FullID = primData.FullID;
467 byte[] pb = pos.GetBytes();
468 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
469 byte[] rot = rotation.GetBytes();
470 Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 48, rot.Length);
471 OutPacket(outPacket);
472 }
473
474 /// <summary>
475 /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive
476 /// or big changes to a existing primitive.
477 /// uses default rotation
478 /// </summary>
451 /// <param name="primData"></param> 479 /// <param name="primData"></param>
452 /// <param name="pos"></param> 480 /// <param name="pos"></param>
453 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID) 481 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID)
@@ -473,9 +501,9 @@ namespace OpenSim
473 protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID) 501 protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID)
474 { 502 {
475 ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); 503 ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock();
476 this.SetDefaultPrimPacketValues(objupdate, textureID); 504 this.SetDefaultPrimPacketValues(objupdate);
477 objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; 505 objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456;
478 this.SetPrimPacketShapeData(objupdate, primData); 506 this.SetPrimPacketShapeData(objupdate, primData, textureID);
479 507
480 return objupdate; 508 return objupdate;
481 } 509 }
@@ -484,7 +512,7 @@ namespace OpenSim
484 /// Set some default values in a ObjectUpdatePacket 512 /// Set some default values in a ObjectUpdatePacket
485 /// </summary> 513 /// </summary>
486 /// <param name="objdata"></param> 514 /// <param name="objdata"></param>
487 protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata, LLUUID textureID) 515 protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
488 { 516 {
489 objdata.PSBlock = new byte[0]; 517 objdata.PSBlock = new byte[0];
490 objdata.ExtraParams = new byte[1]; 518 objdata.ExtraParams = new byte[1];
@@ -497,8 +525,6 @@ namespace OpenSim
497 objdata.Material = 3; 525 objdata.Material = 3;
498 objdata.TextureAnim = new byte[0]; 526 objdata.TextureAnim = new byte[0];
499 objdata.Sound = LLUUID.Zero; 527 objdata.Sound = LLUUID.Zero;
500 LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID);
501 objdata.TextureEntry = ntex.ToBytes();
502 objdata.State = 0; 528 objdata.State = 0;
503 objdata.Data = new byte[0]; 529 objdata.Data = new byte[0];
504 530
@@ -512,8 +538,10 @@ namespace OpenSim
512 /// </summary> 538 /// </summary>
513 /// <param name="objectData"></param> 539 /// <param name="objectData"></param>
514 /// <param name="primData"></param> 540 /// <param name="primData"></param>
515 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData) 541 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData, LLUUID textureID)
516 { 542 {
543 LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID);
544 objectData.TextureEntry = ntex.ToBytes();
517 objectData.OwnerID = primData.OwnerID; 545 objectData.OwnerID = primData.OwnerID;
518 objectData.PCode = primData.PCode; 546 objectData.PCode = primData.PCode;
519 objectData.PathBegin =primData.PathBegin; 547 objectData.PathBegin =primData.PathBegin;