本文整理汇总了C++中LoadPatchMD5函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadPatchMD5函数的具体用法?C++ LoadPatchMD5怎么用?C++ LoadPatchMD5使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadPatchMD5函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadPatchMD5
void Patcher::LoadPatchesInfo()
{
WIN32_FIND_DATA fil;
HANDLE hFil=FindFirstFile("./patches/*.mpq",&fil);
if(hFil==INVALID_HANDLE_VALUE)
return; //no patches were found
LoadPatchMD5(fil.cFileName);
while(FindNextFile(hFil,&fil))
LoadPatchMD5(fil.cFileName);
}
示例2: opendir
void Patcher::LoadPatchesInfo()
{
DIR * dirp;
//int errno;
struct dirent * dp;
dirp = opendir("./patches/");
if(!dirp)
return;
while (dirp)
{
errno = 0;
if ((dp = readdir(dirp)) != NULL)
{
int l = strlen(dp->d_name);
if(l < 8)
continue;
if(!memcmp(&dp->d_name[l-4],".mpq",4))
LoadPatchMD5(dp->d_name);
}
else
{
if(errno != 0)
{
closedir(dirp);
return;
}
break;
}
}
if(dirp)
closedir(dirp);
}
示例3: LoadPatchMD5
void PatchCache::LoadPatchesInfo()
{
const int MIN_FILENAME_LENGTH = 8;
boost::filesystem::path p = "./patches/";
try
{
if (boost::filesystem::exists(p) && boost::filesystem::is_directory(p))
{
boost::filesystem::directory_iterator end_itr;
for (boost::filesystem::directory_iterator itr(p); itr != end_itr; ++itr)
{
if (!boost::filesystem::is_regular_file(itr->status()))
continue;
if (itr->path().filename().string().length() >= MIN_FILENAME_LENGTH
&& itr->path().filename().extension().string() == ".mpq")
LoadPatchMD5(itr->path());
}
}
}
catch (const boost::filesystem::filesystem_error& ex)
{
sLog.outError("PatchCache::LoadPatchInfos: Error occured: %s", ex.what());
}
}
示例4: while
void PatchCache::LoadPatchesInfo()
{
ACE_DIR* dirp = ACE_OS::opendir(ACE_TEXT("./patches/"));
if (!dirp)
return;
ACE_DIRENT* dp;
while ((dp = ACE_OS::readdir(dirp)) != NULL)
{
int l = strlen(dp->d_name);
if (l < 8)
continue;
if (!memcmp(&dp->d_name[l - 4], ".mpq", 4))
LoadPatchMD5(dp->d_name);
}
ACE_OS::closedir(dirp);
}
示例5: opendir
void Patcher::LoadPatchesInfo()
{
DIR* dirp;
struct dirent* dp;
dirp = opendir(PATCH_PATH);
if (!dirp)
{
TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Impossible to open folder %s to search for available patches ! Client patching disabled.", PATCH_PATH);
return;
}
while (dirp)
{
errno = 0;
if ((dp = readdir(dirp)) != NULL)
{
int l = strlen(dp->d_name);
if (l < 8)
continue;
if (!strcmp(&dp->d_name[l - 4], ".mpq"))
LoadPatchMD5(PATCH_PATH, dp->d_name);
}
else
{
if (errno != 0)
{
closedir(dirp);
return;
}
break;
}
}
if (dirp)
closedir(dirp);
}