mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Print errors from local log to chat
This commit is contained in:
parent
013921782b
commit
ab3911ba9e
2 changed files with 69 additions and 1 deletions
12
src/game.cpp
12
src/game.cpp
|
@ -49,6 +49,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "main.h" // For g_settings
|
||||
#include "tooldef.h"
|
||||
#include "tile.h" // For TextureSource
|
||||
#include "logoutputbuffer.h"
|
||||
|
||||
/*
|
||||
Setting this to 1 enables a special camera mode that forces
|
||||
|
@ -642,6 +643,9 @@ void the_game(
|
|||
// Create node definition manager
|
||||
IWritableNodeDefManager *nodedef = createNodeDefManager();
|
||||
|
||||
// Add chat log output for errors to be shown in chat
|
||||
LogOutputBuffer chat_log_error_buf(LMT_ERROR);
|
||||
|
||||
/*
|
||||
Create server.
|
||||
SharedPtr will delete it when it goes out of scope.
|
||||
|
@ -2122,7 +2126,13 @@ void the_game(
|
|||
Get chat messages from client
|
||||
*/
|
||||
{
|
||||
// Get new messages
|
||||
// Get new messages from error log buffer
|
||||
while(!chat_log_error_buf.empty())
|
||||
{
|
||||
chat_lines.push_back(ChatLine(narrow_to_wide(
|
||||
chat_log_error_buf.get())));
|
||||
}
|
||||
// Get new messages from client
|
||||
std::wstring message;
|
||||
while(client.getChatMessage(message))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue