EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Multiple Remote Zone Server Fix (https://www.eqemulator.org/forums/showthread.php?t=38061)

vishnu 04-15-2014 09:32 PM

Multiple Remote Zone Server Fix
 
I'm using zone servers not on the same host as the other servers and it would always handout the IP address of where the world server is running. This fix will allow you use remote zone servers in conjunction with a local zone server. Just be sure to change your <tcp ip="xxx.xxx.xxx.xxx" line inside the eqemu_config.xml file on the remote zone server to point to the IP of the worldserver. This code should take care of the rest.

original ./world/client.cpp
Code:

if (!zs_addr[0]) {
        if (cle->IsLocalClient()) {
                struct in_addr in;
                in.s_addr = zs->GetIP();
                zs_addr=inet_ntoa(in);
                if (!strcmp(zs_addr,"127.0.0.1"))
                        zs_addr=WorldConfig::get()->LocalAddress.c_str();
        } else {
                zs_addr=WorldConfig::get()->WorldAddress.c_str();
        }
}

replace it with:
Code:

if (!zs_addr[0]) {
        if (cle->IsLocalClient()) {
                struct in_addr in;
                in.s_addr = zs->GetIP();
                zs_addr=inet_ntoa(in);
                if (!strcmp(zs_addr,"127.0.0.1"))
                        zs_addr=WorldConfig::get()->LocalAddress.c_str();
        } else {
                //zs_addr=WorldConfig::get()->WorldAddress.c_str();
                struct in_addr in;
                in.s_addr = zs->GetIP();
                zs_addr=inet_ntoa(in);
        }
}


vishnu 04-15-2014 11:31 PM

update:
Code:

if (!zs_addr[0]) {
        if (cle->IsLocalClient()) {
                struct in_addr in;
                in.s_addr = zs->GetIP();
                zs_addr=inet_ntoa(in);
                if (!strcmp(zs_addr,"127.0.0.1"))
                        zs_addr=WorldConfig::get()->LocalAddress.c_str();
        } else {
                //zs_addr=WorldConfig::get()->WorldAddress.c_str();
                struct in_addr in;
                in.s_addr = zs->GetIP();
                zs_addr=inet_ntoa(in);
                if (!strcmp(zs_addr,"127.0.0.1"))
                        zs_addr=WorldConfig::get()->WorldAddress.c_str();
        }
}



All times are GMT -4. The time now is 08:00 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.