Fix for #176 (... doesn't appear in chat bubbles). This also gets the viewer to handle starting/stopping of the typing animation.

afrisby
Jeff Ames 2007-12-13 07:10:32 +00:00
parent 525139a161
commit 83ca8bd178
3 changed files with 27 additions and 76 deletions

View File

@ -2095,9 +2095,8 @@ namespace OpenSim.Region.ClientStack
{
NeedAck.Add(Pack.Header.Sequence, Pack);
}
catch (Exception e) // HACKY
catch (Exception) // HACKY
{
e.ToString();
// Ignore
// Seems to throw a exception here occasionally
// of 'duplicate key' despite being locked.

View File

@ -119,32 +119,16 @@ namespace OpenSim.Region.Environment.Modules
LLVector3 toRegionPos = presence.AbsolutePosition + regionPos;
int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos));
switch (type)
{
case ChatTypeEnum.Whisper:
if (dis < m_whisperdistance)
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
type == ChatTypeEnum.Say && dis > m_saydistance ||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
{
return;
}
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
}
break;
case ChatTypeEnum.Say:
if (dis < m_saydistance)
{
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
}
break;
case ChatTypeEnum.Shout:
if (dis < m_shoutdistance)
{
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
}
break;
case ChatTypeEnum.Broadcast:
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, fromAgentID);
break;
}
}
}
public void SimChat(Object sender, ChatFromViewerArgs e)
@ -185,6 +169,7 @@ namespace OpenSim.Region.Environment.Modules
{
m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
}
}
if (e.Channel == 0)
{
@ -198,22 +183,6 @@ namespace OpenSim.Region.Environment.Modules
}
}
}
else
{
if (avatar != null)
{
switch (e.Type)
{
case ChatTypeEnum.StartTyping:
avatar.setTyping(true);
break;
case ChatTypeEnum.StopTyping:
avatar.setTyping(false);
break;
}
}
}
}
}
internal class IRCChatModule

View File

@ -964,23 +964,6 @@ namespace OpenSim.Region.Environment.Scenes
m_forcesList.Add(newVelocity);
}
/// <summary>
/// Sets whether or not the agent is typing.
/// </summary>
public void setTyping(bool typing)
{
if (m_isChildAgent)
{
MainLog.Instance.Warn("setTyping called on child agent");
return;
}
if (typing)
AddAnimation(Animations.AnimsLLUUID["TYPE"], 1);
else
RemoveAnimation(Animations.AnimsLLUUID["TYPE"]);
}
#endregion
#region Overridden Methods