print chat to stdout on client, cheap copy/paste

This commit is contained in:
darkrose 2015-04-03 16:56:38 +10:00
parent 7166a79d4b
commit 62a27301ce
1 changed files with 3 additions and 4 deletions

View File

@ -1231,14 +1231,13 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
u16 len = readU16(buf); u16 len = readU16(buf);
std::wstring message; std::wstring message;
for(u16 i=0; i<len; i++) for (u16 i=0; i<len; i++) {
{
is.read((char*)buf, 2); is.read((char*)buf, 2);
message += (wchar_t)readU16(buf); message += (wchar_t)readU16(buf);
} }
/*infostream<<"Client received chat message: " /* because I can't remember which random stream prints to stdout */
<<wide_to_narrow(message)<<std::endl;*/ printf("CHAT: %s\n",wide_to_narrow(message).c_str());
m_chat_queue.push_back(message); m_chat_queue.push_back(message);
} }