Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cleanup] use std::make_unique #1259

Merged
merged 31 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
02ecb79
Convert common/eq_limits.cpp to use make_unique
mackal Feb 18, 2021
37bed7d
Convert common/net/console_server.cpp to use make_unique
mackal Feb 18, 2021
9cd4cf6
Convert common/net/servertalk_client_connection.cpp to use make_unique
mackal Feb 18, 2021
945197c
Convert common/net/servertalk_legacy_client_connection.cpp to use mak…
mackal Feb 18, 2021
65f2757
Convert common/net/servertalk_server.cpp to use make_unique
mackal Feb 18, 2021
3b61abb
Convert common/net/websocket_server.cpp to use make_unique
mackal Feb 18, 2021
4cb2ba3
Convert common/net/websocket_server_connection.cpp to use make_unique
mackal Feb 18, 2021
08a4bcc
Convert common/shareddb.cpp to use make_unique
mackal Feb 18, 2021
971c85f
Convert eqlaunch/worldserver.cpp to use make_unique
mackal Feb 18, 2021
b85acb4
Convert loginserver/server_manager.cpp to use make_unique
mackal Feb 18, 2021
47d5b86
Convert loginserver/world_server.cpp to use make_unique
mackal Feb 18, 2021
5faccf4
Convert queryserv/worldserver.cpp to use make_unique
mackal Feb 18, 2021
8b57b6e
Convert ucs/worldserver.cpp to use make_unique
mackal Feb 18, 2021
ae6486a
Convert world/clientlist.cpp to use make_unique
mackal Feb 18, 2021
28e65ca
Convert world/expedition.cpp to use make_unique
mackal Feb 18, 2021
992ebf9
Convert world/launcher_link.cpp to use make_unique
mackal Feb 18, 2021
c96934e
Convert world/login_server.cpp to use make_unique
mackal Feb 18, 2021
bae069d
Convert world/main.cpp to use make_unique
mackal Feb 18, 2021
204ecbe
Convert world/ucs.cpp to use make_unique
mackal Feb 18, 2021
797de2f
Convert world/web_interface.cpp to use make_unique
mackal Feb 18, 2021
537f04b
Convert world/zonelist.cpp to use make_unique
mackal Feb 18, 2021
24cf30b
Convert world/zoneserver.cpp to use make_unique
mackal Feb 18, 2021
e6a409a
Convert zone/client.cpp to use make_unique
mackal Feb 18, 2021
c3fc655
Convert zone/corpse.cpp to use make_unique
mackal Feb 18, 2021
3e03b6f
Convert zone/dynamiczone.cpp to use make_unique
mackal Feb 18, 2021
53969c0
Convert zone/expedition.cpp to use make_unique
mackal Feb 18, 2021
6da11d8
Convert zone/main.cpp to use make_unique
mackal Feb 18, 2021
ee1919e
Convert zone/mob_ai.cpp to use make_unique
mackal Feb 18, 2021
7068c2a
Convert zone/mob_movement_manager.cpp to use make_unique
mackal Feb 18, 2021
7482dea
Convert zone/pathfinder_nav_mesh.cpp to use make_unique
mackal Feb 18, 2021
ee59128
Convert zone/worldserver.cpp to use make_unique
mackal Feb 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/eq_limits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ void EQ::inventory::InitializeDynamicLookups() {
continue;

// direct manipulation of lookup indices is safe so long as (int)ClientVersion::<mob> == (int)MobVersion::<mob>
inventory_dynamic_nongm_lookup_entries[iter] = std::unique_ptr<LookupEntry>(new LookupEntry(inventory_static_lookup_entries[iter]));
inventory_dynamic_nongm_lookup_entries[iter] = std::make_unique<LookupEntry>(inventory_static_lookup_entries[iter]);

// clamp affected fields to the lowest standard
inventory_dynamic_nongm_lookup_entries[iter]->InventoryTypeSize.Bank = Titanium::invtype::BANK_SIZE; // bank size
Expand Down Expand Up @@ -864,7 +864,7 @@ void EQ::inventory::InitializeDynamicLookups() {
}

// direct manipulation of lookup indices is safe so long as (int)ClientVersion::<client> == (int)MobVersion::<client>
inventory_dynamic_gm_lookup_entries[iter] = std::unique_ptr<LookupEntry>(new LookupEntry(inventory_static_lookup_entries[iter]));
inventory_dynamic_gm_lookup_entries[iter] = std::make_unique<LookupEntry>(inventory_static_lookup_entries[iter]);

inventory_dynamic_gm_lookup_entries[iter]->PossessionsBitmask = 0; // we'll fix later
inventory_dynamic_gm_lookup_entries[iter]->CorpseBitmask = 0; // we'll fix later
Expand Down
2 changes: 1 addition & 1 deletion common/net/console_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

EQ::Net::ConsoleServer::ConsoleServer(const std::string &addr, int port)
{
m_server.reset(new EQ::Net::TCPServer());
m_server = std::make_unique<EQ::Net::TCPServer>();
m_server->Listen(addr, port, false, [this](std::shared_ptr<EQ::Net::TCPConnection> connection) {
ConsoleServerConnection *c = new ConsoleServerConnection(this, connection);
m_connections.insert(std::make_pair(c->GetUUID(), std::unique_ptr<ConsoleServerConnection>(c)));
Expand Down
2 changes: 1 addition & 1 deletion common/net/servertalk_client_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../eqemu_logsys.h"

EQ::Net::ServertalkClient::ServertalkClient(const std::string &addr, int port, bool ipv6, const std::string &identifier, const std::string &credentials)
: m_timer(std::unique_ptr<EQ::Timer>(new EQ::Timer(100, true, std::bind(&EQ::Net::ServertalkClient::Connect, this))))
: m_timer(std::make_unique<EQ::Timer>(100, true, std::bind(&EQ::Net::ServertalkClient::Connect, this)))
{
m_port = port;
m_ipv6 = ipv6;
Expand Down
2 changes: 1 addition & 1 deletion common/net/servertalk_legacy_client_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../eqemu_logsys.h"

EQ::Net::ServertalkLegacyClient::ServertalkLegacyClient(const std::string &addr, int port, bool ipv6)
: m_timer(std::unique_ptr<EQ::Timer>(new EQ::Timer(100, true, std::bind(&EQ::Net::ServertalkLegacyClient::Connect, this))))
: m_timer(std::make_unique<EQ::Timer>(100, true, std::bind(&EQ::Net::ServertalkLegacyClient::Connect, this)))
{
m_port = port;
m_ipv6 = ipv6;
Expand Down
2 changes: 1 addition & 1 deletion common/net/servertalk_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void EQ::Net::ServertalkServer::Listen(const ServertalkServerOptions& opts)
m_encrypted = opts.encrypted;
m_credentials = opts.credentials;
m_allow_downgrade = opts.allow_downgrade;
m_server.reset(new EQ::Net::TCPServer());
m_server = std::make_unique<EQ::Net::TCPServer>();
m_server->Listen(opts.port, opts.ipv6, [this](std::shared_ptr<EQ::Net::TCPConnection> connection) {
m_unident_connections.push_back(std::make_shared<ServertalkServerConnection>(connection, this, m_encrypted, m_allow_downgrade));
});
Expand Down
8 changes: 4 additions & 4 deletions common/net/websocket_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ struct EQ::Net::WebsocketServer::Impl

EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
{
_impl.reset(new Impl());
_impl->server.reset(new EQ::Net::TCPServer());
_impl = std::make_unique<Impl>();
_impl->server = std::make_unique<EQ::Net::TCPServer>();
_impl->server->Listen(addr, port, false, [this](std::shared_ptr<EQ::Net::TCPConnection> connection) {
auto wsc = _impl->ws_server.get_connection();
WebsocketServerConnection *c = new WebsocketServerConnection(this, connection, wsc);
Expand All @@ -53,7 +53,7 @@ EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)
return websocketpp::lib::error_code();
});

_impl->ping_timer.reset(new EQ::Timer(5000, true, [this](EQ::Timer *t) {
_impl->ping_timer = std::make_unique<EQ::Timer>(5000, true, [this](EQ::Timer *t) {
auto iter = _impl->connections.begin();

while (iter != _impl->connections.end()) {
Expand All @@ -67,7 +67,7 @@ EQ::Net::WebsocketServer::WebsocketServer(const std::string &addr, int port)

iter++;
}
}));
});

_impl->methods.insert(std::make_pair("login", MethodHandlerEntry(std::bind(&WebsocketServer::Login, this, std::placeholders::_1, std::placeholders::_2), 0)));
_impl->methods.insert(std::make_pair("subscribe", MethodHandlerEntry(std::bind(&WebsocketServer::Subscribe, this, std::placeholders::_1, std::placeholders::_2), 0)));
Expand Down
2 changes: 1 addition & 1 deletion common/net/websocket_server_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ EQ::Net::WebsocketServerConnection::WebsocketServerConnection(WebsocketServer *p
std::shared_ptr<TCPConnection> connection,
std::shared_ptr<websocket_connection> ws_connection)
{
_impl.reset(new Impl());
_impl = std::make_unique<Impl>();
_impl->parent = parent;
_impl->connection = connection;
_impl->id = EQ::Util::UUID::Generate().ToString();
Expand Down
26 changes: 13 additions & 13 deletions common/shareddb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,8 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
mutex.Lock();
std::string file_name = Config->SharedMemDir + prefix + std::string("items");
LogInfo("[Shared Memory] Attempting to load file [{}]", file_name);
items_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
items_hash = std::unique_ptr<EQ::FixedMemoryHashSet<EQ::ItemData>>(new EQ::FixedMemoryHashSet<EQ::ItemData>(reinterpret_cast<uint8*>(items_mmf->Get()), items_mmf->Size()));
items_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
items_hash = std::make_unique<EQ::FixedMemoryHashSet<EQ::ItemData>>(reinterpret_cast<uint8*>(items_mmf->Get()), items_mmf->Size());
mutex.Unlock();
} catch(std::exception& ex) {
LogError("Error Loading Items: {}", ex.what());
Expand Down Expand Up @@ -1353,8 +1353,8 @@ bool SharedDatabase::LoadNPCFactionLists(const std::string &prefix) {
mutex.Lock();
std::string file_name = Config->SharedMemDir + prefix + std::string("faction");
LogInfo("[Shared Memory] Attempting to load file [{}]", file_name);
faction_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
faction_hash = std::unique_ptr<EQ::FixedMemoryHashSet<NPCFactionList>>(new EQ::FixedMemoryHashSet<NPCFactionList>(reinterpret_cast<uint8*>(faction_mmf->Get()), faction_mmf->Size()));
faction_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
faction_hash = std::make_unique<EQ::FixedMemoryHashSet<NPCFactionList>>(reinterpret_cast<uint8*>(faction_mmf->Get()), faction_mmf->Size());
mutex.Unlock();
} catch(std::exception& ex) {
LogError("Error Loading npc factions: {}", ex.what());
Expand Down Expand Up @@ -1555,7 +1555,7 @@ bool SharedDatabase::LoadSkillCaps(const std::string &prefix) {
mutex.Lock();
std::string file_name = Config->SharedMemDir + prefix + std::string("skill_caps");
LogInfo("[Shared Memory] Attempting to load file [{}]", file_name);
skill_caps_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
skill_caps_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
mutex.Unlock();
} catch(std::exception &ex) {
LogError("Error loading skill caps: {}", ex.what());
Expand Down Expand Up @@ -1712,7 +1712,7 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
mutex.Lock();

std::string file_name = Config->SharedMemDir + prefix + std::string("spells");
spells_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
spells_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
LogInfo("[Shared Memory] Attempting to load file [{}]", file_name);
*records = *reinterpret_cast<uint32*>(spells_mmf->Get());
*sp = reinterpret_cast<const SPDat_Spell_Struct*>((char*)spells_mmf->Get() + 4);
Expand Down Expand Up @@ -1920,7 +1920,7 @@ bool SharedDatabase::LoadBaseData(const std::string &prefix) {
mutex.Lock();

std::string file_name = Config->SharedMemDir + prefix + std::string("base_data");
base_data_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name));
base_data_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name);
mutex.Unlock();
} catch(std::exception& ex) {
LogError("Error Loading Base Data: {}", ex.what());
Expand Down Expand Up @@ -2223,15 +2223,15 @@ bool SharedDatabase::LoadLoot(const std::string &prefix) {
EQ::IPCMutex mutex("loot");
mutex.Lock();
std::string file_name_lt = Config->SharedMemDir + prefix + std::string("loot_table");
loot_table_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name_lt));
loot_table_hash = std::unique_ptr<EQ::FixedMemoryVariableHashSet<LootTable_Struct>>(new EQ::FixedMemoryVariableHashSet<LootTable_Struct>(
loot_table_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name_lt);
loot_table_hash = std::make_unique<EQ::FixedMemoryVariableHashSet<LootTable_Struct>>(
reinterpret_cast<uint8*>(loot_table_mmf->Get()),
loot_table_mmf->Size()));
loot_table_mmf->Size());
std::string file_name_ld = Config->SharedMemDir + prefix + std::string("loot_drop");
loot_drop_mmf = std::unique_ptr<EQ::MemoryMappedFile>(new EQ::MemoryMappedFile(file_name_ld));
loot_drop_hash = std::unique_ptr<EQ::FixedMemoryVariableHashSet<LootDrop_Struct>>(new EQ::FixedMemoryVariableHashSet<LootDrop_Struct>(
loot_drop_mmf = std::make_unique<EQ::MemoryMappedFile>(file_name_ld);
loot_drop_hash = std::make_unique<EQ::FixedMemoryVariableHashSet<LootDrop_Struct>>(
reinterpret_cast<uint8*>(loot_drop_mmf->Get()),
loot_drop_mmf->Size()));
loot_drop_mmf->Size());
mutex.Unlock();
} catch(std::exception &ex) {
LogError("Error loading loot: {}", ex.what());
Expand Down
4 changes: 2 additions & 2 deletions eqlaunch/worldserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WorldServer::WorldServer(std::map<std::string, ZoneLaunch *> &zones, const char
m_config(config),
m_zones(zones)
{
m_connection.reset(new EQ::Net::ServertalkClient(config->WorldIP, config->WorldTCPPort, false, "Launcher", config->SharedKey));
m_connection = std::make_unique<EQ::Net::ServertalkClient>(config->WorldIP, config->WorldTCPPort, false, "Launcher", config->SharedKey);
m_connection->OnConnect([this](EQ::Net::ServertalkClient *client) {
OnConnected();
});
Expand Down Expand Up @@ -138,4 +138,4 @@ void WorldServer::SendStatus(const char *short_name, uint32 start_count, bool ru

m_connection->SendPacket(pack);
safe_delete(pack);
}
}
4 changes: 2 additions & 2 deletions loginserver/server_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ServerManager::ServerManager()
{
int listen_port = server.config.GetVariableInt("general", "listen_port", 5998);

server_connection.reset(new EQ::Net::ServertalkServer());
server_connection = std::make_unique<EQ::Net::ServertalkServer>();
EQ::Net::ServertalkServerOptions opts;
opts.port = listen_port;
opts.ipv6 = false;
Expand Down Expand Up @@ -68,7 +68,7 @@ ServerManager::ServerManager()
++iter;
}

world_servers.push_back(std::unique_ptr<WorldServer>(new WorldServer(world_connection)));
world_servers.push_back(std::make_unique<WorldServer>(world_connection));
}
);

Expand Down
4 changes: 2 additions & 2 deletions loginserver/world_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ WorldServer::WorldServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> wo
std::bind(&WorldServer::ProcessLSAccountUpdate, this, std::placeholders::_1, std::placeholders::_2)
);

m_keepalive.reset(new EQ::Timer(5000, true, std::bind(&WorldServer::OnKeepAlive, this, std::placeholders::_1)));
m_keepalive = std::make_unique<EQ::Timer>(5000, true, std::bind(&WorldServer::OnKeepAlive, this, std::placeholders::_1));
}

WorldServer::~WorldServer() = default;
Expand Down Expand Up @@ -1317,4 +1317,4 @@ void WorldServer::OnKeepAlive(EQ::Timer *t)
{
ServerPacket pack(ServerOP_KeepAlive, 0);
connection->SendPacket(&pack);
}
}
4 changes: 2 additions & 2 deletions queryserv/worldserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ WorldServer::~WorldServer()

void WorldServer::Connect()
{
m_connection.reset(new EQ::Net::ServertalkClient(Config->WorldIP, Config->WorldTCPPort, false, "QueryServ", Config->SharedKey));
m_connection = std::make_unique<EQ::Net::ServertalkClient>(Config->WorldIP, Config->WorldTCPPort, false, "QueryServ", Config->SharedKey);
m_connection->OnMessage(std::bind(&WorldServer::HandleMessage, this, std::placeholders::_1, std::placeholders::_2));
}

Expand Down Expand Up @@ -185,4 +185,4 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break;
}
}
}
}
2 changes: 1 addition & 1 deletion ucs/worldserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void Client55ToServerSayLink(std::string& serverSayLink, const std::string& clie

WorldServer::WorldServer()
{
m_connection.reset(new EQ::Net::ServertalkClient(Config->WorldIP, Config->WorldTCPPort, false, "UCS", Config->SharedKey));
m_connection = std::make_unique<EQ::Net::ServertalkClient>(Config->WorldIP, Config->WorldTCPPort, false, "UCS", Config->SharedKey);
m_connection->OnMessage(std::bind(&WorldServer::ProcessMessage, this, std::placeholders::_1, std::placeholders::_2));
}

Expand Down
2 changes: 1 addition & 1 deletion world/clientlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ClientList::ClientList()
{
NextCLEID = 1;

m_tick.reset(new EQ::Timer(5000, true, std::bind(&ClientList::OnTick, this, std::placeholders::_1)));
m_tick = std::make_unique<EQ::Timer>(5000, true, std::bind(&ClientList::OnTick, this, std::placeholders::_1));
}

ClientList::~ClientList() {
Expand Down
8 changes: 4 additions & 4 deletions world/expedition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bool Expedition::SetNewLeader(uint32_t character_id)
void Expedition::SendZonesExpeditionDeleted()
{
uint32_t pack_size = sizeof(ServerExpeditionID_Struct);
auto pack = std::unique_ptr<ServerPacket>(new ServerPacket(ServerOP_ExpeditionDeleted, pack_size));
auto pack = std::make_unique<ServerPacket>(ServerOP_ExpeditionDeleted, pack_size);
auto buf = reinterpret_cast<ServerExpeditionID_Struct*>(pack->pBuffer);
buf->expedition_id = GetID();
zoneserver_list.SendPacket(pack.get());
Expand All @@ -121,7 +121,7 @@ void Expedition::SendZonesExpeditionDeleted()
void Expedition::SendZonesDurationUpdate()
{
uint32_t packsize = sizeof(ServerExpeditionUpdateDuration_Struct);
auto pack = std::unique_ptr<ServerPacket>(new ServerPacket(ServerOP_ExpeditionDzDuration, packsize));
auto pack = std::make_unique<ServerPacket>(ServerOP_ExpeditionDzDuration, packsize);
auto packbuf = reinterpret_cast<ServerExpeditionUpdateDuration_Struct*>(pack->pBuffer);
packbuf->expedition_id = GetID();
packbuf->new_duration_seconds = static_cast<uint32_t>(m_duration.count());
Expand All @@ -131,7 +131,7 @@ void Expedition::SendZonesDurationUpdate()
void Expedition::SendZonesExpireWarning(uint32_t minutes_remaining)
{
uint32_t pack_size = sizeof(ServerExpeditionExpireWarning_Struct);
auto pack = std::unique_ptr<ServerPacket>(new ServerPacket(ServerOP_ExpeditionExpireWarning, pack_size));
auto pack = std::make_unique<ServerPacket>(ServerOP_ExpeditionExpireWarning, pack_size);
auto buf = reinterpret_cast<ServerExpeditionExpireWarning_Struct*>(pack->pBuffer);
buf->expedition_id = GetID();
buf->minutes_remaining = minutes_remaining;
Expand All @@ -141,7 +141,7 @@ void Expedition::SendZonesExpireWarning(uint32_t minutes_remaining)
void Expedition::SendZonesLeaderChanged()
{
uint32_t pack_size = sizeof(ServerExpeditionLeaderID_Struct);
auto pack = std::unique_ptr<ServerPacket>(new ServerPacket(ServerOP_ExpeditionLeaderChanged, pack_size));
auto pack = std::make_unique<ServerPacket>(ServerOP_ExpeditionLeaderChanged, pack_size);
auto buf = reinterpret_cast<ServerExpeditionLeaderID_Struct*>(pack->pBuffer);
buf->expedition_id = GetID();
buf->leader_id = m_leader_id;
Expand Down
4 changes: 2 additions & 2 deletions world/launcher_link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ LauncherLink::LauncherLink(int id, std::shared_ptr<EQ::Net::ServertalkServerConn
m_bootTimer.Disable();

tcpc->OnMessage(std::bind(&LauncherLink::ProcessMessage, this, std::placeholders::_1, std::placeholders::_2));
m_process_timer.reset(new EQ::Timer(100, true, std::bind(&LauncherLink::Process, this, std::placeholders::_1)));
m_process_timer = std::make_unique<EQ::Timer>(100, true, std::bind(&LauncherLink::Process, this, std::placeholders::_1));
}

LauncherLink::~LauncherLink() {
Expand Down Expand Up @@ -296,4 +296,4 @@ void LauncherLink::Shutdown() {
auto pack = new ServerPacket(ServerOP_ShutdownAll);
SendPacket(pack);
delete pack;
}
}
20 changes: 10 additions & 10 deletions world/login_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ bool LoginServer::Connect()
}

if (IsLegacy) {
legacy_client.reset(new EQ::Net::ServertalkLegacyClient(LoginServerAddress, LoginServerPort, false));
legacy_client = std::make_unique<EQ::Net::ServertalkLegacyClient>(LoginServerAddress, LoginServerPort, false);
legacy_client->OnConnect(
[this](EQ::Net::ServertalkLegacyClient *client) {
if (client) {
Expand All @@ -356,12 +356,12 @@ bool LoginServer::Connect()
SendStatus();
zoneserver_list.SendLSZones();

statusupdate_timer.reset(
new EQ::Timer(
statusupdate_timer = std::make_unique<EQ::Timer>(

LoginServer_StatusUpdateInterval, true, [this](EQ::Timer *t) {
SendStatus();
}
)

);
}
else {
Expand Down Expand Up @@ -448,7 +448,7 @@ bool LoginServer::Connect()
);
}
else {
client.reset(new EQ::Net::ServertalkClient(LoginServerAddress, LoginServerPort, false, "World", ""));
client = std::make_unique<EQ::Net::ServertalkClient>(LoginServerAddress, LoginServerPort, false, "World", "");
client->OnConnect(
[this](EQ::Net::ServertalkClient *client) {
if (client) {
Expand All @@ -461,12 +461,12 @@ bool LoginServer::Connect()
SendStatus();
zoneserver_list.SendLSZones();

statusupdate_timer.reset(
new EQ::Timer(
statusupdate_timer = std::make_unique<EQ::Timer>(

LoginServer_StatusUpdateInterval, true, [this](EQ::Timer *t) {
SendStatus();
}
));
);
}
else {
LogInfo(
Expand Down Expand Up @@ -552,7 +552,7 @@ bool LoginServer::Connect()
);
}

m_keepalive.reset(new EQ::Timer(5000, true, std::bind(&LoginServer::OnKeepAlive, this, std::placeholders::_1)));
m_keepalive = std::make_unique<EQ::Timer>(5000, true, std::bind(&LoginServer::OnKeepAlive, this, std::placeholders::_1));

return true;
}
Expand Down Expand Up @@ -649,4 +649,4 @@ void LoginServer::OnKeepAlive(EQ::Timer *t)
{
ServerPacket pack(ServerOP_KeepAlive, 0);
SendPacket(&pack);
}
}
4 changes: 2 additions & 2 deletions world/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,13 @@ int main(int argc, char** argv) {
std::unique_ptr<EQ::Net::ConsoleServer> console;
if (Config->TelnetEnabled) {
LogInfo("Console (TCP) listener started");
console.reset(new EQ::Net::ConsoleServer(Config->TelnetIP, Config->TelnetTCPPort));
console = std::make_unique<EQ::Net::ConsoleServer>(Config->TelnetIP, Config->TelnetTCPPort);
RegisterConsoleFunctions(console);
}

zoneserver_list.Init();
std::unique_ptr<EQ::Net::ServertalkServer> server_connection;
server_connection.reset(new EQ::Net::ServertalkServer());
server_connection = std::make_unique<EQ::Net::ServertalkServer>();

EQ::Net::ServertalkServerOptions server_opts;
server_opts.port = Config->WorldTCPPort;
Expand Down
2 changes: 1 addition & 1 deletion world/ucs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void UCSConnection::SetConnection(std::shared_ptr<EQ::Net::ServertalkServerConne
);
}

m_keepalive.reset(new EQ::Timer(1000, true, std::bind(&UCSConnection::OnKeepAlive, this, std::placeholders::_1)));
m_keepalive = std::make_unique<EQ::Timer>(1000, true, std::bind(&UCSConnection::OnKeepAlive, this, std::placeholders::_1));
}

const std::shared_ptr<EQ::Net::ServertalkServerConnection> &UCSConnection::GetConnection() const
Expand Down
2 changes: 1 addition & 1 deletion world/web_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ WebInterfaceList::~WebInterfaceList()

void WebInterfaceList::AddConnection(std::shared_ptr<EQ::Net::ServertalkServerConnection> connection)
{
m_interfaces.insert(std::make_pair(connection->GetUUID(), std::unique_ptr<WebInterface>(new WebInterface(connection))));
m_interfaces.insert(std::make_pair(connection->GetUUID(), std::make_unique<WebInterface>(connection)));
}

void WebInterfaceList::RemoveConnection(std::shared_ptr<EQ::Net::ServertalkServerConnection> connection)
Expand Down
Loading