mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
feat(tools): add RecentQueue to replace std::deque in server_world
This commit is contained in:
@@ -249,7 +249,7 @@ void ServerWorld::start_gen_thread() {
|
||||
std::optional<std::string> uuid{std::nullopt};
|
||||
if (!m_need_gen_queue.empty()) {
|
||||
uuid = m_need_gen_queue.front();
|
||||
m_need_gen_queue.pop_front();
|
||||
m_need_gen_queue.pop();
|
||||
}
|
||||
lk.unlock();
|
||||
gen_chunks_internal(uuid);
|
||||
@@ -327,7 +327,7 @@ void ServerWorld::need_gen(std::optional<std::string> uuid) {
|
||||
|
||||
if (uuid) {
|
||||
std::lock_guard lock(m_need_gen_queue_mutex);
|
||||
m_need_gen_queue.push_back(*uuid);
|
||||
m_need_gen_queue.enqueue(*uuid);
|
||||
}
|
||||
|
||||
// m_gen_player_pos = get_player("TestPlayer").get_player_pos();
|
||||
|
||||
Reference in New Issue
Block a user