refactor(dev_panel): remove seed editing and server rebuild world, move client rebuild

- Remove text editing for perlin seed and filter function
- Remove ServerWorld::rebuild_world() method and its atomic flag
- Move 'Rebuild World' button to client world tab
- Remove unused perlin_noise_input_buffer
This commit is contained in:
2026-06-30 18:36:22 +08:00
parent 1e17474122
commit 1af41db615
4 changed files with 7 additions and 75 deletions

View File

@@ -504,40 +504,6 @@ void ServerWorld::hot_reload() {
m_rendering_distance = dist <= MAX_DISTANCE ? dist : MAX_DISTANCE;
}
void ServerWorld::rebuild_world() {
if (m_is_rebuilding.exchange(true)) {
return;
}
stop_gen_thread();
stop_thread_pool();
stop_server_thread();
m_cave_carcer.reload(ChunkGenerator::seed());
m_river_worm.reload(ChunkGenerator::seed());
m_chunks.clear();
{
std::lock_guard lock(m_new_chunk_mutex);
m_new_chunks.clear();
}
m_could_gen = true;
ChunkGenerator::reload();
start_thread_pool();
start_gen_thread();
start_server_thread();
Arena arena;
auto* rsp = Arena::Create<S2C_ClearAllChunks>(&arena);
rsp->set_clear(true);
{
std::lock_guard lock(m_player_mutex);
for (auto& [uuid, player] : m_players) {
player.get_session()->send(make_packet(*rsp));
}
}
m_is_rebuilding = false;
}
void ServerWorld::update() {
// poll_finished_chunks();
{