diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Gods')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index a542d62..d22f3f4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -49,6 +49,8 @@ using Caps = OpenSim.Framework.Capabilities.Caps; | |||
49 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; | 49 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; |
50 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | 50 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; |
51 | 51 | ||
52 | using Mono.Addins; | ||
53 | |||
52 | namespace OpenSim.Region.CoreModules.Avatar.Gods | 54 | namespace OpenSim.Region.CoreModules.Avatar.Gods |
53 | { | 55 | { |
54 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GodsModule")] | 56 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GodsModule")] |
@@ -62,6 +64,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
62 | 64 | ||
63 | protected Scene m_scene; | 65 | protected Scene m_scene; |
64 | protected IDialogModule m_dialogModule; | 66 | protected IDialogModule m_dialogModule; |
67 | |||
68 | protected Dictionary<UUID, string> m_capsDict = | ||
69 | new Dictionary<UUID, string>(); | ||
70 | |||
65 | protected IDialogModule DialogModule | 71 | protected IDialogModule DialogModule |
66 | { | 72 | { |
67 | get | 73 | get |
@@ -83,6 +89,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
83 | m_scene.RegisterModuleInterface<IGodsModule>(this); | 89 | m_scene.RegisterModuleInterface<IGodsModule>(this); |
84 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | 90 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; |
85 | m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; | 91 | m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; |
92 | m_scene.EventManager.OnClientClosed += OnClientClosed; | ||
86 | scene.EventManager.OnIncomingInstantMessage += | 93 | scene.EventManager.OnIncomingInstantMessage += |
87 | OnIncomingInstantMessage; | 94 | OnIncomingInstantMessage; |
88 | } | 95 | } |
@@ -118,9 +125,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
118 | client.OnRequestGodlikePowers -= RequestGodlikePowers; | 125 | client.OnRequestGodlikePowers -= RequestGodlikePowers; |
119 | } | 126 | } |
120 | 127 | ||
128 | private void OnClientClosed(UUID agentID, Scene scene) | ||
129 | { | ||
130 | m_capsDict.Remove(agentID); | ||
131 | } | ||
132 | |||
121 | private void OnRegisterCaps(UUID agentID, Caps caps) | 133 | private void OnRegisterCaps(UUID agentID, Caps caps) |
122 | { | 134 | { |
123 | string uri = "/CAPS/" + UUID.Random(); | 135 | string uri = "/CAPS/" + UUID.Random(); |
136 | m_capsDict[agentID] = uri; | ||
124 | 137 | ||
125 | caps.RegisterHandler("UntrustedSimulatorMessage", | 138 | caps.RegisterHandler("UntrustedSimulatorMessage", |
126 | new RestStreamHandler("POST", uri, | 139 | new RestStreamHandler("POST", uri, |
@@ -146,6 +159,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
146 | UUID godSessionID = userData["GodSessionID"].AsUUID(); | 159 | UUID godSessionID = userData["GodSessionID"].AsUUID(); |
147 | uint kickFlags = userData["KickFlags"].AsUInteger(); | 160 | uint kickFlags = userData["KickFlags"].AsUInteger(); |
148 | string reason = userData["Reason"].AsString(); | 161 | string reason = userData["Reason"].AsString(); |
162 | |||
149 | ScenePresence god = m_scene.GetScenePresence(godID); | 163 | ScenePresence god = m_scene.GetScenePresence(godID); |
150 | if (god == null || god.ControllingClient.SessionId != godSessionID) | 164 | if (god == null || god.ControllingClient.SessionId != godSessionID) |
151 | return String.Empty; | 165 | return String.Empty; |