- Mesaj
- 101
- Çözümler
- 3
- Beğeni
- 135
- Puan
- 369
- Ticaret Puanı
- 0
D Diskinizde ymir work klasörünü mevcut ise oyun açılmayacak
Bu Hatayı verecek.
Bu Hatayı verecek.
UserInterface.cpp:
UserInterface.cpp
bool PackInitialize(const char* c_pszFolder) Arat
{
parantezin altına ekle
struct stat st;
if (stat("D:\\ymir work", &st) == 0)
{
MessageBox(NULL, "Please remove the folder D:\\Ymir Work!", "Metin2Client", MB_ICONSTOP);
return false;
}
Tam Kod bloğu
bool PackInitialize(const char* c_pszFolder)
{
struct stat st;
if (stat("D:\\ymir work", &st) == 0)
{
MessageBox(NULL, "Please remove the folder D:\\Ymir Work!", "Metin2Client", MB_ICONSTOP);
return false;
}
if (_access(c_pszFolder, 0) != 0)
{
return true;
}
std::string stFolder(c_pszFolder);
stFolder += "/";
std::string stFileName(stFolder);
stFileName += "Index";
CMappedFile file;
LPCVOID pvData;
if (!file.Create(stFileName.c_str(), &pvData, 0, 0))
{
LogBoxf("FATAL ERROR! File not exist: %s", stFileName.c_str());
TraceError("FATAL ERROR! File not exist: %s", stFileName.c_str());
return true;
}
CMemoryTextFileLoader TextLoader;
TextLoader.Bind(file.Size(), pvData);
bool bPackFirst = TRUE;
const std::string& strPackType = TextLoader.GetLineString(0);
if (strPackType.compare("FILE") && strPackType.compare("PACK"))
{
TraceError("Pack/Index has invalid syntax. First line must be 'PACK' or 'FILE'");
return false;
}
#ifdef NDEBUG // @warme601 _DISTRIBUTE -> NDEBUG
Tracef("Note: PackFirst mode enabled. [pack]\n");
#else
bPackFirst = FALSE;
Tracef("Note: PackFirst mode not enabled. [file]\n");
#endif
CTextFileLoader::SetCacheMode();
#if defined(USE_RELATIVE_PATH)
CEterPackManager::Instance().SetRelativePathMode();
#endif
CEterPackManager::Instance().SetCacheMode();
CEterPackManager::Instance().SetSearchMode(bPackFirst);
CSoundData::SetPackMode();
std::string strPackName, strTexCachePackName;
for (DWORD i = 1; i < TextLoader.GetLineCount() - 1; i += 2)
{
const std::string& c_rstFolder = TextLoader.GetLineString(i);
const std::string& c_rstName = TextLoader.GetLineString(i + 1);
strPackName = stFolder + c_rstName;
strTexCachePackName = strPackName + "_texcache";
CEterPackManager::Instance().RegisterPack(strPackName.c_str(), c_rstFolder.c_str());
CEterPackManager::Instance().RegisterPack(strTexCachePackName.c_str(), c_rstFolder.c_str());
}
CEterPackManager::Instance().RegisterRootPack((stFolder + std::string("root")).c_str());
return true;
}