mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Fix for how servers are removed and added to loginserver
This commit is contained in:
parent
bdf6f6da99
commit
3e38055f20
@ -39,18 +39,21 @@ ServerManager::ServerManager()
|
|||||||
server_connection->OnConnectionIdentified("World", [this](std::shared_ptr<EQ::Net::ServertalkServerConnection> c) {
|
server_connection->OnConnectionIdentified("World", [this](std::shared_ptr<EQ::Net::ServertalkServerConnection> c) {
|
||||||
Log.OutF(Logs::General, Logs::Login_Server, "New world server connection from {0}:{1}", c->Handle()->RemoteIP(), c->Handle()->RemotePort());
|
Log.OutF(Logs::General, Logs::Login_Server, "New world server connection from {0}:{1}", c->Handle()->RemoteIP(), c->Handle()->RemotePort());
|
||||||
|
|
||||||
WorldServer *server_entity = GetServerByAddress(c->Handle()->RemoteIP(), c->Handle()->RemotePort());
|
auto iter = world_servers.begin();
|
||||||
if (server_entity) {
|
while (iter != world_servers.end()) {
|
||||||
Log.OutF(Logs::General, Logs::Login_Server, "World server already existed for {0}:{1}, removing existing connection and updating current.",
|
if ((*iter)->GetConnection()->Handle()->RemoteIP().compare(c->Handle()->RemoteIP()) == 0 &&
|
||||||
c->Handle()->RemoteIP(), c->Handle()->RemotePort());
|
(*iter)->GetConnection()->Handle()->RemotePort() == c->Handle()->RemotePort()) {
|
||||||
|
Log.OutF(Logs::General, Logs::Login_Server, "World server already existed for {0}:{1}, removing existing connection.",
|
||||||
|
c->Handle()->RemoteIP(), c->Handle()->RemotePort());
|
||||||
|
|
||||||
|
world_servers.erase(iter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
server_entity->SetConnection(c);
|
++iter;
|
||||||
server_entity->Reset();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
world_servers.push_back(std::unique_ptr<WorldServer>(new WorldServer(c)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
world_servers.push_back(std::unique_ptr<WorldServer>(new WorldServer(c)));
|
||||||
});
|
});
|
||||||
|
|
||||||
server_connection->OnConnectionRemoved("World", [this](std::shared_ptr<EQ::Net::ServertalkServerConnection> c) {
|
server_connection->OnConnectionRemoved("World", [this](std::shared_ptr<EQ::Net::ServertalkServerConnection> c) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user