Skip to content

Instantly share code, notes, and snippets.

@PilzAdam
Created May 20, 2013 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PilzAdam/5616239 to your computer and use it in GitHub Desktop.
Save PilzAdam/5616239 to your computer and use it in GitHub Desktop.
oid ChatBackend::addMessage(std::wstring name, std::wstring text)
{
// Note: A message may consist of multiple lines, for example the MOTD.
WStrfnd fnd(text);
while (!fnd.atend())
{
std::wstring line = fnd.next(L"\n");
m_console_buffer.addLine(name, line);
m_recent_buffer.addLine(name, line);
WStrfnd fndname(line);
if(fndname.next(narrow_to_wide(playername)) != L"" || name == L"" ||
name == narrow_to_wide(playername)) {
m_recent_filtered_buffer.addLine(name, line);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment