Yardım Dış ip alamama sorunu

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

isacilgin

Üye
Üye
Merhaba değerli dostlar. sunucumda oyunu açmaya çalıştığımda dış ip alınamadı şeklinde bir hata alıyorum. alta ekledim fikri olan yada çözümü olan ?


sorun:
GIRISLER ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

KANAL1 CEKIRDEK1 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

KANAL1 CEKIRDEK2 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

KANAL1 CEKIRDEK3 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

KANAL1 CEKIRDEK4 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

GAME99 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address
 
bu alanmı bende böyle görünen bi alan var:
if (!ifap->ifa_netmask ||  // ignore if no netmask
                sai->sin_addr.s_addr == 0 || // ignore if address is 0.0.0.0
                sai->sin_addr.s_addr == 16777343) // ignore if address is 127.0.0.1
            continue;
O kısmın biraz aşağısında:

Adsız.png
 
game/src/config.cpp (GetIPInfo) içinde:

192.168 -> 999.999 şeklinde değiştir
bu satır olabilirmi 111.111 olan ?:
bool GetIPInfo()
{
#ifndef __WIN32__
    struct ifaddrs* ifaddrp = NULL;

    if (0 != getifaddrs(&ifaddrp))
        return false;

    for( struct ifaddrs* ifap=ifaddrp ; NULL != ifap ; ifap = ifap->ifa_next )
    {
        struct sockaddr_in * sai = (struct sockaddr_in *) ifap->ifa_addr;

        if (!ifap->ifa_netmask ||  // ignore if no netmask
                sai->sin_addr.s_addr == 0 || // ignore if address is 0.0.0.0
                sai->sin_addr.s_addr == 16777343) // ignore if address is 127.0.0.1
            continue;
#else
    WSADATA wsa_data;
    char host_name[100];
    HOSTENT* host_ent;
    int n = 0;

    if (WSAStartup(0x0101, &wsa_data)) {
        return false;
    }

    gethostname(host_name, sizeof(host_name));
    host_ent = gethostbyname(host_name);
    if (host_ent == NULL) {
        return false;
    }
    for ( ; host_ent->h_addr_list[n] != NULL; ++n) {
        struct sockaddr_in addr;
        struct sockaddr_in* sai = &addr;
        memcpy(&sai->sin_addr.s_addr, host_ent->h_addr_list[n], host_ent->h_length);
#endif

        char * netip = inet_ntoa(sai->sin_addr);

        if (!strncmp(netip, "111.111", 7)) // ignore if address is starting with 192
        {
            strlcpy(g_szInternalIP, netip, sizeof(g_szInternalIP));
#ifndef __WIN32__
            fprintf(stderr, "INTERNAL_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
            fprintf(stderr, "INTERNAL_IP: %s\n", netip);
#endif
        }
        else if (!strncmp(netip, "10.", 3))
        {
            strlcpy(g_szInternalIP, netip, sizeof(g_szInternalIP));
#ifndef __WIN32__
            fprintf(stderr, "INTERNAL_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
            fprintf(stderr, "INTERNAL_IP: %s\n", netip);
#endif
        }
        else if (g_szPublicIP[0] == '0')
        {
            strlcpy(g_szPublicIP, netip, sizeof(g_szPublicIP));
#ifndef __WIN32__
            fprintf(stderr, "PUBLIC_IP: %s interface %s\n", netip, ifap->ifa_name);
#else
            fprintf(stderr, "PUBLIC_IP: %s\n", netip);
#endif
        }
    }

#ifndef __WIN32__
    freeifaddrs( ifaddrp );
#else
    WSACleanup();
#endif

    if (g_szPublicIP[0] != '0')
        return true;
    else
        return false;
}
 
Aynen dediğim şekilde yapıp dene
evet config.cpp de değişiklik yapıp build aldım sunucuma tekrar attım ama sonuç yine aynı. :/

sonuç:
GIRISLER ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

KANAL1 CEKIRDEK1 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

KANAL1 CEKIRDEK2 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

KANAL1 CEKIRDEK3 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

KANAL1 CEKIRDEK4 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address

GAME99 ACILIYOR ..
INTERNAL_IP: 10.128.0.6 interface vtnet0
Can not get public ip address
 
Geri