aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs268
1 files changed, 241 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1d0da4c..c25ae10 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2365,14 +2365,40 @@ namespace OpenSim.Region.Framework.Scenes
2365 EventManager.TriggerOnNewClient(client); 2365 EventManager.TriggerOnNewClient(client);
2366 } 2366 }
2367 2367
2368
2369
2368 /// <summary> 2370 /// <summary>
2369 /// Register for events from the client 2371 /// Register for events from the client
2370 /// </summary> 2372 /// </summary>
2371 /// <param name="client">The IClientAPI of the connected client</param> 2373 /// <param name="client">The IClientAPI of the connected client</param>
2372 protected virtual void SubscribeToClientEvents(IClientAPI client) 2374 public virtual void SubscribeToClientEvents(IClientAPI client)
2375 {
2376 SubscribeToClientTerrainEvents(client);
2377 SubscribeToClientPrimEvents(client);
2378 SubscribeToClientPrimRezEvents(client);
2379 SubscribeToClientInventoryEvents(client);
2380 SubscribeToClientAttachmentEvents(client);
2381 SubscribeToClientTeleportEvents(client);
2382 SubscribeToClientScriptEvents(client);
2383 SubscribeToClientParcelEvents(client);
2384 SubscribeToClientGridEvents(client);
2385 SubscribeToClientGodEvents(client);
2386
2387 SubscribeToClientNetworkEvents(client);
2388
2389
2390 // EventManager.TriggerOnNewClient(client);
2391 }
2392
2393 public virtual void SubscribeToClientTerrainEvents(IClientAPI client)
2373 { 2394 {
2374 client.OnRegionHandShakeReply += SendLayerData; 2395 client.OnRegionHandShakeReply += SendLayerData;
2375 client.OnAddPrim += AddNewPrim; 2396 client.OnUnackedTerrain += TerrainUnAcked;
2397 }
2398
2399 public virtual void SubscribeToClientPrimEvents(IClientAPI client)
2400 {
2401
2376 client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition; 2402 client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition;
2377 client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition; 2403 client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition;
2378 client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation; 2404 client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation;
@@ -2384,8 +2410,6 @@ namespace OpenSim.Region.Framework.Scenes
2384 client.OnUpdateExtraParams += m_sceneGraph.UpdateExtraParam; 2410 client.OnUpdateExtraParams += m_sceneGraph.UpdateExtraParam;
2385 client.OnUpdatePrimShape += m_sceneGraph.UpdatePrimShape; 2411 client.OnUpdatePrimShape += m_sceneGraph.UpdatePrimShape;
2386 client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture; 2412 client.OnUpdatePrimTexture += m_sceneGraph.UpdatePrimTexture;
2387 client.OnTeleportLocationRequest += RequestTeleportLocation;
2388 client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
2389 client.OnObjectRequest += RequestPrim; 2413 client.OnObjectRequest += RequestPrim;
2390 client.OnObjectSelect += SelectPrim; 2414 client.OnObjectSelect += SelectPrim;
2391 client.OnObjectDeselect += DeselectPrim; 2415 client.OnObjectDeselect += DeselectPrim;
@@ -2393,15 +2417,7 @@ namespace OpenSim.Region.Framework.Scenes
2393 client.OnSpinStart += m_sceneGraph.SpinStart; 2417 client.OnSpinStart += m_sceneGraph.SpinStart;
2394 client.OnSpinUpdate += m_sceneGraph.SpinObject; 2418 client.OnSpinUpdate += m_sceneGraph.SpinObject;
2395 client.OnDeRezObject += DeRezObject; 2419 client.OnDeRezObject += DeRezObject;
2396 client.OnRezObject += RezObject; 2420
2397 client.OnRezSingleAttachmentFromInv += RezSingleAttachment;
2398 client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments;
2399 client.OnDetachAttachmentIntoInv += DetachSingleAttachmentToInv;
2400 client.OnObjectAttach += m_sceneGraph.AttachObject;
2401 client.OnObjectDetach += m_sceneGraph.DetachObject;
2402 client.OnObjectDrop += m_sceneGraph.DropObject;
2403 client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest;
2404 client.OnObjectDescription += m_sceneGraph.PrimDescription;
2405 client.OnObjectName += m_sceneGraph.PrimName; 2421 client.OnObjectName += m_sceneGraph.PrimName;
2406 client.OnObjectClickAction += m_sceneGraph.PrimClickAction; 2422 client.OnObjectClickAction += m_sceneGraph.PrimClickAction;
2407 client.OnObjectMaterial += m_sceneGraph.PrimMaterial; 2423 client.OnObjectMaterial += m_sceneGraph.PrimMaterial;
@@ -2412,7 +2428,24 @@ namespace OpenSim.Region.Framework.Scenes
2412 client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; 2428 client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags;
2413 client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; 2429 client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily;
2414 client.OnObjectPermissions += HandleObjectPermissionsUpdate; 2430 client.OnObjectPermissions += HandleObjectPermissionsUpdate;
2431 client.OnGrabObject += ProcessObjectGrab;
2432 client.OnDeGrabObject += ProcessObjectDeGrab;
2433 client.OnUndo += m_sceneGraph.HandleUndo;
2434 client.OnObjectDescription += m_sceneGraph.PrimDescription;
2435 client.OnObjectDrop += m_sceneGraph.DropObject;
2436 client.OnObjectSaleInfo += ObjectSaleInfo;
2437 client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable;
2438 client.OnObjectOwner += ObjectOwner;
2439 }
2440
2441 public virtual void SubscribeToClientPrimRezEvents(IClientAPI client)
2442 {
2443 client.OnAddPrim += AddNewPrim;
2444 client.OnRezObject += RezObject;
2445 }
2415 2446
2447 public virtual void SubscribeToClientInventoryEvents(IClientAPI client)
2448 {
2416 client.OnCreateNewInventoryItem += CreateNewInventoryItem; 2449 client.OnCreateNewInventoryItem += CreateNewInventoryItem;
2417 client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder; 2450 client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder;
2418 client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder; 2451 client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder;
@@ -2430,36 +2463,217 @@ namespace OpenSim.Region.Framework.Scenes
2430 client.OnRemoveTaskItem += RemoveTaskInventory; 2463 client.OnRemoveTaskItem += RemoveTaskInventory;
2431 client.OnUpdateTaskInventory += UpdateTaskInventory; 2464 client.OnUpdateTaskInventory += UpdateTaskInventory;
2432 client.OnMoveTaskItem += ClientMoveTaskInventoryItem; 2465 client.OnMoveTaskItem += ClientMoveTaskInventoryItem;
2466 }
2433 2467
2434 client.OnGrabObject += ProcessObjectGrab; 2468 public virtual void SubscribeToClientAttachmentEvents(IClientAPI client)
2435 client.OnDeGrabObject += ProcessObjectDeGrab; 2469 {
2436 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; 2470 client.OnRezSingleAttachmentFromInv += RezSingleAttachment;
2437 client.OnParcelBuy += ProcessParcelBuy; 2471 client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments;
2438 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; 2472 client.OnDetachAttachmentIntoInv += DetachSingleAttachmentToInv;
2439 client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; 2473 client.OnObjectAttach += m_sceneGraph.AttachObject;
2474 client.OnObjectDetach += m_sceneGraph.DetachObject;
2475 }
2476
2477 public virtual void SubscribeToClientTeleportEvents(IClientAPI client)
2478 {
2479 client.OnTeleportLocationRequest += RequestTeleportLocation;
2480 client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
2440 client.OnTeleportHomeRequest += TeleportClientHome; 2481 client.OnTeleportHomeRequest += TeleportClientHome;
2441 client.OnSetStartLocationRequest += SetHomeRezPoint; 2482 }
2442 client.OnUndo += m_sceneGraph.HandleUndo; 2483
2443 client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate; 2484 public virtual void SubscribeToClientScriptEvents(IClientAPI client)
2444 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; 2485 {
2445 client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime;
2446 client.OnObjectSaleInfo += ObjectSaleInfo;
2447 client.OnScriptReset += ProcessScriptReset; 2486 client.OnScriptReset += ProcessScriptReset;
2448 client.OnGetScriptRunning += GetScriptRunning; 2487 client.OnGetScriptRunning += GetScriptRunning;
2449 client.OnSetScriptRunning += SetScriptRunning; 2488 client.OnSetScriptRunning += SetScriptRunning;
2489 }
2490
2491 public virtual void SubscribeToClientParcelEvents(IClientAPI client)
2492 {
2493 client.OnObjectGroupRequest += m_sceneGraph.HandleObjectGroupUpdate;
2494 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
2495 client.OnParcelSetOtherCleanTime += LandChannel.SetParcelOtherCleanTime;
2496 client.OnParcelBuy += ProcessParcelBuy;
2497 }
2498
2499 public virtual void SubscribeToClientGridEvents(IClientAPI client)
2500 {
2501 client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest;
2502 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
2503 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
2504 client.OnSetStartLocationRequest += SetHomeRezPoint;
2450 client.OnRegionHandleRequest += RegionHandleRequest; 2505 client.OnRegionHandleRequest += RegionHandleRequest;
2451 client.OnUnackedTerrain += TerrainUnAcked; 2506 }
2452 client.OnObjectOwner += ObjectOwner;
2453 2507
2508 public virtual void SubscribeToClientGodEvents(IClientAPI client)
2509 {
2454 IGodsModule godsModule = RequestModuleInterface<IGodsModule>(); 2510 IGodsModule godsModule = RequestModuleInterface<IGodsModule>();
2455 client.OnGodKickUser += godsModule.KickUser; 2511 client.OnGodKickUser += godsModule.KickUser;
2456 client.OnRequestGodlikePowers += godsModule.RequestGodlikePowers; 2512 client.OnRequestGodlikePowers += godsModule.RequestGodlikePowers;
2513 }
2457 2514
2515 public virtual void SubscribeToClientNetworkEvents(IClientAPI client)
2516 {
2458 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats; 2517 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats;
2518 }
2519
2520 protected virtual void UnsubscribeToClientEvents(IClientAPI client)
2521 {
2522
2523 }
2524
2525 /// <summary>
2526 /// Register for events from the client
2527 /// </summary>
2528 /// <param name="client">The IClientAPI of the connected client</param>
2529 public virtual void UnSubscribeToClientEvents(IClientAPI client)
2530 {
2531 UnSubscribeToClientTerrainEvents(client);
2532 UnSubscribeToClientPrimEvents(client);
2533 UnSubscribeToClientPrimRezEvents(client);
2534 UnSubscribeToClientInventoryEvents(client);
2535 UnSubscribeToClientAttachmentEvents(client);
2536 UnSubscribeToClientTeleportEvents(client);
2537 UnSubscribeToClientScriptEvents(client);
2538 UnSubscribeToClientParcelEvents(client);
2539 UnSubscribeToClientGridEvents(client);
2540 UnSubscribeToClientGodEvents(client);
2541
2542 UnSubscribeToClientNetworkEvents(client);
2543
2459 2544
2460 // EventManager.TriggerOnNewClient(client); 2545 // EventManager.TriggerOnNewClient(client);
2461 } 2546 }
2462 2547
2548 public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client)
2549 {
2550 client.OnRegionHandShakeReply -= SendLayerData;
2551 client.OnUnackedTerrain -= TerrainUnAcked;
2552 }
2553
2554 public virtual void UnSubscribeToClientPrimEvents(IClientAPI client)
2555 {
2556 client.OnUpdatePrimGroupPosition -= m_sceneGraph.UpdatePrimPosition;
2557 client.OnUpdatePrimSinglePosition -= m_sceneGraph.UpdatePrimSinglePosition;
2558 client.OnUpdatePrimGroupRotation -= m_sceneGraph.UpdatePrimRotation;
2559 client.OnUpdatePrimGroupMouseRotation -= m_sceneGraph.UpdatePrimRotation;
2560 client.OnUpdatePrimSingleRotation -= m_sceneGraph.UpdatePrimSingleRotation;
2561 client.OnUpdatePrimSingleRotationPosition -= m_sceneGraph.UpdatePrimSingleRotationPosition;
2562 client.OnUpdatePrimScale -= m_sceneGraph.UpdatePrimScale;
2563 client.OnUpdatePrimGroupScale -= m_sceneGraph.UpdatePrimGroupScale;
2564 client.OnUpdateExtraParams -= m_sceneGraph.UpdateExtraParam;
2565 client.OnUpdatePrimShape -= m_sceneGraph.UpdatePrimShape;
2566 client.OnUpdatePrimTexture -= m_sceneGraph.UpdatePrimTexture;
2567 client.OnObjectRequest -= RequestPrim;
2568 client.OnObjectSelect -= SelectPrim;
2569 client.OnObjectDeselect -= DeselectPrim;
2570 client.OnGrabUpdate -= m_sceneGraph.MoveObject;
2571 client.OnSpinStart -= m_sceneGraph.SpinStart;
2572 client.OnSpinUpdate -= m_sceneGraph.SpinObject;
2573 client.OnDeRezObject -= DeRezObject;
2574 client.OnObjectName -= m_sceneGraph.PrimName;
2575 client.OnObjectClickAction -= m_sceneGraph.PrimClickAction;
2576 client.OnObjectMaterial -= m_sceneGraph.PrimMaterial;
2577 client.OnLinkObjects -= m_sceneGraph.LinkObjects;
2578 client.OnDelinkObjects -= m_sceneGraph.DelinkObjects;
2579 client.OnObjectDuplicate -= m_sceneGraph.DuplicateObject;
2580 client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay;
2581 client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags;
2582 client.OnRequestObjectPropertiesFamily -= m_sceneGraph.RequestObjectPropertiesFamily;
2583 client.OnObjectPermissions -= HandleObjectPermissionsUpdate;
2584 client.OnGrabObject -= ProcessObjectGrab;
2585 client.OnDeGrabObject -= ProcessObjectDeGrab;
2586 client.OnUndo -= m_sceneGraph.HandleUndo;
2587 client.OnObjectDescription -= m_sceneGraph.PrimDescription;
2588 client.OnObjectDrop -= m_sceneGraph.DropObject;
2589 client.OnObjectSaleInfo -= ObjectSaleInfo;
2590 client.OnObjectIncludeInSearch -= m_sceneGraph.MakeObjectSearchable;
2591 client.OnObjectOwner -= ObjectOwner;
2592 }
2593
2594 public virtual void UnSubscribeToClientPrimRezEvents(IClientAPI client)
2595 {
2596 client.OnAddPrim -= AddNewPrim;
2597 client.OnRezObject -= RezObject;
2598 }
2599
2600
2601 public virtual void UnSubscribeToClientInventoryEvents(IClientAPI client)
2602 {
2603 client.OnCreateNewInventoryItem -= CreateNewInventoryItem;
2604 client.OnCreateNewInventoryFolder -= HandleCreateInventoryFolder;
2605 client.OnUpdateInventoryFolder -= HandleUpdateInventoryFolder;
2606 client.OnMoveInventoryFolder -= HandleMoveInventoryFolder; // 2; //!!
2607 client.OnFetchInventoryDescendents -= HandleFetchInventoryDescendents;
2608 client.OnPurgeInventoryDescendents -= HandlePurgeInventoryDescendents; // 2; //!!
2609 client.OnFetchInventory -= HandleFetchInventory;
2610 client.OnUpdateInventoryItem -= UpdateInventoryItemAsset;
2611 client.OnCopyInventoryItem -= CopyInventoryItem;
2612 client.OnMoveInventoryItem -= MoveInventoryItem;
2613 client.OnRemoveInventoryItem -= RemoveInventoryItem;
2614 client.OnRemoveInventoryFolder -= RemoveInventoryFolder;
2615 client.OnRezScript -= RezScript;
2616 client.OnRequestTaskInventory -= RequestTaskInventory;
2617 client.OnRemoveTaskItem -= RemoveTaskInventory;
2618 client.OnUpdateTaskInventory -= UpdateTaskInventory;
2619 client.OnMoveTaskItem -= ClientMoveTaskInventoryItem;
2620 }
2621
2622 public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client)
2623 {
2624 client.OnRezSingleAttachmentFromInv -= RezSingleAttachment;
2625 client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments;
2626 client.OnDetachAttachmentIntoInv -= DetachSingleAttachmentToInv;
2627 client.OnObjectAttach -= m_sceneGraph.AttachObject;
2628 client.OnObjectDetach -= m_sceneGraph.DetachObject;
2629 }
2630
2631 public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client)
2632 {
2633 client.OnTeleportLocationRequest -= RequestTeleportLocation;
2634 client.OnTeleportLandmarkRequest -= RequestTeleportLandmark;
2635 client.OnTeleportHomeRequest -= TeleportClientHome;
2636 }
2637
2638 public virtual void UnSubscribeToClientScriptEvents(IClientAPI client)
2639 {
2640 client.OnScriptReset -= ProcessScriptReset;
2641 client.OnGetScriptRunning -= GetScriptRunning;
2642 client.OnSetScriptRunning -= SetScriptRunning;
2643 }
2644
2645 public virtual void UnSubscribeToClientParcelEvents(IClientAPI client)
2646 {
2647 client.OnObjectGroupRequest -= m_sceneGraph.HandleObjectGroupUpdate;
2648 client.OnParcelReturnObjectsRequest -= LandChannel.ReturnObjectsInParcel;
2649 client.OnParcelSetOtherCleanTime -= LandChannel.SetParcelOtherCleanTime;
2650 client.OnParcelBuy -= ProcessParcelBuy;
2651 }
2652
2653 public virtual void UnSubscribeToClientGridEvents(IClientAPI client)
2654 {
2655 client.OnNameFromUUIDRequest -= CommsManager.HandleUUIDNameRequest;
2656 client.OnMoneyTransferRequest -= ProcessMoneyTransferRequest;
2657 client.OnAvatarPickerRequest -= ProcessAvatarPickerRequest;
2658 client.OnSetStartLocationRequest -= SetHomeRezPoint;
2659 client.OnRegionHandleRequest -= RegionHandleRequest;
2660 }
2661
2662 public virtual void UnSubscribeToClientGodEvents(IClientAPI client)
2663 {
2664 IGodsModule godsModule = RequestModuleInterface<IGodsModule>();
2665 client.OnGodKickUser -= godsModule.KickUser;
2666 client.OnRequestGodlikePowers -= godsModule.RequestGodlikePowers;
2667 }
2668
2669 public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client)
2670 {
2671 client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats;
2672 }
2673
2674
2675
2676
2463 /// <summary> 2677 /// <summary>
2464 /// Teleport an avatar to their home region 2678 /// Teleport an avatar to their home region
2465 /// </summary> 2679 /// </summary>