diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/LightShare/LightShareModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/LightShare/LightShareModule.cs | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index 2de8d7a..cabbd31 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs | |||
@@ -145,57 +145,38 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
145 | param.Add(mBlock); | 145 | param.Add(mBlock); |
146 | return param; | 146 | return param; |
147 | } | 147 | } |
148 | public void SendProfileToClient(ScenePresence presence) | 148 | |
149 | public void SendProfileToClient(IClientAPI client) | ||
149 | { | 150 | { |
150 | IClientAPI client = presence.ControllingClient; | 151 | SendProfileToClient(client, m_scene.RegionInfo.WindlightSettings); |
151 | if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) | ||
152 | { | ||
153 | if (presence.IsChildAgent == false) | ||
154 | { | ||
155 | List<byte[]> param = compileWindlightSettings(m_scene.RegionInfo.WindlightSettings); | ||
156 | client.SendGenericMessage("Windlight", param); | ||
157 | } | ||
158 | } | ||
159 | else | ||
160 | { | ||
161 | //We probably don't want to spam chat with this.. probably | ||
162 | //m_log.Debug("[WINDLIGHT]: Module disabled"); | ||
163 | } | ||
164 | } | 152 | } |
165 | public void SendProfileToClient(ScenePresence presence, RegionLightShareData wl) | 153 | |
154 | public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) | ||
166 | { | 155 | { |
167 | IClientAPI client = presence.ControllingClient; | ||
168 | if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) | 156 | if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) |
169 | { | 157 | { |
170 | if (presence.IsChildAgent == false) | 158 | List<byte[]> param = compileWindlightSettings(wl); |
171 | { | 159 | client.SendGenericMessage("Windlight", param); |
172 | List<byte[]> param = compileWindlightSettings(wl); | ||
173 | client.SendGenericMessage("Windlight", param); | ||
174 | } | ||
175 | } | ||
176 | else | ||
177 | { | ||
178 | //We probably don't want to spam chat with this.. probably | ||
179 | //m_log.Debug("[WINDLIGHT]: Module disabled"); | ||
180 | } | 160 | } |
181 | } | 161 | } |
162 | |||
182 | private void EventManager_OnMakeRootAgent(ScenePresence presence) | 163 | private void EventManager_OnMakeRootAgent(ScenePresence presence) |
183 | { | 164 | { |
184 | m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client"); | 165 | m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client"); |
185 | SendProfileToClient(presence); | 166 | SendProfileToClient(presence.ControllingClient); |
186 | } | 167 | } |
168 | |||
187 | private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID) | 169 | private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID) |
188 | { | 170 | { |
189 | ScenePresence Sc; | 171 | IClientAPI client; |
190 | if (m_scene.TryGetScenePresence(pUUID,out Sc)) | 172 | m_scene.TryGetClient(pUUID, out client); |
191 | { | 173 | SendProfileToClient(client, wl); |
192 | SendProfileToClient(Sc,wl); | ||
193 | } | ||
194 | } | 174 | } |
175 | |||
195 | private void EventManager_OnSaveNewWindlightProfile() | 176 | private void EventManager_OnSaveNewWindlightProfile() |
196 | { | 177 | { |
197 | if (m_scene.RegionInfo.WindlightSettings.valid) | 178 | if (m_scene.RegionInfo.WindlightSettings.valid) |
198 | m_scene.ForEachScenePresence(SendProfileToClient); | 179 | m_scene.ForEachRootClient(SendProfileToClient); |
199 | } | 180 | } |
200 | 181 | ||
201 | public void PostInitialise() | 182 | public void PostInitialise() |