mirror of
https://github.com/bdnugget/freeminer.git
synced 2026-11-07 06:57:27 +00:00
far wip
This commit is contained in:
1 parent
0f467dc2e5
commit
80be0b4e39
7 files changed
+138
-93
No files matched your search
+20
-17
@@ -284,10 +284,10 @@ void Client::handleCommand_BlockDataFm(NetworkPacket *pkt)
|
||||
auto &far_blocks_storage = getEnv().getClientMap().far_blocks_storage[step];
|
||||
{
|
||||
const auto lock = far_blocks_storage.lock_unique_rec();
|
||||
if (const auto it = far_blocks_storage.find(bpos);
|
||||
it != far_blocks_storage.end() && it->second.block) {
|
||||
return;
|
||||
}
|
||||
// if (const auto it = far_blocks_storage.find(bpos);
|
||||
// it != far_blocks_storage.end() && it->second.block) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
far_blocks_storage.insert_or_assign(
|
||||
block->getPos(), Map::BlockUsed{block, (int32_t)m_uptime});
|
||||
@@ -298,16 +298,18 @@ void Client::handleCommand_BlockDataFm(NetworkPacket *pkt)
|
||||
mesh_thread_pool.enqueue([this, block, step]() mutable {
|
||||
auto &client_map = getEnv().getClientMap();
|
||||
const auto &control = client_map.getControl();
|
||||
const auto blockpos = block->getPos();
|
||||
const auto res = farmesh::getFarParams(control,
|
||||
auto blockpos = block->getPos();
|
||||
const auto tree_result = farmesh::getFarParams(control,
|
||||
getNodeBlockPos(client_map.far_blocks_last_cam_pos), blockpos);
|
||||
if (!res)
|
||||
if (!tree_result)
|
||||
return;
|
||||
auto &far_blocks = client_map.m_far_blocks;
|
||||
bool other_draw_block = false;
|
||||
if (!(res->pos == blockpos && res->step == step)) {
|
||||
if (tree_result->pos != blockpos || tree_result->step != step) {
|
||||
step = tree_result->step;
|
||||
blockpos = tree_result->pos;
|
||||
const auto lock = far_blocks.lock_unique_rec();
|
||||
if (const auto &it = far_blocks.find(res->pos);
|
||||
if (const auto &it = far_blocks.find(blockpos);
|
||||
it != far_blocks.end() && it->second->far_step == step) {
|
||||
block = it->second;
|
||||
other_draw_block = true;
|
||||
@@ -319,16 +321,17 @@ void Client::handleCommand_BlockDataFm(NetworkPacket *pkt)
|
||||
createFarMesh(block);
|
||||
if (other_draw_block)
|
||||
return;
|
||||
{
|
||||
const auto lock = far_blocks.lock_unique_rec();
|
||||
if (const auto &it = far_blocks.find(blockpos); it != far_blocks.end()) {
|
||||
if (it->second->far_step != block->far_step) {
|
||||
return;
|
||||
}
|
||||
block->far_iteration =
|
||||
it->second->far_iteration.load(std::memory_order::relaxed);
|
||||
|
||||
const auto lock = far_blocks.lock_unique_rec();
|
||||
if (const auto &it = far_blocks.find(blockpos); it != far_blocks.end()) {
|
||||
if (it->second->far_step != block->far_step) {
|
||||
return;
|
||||
far_blocks.at(blockpos) = block;
|
||||
}
|
||||
block->far_iteration =
|
||||
it->second->far_iteration.load(std::memory_order::relaxed);
|
||||
|
||||
far_blocks.at(blockpos) = block;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+49
-36
@@ -54,19 +54,14 @@ const v3opos_t g_6dirso[6] = {
|
||||
v3opos_t(0, 1, 0), // top
|
||||
};
|
||||
|
||||
void FarMesh::makeFarBlock(const v3bpos_t &blockpos, block_step_t step, bool bnear,
|
||||
std::optional<v3bpos_t> blockpos_actual_optional)
|
||||
void FarMesh::makeFarBlock(const v3bpos_t &blockpos, block_step_t step)
|
||||
{
|
||||
g_profiler->add("Client: Farmesh make", 1);
|
||||
|
||||
auto &client_map = m_client->getEnv().getClientMap();
|
||||
//const auto &draw_control = client_map.getControl();
|
||||
const auto &draw_control = *m_control;
|
||||
const auto blockpos_actual =
|
||||
blockpos_actual_optional.has_value() ? blockpos_actual_optional.value()
|
||||
: bnear ? blockpos
|
||||
: farmesh::getFarActualBlockPos(draw_control,
|
||||
getNodeBlockPos(m_camera_pos_aligned), blockpos);
|
||||
const auto blockpos_actual = blockpos;
|
||||
auto &far_blocks = //near ? m_client->getEnv().getClientMap().m_far_near_blocks :
|
||||
client_map.m_far_blocks;
|
||||
if (const auto it = client_map.far_blocks_storage[step].find(blockpos_actual);
|
||||
@@ -98,8 +93,15 @@ void FarMesh::makeFarBlock(const v3bpos_t &blockpos, block_step_t step, bool bne
|
||||
block = it->second;
|
||||
} else {
|
||||
if (!block) {
|
||||
client_map.m_far_blocks_ask.emplace(
|
||||
blockpos_actual, std::make_pair(step, far_iteration_complete));
|
||||
for (pos_t x = 0; x < 1 << draw_control.cell_size_pow; ++x) {
|
||||
for (pos_t y = 0; y < 1 << draw_control.cell_size_pow; ++y) {
|
||||
for (pos_t z = 0; z < 1 << draw_control.cell_size_pow; ++z) {
|
||||
client_map.m_far_blocks_ask.emplace(
|
||||
blockpos_actual + v3bpos_t{x, y, z},
|
||||
std::make_pair(step, far_iteration_complete));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
block = client_map.createBlankBlockNoInsert(blockpos_actual);
|
||||
block->far_step = step;
|
||||
@@ -123,14 +125,19 @@ void FarMesh::makeFarBlock(const v3bpos_t &blockpos, block_step_t step, bool bne
|
||||
|
||||
void FarMesh::makeFarBlocks(const v3bpos_t &blockpos, const block_step_t step)
|
||||
{
|
||||
const auto &control = *m_control;
|
||||
#if FARMESH_DEBUG || FARMESH_FAST
|
||||
{
|
||||
auto block_step_correct =
|
||||
farmesh::getFarStep(m_client->getEnv().getClientMap().getControl(),
|
||||
getNodeBlockPos(m_camera_pos_aligned), blockpos);
|
||||
const auto tree_result = farmesh::getFarParams(
|
||||
control, getNodeBlockPos(m_camera_pos_aligned), blockpos);
|
||||
if (!tree_result) {
|
||||
return;
|
||||
}
|
||||
const auto &block_step_correct = tree_result->step;
|
||||
if (!block_step_correct)
|
||||
return;
|
||||
return makeFarBlock(blockpos, block_step_correct);
|
||||
const v3bpos_t &bpos = tree_result->pos;
|
||||
return makeFarBlock(bpos, block_step_correct /*, {}, bpos*/);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -149,7 +156,6 @@ void FarMesh::makeFarBlocks(const v3bpos_t &blockpos, const block_step_t step)
|
||||
v3pos_t(0, -1, 0), // bottom
|
||||
};
|
||||
const auto &use_dirs = pnear;
|
||||
const auto &control = *m_control;
|
||||
const auto step_width = 1 << (step - 1 + control.cell_size_pow);
|
||||
for (const auto &dir : use_dirs) {
|
||||
const auto bpos_dir = blockpos + dir * step_width;
|
||||
@@ -159,8 +165,10 @@ void FarMesh::makeFarBlocks(const v3bpos_t &blockpos, const block_step_t step)
|
||||
continue;
|
||||
}
|
||||
const auto &block_step_correct = tree_result->step;
|
||||
if (!block_step_correct)
|
||||
return;
|
||||
const v3bpos_t &bpos = tree_result->pos;
|
||||
makeFarBlock(bpos, block_step_correct, {}, bpos);
|
||||
makeFarBlock(bpos, block_step_correct);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +294,6 @@ int FarMesh::go_container()
|
||||
draw_control.farmesh_quality_pow, 0, false,
|
||||
[this, &player_block_pos](const v3bpos_t &bpos, const bpos_t &size,
|
||||
const block_step_t &step) -> bool {
|
||||
|
||||
if (step >= FARMESH_STEP_MAX) {
|
||||
return false;
|
||||
}
|
||||
@@ -303,7 +310,7 @@ int FarMesh::go_container()
|
||||
const auto contains = it != step_blocks.end() && it->second.block;
|
||||
|
||||
if (contains) {
|
||||
makeFarBlock(bpos, step, {}, bpos);
|
||||
makeFarBlock(bpos, step);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -338,30 +345,30 @@ int FarMesh::go_flat()
|
||||
(bpos_new.Z << MAP_BLOCKP) - 1)) >>
|
||||
MAP_BLOCKP;
|
||||
|
||||
const auto step_new =
|
||||
farmesh::getFarStep(draw_control, player_block_pos, bpos_new);
|
||||
const auto res = farmesh::getFarParams(
|
||||
draw_control, player_block_pos, bpos_new);
|
||||
if (!res)
|
||||
return false;
|
||||
const auto &step_new = res->step;
|
||||
const auto &bpos_new_correct = res->pos;
|
||||
if (step_new >= FARMESH_STEP_MAX)
|
||||
return false;
|
||||
|
||||
blocks[step_new].emplace(bpos_new);
|
||||
blocks[step_new].emplace(bpos_new_correct);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
const auto add_size = size << draw_control.cell_size_pow;
|
||||
const auto add_size = 1 << (step + draw_control.cell_size_pow);
|
||||
for (const auto &add : {
|
||||
v2bpos_t(0, 0),
|
||||
v2bpos_t(0, add_size - 1),
|
||||
v2bpos_t(add_size - 1, 0),
|
||||
v2bpos_t(add_size - 1, add_size - 1),
|
||||
v2bpos_t(add_size >> 1, add_size >> 1),
|
||||
|
||||
v3bpos_t{0, 0, 0},
|
||||
v3bpos_t{0, add_size, 0},
|
||||
v3bpos_t{0, -add_size, 0},
|
||||
}) {
|
||||
v3bpos_t bpos_new{bpos.X + add.X, 0, bpos.Z + add.Y};
|
||||
bpos_new.Y = mg->getGroundLevelAtPoint(
|
||||
v2pos_t((bpos_new.X << MAP_BLOCKP) - 1,
|
||||
(bpos_new.Z << MAP_BLOCKP) - 1)) >>
|
||||
MAP_BLOCKP;
|
||||
|
||||
v3bpos_t bpos_new{bpos.X + add.X, add.Y, bpos.Z + add.Z};
|
||||
bpos_new.Y += mg->getGroundLevelAtPoint(
|
||||
v2pos_t{(bpos_new.X << MAP_BLOCKP) - 1,
|
||||
(bpos_new.Z << MAP_BLOCKP) - 1}) >>
|
||||
MAP_BLOCKP;
|
||||
const auto res = farmesh::getFarParams(
|
||||
draw_control, player_block_pos, bpos_new);
|
||||
if (!res)
|
||||
@@ -388,7 +395,7 @@ int FarMesh::go_flat()
|
||||
last_distance_max) {
|
||||
return last_step;
|
||||
}
|
||||
makeFarBlock(bpos, last_step, {}, bpos);
|
||||
makeFarBlock(bpos, last_step);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -656,7 +663,7 @@ uint8_t FarMesh::update(v3opos_t camera_pos,
|
||||
}
|
||||
}
|
||||
|
||||
go_container();
|
||||
//go_container();
|
||||
|
||||
planes_processed_last = planes_processed;
|
||||
|
||||
@@ -744,3 +751,9 @@ uint8_t FarMesh::update(v3opos_t camera_pos,
|
||||
return planes_processed;
|
||||
}
|
||||
}
|
||||
|
||||
void FarMesh::enqueueFarMeshForBlock(const v3bpos_t &blockpos, const block_step_t step,
|
||||
const MapBlockPtr &block, const double timestamp)
|
||||
{
|
||||
farmesh_make_queue[step].insert_or_assign(blockpos, BlockTodo{block, timestamp});
|
||||
}
|
||||
+12
-7
@@ -23,14 +23,12 @@ along with Freeminer. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <future>
|
||||
#include "client/camera.h"
|
||||
#include "irr_v3d.h"
|
||||
#include "irrlichttypes.h"
|
||||
#include "mapblock.h"
|
||||
#include "threading/async.h"
|
||||
#include "threading/concurrent_unordered_map.h"
|
||||
#include "threading/concurrent_unordered_set.h"
|
||||
|
||||
class Client;
|
||||
class Mapgen;
|
||||
@@ -59,10 +57,11 @@ public:
|
||||
v3pos_t m_camera_offset,
|
||||
//float brightness,
|
||||
int render_range, float speed);
|
||||
void makeFarBlock(const v3bpos_t &blockpos, block_step_t step, bool bnear = false,
|
||||
std::optional<v3bpos_t> blockpos_actual = {});
|
||||
void makeFarBlock(const v3bpos_t &blockpos, block_step_t step);
|
||||
void makeFarBlocks(const v3bpos_t &blockpos, block_step_t step);
|
||||
//void makeFarBlocks(const v3bpos_t &blockpos);
|
||||
|
||||
void enqueueFarMeshForBlock(const v3bpos_t &blockpos, const block_step_t step,
|
||||
const MapBlockPtr &block, const double timestamp);
|
||||
|
||||
private:
|
||||
//std::vector<v3bpos_t> m_make_far_blocks_list;
|
||||
@@ -121,9 +120,15 @@ private:
|
||||
bool complete_set{};
|
||||
uint32_t collect_reset_timestamp{static_cast<uint32_t>(-1)};
|
||||
uint8_t planes_processed_last{};
|
||||
concurrent_shared_unordered_map<uint16_t, concurrent_unordered_set<v3bpos_t>>
|
||||
far_blocks_list;
|
||||
std::array<async_step_runner, 6> async;
|
||||
async_step_runner async_cleaner;
|
||||
int async_cleaner_next{};
|
||||
|
||||
struct BlockTodo
|
||||
{
|
||||
MapBlockPtr block;
|
||||
double timestamp;
|
||||
};
|
||||
std::array<concurrent_unordered_map<v3bpos_t, BlockTodo>, FARMESH_STEP_MAX>
|
||||
farmesh_make_queue;
|
||||
};
|
||||
+14
-8
@@ -936,7 +936,7 @@ void Hud::drawBlockBounds()
|
||||
|
||||
// 3s16 pos = player->getStandingNodePos();
|
||||
|
||||
const auto is_each_mode= m_block_bounds_mode == BLOCK_BOUNDS_FAR_DRAWN_EACH;
|
||||
const auto is_each_mode= m_block_bounds_mode == BLOCK_BOUNDS_FAR_DRAWN_EACH;
|
||||
if (m_block_bounds_mode == BLOCK_BOUNDS_FAR_DRAWN || is_each_mode) {
|
||||
const auto offset = intToFloat(client->getCamera()->getOffset(), BS);
|
||||
|
||||
@@ -981,22 +981,28 @@ const auto is_each_mode= m_block_bounds_mode == BLOCK_BOUNDS_FAR_DRAWN_EACH;
|
||||
if (!mesh || !mesh->getMesh() || !mesh->getMesh()->getMeshBufferCount()) {
|
||||
b = 50;
|
||||
}
|
||||
std::optional<aabb3f> box;
|
||||
if (mesh) {
|
||||
fscale = mesh->fscale;
|
||||
lod_step = mesh->lod_step;
|
||||
far_step = mesh->far_step;
|
||||
//box = mesh->getMesh(0)->getBoundingBox();
|
||||
}
|
||||
if (is_each_mode) {
|
||||
fscale = 1 << mesh_step;
|
||||
}
|
||||
const aabb3f box(oposToV3f(intToFloat((blockPos)*MAP_BLOCKSIZE, BS) -
|
||||
if (!box) {
|
||||
box = aabb3f{oposToV3f(intToFloat((blockPos)*MAP_BLOCKSIZE, BS) -
|
||||
offset - halfNode + 1),
|
||||
oposToV3f(intToFloat(((blockPos)*MAP_BLOCKSIZE) +
|
||||
(MAP_BLOCKSIZE * fscale - fscale),
|
||||
BS) -
|
||||
offset + halfNode - 1));
|
||||
driver->draw3DBox(box, video::SColor(200 + b, 255 - lod_step * 10 + b,
|
||||
255 - g - far_step * 10, fscale * 20));
|
||||
oposToV3f(
|
||||
intToFloat(((blockPos)*MAP_BLOCKSIZE) +
|
||||
(MAP_BLOCKSIZE * fscale - fscale),
|
||||
BS) -
|
||||
offset + halfNode - 1)};
|
||||
}
|
||||
driver->draw3DBox(
|
||||
box.value(), video::SColor(200 + b, 255 - lod_step * 10 + b,
|
||||
255 - g - far_step * 10, fscale * 20));
|
||||
}
|
||||
}
|
||||
} else if (m_block_bounds_mode == BLOCK_BOUNDS_FAR_REQUEST) {
|
||||
|
||||
+39
-22
@@ -73,7 +73,7 @@ block_step_t getLodStep(const MapDrawControl &draw_control,
|
||||
return 0;
|
||||
};
|
||||
|
||||
uint8_t rangeToStep(const int range)
|
||||
block_step_t rangeToStep(const int range)
|
||||
{
|
||||
const unsigned int r = static_cast<unsigned int>(range);
|
||||
return r ? static_cast<int>(std::bit_width(r) - 1) : 0;
|
||||
@@ -147,8 +147,8 @@ struct find_param_t
|
||||
{
|
||||
const v3tpos_t &player_pos;
|
||||
const v3tpos_t &block_pos;
|
||||
const uint8_t cell_size_pow;
|
||||
const uint8_t farmesh_quality_pow;
|
||||
const block_step_t cell_size_pow;
|
||||
const block_step_t farmesh_quality_pow;
|
||||
const bool cell_size_each{0};
|
||||
};
|
||||
|
||||
@@ -158,15 +158,17 @@ struct child_t
|
||||
tpos_t size;
|
||||
};
|
||||
|
||||
std::optional<tree_result_t> find(const find_param_t ¶m,
|
||||
const child_t &child,
|
||||
const uint16_t depth = 0)
|
||||
std::optional<tree_result_t> find(
|
||||
const find_param_t ¶m, const child_t &child, const uint16_t depth = 0)
|
||||
{
|
||||
const auto make_result = [¶m](const auto &child) {
|
||||
return tree_result_t{
|
||||
.pos{child.pos},
|
||||
.size{child.size >> (param.cell_size_each ? 0 : param.cell_size_pow)},
|
||||
.step{rangeToStep(child.size)},
|
||||
//.size{child.size >> (param.cell_size_each ? 0 : param.cell_size_pow)},
|
||||
.size{child.size >> param.cell_size_pow},
|
||||
.step{static_cast<block_step_t>(
|
||||
rangeToStep(child.size) -
|
||||
(param.cell_size_each ? 0 : param.cell_size_pow))},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -180,7 +182,6 @@ std::optional<tree_result_t> find(const find_param_t ¶m,
|
||||
return {};
|
||||
} else {
|
||||
return make_result(child);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,6 +190,14 @@ std::optional<tree_result_t> find(const find_param_t ¶m,
|
||||
}
|
||||
|
||||
const tpos_t childSize = child.size >> 1;
|
||||
/*
|
||||
const auto distance =
|
||||
((tpos_t)std::hypot(param.player_pos.X - (child.pos.X + childSize),
|
||||
param.player_pos.Y - (child.pos.Y + childSize),
|
||||
param.player_pos.Z - (child.pos.Z + childSize)) >>
|
||||
param.cell_size_pow)
|
||||
<< param.cell_size_pow;
|
||||
*/
|
||||
const auto distance =
|
||||
(std::max({std::abs((tpos_t)param.player_pos.X - (child.pos.X + childSize)),
|
||||
std::abs((tpos_t)param.player_pos.Y - (child.pos.Y + childSize)),
|
||||
@@ -196,7 +205,8 @@ std::optional<tree_result_t> find(const find_param_t ¶m,
|
||||
param.cell_size_pow)
|
||||
<< param.cell_size_pow;
|
||||
const auto next_child_size =
|
||||
child.size << (1 + std::max(param.farmesh_quality_pow, param.cell_size_pow));
|
||||
child.size << (1 + std::max(param.farmesh_quality_pow, param.cell_size_pow) -
|
||||
(param.cell_size_each ? 0 : param.cell_size_pow));
|
||||
if (distance >= next_child_size) {
|
||||
return make_result(child);
|
||||
}
|
||||
@@ -287,18 +297,17 @@ std::optional<tree_result_t> getFarParams(const MapDrawControl &draw_control,
|
||||
const auto blockpos_aligned_cell = align_shift(blockpos, draw_control.cell_size_pow);
|
||||
const tree_params_t tree_params{.tree_pow{farmesh_to_tree_pow(draw_control.farmesh)}};
|
||||
const auto start = tree_params_to_child(tree_params, player_block_pos);
|
||||
const auto res = find(
|
||||
{.player_pos{player_block_pos.X, player_block_pos.Y, player_block_pos.Z},
|
||||
.block_pos{blockpos_aligned_cell.X, blockpos_aligned_cell.Y,
|
||||
blockpos_aligned_cell.Z},
|
||||
.cell_size_pow{draw_control.cell_size_pow},
|
||||
.farmesh_quality_pow{draw_control.farmesh_quality_pow},
|
||||
.cell_size_each{cell_each}},
|
||||
start);
|
||||
const auto res =
|
||||
find({.player_pos{player_block_pos.X, player_block_pos.Y, player_block_pos.Z},
|
||||
.block_pos{blockpos_aligned_cell.X, blockpos_aligned_cell.Y,
|
||||
blockpos_aligned_cell.Z},
|
||||
.cell_size_pow{draw_control.cell_size_pow},
|
||||
.farmesh_quality_pow{draw_control.farmesh_quality_pow},
|
||||
.cell_size_each{cell_each}},
|
||||
start);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
block_step_t getFarStep(const MapDrawControl &draw_control,
|
||||
const v3bpos_t &player_block_pos, const v3bpos_t &blockpos, bool cell_each)
|
||||
{
|
||||
@@ -351,6 +360,15 @@ struct each_param_t
|
||||
void each(const each_param_t ¶m, const child_t &child)
|
||||
{
|
||||
const tpos_t childSize = child.size >> 1;
|
||||
/*
|
||||
const auto distance =
|
||||
((tpos_t)std::hypot(param.player_pos.X - (child.pos.X + childSize),
|
||||
param.player_pos.Y - (child.pos.Y + childSize),
|
||||
param.player_pos.Z - (child.pos.Z + childSize)) >>
|
||||
param.cell_size_pow)
|
||||
<< param.cell_size_pow;
|
||||
*/
|
||||
|
||||
const auto distance =
|
||||
(std::max({std::abs((tpos_t)param.player_pos.X - (child.pos.X + childSize)),
|
||||
std::abs((tpos_t)param.player_pos.Y - (child.pos.Y + childSize)),
|
||||
@@ -363,7 +381,7 @@ void each(const each_param_t ¶m, const child_t &child)
|
||||
if (distance >= next_child_size) {
|
||||
param.func(tree_result_t{
|
||||
.pos{child.pos},
|
||||
.size{child.size >> (param.cell_size_each ? 0 : param.cell_size_pow)},
|
||||
.size{child.size >> (param.cell_size_each ? param.cell_size_pow : 0)},
|
||||
.step{rangeToStep(child.size)},
|
||||
});
|
||||
return;
|
||||
@@ -413,8 +431,7 @@ void each(const each_param_t ¶m, const child_t &child)
|
||||
.size{child.size >>
|
||||
(param.cell_size_each ? 0 : param.cell_size_pow)},
|
||||
.step{rangeToStep(child.size)},
|
||||
}))
|
||||
{
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -81,5 +81,5 @@ void runFarAll(const v3bpos_t &player_block_pos, uint8_t cell_size_pow, int farm
|
||||
const std::function<bool(const v3bpos_t &, const bpos_t &, const block_step_t &)>
|
||||
&func);
|
||||
|
||||
uint8_t rangeToStep(const int range);
|
||||
block_step_t rangeToStep(const int range);
|
||||
}
|
||||
@@ -85,7 +85,8 @@ size_t multi_http_to_file(
|
||||
<< "\n";
|
||||
|
||||
std::ofstream(path, std::ios_base::binary) << ""; // create zero file
|
||||
return std::filesystem::file_size(path);
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
size_t multi_http_to_file_cdn(const std::string &dir, const std::string &name,
|
||||
@@ -130,7 +131,7 @@ size_t multi_http_to_file(const std::vector<std::string> &links, const std::stri
|
||||
<< "\n";
|
||||
|
||||
std::ofstream(path, std::ios_base::binary) << ""; // create zero file
|
||||
return std::filesystem::file_size(path);
|
||||
return 0;
|
||||
};
|
||||
|
||||
std::string exec_to_string(const std::string &cmd)
|
||||
|
||||
Reference in new issue
Block a user