aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
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
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')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs14
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/LightShare/LightShareModule.cs49
-rw-r--r--OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs11
-rw-r--r--OpenSim/Region/CoreModules/World/Sun/SunModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/WindModule.cs4
7 files changed, 37 insertions, 55 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index b16ca53..4d8fb90 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
45 private const int DEBUG_CHANNEL = 2147483647; 45 private const int DEBUG_CHANNEL = 2147483647;
46 46
47 private bool m_enabled = true; 47 private bool m_enabled = true;
48 private int m_saydistance = 30; 48 private int m_saydistance = 20;
49 private int m_shoutdistance = 100; 49 private int m_shoutdistance = 100;
50 private int m_whisperdistance = 10; 50 private int m_whisperdistance = 10;
51 private List<Scene> m_scenes = new List<Scene>(); 51 private List<Scene> m_scenes = new List<Scene>();
@@ -242,7 +242,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
242 242
243 foreach (Scene s in m_scenes) 243 foreach (Scene s in m_scenes)
244 { 244 {
245 s.ForEachScenePresence( 245 // This should use ForEachClient, but clients don't have a position.
246 // If camera is moved into client, then camera position can be used
247 s.ForEachRootScenePresence(
246 delegate(ScenePresence presence) 248 delegate(ScenePresence presence)
247 { 249 {
248 ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); 250 ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
@@ -306,12 +308,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
306 308
307 if (c.Scene != null) 309 if (c.Scene != null)
308 { 310 {
309 ((Scene)c.Scene).ForEachRootScenePresence 311 ((Scene)c.Scene).ForEachRootClient
310 ( 312 (
311 delegate(ScenePresence presence) 313 delegate(IClientAPI client)
312 { 314 {
313 IClientAPI client = presence.ControllingClient;
314
315 // don't forward SayOwner chat from objects to 315 // don't forward SayOwner chat from objects to
316 // non-owner agents 316 // non-owner agents
317 if ((c.Type == ChatTypeEnum.Owner) && 317 if ((c.Type == ChatTypeEnum.Owner) &&
@@ -321,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
321 321
322 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, 322 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
323 (byte)sourceType, (byte)ChatAudibleLevel.Fully); 323 (byte)sourceType, (byte)ChatAudibleLevel.Fully);
324 receiverIDs.Add(presence.UUID); 324 receiverIDs.Add(client.AgentId);
325 } 325 }
326 ); 326 );
327 (c.Scene as Scene).EventManager.TriggerOnChatToClients( 327 (c.Scene as Scene).EventManager.TriggerOnChatToClients(
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
index 00556c4..bb2cd1f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
@@ -98,9 +98,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
98 98
99 public void SendGeneralAlert(string message) 99 public void SendGeneralAlert(string message)
100 { 100 {
101 m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) 101 m_scene.ForEachRootClient(delegate(IClientAPI client)
102 { 102 {
103 presence.ControllingClient.SendAlertMessage(message); 103 client.SendAlertMessage(message);
104 }); 104 });
105 } 105 }
106 106
@@ -162,9 +162,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
162 public void SendNotificationToUsersInRegion( 162 public void SendNotificationToUsersInRegion(
163 UUID fromAvatarID, string fromAvatarName, string message) 163 UUID fromAvatarID, string fromAvatarName, string message)
164 { 164 {
165 m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) 165 m_scene.ForEachRootClient(delegate(IClientAPI client)
166 { 166 {
167 presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message); 167 client.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
168 }); 168 });
169 } 169 }
170 170
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()
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
index a14a84b..640a60b 100644
--- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
@@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
95 private Queue m_pendingQ; 95 private Queue m_pendingQ;
96 private Scene m_scene; 96 private Scene m_scene;
97 private int m_whisperdistance = 10; 97 private int m_whisperdistance = 10;
98 private int m_saydistance = 30; 98 private int m_saydistance = 20;
99 private int m_shoutdistance = 100; 99 private int m_shoutdistance = 100;
100 100
101 #region IRegionModule Members 101 #region IRegionModule Members
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 1471bc9..0067615 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -678,13 +678,14 @@ namespace OpenSim.Region.CoreModules.World.Estate
678 if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false)) 678 if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
679 return; 679 return;
680 680
681 Scene.ForEachRootScenePresence(delegate(ScenePresence p) 681 Scene.ForEachRootClient(delegate(IClientAPI client)
682 { 682 {
683 if (p.UUID != senderID) 683 if (client.AgentId != senderID)
684 { 684 {
685 // make sure they are still there, we could be working down a long list 685 // make sure they are still there, we could be working down a long list
686 // Also make sure they are actually in the region 686 // Also make sure they are actually in the region
687 if (p != null && !p.IsChildAgent) 687 ScenePresence p;
688 if(Scene.TryGetScenePresence(client.AgentId, out p))
688 { 689 {
689 if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient)) 690 if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient))
690 { 691 {
@@ -952,9 +953,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
952 953
953 public void sendRegionInfoPacketToAll() 954 public void sendRegionInfoPacketToAll()
954 { 955 {
955 Scene.ForEachRootScenePresence(delegate(ScenePresence sp) 956 Scene.ForEachRootClient(delegate(IClientAPI client)
956 { 957 {
957 HandleRegionInfoRequest(sp.ControllingClient); 958 HandleRegionInfoRequest(client);
958 }); 959 });
959 } 960 }
960 961
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
index d2c1289..a838e1e 100644
--- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
@@ -488,9 +488,9 @@ namespace OpenSim.Region.CoreModules
488 488
489 private void SunUpdateToAllClients() 489 private void SunUpdateToAllClients()
490 { 490 {
491 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp) 491 m_scene.ForEachRootClient(delegate(IClientAPI client)
492 { 492 {
493 SunToClient(sp.ControllingClient); 493 SunToClient(client);
494 }); 494 });
495 } 495 }
496 496
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
index bea5db1..a488725 100644
--- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
@@ -435,9 +435,9 @@ namespace OpenSim.Region.CoreModules
435 m_frameLastUpdateClientArray = m_frame; 435 m_frameLastUpdateClientArray = m_frame;
436 } 436 }
437 437
438 m_scene.ForEachRootScenePresence(delegate(ScenePresence sp) 438 m_scene.ForEachRootClient(delegate(IClientAPI client)
439 { 439 {
440 sp.ControllingClient.SendWindData(windSpeeds); 440 client.SendWindData(windSpeeds);
441 }); 441 });
442 } 442 }
443 } 443 }