Use ring buffers for network _chatmsg_list and _command_queue

pull/590/head
Jonathan G Rennison 10 months ago
parent e958bdde9f
commit 8c1a3c26af

@ -34,8 +34,8 @@
#include "debug_settings.h"
#include "debug_desync.h"
#include "order_backup.h"
#include "core/ring_buffer.hpp"
#include <array>
#include <deque>
#include "table/strings.h"
@ -638,7 +638,7 @@ struct CommandQueueItem {
CommandContainer cmd;
CompanyID company;
};
static std::deque<CommandQueueItem> _command_queue;
static ring_buffer<CommandQueueItem> _command_queue;
void ClearCommandLog()
{

@ -22,13 +22,13 @@
#include "network_client.h"
#include "network_base.h"
#include "../core/format.hpp"
#include "core/ring_buffer.hpp"
#include "../widgets/network_chat_widget.h"
#include "table/strings.h"
#include <stdarg.h> /* va_list */
#include <deque>
#include <optional>
#include "../safeguards.h"
@ -48,7 +48,7 @@ struct ChatMessage {
};
/* used for chat window */
static std::deque<ChatMessage> _chatmsg_list; ///< The actual chat message list.
static ring_buffer<ChatMessage> _chatmsg_list; ///< The actual chat message list.
static bool _chatmessage_dirty = false; ///< Does the chat message need repainting?
static bool _chatmessage_visible = false; ///< Is a chat message visible.
static bool _chat_tab_completion_active; ///< Whether tab completion is active.

Loading…
Cancel
Save