How to Integrate a Game at IDC Games
  • Introduction
  • Quick Integration Guide
    • 1. Upload your game
    • 2. You integrate our login system
    • 3. Quick Payments Integration
    • 4. Upload Content to the Game Page
    • 5. Player acquisition
  • Complete Integration Guide
    • Introducion
    • 1. Panel Guide
      • 1.1. Create a new game
      • 1.2 Game Configuration
      • 1.3 Shop
        • 1.3.1. Shop Wizard
        • 1.3.2. Shop Offers
        • 1.3.3. Shop Coupons
        • 1.3.4. Shop Themes
        • 1.3.5. Test shop
      • 1.4. Multi-Language
      • 1.5. Releases
      • 1.6. DLC
      • 1.7. Store Content
      • 1.8. Content
      • 1.9. WebSection
      • 1.10. Purchase Report
        • 1.10.1. Dashboard
        • 1.10.2 Client & App
        • 1.10.3 Gamer Level
        • 1.10.4 Region & Country
        • 1.10.5 Purchase Notifications
        • 1.10.6 Sales Wallet
        • 1.10.7 Player Summary
      • 1.11 Stats Report
        • 1.11.1 Leads
        • 1.11.2 Retention
        • 1.11.3 Login
        • 1.11.4 Payment
        • 1.11.5 Wishlist
    • 2. Login Guide
      • 2.1. Login with Unity
      • 2.2. Login with C#
      • 2.3. Login with C++/Unreal
      • 2.4. Login with HTTP
      • 2.5. Login with Web Service Definition Language (WSDL)
    • 3. Payments Guide
      • 3.1. Payments Integration Overview
      • 3.2. How to launch the Shop
    • 4. API Guide
      • Releases Workflow
      • C# examples
  • The Platform Visual Guide
    • About the Game Platform
    • General Pages
    • Game page
  • Glossary
    • Glossary
Powered by GitBook
On this page

Was this helpful?

  1. Complete Integration Guide
  2. 2. Login Guide

2.3. Login with C++/Unreal

Previous2.2. Login with C#Next2.4. Login with HTTP

Last updated 1 year ago

Was this helpful?

You can download the DLL .

Example of login with C++/Unreal

#if _WIN32 || _WIN64
#if _WIN64
#define ENV64BIT
BOOL GetProcAddresses(HINSTANCE *hLibrary, LPCWSTR lpszLibrary, INT nCount, ...)
{
    va_list va;
    va_start(va, nCount);

    if ((*hLibrary = LoadLibrary(lpszLibrary))
        != NULL)
    {
        FARPROC * lpfProcFunction = NULL;
        LPSTR lpszFuncName = NULL;
        INT nIdxCount = 0;
        while (nIdxCount < nCount)
        {
            lpfProcFunction = va_arg(va, FARPROC*);
            lpszFuncName = va_arg(va, LPSTR);
            if ((*lpfProcFunction =
                GetProcAddress(*hLibrary,
                    lpszFuncName)) == NULL)
            {
                lpfProcFunction = NULL;
                return FALSE;
            }
            nIdxCount++;
        }
    }
    else
    {
        va_end(va);
        return FALSE;
    }
    va_end(va);
    return TRUE;
}
#else
#define ENV32BIT
BOOL GetProcAddresses(HINSTANCE *hLibrary, LPCSTR lpszLibrary, INT nCount, ...)
{
    va_list va;
    va_start(va, nCount);

    if ((*hLibrary = LoadLibrary(lpszLibrary))
        != NULL)
    {
        FARPROC * lpfProcFunction = NULL;
        LPSTR lpszFuncName = NULL;
        INT nIdxCount = 0;
        while (nIdxCount < nCount)
        {
            lpfProcFunction = va_arg(va, FARPROC*);
            lpszFuncName = va_arg(va, LPSTR);
            if ((*lpfProcFunction =
                GetProcAddress(*hLibrary,
                    lpszFuncName)) == NULL)
            {
                lpfProcFunction = NULL;
                return FALSE;
            }
            nIdxCount++;
        }
    }
    else
    {
        va_end(va);
        return FALSE;
    }
    va_end(va);
    return TRUE;
}
#endif
#endif


private void idcfunctions()
{
    /*char buff[100];
    std::cin >> buff;*/
    //int(__stdcall* GetUserProfileInfo)(int, char*, char*, char*, char*, char*, char*, char*, char*, char*);
    int result;

    //GetAccessData Parameters
    int idcgameid;
    char idctk[1024];
    char idcuuid[1024];
    int userid;
    char usercrc[1024];
    char country[3];
    char language[3];
    char currency[3];


    //GetUserProfileInfo Parameters
    //int userid = 1; //userid is already defined for GetAccessData
    char secret[] = "test";
    char nick[80];
    char email[320];
    char status[1024];
    char avatar[1024];
    char custom[1024];

    typedef int (WINAPI *GETACCESSDATA)
        (int, LPCSTR, LPCSTR, int*, LPCSTR, LPCSTR, LPCSTR, LPCSTR);
    GETACCESSDATA GetAccessData = NULL;
    typedef int (WINAPI *GETUSERPROFILEINFO)
        (int, LPCSTR, LPCSTR, LPCSTR, LPCSTR, LPCSTR, LPCSTR);
    GETUSERPROFILEINFO GetUserProfileInfo = NULL;
    HINSTANCE hLib;
    //Params: Instance, libname, number of functionts to import, function pointer 1, function name 1, function pointer 2, function name 2...
    if(GetProcAddresses(&hLib, L"idclib.dll", 2, &GetAccessData, "GetAccessData", &GetUserProfileInfo, "GetUserProfileInfo"))
    {
        gameid = 1;
        char idctkaux[1024] = "ae854aeb5b7397da99b5c8aed5eb8cea";
        strcpy_s(idctk, strlen(idctkaux) + 1, idctkaux);
        char uuidaux[1024] = "6022DAAE-03F7-11E9-BB88-E86A6485A3C7";
        strcpy_s(uuid, strlen(uuidaux) + 1,uuidaux);
        result = GetAccessData(idcgameid, idctk, idcuuid, &userid, usercrc, country, language, currency);
        if (result == 0) {
            //Success
            result = GetUserProfileInfo(userid, secret, nick, email, status, avatar, custom, country, language, currency);
            if (result == 0) {
                //Success
            }
        }
    }
    if (hLib != NULL)
        FreeLibrary(hLib);
}

here