aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
authorlbsa712007-09-19 00:30:55 +0000
committerlbsa712007-09-19 00:30:55 +0000
commit8f0b03597b0bc8ea6873af9a55495407fae1ec56 (patch)
treef9f4de38379aebf2223ad4cb10a3d9ebcfa52a4f /OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
parent* Moved SendLogoutPacket back to IClientAPI. (diff)
downloadopensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.zip
opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.gz
opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.bz2
opensim-SC-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.xz
* Modernized ScriptManager to new interface-based module calls.
* 'remove redundant this qualifier' ftw
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs115
1 files changed, 55 insertions, 60 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 881b4a1..5a7dda5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -25,17 +25,11 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.IO;
30using System.Collections.Generic; 28using System.Collections.Generic;
31using libsecondlife; 29using libsecondlife;
32using libsecondlife.Packets; 30using libsecondlife.Packets;
31using OpenSim.Framework.Console;
33using OpenSim.Framework.Interfaces; 32using OpenSim.Framework.Interfaces;
34using OpenSim.Framework.Types;
35using OpenSim.Framework.Communications.Caches;
36using OpenSim.Framework.Data;
37using OpenSim.Framework.Utilities;
38using OpenSim.Region.Environment.Interfaces;
39 33
40namespace OpenSim.Region.Environment.Scenes 34namespace OpenSim.Region.Environment.Scenes
41{ 35{
@@ -50,7 +44,8 @@ namespace OpenSim.Region.Environment.Scenes
50 /// <param name="action">The action to be performed</param> 44 /// <param name="action">The action to be performed</param>
51 /// <param name="north">Distance from the north border where the cursor is located</param> 45 /// <param name="north">Distance from the north border where the cursor is located</param>
52 /// <param name="west">Distance from the west border where the cursor is located</param> 46 /// <param name="west">Distance from the west border where the cursor is located</param>
53 public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west, IClientAPI remoteUser) 47 public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west,
48 IClientAPI remoteUser)
54 { 49 {
55 // Do a permissions check before allowing terraforming. 50 // Do a permissions check before allowing terraforming.
56 // random users are now no longer allowed to terraform 51 // random users are now no longer allowed to terraform
@@ -71,17 +66,19 @@ namespace OpenSim.Region.Environment.Scenes
71 /// <param name="timestamp"></param> 66 /// <param name="timestamp"></param>
72 /// <param name="fromAgentName"></param> 67 /// <param name="fromAgentName"></param>
73 /// <param name="message"></param> 68 /// <param name="message"></param>
74 public void InstantMessage(LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog) 69 public void InstantMessage(LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID,
70 uint timestamp, string fromAgentName, string message, byte dialog)
75 { 71 {
76 if (this.Avatars.ContainsKey(toAgentID)) 72 if (Avatars.ContainsKey(toAgentID))
77 { 73 {
78 if (this.Avatars.ContainsKey(fromAgentID)) 74 if (Avatars.ContainsKey(fromAgentID))
79 { 75 {
80 // Local sim message 76 // Local sim message
81 ScenePresence fromAvatar = this.Avatars[fromAgentID]; 77 ScenePresence fromAvatar = Avatars[fromAgentID];
82 ScenePresence toAvatar = this.Avatars[toAgentID]; 78 ScenePresence toAvatar = Avatars[toAgentID];
83 string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname; 79 string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname;
84 toAvatar.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, toAgentID, imSessionID, fromName, dialog, timestamp); 80 toAvatar.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, toAgentID,
81 imSessionID, fromName, dialog, timestamp);
85 } 82 }
86 else 83 else
87 { 84 {
@@ -102,7 +99,8 @@ namespace OpenSim.Region.Environment.Scenes
102 /// <param name="fromPos"></param> 99 /// <param name="fromPos"></param>
103 /// <param name="fromName"></param> 100 /// <param name="fromName"></param>
104 /// <param name="fromAgentID"></param> 101 /// <param name="fromAgentID"></param>
105 public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 102 public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName,
103 LLUUID fromAgentID)
106 { 104 {
107 if (m_simChatModule != null) 105 if (m_simChatModule != null)
108 { 106 {
@@ -123,9 +121,9 @@ namespace OpenSim.Region.Environment.Scenes
123 { 121 {
124 if (ent is SceneObjectGroup) 122 if (ent is SceneObjectGroup)
125 { 123 {
126 if (((SceneObjectGroup)ent).LocalId == originalPrim) 124 if (((SceneObjectGroup) ent).LocalId == originalPrim)
127 { 125 {
128 originPrim = (SceneObjectGroup)ent; 126 originPrim = (SceneObjectGroup) ent;
129 break; 127 break;
130 } 128 }
131 } 129 }
@@ -135,7 +133,7 @@ namespace OpenSim.Region.Environment.Scenes
135 { 133 {
136 SceneObjectGroup copy = originPrim.Copy(); 134 SceneObjectGroup copy = originPrim.Copy();
137 copy.AbsolutePosition = copy.AbsolutePosition + offset; 135 copy.AbsolutePosition = copy.AbsolutePosition + offset;
138 this.Entities.Add(copy.UUID, copy); 136 Entities.Add(copy.UUID, copy);
139 137
140 copy.ScheduleGroupForFullUpdate(); 138 copy.ScheduleGroupForFullUpdate();
141 /* List<ScenePresence> avatars = this.RequestAvatarList(); 139 /* List<ScenePresence> avatars = this.RequestAvatarList();
@@ -143,13 +141,11 @@ namespace OpenSim.Region.Environment.Scenes
143 { 141 {
144 // copy.SendAllChildPrimsToClient(avatars[i].ControllingClient); 142 // copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
145 }*/ 143 }*/
146
147 } 144 }
148 else 145 else
149 { 146 {
150 OpenSim.Framework.Console.MainLog.Instance.Warn("client", "Attempted to duplicate nonexistant prim"); 147 MainLog.Instance.Warn("client", "Attempted to duplicate nonexistant prim");
151 } 148 }
152
153 } 149 }
154 150
155 /// <summary> 151 /// <summary>
@@ -164,9 +160,9 @@ namespace OpenSim.Region.Environment.Scenes
164 { 160 {
165 if (ent is SceneObjectGroup) 161 if (ent is SceneObjectGroup)
166 { 162 {
167 if (((SceneObjectGroup)ent).LocalId == parentPrim) 163 if (((SceneObjectGroup) ent).LocalId == parentPrim)
168 { 164 {
169 parenPrim = (SceneObjectGroup)ent; 165 parenPrim = (SceneObjectGroup) ent;
170 break; 166 break;
171 } 167 }
172 } 168 }
@@ -181,9 +177,9 @@ namespace OpenSim.Region.Environment.Scenes
181 { 177 {
182 if (ent is SceneObjectGroup) 178 if (ent is SceneObjectGroup)
183 { 179 {
184 if (((SceneObjectGroup)ent).LocalId == childPrims[i]) 180 if (((SceneObjectGroup) ent).LocalId == childPrims[i])
185 { 181 {
186 children.Add((SceneObjectGroup)ent); 182 children.Add((SceneObjectGroup) ent);
187 } 183 }
188 } 184 }
189 } 185 }
@@ -208,10 +204,10 @@ namespace OpenSim.Region.Environment.Scenes
208 { 204 {
209 if (ent is SceneObjectGroup) 205 if (ent is SceneObjectGroup)
210 { 206 {
211 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID); 207 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID);
212 if (hasPrim != false) 208 if (hasPrim != false)
213 { 209 {
214 ((SceneObjectGroup)ent).UpdateShape(shapeBlock, primLocalID); 210 ((SceneObjectGroup) ent).UpdateShape(shapeBlock, primLocalID);
215 break; 211 break;
216 } 212 }
217 } 213 }
@@ -225,10 +221,10 @@ namespace OpenSim.Region.Environment.Scenes
225 { 221 {
226 if (ent is SceneObjectGroup) 222 if (ent is SceneObjectGroup)
227 { 223 {
228 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID); 224 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID);
229 if (hasPrim != false) 225 if (hasPrim != false)
230 { 226 {
231 ((SceneObjectGroup)ent).UpdateExtraParam(primLocalID, type, inUse, data); 227 ((SceneObjectGroup) ent).UpdateExtraParam(primLocalID, type, inUse, data);
232 break; 228 break;
233 } 229 }
234 } 230 }
@@ -246,11 +242,11 @@ namespace OpenSim.Region.Environment.Scenes
246 { 242 {
247 if (ent is SceneObjectGroup) 243 if (ent is SceneObjectGroup)
248 { 244 {
249 if (((SceneObjectGroup)ent).LocalId == primLocalID) 245 if (((SceneObjectGroup) ent).LocalId == primLocalID)
250 { 246 {
251 ((SceneObjectGroup)ent).GetProperites(remoteClient); 247 ((SceneObjectGroup) ent).GetProperites(remoteClient);
252 ((SceneObjectGroup)ent).IsSelected = true; 248 ((SceneObjectGroup) ent).IsSelected = true;
253 this.LandManager.setPrimsTainted(); 249 LandManager.setPrimsTainted();
254 break; 250 break;
255 } 251 }
256 } 252 }
@@ -268,10 +264,10 @@ namespace OpenSim.Region.Environment.Scenes
268 { 264 {
269 if (ent is SceneObjectGroup) 265 if (ent is SceneObjectGroup)
270 { 266 {
271 if (((SceneObjectGroup)ent).LocalId == primLocalID) 267 if (((SceneObjectGroup) ent).LocalId == primLocalID)
272 { 268 {
273 ((SceneObjectGroup)ent).IsSelected = false; 269 ((SceneObjectGroup) ent).IsSelected = false;
274 this.LandManager.setPrimsTainted(); 270 LandManager.setPrimsTainted();
275 break; 271 break;
276 } 272 }
277 } 273 }
@@ -290,10 +286,10 @@ namespace OpenSim.Region.Environment.Scenes
290 { 286 {
291 if (ent is SceneObjectGroup) 287 if (ent is SceneObjectGroup)
292 { 288 {
293 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID); 289 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID);
294 if (hasPrim != false) 290 if (hasPrim != false)
295 { 291 {
296 ((SceneObjectGroup)ent).SetPartDescription(description, primLocalID); 292 ((SceneObjectGroup) ent).SetPartDescription(description, primLocalID);
297 break; 293 break;
298 } 294 }
299 } 295 }
@@ -312,10 +308,10 @@ namespace OpenSim.Region.Environment.Scenes
312 { 308 {
313 if (ent is SceneObjectGroup) 309 if (ent is SceneObjectGroup)
314 { 310 {
315 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(primLocalID); 311 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(primLocalID);
316 if (hasPrim != false) 312 if (hasPrim != false)
317 { 313 {
318 ((SceneObjectGroup)ent).SetPartName(name, primLocalID); 314 ((SceneObjectGroup) ent).SetPartName(name, primLocalID);
319 break; 315 break;
320 } 316 }
321 } 317 }
@@ -331,10 +327,10 @@ namespace OpenSim.Region.Environment.Scenes
331 { 327 {
332 if (ent is SceneObjectGroup) 328 if (ent is SceneObjectGroup)
333 { 329 {
334 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(objectID); 330 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(objectID);
335 if (hasPrim != false) 331 if (hasPrim != false)
336 { 332 {
337 ((SceneObjectGroup)ent).GrabMovement(offset, pos, remoteClient); 333 ((SceneObjectGroup) ent).GrabMovement(offset, pos, remoteClient);
338 break; 334 break;
339 } 335 }
340 } 336 }
@@ -350,7 +346,6 @@ namespace OpenSim.Region.Environment.Scenes
350 /// <param name="remoteClient"></param> 346 /// <param name="remoteClient"></param>
351 public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient) 347 public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient)
352 { 348 {
353
354 } 349 }
355 350
356 /// <summary> 351 /// <summary>
@@ -366,10 +361,10 @@ namespace OpenSim.Region.Environment.Scenes
366 { 361 {
367 if (ent is SceneObjectGroup) 362 if (ent is SceneObjectGroup)
368 { 363 {
369 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 364 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
370 if (hasPrim != false) 365 if (hasPrim != false)
371 { 366 {
372 ((SceneObjectGroup)ent).UpdateTextureEntry(localID, texture); 367 ((SceneObjectGroup) ent).UpdateTextureEntry(localID, texture);
373 break; 368 break;
374 } 369 }
375 } 370 }
@@ -389,10 +384,10 @@ namespace OpenSim.Region.Environment.Scenes
389 { 384 {
390 if (ent is SceneObjectGroup) 385 if (ent is SceneObjectGroup)
391 { 386 {
392 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 387 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
393 if (hasPrim != false) 388 if (hasPrim != false)
394 { 389 {
395 ((SceneObjectGroup)ent).UpdateGroupPosition(pos); 390 ((SceneObjectGroup) ent).UpdateGroupPosition(pos);
396 break; 391 break;
397 } 392 }
398 } 393 }
@@ -406,10 +401,10 @@ namespace OpenSim.Region.Environment.Scenes
406 { 401 {
407 if (ent is SceneObjectGroup) 402 if (ent is SceneObjectGroup)
408 { 403 {
409 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 404 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
410 if (hasPrim != false) 405 if (hasPrim != false)
411 { 406 {
412 ((SceneObjectGroup)ent).UpdateSinglePosition(pos, localID); 407 ((SceneObjectGroup) ent).UpdateSinglePosition(pos, localID);
413 break; 408 break;
414 } 409 }
415 } 410 }
@@ -430,10 +425,10 @@ namespace OpenSim.Region.Environment.Scenes
430 { 425 {
431 if (ent is SceneObjectGroup) 426 if (ent is SceneObjectGroup)
432 { 427 {
433 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 428 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
434 if (hasPrim != false) 429 if (hasPrim != false)
435 { 430 {
436 ((SceneObjectGroup)ent).UpdateGroupRotation(pos, rot); 431 ((SceneObjectGroup) ent).UpdateGroupRotation(pos, rot);
437 break; 432 break;
438 } 433 }
439 } 434 }
@@ -453,10 +448,10 @@ namespace OpenSim.Region.Environment.Scenes
453 { 448 {
454 if (ent is SceneObjectGroup) 449 if (ent is SceneObjectGroup)
455 { 450 {
456 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 451 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
457 if (hasPrim != false) 452 if (hasPrim != false)
458 { 453 {
459 ((SceneObjectGroup)ent).UpdateGroupRotation(rot); 454 ((SceneObjectGroup) ent).UpdateGroupRotation(rot);
460 break; 455 break;
461 } 456 }
462 } 457 }
@@ -476,10 +471,10 @@ namespace OpenSim.Region.Environment.Scenes
476 { 471 {
477 if (ent is SceneObjectGroup) 472 if (ent is SceneObjectGroup)
478 { 473 {
479 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 474 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
480 if (hasPrim != false) 475 if (hasPrim != false)
481 { 476 {
482 ((SceneObjectGroup)ent).UpdateSingleRotation(rot, localID); 477 ((SceneObjectGroup) ent).UpdateSingleRotation(rot, localID);
483 break; 478 break;
484 } 479 }
485 } 480 }
@@ -499,10 +494,10 @@ namespace OpenSim.Region.Environment.Scenes
499 { 494 {
500 if (ent is SceneObjectGroup) 495 if (ent is SceneObjectGroup)
501 { 496 {
502 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 497 hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
503 if (hasPrim != false) 498 if (hasPrim != false)
504 { 499 {
505 ((SceneObjectGroup)ent).Resize(scale, localID); 500 ((SceneObjectGroup) ent).Resize(scale, localID);
506 break; 501 break;
507 } 502 }
508 } 503 }
@@ -511,7 +506,7 @@ namespace OpenSim.Region.Environment.Scenes
511 506
512 public void StartAnimation(IClientAPI client, LLUUID animID, int seq) 507 public void StartAnimation(IClientAPI client, LLUUID animID, int seq)
513 { 508 {
514 List<ScenePresence> avatars = this.RequestAvatarList(); 509 List<ScenePresence> avatars = RequestAvatarList();
515 for (int i = 0; i < avatars.Count; i++) 510 for (int i = 0; i < avatars.Count; i++)
516 { 511 {
517 avatars[i].ControllingClient.SendAnimation(animID, seq, client.AgentId); 512 avatars[i].ControllingClient.SendAnimation(animID, seq, client.AgentId);
@@ -520,7 +515,7 @@ namespace OpenSim.Region.Environment.Scenes
520 515
521 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 516 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
522 { 517 {
523 this.EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient); 518 EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient);
524 } 519 }
525 } 520 }
526} 521} \ No newline at end of file