fix: correct argument typo and path/error handling

Fix --enable-consolelog flag, screenshot filter bug, paths to C APIs, add includes and gitignore entries, and improve ShellExecuteW failure detection.
This commit is contained in:
2026-08-07 21:33:46 +08:00
parent d9b4b42f74
commit 0919faa3e4
9 changed files with 26 additions and 12 deletions

View File

@@ -7,6 +7,7 @@
#include <tbb/concurrent_hash_map.h>
#include <tbb/concurrent_queue.h>
#include <tbb/concurrent_vector.h>
#include <variant>
namespace Cubed {
class ServerWorld;
class Session;

View File

@@ -17,9 +17,18 @@ namespace Cubed::Tools {
inline void open_file_manager(const std::filesystem::path& path) {
#ifdef _WIN32
ShellExecuteW(nullptr, L"open", path.wstring().c_str(), nullptr, nullptr,
SW_SHOWNORMAL);
auto abs_path = std::filesystem::absolute(path);
if (!std::filesystem::exists(abs_path)) {
Logger::warn("Path does not exist: {}", abs_path.string());
return;
}
HINSTANCE result =
ShellExecuteW(nullptr, L"open", abs_path.wstring().c_str(), nullptr,
nullptr, SW_SHOWNORMAL);
if ((INT_PTR)result <= 32) {
Logger::warn("ShellExecuteW failed for path: {}, error code: {}",
path.string(), (int)(INT_PTR)result);
}
#elif __linux__

View File

@@ -1,8 +1,10 @@
#pragma once
#include <rapidjson/document.h>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>
namespace Cubed {
class SensitiveFilter {
public: