aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs16
1 files changed, 7 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index bf98b0d..1445edf 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -149,15 +149,13 @@ namespace OpenSim.Region.Environment.Scenes
149 avatar = null; 149 avatar = null;
150 } 150 }
151 151
152 m_clientManager.ForEachClient(delegate(IClientAPI client) 152 this.ForEachScenePresence(delegate(ScenePresence presence)
153 { 153 {
154 int dis = -1000; 154 int dis = -1000;
155 if (this.Avatars.ContainsKey(client.AgentId)) 155 if (this.Avatars.ContainsKey(presence.ControllingClient.AgentId))
156 { 156 {
157 avatar = this.Avatars[client.AgentId]; 157 avatar = this.Avatars[presence.ControllingClient.AgentId];
158 // int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
159 dis = (int)avatar.Pos.GetDistanceTo(fromPos); 158 dis = (int)avatar.Pos.GetDistanceTo(fromPos);
160 //Console.WriteLine("found avatar at " +dis);
161 } 159 }
162 160
163 switch (type) 161 switch (type)
@@ -166,7 +164,7 @@ namespace OpenSim.Region.Environment.Scenes
166 if ((dis < 10) && (dis > -10)) 164 if ((dis < 10) && (dis > -10))
167 { 165 {
168 //should change so the message is sent through the avatar rather than direct to the ClientView 166 //should change so the message is sent through the avatar rather than direct to the ClientView
169 client.SendChatMessage(message, type, fromPos, fromName, 167 presence.ControllingClient.SendChatMessage(message, type, fromPos, fromName,
170 fromAgentID); 168 fromAgentID);
171 } 169 }
172 break; 170 break;
@@ -174,20 +172,20 @@ namespace OpenSim.Region.Environment.Scenes
174 if ((dis < 30) && (dis > -30)) 172 if ((dis < 30) && (dis > -30))
175 { 173 {
176 //Console.WriteLine("sending chat"); 174 //Console.WriteLine("sending chat");
177 client.SendChatMessage(message, type, fromPos, fromName, 175 presence.ControllingClient.SendChatMessage(message, type, fromPos, fromName,
178 fromAgentID); 176 fromAgentID);
179 } 177 }
180 break; 178 break;
181 case 2: // Shout 179 case 2: // Shout
182 if ((dis < 100) && (dis > -100)) 180 if ((dis < 100) && (dis > -100))
183 { 181 {
184 client.SendChatMessage(message, type, fromPos, fromName, 182 presence.ControllingClient.SendChatMessage(message, type, fromPos, fromName,
185 fromAgentID); 183 fromAgentID);
186 } 184 }
187 break; 185 break;
188 186
189 case 0xff: // Broadcast 187 case 0xff: // Broadcast
190 client.SendChatMessage(message, type, fromPos, fromName, 188 presence.ControllingClient.SendChatMessage(message, type, fromPos, fromName,
191 fromAgentID); 189 fromAgentID);
192 break; 190 break;
193 } 191 }