mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
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:
@@ -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;
|
||||
|
||||
@@ -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__
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user