aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/LightShare
diff options
context:
space:
mode:
authorDan Lake2011-11-03 17:06:08 -0700
committerDan Lake2011-11-03 17:06:08 -0700
commit94dc7d07ebc22ce0e0d9b77e91538ddc90799bee (patch)
tree0d2ffc74fa937af0ca5d9e6fb2fafeac2c37dd61 /OpenSim/Region/CoreModules/LightShare
parentremove the pointless check of the face texture struct against null in Bot.Obj... (diff)
downloadopensim-SC_OLD-94dc7d07ebc22ce0e0d9b77e91538ddc90799bee.zip
opensim-SC_OLD-94dc7d07ebc22ce0e0d9b77e91538ddc90799bee.tar.gz
opensim-SC_OLD-94dc7d07ebc22ce0e0d9b77e91538ddc90799bee.tar.bz2
opensim-SC_OLD-94dc7d07ebc22ce0e0d9b77e91538ddc90799bee.tar.xz
Renamed ForEachRootScenePresence to ForEachAvatar. Cleaned up calls to
the 3 iteration functions so more of them are using the correct iteration for the action they are performing. The 3 iterators that seem to fit all actions within OpenSim at this time are: ForEachAvatar: Perform an action on all avatars (root presences) ForEachClient: Perform an action on all clients (root or child clients) ForEachRootClient: Perform an action on all clients that have an avatar There are still a dozen places or so calling the old ForEachScenePresence that will take a little more refactoring to eliminate.
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 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()