Added two other commands to let you do shared reloading on your own without the hotfix command. Also changed how world determines a zone's address

This commit is contained in:
KimLS
2015-07-16 01:51:10 -07:00
parent 9f1f36cca6
commit b7cd0b223f
9 changed files with 98 additions and 79 deletions
+17 -16
View File
@@ -1217,30 +1217,31 @@ void Client::Clearance(int8 response)
return;
}
// @bp This is the chat server
/*
char packetData[] = "64.37.148.34.9876,MyServer,Testchar,23cd2c95";
outapp = new EQApplicationPacket(OP_0x0282, sizeof(packetData));
strcpy((char*)outapp->pBuffer, packetData);
QueuePacket(outapp);
delete outapp;
*/
// Send zone server IP data
outapp = new EQApplicationPacket(OP_ZoneServerInfo, sizeof(ZoneServerInfo_Struct));
ZoneServerInfo_Struct* zsi = (ZoneServerInfo_Struct*)outapp->pBuffer;
const char *zs_addr=zs->GetCAddress();
if (!zs_addr[0]) {
if (cle->IsLocalClient()) {
const char *zs_addr = nullptr;
if(cle && cle->IsLocalClient()) {
const char *local_addr = zs->GetCLocalAddress();
if(local_addr[0]) {
zs_addr = local_addr;
} else {
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();
zs_addr = inet_ntoa(in);
}
} else {
const char *addr = zs->GetCAddress();
if(addr[0]) {
zs_addr = addr;
} else {
zs_addr=WorldConfig::get()->WorldAddress.c_str();
struct in_addr in;
in.s_addr = zs->GetIP();
zs_addr = inet_ntoa(in);
}
}
strcpy(zsi->ip, zs_addr);
zsi->port =zs->GetCPort();
Log.Out(Logs::Detail, Logs::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port);
+14 -3
View File
@@ -57,6 +57,7 @@ ZoneServer::ZoneServer(EmuTCPConnection* itcpc)
instanceID = 0;
memset(clientaddress, 0, sizeof(clientaddress));
memset(clientlocaladdress, 0, sizeof(clientlocaladdress));
clientport = 0;
BootingUp = false;
authenticated = false;
@@ -581,7 +582,7 @@ bool ZoneServer::Process() {
ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer;
if (!sci->port) {
clientport=zoneserver_list.GetAvailableZonePort();
clientport = zoneserver_list.GetAvailableZonePort();
ServerPacket p(ServerOP_SetConnectInfo, sizeof(ServerConnectInfo));
memset(p.pBuffer,0,sizeof(ServerConnectInfo));
@@ -590,8 +591,18 @@ bool ZoneServer::Process() {
SendPacket(&p);
Log.Out(Logs::Detail, Logs::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport);
} else {
clientport=sci->port;
Log.Out(Logs::Detail, Logs::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport);
clientport = sci->port;
Log.Out(Logs::Detail, Logs::World_Server,"Zone specified port %d.",clientport);
}
if(sci->address[0]) {
strn0cpy(clientaddress, sci->address, 250);
Log.Out(Logs::Detail, Logs::World_Server, "Zone specified address %s.", sci->address);
}
if(sci->local_address[0]) {
strn0cpy(clientlocaladdress, sci->local_address, 250);
Log.Out(Logs::Detail, Logs::World_Server, "Zone specified local address %s.", sci->address);
}
}
+2
View File
@@ -56,6 +56,7 @@ public:
inline uint32 GetIP() const { return tcpc->GetrIP(); }
inline uint16 GetPort() const { return tcpc->GetrPort(); }
inline const char* GetCAddress() const { return clientaddress; }
inline const char* GetCLocalAddress() const { return clientaddress; }
inline uint16 GetCPort() const { return clientport; }
inline uint32 GetID() const { return ID; }
inline bool IsBootingUp() const { return BootingUp; }
@@ -73,6 +74,7 @@ private:
uint32 ID;
char clientaddress[250];
char clientlocaladdress[250];
uint16 clientport;
bool BootingUp;
bool staticzone;