mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-01 19:56:38 +00:00
Merge of a monster
This commit is contained in:
+32
-32
@@ -1,19 +1,19 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||
are required to give you total support for your newly bought product;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "eql_config.h"
|
||||
|
||||
LauncherList::LauncherList()
|
||||
: nextID(1)
|
||||
: nextID(1)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -32,21 +32,21 @@ LauncherList::~LauncherList() {
|
||||
std::vector<LauncherLink *>::iterator cur, end;
|
||||
cur = m_pendingLaunchers.begin();
|
||||
end = m_pendingLaunchers.end();
|
||||
for(; cur != end; ++cur) {
|
||||
for (; cur != end; ++cur) {
|
||||
delete *cur;
|
||||
}
|
||||
|
||||
std::map<std::string, EQLConfig *>::iterator curc, endc;
|
||||
curc = m_configs.begin();
|
||||
endc = m_configs.end();
|
||||
for(; curc != endc; ++curc) {
|
||||
for (; curc != endc; ++curc) {
|
||||
delete curc->second;
|
||||
}
|
||||
|
||||
std::map<std::string, LauncherLink *>::iterator curl, endl;
|
||||
curl = m_launchers.begin();
|
||||
endl = m_launchers.end();
|
||||
for(; curl != endl; ++curl) {
|
||||
for (; curl != endl; ++curl) {
|
||||
delete curl->second;
|
||||
}
|
||||
}
|
||||
@@ -54,9 +54,9 @@ LauncherList::~LauncherList() {
|
||||
void LauncherList::Process() {
|
||||
std::vector<LauncherLink *>::iterator cur;
|
||||
cur = m_pendingLaunchers.begin();
|
||||
while(cur != m_pendingLaunchers.end()) {
|
||||
while (cur != m_pendingLaunchers.end()) {
|
||||
LauncherLink *l = *cur;
|
||||
if(l->HasName()) {
|
||||
if (l->HasName()) {
|
||||
//launcher has identified itself now.
|
||||
//remove ourself from the pending list
|
||||
cur = m_pendingLaunchers.erase(cur);
|
||||
@@ -64,14 +64,15 @@ void LauncherList::Process() {
|
||||
//kill off anybody else using our name.
|
||||
std::map<std::string, LauncherLink *>::iterator res;
|
||||
res = m_launchers.find(name);
|
||||
if(res != m_launchers.end()) {
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Ghosting launcher %s", name.c_str());
|
||||
if (res != m_launchers.end()) {
|
||||
Log(Logs::Detail, Logs::World_Server, "Ghosting launcher %s", name.c_str());
|
||||
delete res->second;
|
||||
}
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str());
|
||||
Log(Logs::Detail, Logs::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str());
|
||||
//put the launcher in the list.
|
||||
m_launchers[name] = l;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
++cur;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +81,7 @@ void LauncherList::Process() {
|
||||
LauncherLink *LauncherList::Get(const char *name) {
|
||||
std::map<std::string, LauncherLink *>::iterator res;
|
||||
res = m_launchers.find(name);
|
||||
if(res == m_launchers.end())
|
||||
if (res == m_launchers.end())
|
||||
return(nullptr);
|
||||
return(res->second);
|
||||
}
|
||||
@@ -89,8 +90,8 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) {
|
||||
std::map<std::string, LauncherLink *>::iterator cur, end;
|
||||
cur = m_launchers.begin();
|
||||
end = m_launchers.end();
|
||||
for(; cur != end; ++cur) {
|
||||
if(cur->second->ContainsZone(short_name))
|
||||
for (; cur != end; ++cur) {
|
||||
if (cur->second->ContainsZone(short_name))
|
||||
return(cur->second);
|
||||
}
|
||||
return(nullptr);
|
||||
@@ -98,7 +99,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) {
|
||||
|
||||
void LauncherList::Add(std::shared_ptr<EQ::Net::ServertalkServerConnection> conn) {
|
||||
auto it = new LauncherLink(nextID++, conn);
|
||||
Log.Out(Logs::Detail, Logs::World_Server, "Adding pending launcher %d", it->GetID());
|
||||
Log(Logs::Detail, Logs::World_Server, "Adding pending launcher %d", it->GetID());
|
||||
m_pendingLaunchers.push_back(it);
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ void LauncherList::GetLauncherNameList(std::vector<std::string> &res) {
|
||||
std::map<std::string, EQLConfig *>::iterator cur, end;
|
||||
cur = m_configs.begin();
|
||||
end = m_configs.end();
|
||||
for(; cur != end; ++cur) {
|
||||
for (; cur != end; ++cur) {
|
||||
res.push_back(cur->first);
|
||||
}
|
||||
}
|
||||
@@ -145,7 +146,7 @@ void LauncherList::LoadList() {
|
||||
std::vector<std::string>::iterator cur, end;
|
||||
cur = launchers.begin();
|
||||
end = launchers.end();
|
||||
for(; cur != end; ++cur) {
|
||||
for (; cur != end; ++cur) {
|
||||
m_configs[*cur] = new EQLConfig(cur->c_str());
|
||||
}
|
||||
}
|
||||
@@ -153,7 +154,7 @@ void LauncherList::LoadList() {
|
||||
EQLConfig *LauncherList::GetConfig(const char *name) {
|
||||
std::map<std::string, EQLConfig *>::iterator res;
|
||||
res = m_configs.find(name);
|
||||
if(res == m_configs.end()) {
|
||||
if (res == m_configs.end()) {
|
||||
return(nullptr);
|
||||
}
|
||||
return(res->second);
|
||||
@@ -166,15 +167,14 @@ void LauncherList::CreateLauncher(const char *name, uint8 dynamic_count) {
|
||||
void LauncherList::Remove(const char *name) {
|
||||
std::map<std::string, EQLConfig *>::iterator resc;
|
||||
resc = m_configs.find(name);
|
||||
if(resc != m_configs.end()) {
|
||||
if (resc != m_configs.end()) {
|
||||
delete resc->second;
|
||||
m_configs.erase(resc);
|
||||
}
|
||||
|
||||
std::map<std::string, LauncherLink *>::iterator resl;
|
||||
resl = m_launchers.find(name);
|
||||
if(resl != m_launchers.end()) {
|
||||
if (resl != m_launchers.end()) {
|
||||
resl->second->Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user