mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Tools/Extractors: Warn when casc storage could not be opened in remote mode because a local installation was detected in input/cache directory
This commit is contained in:
@@ -47,6 +47,7 @@ char const* CASC::HumanReadableCASCError(uint32 error)
|
||||
case ERROR_ACCESS_DENIED: return "ACCESS_DENIED";
|
||||
case ERROR_FILE_NOT_FOUND: return "FILE_NOT_FOUND";
|
||||
case ERROR_FILE_ENCRYPTED: return "FILE_ENCRYPTED";
|
||||
case ERROR_FILE_OFFLINE: return "FILE_OFFLINE";
|
||||
default: return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
@@ -210,6 +211,15 @@ CASC::Storage* CASC::Storage::OpenRemote(boost::filesystem::path const& path, ui
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DWORD features = 0;
|
||||
if (!GetStorageInfo(handle, CascStorageFeatures, &features) || !(features & CASC_FEATURE_ONLINE))
|
||||
{
|
||||
printf("Local casc storage detected in cache path \"%s\" (or its parent directory). Remote storage not opened!\n", args.szLocalPath);
|
||||
CascCloseStorage(handle);
|
||||
SetCascError(ERROR_FILE_OFFLINE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
printf("Opened remote casc storage '%s'\n", path.string().c_str());
|
||||
Storage* storage = new Storage(handle);
|
||||
|
||||
|
||||
@@ -148,7 +148,8 @@ void CreateDir(boost::filesystem::path const& path)
|
||||
if (fs::exists(path))
|
||||
return;
|
||||
|
||||
if (!fs::create_directory(path))
|
||||
boost::system::error_code err;
|
||||
if (!fs::create_directory(path, err) || err)
|
||||
throw std::runtime_error("Unable to create directory" + path.string());
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace VMAP
|
||||
TileAssembler::TileAssembler(const std::string& pSrcDirName, const std::string& pDestDirName)
|
||||
: iDestDir(pDestDirName), iSrcDir(pSrcDirName)
|
||||
{
|
||||
boost::filesystem::create_directory(iDestDir);
|
||||
boost::filesystem::create_directories(iDestDir);
|
||||
}
|
||||
|
||||
TileAssembler::~TileAssembler()
|
||||
|
||||
Reference in New Issue
Block a user