当前位置: 首页>>代码示例>>C++>>正文


C++ LoadPatchMD5函数代码示例

本文整理汇总了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);
}
开发者ID:Dump,项目名称:mangos,代码行数:12,代码来源:AuthSocket.cpp

示例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);
}
开发者ID:X-Core,项目名称:X-core-addons,代码行数:33,代码来源:AuthSocket.cpp

示例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());
    }
}
开发者ID:beyourself,项目名称:RustEmu-Core,代码行数:28,代码来源:PatchHandler.cpp

示例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);
}
开发者ID:SakhWoW,项目名称:blizzlikecore,代码行数:21,代码来源:PatchHandler.cpp

示例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);
}
开发者ID:RaitoBezarius,项目名称:TrinityCore,代码行数:40,代码来源:AuthSocket.cpp


注:本文中的LoadPatchMD5函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。