2. You integrate our login system

Login Overview

If you wish to publish your game DRM free, you can skip the login system integration. If not, login integration is compulsory.

Your game is now available at our launcher in test mode with the following parameters, that we add for developers to test the game prior to release.

PARAMETER NAMEDESCRIPTION

idctk

Token that identifies a start session at the game

idcgameid

Unique game identifier

idcuuid

Identifies the machine from which the session was started (only necessary if developers don't use the IDC Games library to retrieve the user ID

result

Values: 0 (OK) or 1 (USER INVALID)

Once these parameters are retrieved, the game can access the information in 2 ways:

  • 1. Calling the GetAccessData function at our DLL idclib.dll/idclib64.dll.

  • 2. Making an HTTP request to and URL that will retrieve the necessary data. This is recommended for games that prefer to make a server to server call from the game's server to IDC's. In this case, developers have to notify IDC Games the IP/IPs from which they will launch the request.

Login with Unity

You can download the Unity login package here.

How to integrate the IDC Login prefab for Unity:

1. Drag IDCLoginManager prefab to your scene.

2. Select IDCLoginManager object and set your game "secret" at the Inspector.

3. You can retrieve if a user is logged in with the IsLogged property.

string isLogged = IDCLoginManager.instance.IsLogged;

4. Retrieve advanced user data by adding the following code at your scripts:

string userId = IDCLoginManager.instance.UserId;
string country = IDCLoginManager.instance.Country;
string language = IDCLoginManager.instance.Language;
string currency = IDCLoginManager.instance.Currency;
string nick = IDCLoginManager.instance.Nick;
string email = IDCLoginManager.instance.Email;
string status = IDCLoginManager.instance.Status;
string avatar = IDCLoginManager.instance.Avatar;
string custom = IDCLoginManager.instance.Custom;

Login with C#

You can download the DLL here.

Example:

    [DllImportAttribute("idclib.dll")]
        public static extern int GetAccessData(int idcgameid, string idctk, string idcuuid, ref int iduser, 
          [Out] StringBuilder usercrc,
          [Out] StringBuilder language, 
          [Out] StringBuilder country,
          [Out] StringBuilder currency);

    [DllImportAttribute("idclib.dll")]
        public static extern int GetUserProfileInfo(int userid, string secret,
          [Out] StringBuilder nick, [Out] StringBuilder email,
          [Out] StringBuilder status, [Out] StringBuilder avatar,
          [Out] StringBuilder custom, [Out] StringBuilder language,
          [Out] StringBuilder country, [Out] StringBuilder currency);

        private void idcfunctions()
        {
            int result = 0;

    //getAcessData params
            int userid = 0;
            int gameid = 1;
            StringBuilder usercrcaux = new StringBuilder(256);
            StringBuilder countryaux = new StringBuilder(3);
            StringBuilder languageaux = new StringBuilder(3);
            StringBuilder currencyaux = new StringBuilder(3);
            string usercrc;
            string country;
            string language;
            string currency;

    //getUserProfileInfo params
        //int gameid; //already defined in getAccessData params
            string token = "4a0a7b6e8f7775f84883093e1028a0a2";
            string uuid = "6022DAAE-03F7-11E9-BB88-E86A6485A3C7";
            StringBuilder nickaux = new StringBuilder(80);
            StringBuilder emailaux = new StringBuilder(320);
            StringBuilder statusaux = new StringBuilder(1024);
            StringBuilder avataraux = new StringBuilder(1024);
            StringBuilder customaux = new StringBuilder(1024);
            string nick;
            string email;
            string status;
            string avatar;
            string custom;

            result = getAccessData(gameid, token, uuid, ref userid, usercrcaux, countryaux, languageaux, currencyaux);
            if (result == 0)
            {
                usercrc = usercrcaux.ToString();
                country = countryaux.ToString();
                language = languageaux.ToString();
                currency = currencyaux.ToString();
            }

            result = getUserProfileInfo(userid, secret, nickaux, emailaux, statusaux, avataraux, customaux, countryaux, languageaux, currencyaux);
            if (result == 0)
            {
                nick = nickaux.ToString();
                email = emailaux.ToString();
                status = statusaux.ToString();
                avatar = avataraux.ToString();
                custom = customaux.ToString();
                country = countryaux.ToString();
                language = languageaux.ToString();
                currency = currencyaux.ToString();
          }
        }
 

Login with C++/Unreal

You can download the DLL here.

Example:

#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(&amp;hLib, L"idclib.dll", 2, &amp;GetAccessData, "GetAccessData", &amp;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, &amp;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);
}

Login with HTTP

https://www.idcgames.com/unilogin/GetAccessData.php?

Parameters of the request

  • &idctk is obtained from idctk parameter

  • &idcgameid unique game identifier obtained from idcgameid parameter

  • &idcuuid obtained from idcuuid parameter

Parameters of the answer

PARAMETER NAMEDESCRIPTION

result

Values: 0 (OK) or 1 (USER INVALID)

userid

User identifier within the IDC Games platform

usercrc

for security reasons we add a CRC that always will match the userid, it can be used to avoid man-in-the-middle securiy problems.

language

2 letters that indicate the language of the user (ISO 639-1)

country

2 letters that indicates the country code (ISO 3166-1)

currency

3 letters indicating the curreny that the user has used to buy in the platfotm (ISO-4217)

Example of the request

https://www.idcgames.com/unilogin/getAccessData.php? idctk=6ae4e9d12e76438eb41955c09c9369ef&idcgameid=999&idcuuid=6022DAAE-03F7-11E9-BB88-E86A6485A3C7

Example of the answer

{"status":0,"description":"LOGIN OK","user":{"userid":19833”, "usercrc":"c0c16dbf26478896b9a76b01670247fa", "language":"es", "country":"ES", "currency":"}}

Login with Web Service Definition Language (WSDL)

The WSDL to retrieve the available web services is at the following URL:

https://www.idcgames.com/unilogin/idcws.php?wsdl

The web services available are GetAccessData and GetUserProfileInfo and the parameters of the answer are the same as explained at the Login Overview section above.

Request extra user's info in C#

Method definitions:

[DllImportAttribute("idclib_64.dll")]
public static extern int getUserProfileInfo (string userid, string apisecret, [Out] StringBuilder nick, [Out] StringBuilder email, [Out] StringBuilder avatar, [Out] StringBuilder status, [Out] StringBuilder custom;

At the class that calls the method:

IntBuilder nick = new IntBuilder(80);
StringBuilder email = new StringBuilder(320);
StringBuilder avatar = new StringBuilder(2048);
StringBuilder status = new StringBuilder(256);
StringBuilder custom = new StringBuilder(256);
Int result = getUserProfileInfo (userid, apisecret, nick, email, avatar, status, custom);

Request extra user's info in HTTP

https://www.idcgames.com/unilogin/getUserProfileInfo.php?

Parameters of the request:

  • &userid

  • &apisecret with the following values: 0 (OK) or 1 (USER INVALID)

  • nick: user's nick

  • email: user's email address, of provided

  • avatar: URL to the user's avatar's image

  • status: conexion status of the user: online, offline, etc.

  • custom: custom user's status message

Last updated