diff options
Can change the name and description of a prim.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/General/Interfaces/IClientAPI.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | 29 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Entity.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/EntityBase.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Primitive.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 45 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObject.cs | 20 |
10 files changed, 112 insertions, 10 deletions
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 9c112ae..2110b74 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -51,6 +51,7 @@ namespace OpenSim.Framework.Interfaces | |||
51 | public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); | 51 | public delegate void GenericCall4(Packet packet, IClientAPI remoteClient); |
52 | public delegate void GenericCall5(IClientAPI remoteClient, bool status); | 52 | public delegate void GenericCall5(IClientAPI remoteClient, bool status); |
53 | public delegate void GenericCall6(LLUUID uid); | 53 | public delegate void GenericCall6(LLUUID uid); |
54 | public delegate void GenericCall7(uint localID, string message); | ||
54 | 55 | ||
55 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); | 56 | public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock); |
56 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); | 57 | public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); |
@@ -96,6 +97,8 @@ namespace OpenSim.Framework.Interfaces | |||
96 | 97 | ||
97 | event UpdateShape OnUpdatePrimShape; | 98 | event UpdateShape OnUpdatePrimShape; |
98 | event ObjectSelect OnObjectSelect; | 99 | event ObjectSelect OnObjectSelect; |
100 | event GenericCall7 OnObjectDescription; | ||
101 | event GenericCall7 OnObjectName; | ||
99 | event UpdatePrimFlags OnUpdatePrimFlags; | 102 | event UpdatePrimFlags OnUpdatePrimFlags; |
100 | event UpdatePrimTexture OnUpdatePrimTexture; | 103 | event UpdatePrimTexture OnUpdatePrimTexture; |
101 | event UpdateVector OnUpdatePrimPosition; | 104 | event UpdateVector OnUpdatePrimPosition; |
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 5056f41..7a9c6cf 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -58,6 +58,8 @@ namespace OpenSim.Region.ClientStack | |||
58 | public event GenericCall4 OnAddPrim; | 58 | public event GenericCall4 OnAddPrim; |
59 | public event UpdateShape OnUpdatePrimShape; | 59 | public event UpdateShape OnUpdatePrimShape; |
60 | public event ObjectSelect OnObjectSelect; | 60 | public event ObjectSelect OnObjectSelect; |
61 | public event GenericCall7 OnObjectDescription; | ||
62 | public event GenericCall7 OnObjectName; | ||
61 | public event UpdatePrimFlags OnUpdatePrimFlags; | 63 | public event UpdatePrimFlags OnUpdatePrimFlags; |
62 | public event UpdatePrimTexture OnUpdatePrimTexture; | 64 | public event UpdatePrimTexture OnUpdatePrimTexture; |
63 | public event UpdateVector OnUpdatePrimPosition; | 65 | public event UpdateVector OnUpdatePrimPosition; |
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 0d90968..75d3f65 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -130,7 +130,7 @@ namespace OpenSim.Region.ClientStack | |||
130 | { | 130 | { |
131 | if (OnModifyTerrain != null) | 131 | if (OnModifyTerrain != null) |
132 | { | 132 | { |
133 | OnModifyTerrain(modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, modify.ModifyBlock.BrushSize, | 133 | OnModifyTerrain(modify.ModifyBlock.Height, modify.ModifyBlock.Seconds, modify.ModifyBlock.BrushSize, |
134 | modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West); | 134 | modify.ModifyBlock.Action, modify.ParcelData[0].North, modify.ParcelData[0].West); |
135 | } | 135 | } |
136 | } | 136 | } |
@@ -167,8 +167,8 @@ namespace OpenSim.Region.ClientStack | |||
167 | case PacketType.AgentUpdate: | 167 | case PacketType.AgentUpdate: |
168 | if (OnAgentUpdate != null) | 168 | if (OnAgentUpdate != null) |
169 | { | 169 | { |
170 | AgentUpdatePacket agenUpdate = (AgentUpdatePacket) Pack; | 170 | AgentUpdatePacket agenUpdate = (AgentUpdatePacket)Pack; |
171 | OnAgentUpdate(this, agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotation ); | 171 | OnAgentUpdate(this, agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotation); |
172 | } | 172 | } |
173 | break; | 173 | break; |
174 | case PacketType.AgentAnimation: | 174 | case PacketType.AgentAnimation: |
@@ -274,6 +274,29 @@ namespace OpenSim.Region.ClientStack | |||
274 | OnDeGrapObject(deGrap.ObjectData.LocalID, this); | 274 | OnDeGrapObject(deGrap.ObjectData.LocalID, this); |
275 | } | 275 | } |
276 | break; | 276 | break; |
277 | case PacketType.ObjectDescription: | ||
278 | ObjectDescriptionPacket objDes = (ObjectDescriptionPacket)Pack; | ||
279 | for (int i = 0; i < objDes.ObjectData.Length; i++) | ||
280 | { | ||
281 | if (OnObjectDescription != null) | ||
282 | { | ||
283 | OnObjectDescription(objDes.ObjectData[i].LocalID, enc.GetString(objDes.ObjectData[i].Description)); | ||
284 | } | ||
285 | } | ||
286 | break; | ||
287 | case PacketType.ObjectName: | ||
288 | ObjectNamePacket objName = (ObjectNamePacket)Pack; | ||
289 | for (int i = 0; i < objName.ObjectData.Length; i++) | ||
290 | { | ||
291 | if (OnObjectName != null) | ||
292 | { | ||
293 | OnObjectName(objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name)); | ||
294 | } | ||
295 | } | ||
296 | break; | ||
297 | case PacketType.ObjectPermissions: | ||
298 | //Console.WriteLine("permissions set " + Pack.ToString()); | ||
299 | break; | ||
277 | #endregion | 300 | #endregion |
278 | 301 | ||
279 | #region Inventory/Asset/Other related packets | 302 | #region Inventory/Asset/Other related packets |
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 402a3ca..a36eeb0 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -79,6 +79,7 @@ namespace OpenSim.Region.ClientStack | |||
79 | private int cachedtextureserial = 0; | 79 | private int cachedtextureserial = 0; |
80 | private RegionInfo m_regionData; | 80 | private RegionInfo m_regionData; |
81 | protected AuthenticateSessionsBase m_authenticateSessionsHandler; | 81 | protected AuthenticateSessionsBase m_authenticateSessionsHandler; |
82 | private System.Text.Encoding enc = System.Text.Encoding.ASCII; | ||
82 | 83 | ||
83 | public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions ) | 84 | public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions ) |
84 | { | 85 | { |
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 | ||
35 | namespace OpenSim.Region.Environment.Scenes | 35 | namespace 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; |