revert 5028, as this approach to 1 nick per avatar isn't going to work,

however, I think I understand now how to make it work.  I just don't want
to have this broken for people this weekend.
0.6.0-stable
Sean Dague 2008-06-06 20:42:12 +00:00
parent 2cfdfaeaa5
commit 6a66caa02e
1 changed files with 8 additions and 21 deletions

View File

@ -237,7 +237,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{ {
try try
{ {
string clientName = String.Format("{0}{1}", client.FirstName, client.LastName); string clientName = String.Format("{0} {1}", client.FirstName, client.LastName);
client.OnChatFromViewer += SimChat; client.OnChatFromViewer += SimChat;
client.OnLogout += ClientLoggedOut; client.OnLogout += ClientLoggedOut;
@ -250,7 +250,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
m_log.DebugFormat("[IRC] {0} logging on", clientName); m_log.DebugFormat("[IRC] {0} logging on", clientName);
m_irc.PrivMsg(m_irc.Nick, "Sim", m_irc.PrivMsg(m_irc.Nick, "Sim",
String.Format("notices {0} logging on", clientName)); String.Format("notices {0} logging on", clientName));
m_irc.NewUser(clientName);
} }
m_last_new_user = clientName; m_last_new_user = clientName;
} }
@ -285,10 +284,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
if ((m_irc.Enabled) && (m_irc.Connected)) if ((m_irc.Enabled) && (m_irc.Connected))
{ {
string regionName = presence.Scene.RegionInfo.RegionName; string regionName = presence.Scene.RegionInfo.RegionName;
string clientName = String.Format("{0}{1}", presence.Firstname, presence.Lastname); string clientName = String.Format("{0} {1}", presence.Firstname, presence.Lastname);
m_log.DebugFormat("[IRC] noticing {0} in {1}", clientName, regionName); m_log.DebugFormat("[IRC] noticing {0} in {1}", clientName, regionName);
m_irc.PrivMsg(m_irc.Nick, "Sim", String.Format("notices {0} left {1}", clientName, regionName)); m_irc.PrivMsg(m_irc.Nick, "Sim", String.Format("notices {0} left {1}", clientName, regionName));
m_irc.RemoveUser(clientName);
} }
} }
catch (Exception) catch (Exception)
@ -484,8 +482,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
listener.Start(); listener.Start();
ThreadTracker.Add(listener); ThreadTracker.Add(listener);
NewUser(m_user); m_writer.WriteLine(m_user);
m_writer.Flush();
m_writer.WriteLine(String.Format("NICK {0}", m_nick));
m_writer.Flush();
m_writer.WriteLine(String.Format("JOIN {0}", m_channel));
m_writer.Flush();
m_log.Info("[IRC]: Connection fully established"); m_log.Info("[IRC]: Connection fully established");
m_connected = true; m_connected = true;
} }
@ -498,21 +500,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
} }
} }
public void NewUser(string nick)
{
m_writer.WriteLine(nick);
m_writer.Flush();
m_writer.WriteLine(String.Format("NICK {0}", m_nick));
m_writer.Flush();
m_writer.WriteLine(String.Format("JOIN {0}", m_channel));
m_writer.Flush();
}
public void RemoveUser(string nick)
{
m_writer.WriteLine(String.Format("QUIT :{0}", nick));
}
public void Reconnect() public void Reconnect()
{ {
m_connected = false; m_connected = false;