aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJeff Ames2007-12-13 07:10:32 +0000
committerJeff Ames2007-12-13 07:10:32 +0000
commit83ca8bd178c397c58d13e2a7fd089f2d2998784b (patch)
treeacdbc9926d69b84707c5762e38a248b303ead43f
parentset svn:eol-style (diff)
downloadopensim-SC-83ca8bd178c397c58d13e2a7fd089f2d2998784b.zip
opensim-SC-83ca8bd178c397c58d13e2a7fd089f2d2998784b.tar.gz
opensim-SC-83ca8bd178c397c58d13e2a7fd089f2d2998784b.tar.bz2
opensim-SC-83ca8bd178c397c58d13e2a7fd089f2d2998784b.tar.xz
Fix for #176 (... doesn't appear in chat bubbles). This also gets the viewer to handle starting/stopping of the typing animation.
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs25
-rw-r--r--OpenSim/Region/Environment/Modules/ChatModule.cs61
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs17
3 files changed, 27 insertions, 76 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 750226d..653077f 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -2095,9 +2095,8 @@ namespace OpenSim.Region.ClientStack
2095 { 2095 {
2096 NeedAck.Add(Pack.Header.Sequence, Pack); 2096 NeedAck.Add(Pack.Header.Sequence, Pack);
2097 } 2097 }
2098 catch (Exception e) // HACKY 2098 catch (Exception) // HACKY
2099 { 2099 {
2100 e.ToString();
2101 // Ignore 2100 // Ignore
2102 // Seems to throw a exception here occasionally 2101 // Seems to throw a exception here occasionally
2103 // of 'duplicate key' despite being locked. 2102 // of 'duplicate key' despite being locked.
@@ -2159,17 +2158,17 @@ namespace OpenSim.Region.ClientStack
2159 // Actually make the byte array and send it 2158 // Actually make the byte array and send it
2160 try 2159 try
2161 { 2160 {
2162 byte[] sendbuffer = Pack.ToBytes(); 2161 byte[] sendbuffer = Pack.ToBytes();
2163 if (Pack.Header.Zerocoded) 2162 if (Pack.Header.Zerocoded)
2164 { 2163 {
2165 byte[] ZeroOutBuffer = new byte[4096]; 2164 byte[] ZeroOutBuffer = new byte[4096];
2166 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); 2165 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
2167 m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode); 2166 m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode);
2168 } 2167 }
2169 else 2168 else
2170 { 2169 {
2171 m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode); 2170 m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode);
2172 } 2171 }
2173 } 2172 }
2174 catch (Exception e) 2173 catch (Exception e)
2175 { 2174 {
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index 081e7ac..75d3670 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -119,31 +119,15 @@ namespace OpenSim.Region.Environment.Modules
119 LLVector3 toRegionPos = presence.AbsolutePosition + regionPos; 119 LLVector3 toRegionPos = presence.AbsolutePosition + regionPos;
120 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos)); 120 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos));
121 121
122 switch (type) 122 if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
123 type == ChatTypeEnum.Say && dis > m_saydistance ||
124 type == ChatTypeEnum.Shout && dis > m_shoutdistance)
123 { 125 {
124 case ChatTypeEnum.Whisper: 126 return;
125 if (dis < m_whisperdistance)
126 {
127 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
128 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
129 }
130 break;
131 case ChatTypeEnum.Say:
132 if (dis < m_saydistance)
133 {
134 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
135 }
136 break;
137 case ChatTypeEnum.Shout:
138 if (dis < m_shoutdistance)
139 {
140 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
141 }
142 break;
143 case ChatTypeEnum.Broadcast:
144 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
145 break;
146 } 127 }
128
129 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
130 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
147 } 131 }
148 } 132 }
149 133
@@ -185,32 +169,17 @@ namespace OpenSim.Region.Environment.Modules
185 { 169 {
186 m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message); 170 m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
187 } 171 }
188
189 if (e.Channel == 0)
190 {
191 foreach (Scene s in m_scenes)
192 {
193 s.ForEachScenePresence(delegate(ScenePresence presence)
194 {
195 TrySendChatMessage(presence, fromPos, regionPos,
196 fromAgentID, fromName, e.Type, message);
197 });
198 }
199 }
200 } 172 }
201 else 173
174 if (e.Channel == 0)
202 { 175 {
203 if (avatar != null) 176 foreach (Scene s in m_scenes)
204 { 177 {
205 switch (e.Type) 178 s.ForEachScenePresence(delegate(ScenePresence presence)
206 { 179 {
207 case ChatTypeEnum.StartTyping: 180 TrySendChatMessage(presence, fromPos, regionPos,
208 avatar.setTyping(true); 181 fromAgentID, fromName, e.Type, message);
209 break; 182 });
210 case ChatTypeEnum.StopTyping:
211 avatar.setTyping(false);
212 break;
213 }
214 } 183 }
215 } 184 }
216 } 185 }
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 512eed0..3460e8f 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -964,23 +964,6 @@ namespace OpenSim.Region.Environment.Scenes
964 m_forcesList.Add(newVelocity); 964 m_forcesList.Add(newVelocity);
965 } 965 }
966 966
967 /// <summary>
968 /// Sets whether or not the agent is typing.
969 /// </summary>
970 public void setTyping(bool typing)
971 {
972 if (m_isChildAgent)
973 {
974 MainLog.Instance.Warn("setTyping called on child agent");
975 return;
976 }
977
978 if (typing)
979 AddAnimation(Animations.AnimsLLUUID["TYPE"], 1);
980 else
981 RemoveAnimation(Animations.AnimsLLUUID["TYPE"]);
982 }
983
984 #endregion 967 #endregion
985 968
986 #region Overridden Methods 969 #region Overridden Methods