1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

some tinkering around

This commit is contained in:
Perttu Ahola 2010-12-25 03:33:38 +02:00
parent a5c62045ed
commit c1e0d3e031
3 changed files with 44 additions and 13 deletions

View file

@ -2313,6 +2313,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
dstream<<"CHAT: "<<wide_to_narrow(message)<<std::endl;
// Get player name of this client
std::wstring name = narrow_to_wide(player->getName());
std::wstring line = std::wstring(L"<")+name+L"> "+message;
/*
Send the message to all other clients
*/
@ -2330,14 +2335,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
if(peer_id == client->peer_id)
continue;
// Get player name of this client
std::wstring name = L"unknown";
Player *player = m_env.getPlayer(client->peer_id);
if(player != NULL)
name = narrow_to_wide(player->getName());
SendChatMessage(client->peer_id,
std::wstring(L"<")+name+L"> "+message);
SendChatMessage(client->peer_id, line);
}
}
else