aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/LightShare
diff options
context:
space:
mode:
authorMelanie2011-11-04 01:18:37 +0000
committerMelanie2011-11-04 01:18:37 +0000
commit24235006f473cec56213705ce70df781cf9bcbc1 (patch)
tree7d0e75978d48272827c3f03f087bf79658dd16cf /OpenSim/Region/CoreModules/LightShare
parentMerge branch 'master' into bigmerge (diff)
parentRename ForEachAvatar back to ForEachScenePresence. The other changes (diff)
downloadopensim-SC-24235006f473cec56213705ce70df781cf9bcbc1.zip
opensim-SC-24235006f473cec56213705ce70df781cf9bcbc1.tar.gz
opensim-SC-24235006f473cec56213705ce70df781cf9bcbc1.tar.bz2
opensim-SC-24235006f473cec56213705ce70df781cf9bcbc1.tar.xz
Merge branch 'master' into bigmerge
Conflicts: OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs OpenSim/Region/CoreModules/LightShare/LightShareModule.cs OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/LightShare')
-rw-r--r--OpenSim/Region/CoreModules/LightShare/LightShareModule.cs49
1 files changed, 15 insertions, 34 deletions
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
index 93e65c3..41a80ce 100644
--- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
+++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs
@@ -145,58 +145,39 @@ 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 if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) 165 if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
185 m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client"); 166 m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
186 SendProfileToClient(presence); 167 SendProfileToClient(presence.ControllingClient);
187 } 168 }
169
188 private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID) 170 private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID)
189 { 171 {
190 ScenePresence Sc; 172 IClientAPI client;
191 if (m_scene.TryGetScenePresence(pUUID,out Sc)) 173 m_scene.TryGetClient(pUUID, out client);
192 { 174 SendProfileToClient(client, wl);
193 SendProfileToClient(Sc,wl);
194 }
195 } 175 }
176
196 private void EventManager_OnSaveNewWindlightProfile() 177 private void EventManager_OnSaveNewWindlightProfile()
197 { 178 {
198 if (m_scene.RegionInfo.WindlightSettings.valid) 179 if (m_scene.RegionInfo.WindlightSettings.valid)
199 m_scene.ForEachScenePresence(SendProfileToClient); 180 m_scene.ForEachRootClient(SendProfileToClient);
200 } 181 }
201 182
202 public void PostInitialise() 183 public void PostInitialise()