aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
authorMW2007-07-13 19:01:09 +0000
committerMW2007-07-13 19:01:09 +0000
commit401af6ad4a16a39e1460abaf30df1a1170069087 (patch)
tree1c40aa36b6f33ce1ff01183dd5c74f584cb358cd /OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
parent* Fixed bug reported by xyzo - region assets are now stored in "regionassets.... (diff)
downloadopensim-SC-401af6ad4a16a39e1460abaf30df1a1170069087.zip
opensim-SC-401af6ad4a16a39e1460abaf30df1a1170069087.tar.gz
opensim-SC-401af6ad4a16a39e1460abaf30df1a1170069087.tar.bz2
opensim-SC-401af6ad4a16a39e1460abaf30df1a1170069087.tar.xz
Prim Copying (both CTRL+D and shift-drag) should now work.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs84
1 files changed, 46 insertions, 38 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 14bf87c..b86e5c8 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
139 /// <param name="fromAgentID"></param> 139 /// <param name="fromAgentID"></param>
140 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 140 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
141 { 141 {
142 // Console.WriteLine("Chat message"); 142 // Console.WriteLine("Chat message");
143 ScenePresence avatar = null; 143 ScenePresence avatar = null;
144 144
145 m_clientManager.ForEachClient(delegate(IClientAPI client) 145 m_clientManager.ForEachClient(delegate(IClientAPI client)
@@ -149,7 +149,7 @@ namespace OpenSim.Region.Environment.Scenes
149 { 149 {
150 avatar = this.Avatars[client.AgentId]; 150 avatar = this.Avatars[client.AgentId];
151 // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y)); 151 // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
152 dis = (int) avatar.Pos.GetDistanceTo(fromPos); 152 dis = (int)avatar.Pos.GetDistanceTo(fromPos);
153 //Console.WriteLine("found avatar at " +dis); 153 //Console.WriteLine("found avatar at " +dis);
154 } 154 }
155 155
@@ -194,7 +194,7 @@ namespace OpenSim.Region.Environment.Scenes
194 /// <param name="pos"></param> 194 /// <param name="pos"></param>
195 public void RezObject(AssetBase primAsset, LLVector3 pos) 195 public void RezObject(AssetBase primAsset, LLVector3 pos)
196 { 196 {
197 197
198 } 198 }
199 199
200 /// <summary> 200 /// <summary>
@@ -204,7 +204,7 @@ namespace OpenSim.Region.Environment.Scenes
204 /// <param name="simClient"></param> 204 /// <param name="simClient"></param>
205 public void DeRezObject(Packet packet, IClientAPI simClient) 205 public void DeRezObject(Packet packet, IClientAPI simClient)
206 { 206 {
207 207
208 } 208 }
209 209
210 /// <summary> 210 /// <summary>
@@ -213,7 +213,7 @@ namespace OpenSim.Region.Environment.Scenes
213 /// <param name="remoteClient"></param> 213 /// <param name="remoteClient"></param>
214 public void SendAvatarsToClient(IClientAPI remoteClient) 214 public void SendAvatarsToClient(IClientAPI remoteClient)
215 { 215 {
216 216
217 } 217 }
218 218
219 /// <summary> 219 /// <summary>
@@ -239,7 +239,15 @@ namespace OpenSim.Region.Environment.Scenes
239 239
240 if (originPrim != null) 240 if (originPrim != null)
241 { 241 {
242 //SceneObject copy = originPrim.Copy(); 242 SceneObject copy = originPrim.Copy();
243 copy.Pos = copy.Pos + offset;
244 this.Entities.Add(copy.rootUUID, copy);
245
246 List<ScenePresence> avatars = this.RequestAvatarList();
247 for (int i = 0; i < avatars.Count; i++)
248 {
249 copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
250 }
243 251
244 } 252 }
245 else 253 else
@@ -256,7 +264,7 @@ namespace OpenSim.Region.Environment.Scenes
256 /// <param name="childPrims"></param> 264 /// <param name="childPrims"></param>
257 public void LinkObjects(uint parentPrim, List<uint> childPrims) 265 public void LinkObjects(uint parentPrim, List<uint> childPrims)
258 { 266 {
259 SceneObject parenPrim = null; 267 SceneObject parenPrim = null;
260 foreach (EntityBase ent in Entities.Values) 268 foreach (EntityBase ent in Entities.Values)
261 { 269 {
262 if (ent is SceneObject) 270 if (ent is SceneObject)
@@ -328,7 +336,7 @@ namespace OpenSim.Region.Environment.Scenes
328 { 336 {
329 if (((SceneObject)ent).rootLocalID == primLocalID) 337 if (((SceneObject)ent).rootLocalID == primLocalID)
330 { 338 {
331 ((SceneObject)ent).GetProperites(remoteClient); 339 ((SceneObject)ent).GetProperites(remoteClient);
332 break; 340 break;
333 } 341 }
334 } 342 }
@@ -342,7 +350,7 @@ namespace OpenSim.Region.Environment.Scenes
342 /// <param name="description"></param> 350 /// <param name="description"></param>
343 public void PrimDescription(uint primLocalID, string description) 351 public void PrimDescription(uint primLocalID, string description)
344 { 352 {
345 Primitive prim = null; 353 Primitive prim = null;
346 foreach (EntityBase ent in Entities.Values) 354 foreach (EntityBase ent in Entities.Values)
347 { 355 {
348 if (ent is SceneObject) 356 if (ent is SceneObject)
@@ -350,7 +358,7 @@ namespace OpenSim.Region.Environment.Scenes
350 prim = ((SceneObject)ent).HasChildPrim(primLocalID); 358 prim = ((SceneObject)ent).HasChildPrim(primLocalID);
351 if (prim != null) 359 if (prim != null)
352 { 360 {
353 prim.Description = description; 361 prim.Description = description;
354 break; 362 break;
355 } 363 }
356 } 364 }
@@ -381,19 +389,19 @@ namespace OpenSim.Region.Environment.Scenes
381 389
382 public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) 390 public void MoveObject(LLUUID objectID, LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
383 { 391 {
384 Primitive prim = null; 392 Primitive prim = null;
385 foreach (EntityBase ent in Entities.Values) 393 foreach (EntityBase ent in Entities.Values)
386 { 394 {
387 if (ent is SceneObject) 395 if (ent is SceneObject)
388 { 396 {
389 prim = ((SceneObject)ent).HasChildPrim(objectID); 397 prim = ((SceneObject)ent).HasChildPrim(objectID);
390 if (prim != null) 398 if (prim != null)
391 { 399 {
392 ((SceneObject)ent).GrapMovement(offset, pos, remoteClient); 400 ((SceneObject)ent).GrapMovement(offset, pos, remoteClient);
393 break; 401 break;
394 } 402 }
395 } 403 }
396 } 404 }
397 /* 405 /*
398 if (this.Entities.ContainsKey(objectID)) 406 if (this.Entities.ContainsKey(objectID))
399 { 407 {
@@ -412,7 +420,7 @@ namespace OpenSim.Region.Environment.Scenes
412 /// <param name="remoteClient"></param> 420 /// <param name="remoteClient"></param>
413 public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient) 421 public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient)
414 { 422 {
415 423
416 } 424 }
417 425
418 /// <summary> 426 /// <summary>
@@ -423,18 +431,18 @@ namespace OpenSim.Region.Environment.Scenes
423 /// <param name="remoteClient"></param> 431 /// <param name="remoteClient"></param>
424 public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) 432 public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
425 { 433 {
426 Primitive prim = null; 434 Primitive prim = null;
427 foreach (EntityBase ent in Entities.Values) 435 foreach (EntityBase ent in Entities.Values)
428 { 436 {
429 if (ent is SceneObject) 437 if (ent is SceneObject)
430 { 438 {
431 prim = ((SceneObject)ent).HasChildPrim(localID); 439 prim = ((SceneObject)ent).HasChildPrim(localID);
432 if (prim != null) 440 if (prim != null)
433 { 441 {
434 prim.UpdateTextureEntry(texture); 442 prim.UpdateTextureEntry(texture);
435 } 443 }
436 } 444 }
437 } 445 }
438 } 446 }
439 447
440 /// <summary> 448 /// <summary>
@@ -494,7 +502,7 @@ namespace OpenSim.Region.Environment.Scenes
494 prim = ((SceneObject)ent).HasChildPrim(localID); 502 prim = ((SceneObject)ent).HasChildPrim(localID);
495 if (prim != null) 503 if (prim != null)
496 { 504 {
497 prim.UpdateGroupMouseRotation( pos, rot); 505 prim.UpdateGroupMouseRotation(pos, rot);
498 break; 506 break;
499 } 507 }
500 } 508 }
@@ -532,7 +540,7 @@ namespace OpenSim.Region.Environment.Scenes
532 /// <param name="remoteClient"></param> 540 /// <param name="remoteClient"></param>
533 public void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) 541 public void UpdatePrimSingleRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient)
534 { 542 {
535 //Console.WriteLine("trying to update single prim rotation"); 543 //Console.WriteLine("trying to update single prim rotation");
536 Primitive prim = null; 544 Primitive prim = null;
537 foreach (EntityBase ent in Entities.Values) 545 foreach (EntityBase ent in Entities.Values)
538 { 546 {