Otomatik Makine IP Tespiti

nyami

Üye
Üye
Mesaj
135
Beğeni
61
Puan
114
common/service.h:
//Ekle
#define ENABLE_AUTODETECT_INTERNAL_IP                // AutoDetect Local Machine IP

config.cpp:
//Arat
    if (g_szPublicIP[0] != '0')
        return true;
    else
        return false;

//Değiştir
    if (g_szPublicIP[0] != '0')
        return true;
    else
    {
#ifdef ENABLE_AUTODETECT_INTERNAL_IP
        if (g_szInternalIP[0] == '0')
            return false;
        else
        {
            strlcpy(g_szPublicIP, g_szInternalIP, sizeof(g_szPublicIP));
            fprintf(stderr, "INTERNAL_IP -> PUBLIC_IP: %s\n", g_szPublicIP);
            return true;
        }
#else
        return false;
#endif
    }
 

Üst