aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs25
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs19
3 files changed, 32 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 50171a3..4b30b0d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
47 m_scene = scene; 47 m_scene = scene;
48 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); 48 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
49 m_scene.RegisterModuleInterface<IGodsModule>(this); 49 m_scene.RegisterModuleInterface<IGodsModule>(this);
50 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
50 } 51 }
51 52
52 public void PostInitialise() {} 53 public void PostInitialise() {}
@@ -54,6 +55,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
54 public string Name { get { return "Gods Module"; } } 55 public string Name { get { return "Gods Module"; } }
55 public bool IsSharedModule { get { return false; } } 56 public bool IsSharedModule { get { return false; } }
56 57
58 public void SubscribeToClientEvents(IClientAPI client)
59 {
60 client.OnGodKickUser += KickUser;
61 client.OnRequestGodlikePowers += RequestGodlikePowers;
62 }
63
64 public void UnsubscribeFromClientEvents(IClientAPI client)
65 {
66 client.OnGodKickUser -= KickUser;
67 client.OnRequestGodlikePowers -= RequestGodlikePowers;
68 }
69
57 public void RequestGodlikePowers( 70 public void RequestGodlikePowers(
58 UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) 71 UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient)
59 { 72 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 61817f2..83489e8 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2787,7 +2787,6 @@ namespace OpenSim.Region.Framework.Scenes
2787 SubscribeToClientScriptEvents(client); 2787 SubscribeToClientScriptEvents(client);
2788 SubscribeToClientParcelEvents(client); 2788 SubscribeToClientParcelEvents(client);
2789 SubscribeToClientGridEvents(client); 2789 SubscribeToClientGridEvents(client);
2790 SubscribeToClientGodEvents(client);
2791 SubscribeToClientNetworkEvents(client); 2790 SubscribeToClientNetworkEvents(client);
2792 } 2791 }
2793 2792
@@ -2798,8 +2797,7 @@ namespace OpenSim.Region.Framework.Scenes
2798 } 2797 }
2799 2798
2800 public virtual void SubscribeToClientPrimEvents(IClientAPI client) 2799 public virtual void SubscribeToClientPrimEvents(IClientAPI client)
2801 { 2800 {
2802
2803 client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition; 2801 client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition;
2804 client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition; 2802 client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition;
2805 client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation; 2803 client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation;
@@ -2898,14 +2896,7 @@ namespace OpenSim.Region.Framework.Scenes
2898 client.OnSetStartLocationRequest += SetHomeRezPoint; 2896 client.OnSetStartLocationRequest += SetHomeRezPoint;
2899 client.OnRegionHandleRequest += RegionHandleRequest; 2897 client.OnRegionHandleRequest += RegionHandleRequest;
2900 } 2898 }
2901 2899
2902 public virtual void SubscribeToClientGodEvents(IClientAPI client)
2903 {
2904 IGodsModule godsModule = RequestModuleInterface<IGodsModule>();
2905 client.OnGodKickUser += godsModule.KickUser;
2906 client.OnRequestGodlikePowers += godsModule.RequestGodlikePowers;
2907 }
2908
2909 public virtual void SubscribeToClientNetworkEvents(IClientAPI client) 2900 public virtual void SubscribeToClientNetworkEvents(IClientAPI client)
2910 { 2901 {
2911 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats; 2902 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats;
@@ -2915,6 +2906,7 @@ namespace OpenSim.Region.Framework.Scenes
2915 /// <summary> 2906 /// <summary>
2916 /// Unsubscribe the client from events. 2907 /// Unsubscribe the client from events.
2917 /// </summary> 2908 /// </summary>
2909 /// FIXME: Not called anywhere!
2918 /// <param name="client">The IClientAPI of the client</param> 2910 /// <param name="client">The IClientAPI of the client</param>
2919 public virtual void UnSubscribeToClientEvents(IClientAPI client) 2911 public virtual void UnSubscribeToClientEvents(IClientAPI client)
2920 { 2912 {
@@ -2926,8 +2918,6 @@ namespace OpenSim.Region.Framework.Scenes
2926 UnSubscribeToClientScriptEvents(client); 2918 UnSubscribeToClientScriptEvents(client);
2927 UnSubscribeToClientParcelEvents(client); 2919 UnSubscribeToClientParcelEvents(client);
2928 UnSubscribeToClientGridEvents(client); 2920 UnSubscribeToClientGridEvents(client);
2929 UnSubscribeToClientGodEvents(client);
2930
2931 UnSubscribeToClientNetworkEvents(client); 2921 UnSubscribeToClientNetworkEvents(client);
2932 } 2922 }
2933 2923
@@ -3036,13 +3026,6 @@ namespace OpenSim.Region.Framework.Scenes
3036 client.OnRegionHandleRequest -= RegionHandleRequest; 3026 client.OnRegionHandleRequest -= RegionHandleRequest;
3037 } 3027 }
3038 3028
3039 public virtual void UnSubscribeToClientGodEvents(IClientAPI client)
3040 {
3041 IGodsModule godsModule = RequestModuleInterface<IGodsModule>();
3042 client.OnGodKickUser -= godsModule.KickUser;
3043 client.OnRequestGodlikePowers -= godsModule.RequestGodlikePowers;
3044 }
3045
3046 public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client) 3029 public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client)
3047 { 3030 {
3048 client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats; 3031 client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats;
@@ -5256,4 +5239,4 @@ namespace OpenSim.Region.Framework.Scenes
5256 return offsets.ToArray(); 5239 return offsets.ToArray();
5257 } 5240 }
5258 } 5241 }
5259} 5242} \ No newline at end of file
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs
index 62410e2..a0d6197 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs
@@ -29,6 +29,8 @@ using System;
29using OpenMetaverse; 29using OpenMetaverse;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.CoreModules.Avatar.Attachments; 31using OpenSim.Region.CoreModules.Avatar.Attachments;
32using OpenSim.Region.CoreModules.Avatar.Gods;
33using OpenSim.Region.Framework.Interfaces;
32using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
33 35
34namespace OpenSim.Region.RegionCombinerModule 36namespace OpenSim.Region.RegionCombinerModule
@@ -47,22 +49,31 @@ namespace OpenSim.Region.RegionCombinerModule
47 public void ClientConnect(IClientAPI client) 49 public void ClientConnect(IClientAPI client)
48 { 50 {
49 m_virtScene.UnSubscribeToClientPrimEvents(client); 51 m_virtScene.UnSubscribeToClientPrimEvents(client);
50 m_virtScene.UnSubscribeToClientPrimRezEvents(client); 52 m_virtScene.UnSubscribeToClientPrimRezEvents(client);
51 m_virtScene.UnSubscribeToClientInventoryEvents(client); 53 m_virtScene.UnSubscribeToClientInventoryEvents(client);
52 ((AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client); 54 ((AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client);
53 //m_virtScene.UnSubscribeToClientTeleportEvents(client); 55 //m_virtScene.UnSubscribeToClientTeleportEvents(client);
54 m_virtScene.UnSubscribeToClientScriptEvents(client); 56 m_virtScene.UnSubscribeToClientScriptEvents(client);
55 m_virtScene.UnSubscribeToClientGodEvents(client); 57
58 IGodsModule virtGodsModule = m_virtScene.RequestModuleInterface<IGodsModule>();
59 if (virtGodsModule != null)
60 ((GodsModule)virtGodsModule).UnsubscribeFromClientEvents(client);
61
56 m_virtScene.UnSubscribeToClientNetworkEvents(client); 62 m_virtScene.UnSubscribeToClientNetworkEvents(client);
57 63
58 m_rootScene.SubscribeToClientPrimEvents(client); 64 m_rootScene.SubscribeToClientPrimEvents(client);
59 client.OnAddPrim += LocalAddNewPrim; 65 client.OnAddPrim += LocalAddNewPrim;
60 client.OnRezObject += LocalRezObject; 66 client.OnRezObject += LocalRezObject;
67
61 m_rootScene.SubscribeToClientInventoryEvents(client); 68 m_rootScene.SubscribeToClientInventoryEvents(client);
62 ((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client); 69 ((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client);
63 //m_rootScene.SubscribeToClientTeleportEvents(client); 70 //m_rootScene.SubscribeToClientTeleportEvents(client);
64 m_rootScene.SubscribeToClientScriptEvents(client); 71 m_rootScene.SubscribeToClientScriptEvents(client);
65 m_rootScene.SubscribeToClientGodEvents(client); 72
73 IGodsModule rootGodsModule = m_virtScene.RequestModuleInterface<IGodsModule>();
74 if (rootGodsModule != null)
75 ((GodsModule)rootGodsModule).UnsubscribeFromClientEvents(client);
76
66 m_rootScene.SubscribeToClientNetworkEvents(client); 77 m_rootScene.SubscribeToClientNetworkEvents(client);
67 } 78 }
68 79