aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Entity.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityBase.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive.cs13
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs45
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObject.cs20
6 files changed, 80 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Entity.cs b/OpenSim/Region/Environment/Scenes/Entity.cs
index 9603f7f..6db57a4 100644
--- a/OpenSim/Region/Environment/Scenes/Entity.cs
+++ b/OpenSim/Region/Environment/Scenes/Entity.cs
@@ -34,7 +34,7 @@ using libsecondlife;
34 34
35namespace OpenSim.Region.Environment.Scenes 35namespace OpenSim.Region.Environment.Scenes
36{ 36{
37 public abstract class Entity :EntityBase //will be phased out 37 public abstract class Entity :EntityBase //this class (Entity) will be phased out
38 { 38 {
39 protected PhysicsActor _physActor; 39 protected PhysicsActor _physActor;
40 40
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index edd72c5..63f3f5d 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -21,6 +21,7 @@ namespace OpenSim.Region.Environment.Scenes
21 public virtual string Name 21 public virtual string Name
22 { 22 {
23 get { return m_name; } 23 get { return m_name; }
24 set { m_name = value; }
24 } 25 }
25 26
26 protected LLVector3 m_pos; 27 protected LLVector3 m_pos;
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs
index 497196d..97e7974 100644
--- a/OpenSim/Region/Environment/Scenes/Primitive.cs
+++ b/OpenSim/Region/Environment/Scenes/Primitive.cs
@@ -21,6 +21,7 @@ namespace OpenSim.Region.Environment.Scenes
21 21
22 private Dictionary<LLUUID, InventoryItem> inventoryItems; 22 private Dictionary<LLUUID, InventoryItem> inventoryItems;
23 23
24 private string description = "";
24 public LLUUID OwnerID; 25 public LLUUID OwnerID;
25 public Int32 CreationDate; 26 public Int32 CreationDate;
26 public uint OwnerMask = FULL_MASK_PERMISSIONS; 27 public uint OwnerMask = FULL_MASK_PERMISSIONS;
@@ -55,6 +56,18 @@ namespace OpenSim.Region.Environment.Scenes
55 56
56 } 57 }
57 58
59 public string Description
60 {
61 get
62 {
63 return this.description;
64 }
65 set
66 {
67 this.description = value;
68 }
69 }
70
58 public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent , SceneObject rootObject) 71 public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent , SceneObject rootObject)
59 { 72 {
60 m_regionHandle = regionHandle; 73 m_regionHandle = regionHandle;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index f3d461a..f55c118 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -214,7 +214,6 @@ namespace OpenSim.Region.Environment.Scenes
214 /// <param name="remoteClient"></param> 214 /// <param name="remoteClient"></param>
215 public void SelectPrim(uint primLocalID, IClientAPI remoteClient) 215 public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
216 { 216 {
217 Console.WriteLine("prim selected :" + primLocalID);
218 foreach (EntityBase ent in Entities.Values) 217 foreach (EntityBase ent in Entities.Values)
219 { 218 {
220 if (ent is SceneObject) 219 if (ent is SceneObject)
@@ -228,6 +227,50 @@ namespace OpenSim.Region.Environment.Scenes
228 } 227 }
229 } 228 }
230 229
230 /// <summary>
231 ///
232 /// </summary>
233 /// <param name="primLocalID"></param>
234 /// <param name="description"></param>
235 public void PrimDescription(uint primLocalID, string description)
236 {
237 Primitive prim = null;
238 foreach (EntityBase ent in Entities.Values)
239 {
240 if (ent is SceneObject)
241 {
242 prim = ((SceneObject)ent).HasChildPrim(primLocalID);
243 if (prim != null)
244 {
245 prim.Description = description;
246 break;
247 }
248 }
249 }
250 }
251
252 /// <summary>
253 ///
254 /// </summary>
255 /// <param name="primLocalID"></param>
256 /// <param name="description"></param>
257 public void PrimName(uint primLocalID, string name)
258 {
259 Primitive prim = null;
260 foreach (EntityBase ent in Entities.Values)
261 {
262 if (ent is SceneObject)
263 {
264 prim = ((SceneObject)ent).HasChildPrim(primLocalID);
265 if (prim != null)
266 {
267 prim.Name = name;
268 break;
269 }
270 }
271 }
272 }
273
231 public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 274 public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
232 { 275 {
233 if (this.Entities.ContainsKey(objectID)) 276 if (this.Entities.ContainsKey(objectID))
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 2ff3976..08adc84 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Environment.Scenes
56 { 56 {
57 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); 57 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
58 protected Dictionary<libsecondlife.LLUUID, ScenePresence> Avatars; 58 protected Dictionary<libsecondlife.LLUUID, ScenePresence> Avatars;
59 protected Dictionary<libsecondlife.LLUUID, Primitive> Prims; 59 protected Dictionary<libsecondlife.LLUUID, SceneObject> Prims;
60 private PhysicsScene phyScene; 60 private PhysicsScene phyScene;
61 private float timeStep = 0.1f; 61 private float timeStep = 0.1f;
62 private Random Rand = new Random(); 62 private Random Rand = new Random();
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Scenes
124 OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating new entitities instance"); 124 OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating new entitities instance");
125 Entities = new Dictionary<libsecondlife.LLUUID, EntityBase>(); 125 Entities = new Dictionary<libsecondlife.LLUUID, EntityBase>();
126 Avatars = new Dictionary<LLUUID, ScenePresence>(); 126 Avatars = new Dictionary<LLUUID, ScenePresence>();
127 Prims = new Dictionary<LLUUID, Primitive>(); 127 Prims = new Dictionary<LLUUID, SceneObject>();
128 128
129 OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating LandMap"); 129 OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating LandMap");
130 Terrain = new TerrainEngine(); 130 Terrain = new TerrainEngine();
@@ -463,6 +463,8 @@ namespace OpenSim.Region.Environment.Scenes
463 client.OnObjectSelect += this.SelectPrim; 463 client.OnObjectSelect += this.SelectPrim;
464 // client.OnGrapUpdate += this.MoveObject; 464 // client.OnGrapUpdate += this.MoveObject;
465 client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; 465 client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest;
466 client.OnObjectDescription += this.PrimDescription;
467 client.OnObjectName += this.PrimName;
466 468
467 /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); 469 /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest);
468 remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); 470 remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest);
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs
index a228638..00df447 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObject.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Environment.Scenes
39{ 39{
40 public class SceneObject : EntityBase 40 public class SceneObject : EntityBase
41 { 41 {
42 42 private System.Text.Encoding enc = System.Text.Encoding.ASCII;
43 private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>(); //list of all primitive id's that are part of this group 43 private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>(); //list of all primitive id's that are part of this group
44 protected Primitive rootPrimitive; 44 protected Primitive rootPrimitive;
45 private Scene m_world; 45 private Scene m_world;
@@ -114,6 +114,19 @@ namespace OpenSim.Region.Environment.Scenes
114 return null; 114 return null;
115 } 115 }
116 116
117 public Primitive HasChildPrim(uint localID)
118 {
119 Primitive returnPrim = null;
120 foreach (Primitive prim in this.children)
121 {
122 if (prim.LocalId == localID)
123 {
124 returnPrim = prim;
125 break;
126 }
127 }
128 return returnPrim;
129 }
117 130
118 /// <summary> 131 /// <summary>
119 /// 132 ///
@@ -141,6 +154,7 @@ namespace OpenSim.Region.Environment.Scenes
141 /// <param name="client"></param> 154 /// <param name="client"></param>
142 public void GetProperites(IClientAPI client) 155 public void GetProperites(IClientAPI client)
143 { 156 {
157
144 //needs changing 158 //needs changing
145 ObjectPropertiesPacket proper = new ObjectPropertiesPacket(); 159 ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
146 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; 160 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
@@ -158,8 +172,8 @@ namespace OpenSim.Region.Environment.Scenes
158 proper.ObjectData[0].TouchName = new byte[0]; 172 proper.ObjectData[0].TouchName = new byte[0];
159 proper.ObjectData[0].TextureID = new byte[0]; 173 proper.ObjectData[0].TextureID = new byte[0];
160 proper.ObjectData[0].SitName = new byte[0]; 174 proper.ObjectData[0].SitName = new byte[0];
161 proper.ObjectData[0].Name = new byte[0]; 175 proper.ObjectData[0].Name = enc.GetBytes(this.rootPrimitive.Name +"\0");
162 proper.ObjectData[0].Description = new byte[0]; 176 proper.ObjectData[0].Description = enc.GetBytes(this.rootPrimitive.Description +"\0");
163 proper.ObjectData[0].OwnerMask = this.rootPrimitive.OwnerMask; 177 proper.ObjectData[0].OwnerMask = this.rootPrimitive.OwnerMask;
164 proper.ObjectData[0].NextOwnerMask = this.rootPrimitive.NextOwnerMask; 178 proper.ObjectData[0].NextOwnerMask = this.rootPrimitive.NextOwnerMask;
165 proper.ObjectData[0].GroupMask = this.rootPrimitive.GroupMask; 179 proper.ObjectData[0].GroupMask = this.rootPrimitive.GroupMask;