mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Print errors from local log to chat
This commit is contained in:
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))
|
||||
{
|
||||
|
Reference in New Issue
Block a user