Use ring buffers for network _chatmsg_list and _command_queue
This commit is contained in:
@@ -34,8 +34,8 @@
|
|||||||
#include "debug_settings.h"
|
#include "debug_settings.h"
|
||||||
#include "debug_desync.h"
|
#include "debug_desync.h"
|
||||||
#include "order_backup.h"
|
#include "order_backup.h"
|
||||||
|
#include "core/ring_buffer.hpp"
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <deque>
|
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
||||||
@@ -638,7 +638,7 @@ struct CommandQueueItem {
|
|||||||
CommandContainer cmd;
|
CommandContainer cmd;
|
||||||
CompanyID company;
|
CompanyID company;
|
||||||
};
|
};
|
||||||
static std::deque<CommandQueueItem> _command_queue;
|
static ring_buffer<CommandQueueItem> _command_queue;
|
||||||
|
|
||||||
void ClearCommandLog()
|
void ClearCommandLog()
|
||||||
{
|
{
|
||||||
|
@@ -22,13 +22,13 @@
|
|||||||
#include "network_client.h"
|
#include "network_client.h"
|
||||||
#include "network_base.h"
|
#include "network_base.h"
|
||||||
#include "../core/format.hpp"
|
#include "../core/format.hpp"
|
||||||
|
#include "core/ring_buffer.hpp"
|
||||||
|
|
||||||
#include "../widgets/network_chat_widget.h"
|
#include "../widgets/network_chat_widget.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
|
||||||
#include <stdarg.h> /* va_list */
|
#include <stdarg.h> /* va_list */
|
||||||
#include <deque>
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
#include "../safeguards.h"
|
#include "../safeguards.h"
|
||||||
@@ -48,7 +48,7 @@ struct ChatMessage {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* used for chat window */
|
/* 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_dirty = false; ///< Does the chat message need repainting?
|
||||||
static bool _chatmessage_visible = false; ///< Is a chat message visible.
|
static bool _chatmessage_visible = false; ///< Is a chat message visible.
|
||||||
static bool _chat_tab_completion_active; ///< Whether tab completion is active.
|
static bool _chat_tab_completion_active; ///< Whether tab completion is active.
|
||||||
|
Reference in New Issue
Block a user