diff --git a/CMakeLists.txt b/CMakeLists.txt index f062f4892..9fd23285b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.7) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH}) @@ -12,7 +12,7 @@ IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) -SET(CMAKE_CXX_STANDARD 17) +SET(CMAKE_CXX_STANDARD 20) SET(CMAKE_CXX_STANDARD_REQUIRED ON) SET(CMAKE_CXX_EXTENSIONS OFF) diff --git a/client_files/export/CMakeLists.txt b/client_files/export/CMakeLists.txt index 08cbbc822..b7f15dddb 100644 --- a/client_files/export/CMakeLists.txt +++ b/client_files/export/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(export_sources main.cpp diff --git a/client_files/import/CMakeLists.txt b/client_files/import/CMakeLists.txt index a76bab416..da08cda6e 100644 --- a/client_files/import/CMakeLists.txt +++ b/client_files/import/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(import_sources main.cpp diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 44b7d0125..fcf9db865 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(common_sources base_packet.cpp diff --git a/common/memory_buffer.h b/common/memory_buffer.h index b1019a232..a2e19d364 100644 --- a/common/memory_buffer.h +++ b/common/memory_buffer.h @@ -1,5 +1,5 @@ /* EQEMu: Everquest Server Emulator - + Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net) This program is free software; you can redistribute it and/or modify @@ -41,7 +41,7 @@ namespace EQ MemoryBuffer& operator+=(const MemoryBuffer &rhs); friend MemoryBuffer operator+(MemoryBuffer lhs, const MemoryBuffer& rhs) { return lhs += rhs; } ~MemoryBuffer(); - + uchar& operator[](size_t pos); const uchar& operator[](size_t pos) const; @@ -64,20 +64,20 @@ namespace EQ size_t Size() const; size_t Capacity(); size_t Capacity() const; - + void Resize(size_t sz); void Clear(); void Zero(); template void Write(T val) { - static_assert(std::is_pod::value, "MemoryBuffer::Write(T val) only works on pod and string types."); + static_assert(std::is_standard_layout::value, "MemoryBuffer::Write(T val) only works on pod and string types."); Write((const char*)&val, sizeof(T)); } template T Read() { - static_assert(std::is_pod::value, "MemoryBuffer::Read() only works on pod and string types."); + static_assert(std::is_standard_layout::value, "MemoryBuffer::Read() only works on pod and string types."); T temp; Read((uchar*)&temp, sizeof(T)); return temp; @@ -102,7 +102,7 @@ namespace EQ read_pos_ += len + 1; return ret; } - + void Write(const char *val, size_t len); void Read(uchar *buf, size_t len); void Read(char *str); @@ -113,7 +113,7 @@ namespace EQ inline size_t GetReadPosition() { return read_pos_; } inline void SetReadPosition(size_t rp) { read_pos_ = rp; } inline void ReadSkipBytes(size_t skip) { read_pos_ += skip; } - + private: uchar *buffer_; size_t size_; diff --git a/common/repositories/character_expedition_lockouts_repository.h b/common/repositories/character_expedition_lockouts_repository.h index af5040c43..bf16e49a4 100644 --- a/common/repositories/character_expedition_lockouts_repository.h +++ b/common/repositories/character_expedition_lockouts_repository.h @@ -75,8 +75,6 @@ public: Database& db, const std::vector& character_ids, const std::string& expedition_name, const std::string& ordered_event_name) { - auto joined_character_ids = fmt::join(character_ids, ","); - auto results = db.QueryDatabase(fmt::format(SQL( SELECT character_id, @@ -93,9 +91,9 @@ public: FIELD(character_id, {}), FIELD(event_name, '{}') DESC ), - joined_character_ids, + fmt::join(character_ids, ","), Strings::Escape(expedition_name), - joined_character_ids, + fmt::join(character_ids, ","), Strings::Escape(ordered_event_name) )); diff --git a/common/strings.h b/common/strings.h index 90decba75..626ca8024 100644 --- a/common/strings.h +++ b/common/strings.h @@ -44,9 +44,10 @@ #include #include +#include + #ifndef _WIN32 // this doesn't appear to affect linux-based systems..need feedback for _WIN64 -#include #endif diff --git a/eqlaunch/CMakeLists.txt b/eqlaunch/CMakeLists.txt index c5e7bbd03..4fde2c222 100644 --- a/eqlaunch/CMakeLists.txt +++ b/eqlaunch/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(eqlaunch_sources eqlaunch.cpp diff --git a/libs/luabind/CMakeLists.txt b/libs/luabind/CMakeLists.txt index d29bb4bb1..74d95ee70 100644 --- a/libs/luabind/CMakeLists.txt +++ b/libs/luabind/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(lb_sources src/class.cpp diff --git a/libs/luabind/src/class_info.cpp b/libs/luabind/src/class_info.cpp index 531f6e0cc..30d1032a5 100644 --- a/libs/luabind/src/class_info.cpp +++ b/libs/luabind/src/class_info.cpp @@ -33,7 +33,7 @@ namespace luabind LUABIND_API class_info get_class_info(argument const& o) { lua_State* L = o.interpreter(); - + o.push(L); detail::object_rep* obj = detail::get_instance(L, -1); @@ -106,15 +106,15 @@ namespace luabind LUABIND_API void bind_class_info(lua_State* L) { module(L) - [ + [( class_("class_info_data") .def_readonly("name", &class_info::name) .def_readonly("methods", &class_info::methods) .def_readonly("attributes", &class_info::attributes), - + def("class_info", &get_class_info), def("class_names", &get_class_names) - ]; + )]; } } diff --git a/loginserver/CMakeLists.txt b/loginserver/CMakeLists.txt index eec55af2a..e55c32c1d 100644 --- a/loginserver/CMakeLists.txt +++ b/loginserver/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(eqlogin_sources account_management.cpp diff --git a/queryserv/CMakeLists.txt b/queryserv/CMakeLists.txt index 0b8eeba05..bd6e37ecd 100644 --- a/queryserv/CMakeLists.txt +++ b/queryserv/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(qserv_sources database.cpp diff --git a/shared_memory/CMakeLists.txt b/shared_memory/CMakeLists.txt index 407719ea3..86fa47d6b 100644 --- a/shared_memory/CMakeLists.txt +++ b/shared_memory/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(shared_memory_sources base_data.cpp diff --git a/submodules/fmt b/submodules/fmt index 9e554999c..a33701196 160000 --- a/submodules/fmt +++ b/submodules/fmt @@ -1 +1 @@ -Subproject commit 9e554999ce02cf86fcdfe74fe740c4fe3f5a56d5 +Subproject commit a33701196adfad74917046096bf5a2aa0ab0bb50 diff --git a/ucs/CMakeLists.txt b/ucs/CMakeLists.txt index a1c0b32b4..660d168d8 100644 --- a/ucs/CMakeLists.txt +++ b/ucs/CMakeLists.txt @@ -1,5 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) - +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(ucs_sources chatchannel.cpp clientlist.cpp diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt index 45c4a4397..c46b68d84 100644 --- a/world/CMakeLists.txt +++ b/world/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(world_sources adventure.cpp diff --git a/world/client.cpp b/world/client.cpp index e95782927..6bbf0143f 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -989,7 +989,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) { uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer); if(char_acct_id == GetAccountID()) { - LogInfo("Delete character: [{}]", app->pBuffer); + LogInfo("Delete character: [{}]", (const char*)app->pBuffer); database.DeleteCharacter((char *)app->pBuffer); SendCharInfo(); } diff --git a/world/clientlist.cpp b/world/clientlist.cpp index eae45b7e3..8dcf6dd48 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -319,7 +319,7 @@ void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnect strcpy(newline, "\r\n"); else strcpy(newline, "^"); - fmt::memory_buffer out; + std::vector out; iterator.Reset(); while(iterator.MoreElements()) { @@ -328,22 +328,21 @@ void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnect struct in_addr in; in.s_addr = cle->GetIP(); if (addnewline) { - fmt::format_to(out, newline); + fmt::format_to(std::back_inserter(out), fmt::runtime(newline)); } - fmt::format_to(out, "ID: {} Acc# {} AccName: {} IP: {}", cle->GetID(), cle->AccountID(), cle->AccountName(), inet_ntoa(in)); - fmt::format_to(out, "{} Stale: {} Online: {} Admin: {}", newline, cle->GetStaleCounter(), cle->Online(), cle->Admin()); + fmt::format_to(std::back_inserter(out), "ID: {} Acc# {} AccName: {} IP: {}", cle->GetID(), cle->AccountID(), cle->AccountName(), inet_ntoa(in)); + fmt::format_to(std::back_inserter(out), "{} Stale: {} Online: {} Admin: {}", newline, cle->GetStaleCounter(), cle->Online(), cle->Admin()); if (cle->LSID()) - fmt::format_to(out, "{} LSID: {} LSName: {} WorldAdmin: {}", newline, cle->LSID(), cle->LSName(), cle->WorldAdmin()); + fmt::format_to(std::back_inserter(out), "{} LSID: {} LSName: {} WorldAdmin: {}", newline, cle->LSID(), cle->LSName(), cle->WorldAdmin()); if (cle->CharID()) - fmt:format_to(out, "{} CharID: {} CharName: {} Zone: {} ({})", newline, cle->CharID(), cle->name(), ZoneName(cle->zone()), cle->zone()); + fmt::format_to(std::back_inserter(out), "{} CharID: {} CharName: {} Zone: {} ({})", newline, cle->CharID(), cle->name(), ZoneName(cle->zone()), cle->zone()); if (out.size() >= 3072) { - auto output = fmt::to_string(out); connection->SendEmoteMessageRaw( to, 0, AccountStatus::Player, Chat::NPCQuestSay, - output.c_str() + out.data() ); addnewline = false; out.clear(); @@ -355,14 +354,13 @@ void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnect iterator.Advance(); x++; } - fmt::format_to(out, "{}{} CLEs in memory. {} CLEs listed. numplayers = {}.", newline, x, y, numplayers); - auto output = fmt::to_string(out); + fmt::format_to(std::back_inserter(out), "{}{} CLEs in memory. {} CLEs listed. numplayers = {}.", newline, x, y, numplayers); connection->SendEmoteMessageRaw( to, 0, AccountStatus::Player, Chat::NPCQuestSay, - output.c_str() + out.data() ); } @@ -1061,12 +1059,12 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct* if (whom) whomlen = strlen(whom->whom); - fmt::memory_buffer out; - fmt::format_to(out, "Players on server:"); + std::vector out; + fmt::format_to(std::back_inserter(out), "Players on server:"); if (connection->IsConsole()) - fmt::format_to(out, "\r\n"); + fmt::format_to(std::back_inserter(out), "\r\n"); else - fmt::format_to(out, "\n"); + fmt::format_to(std::back_inserter(out), "\n"); iterator.Reset(); while (iterator.MoreElements()) { cle = iterator.GetData(); @@ -1162,23 +1160,22 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct* else sprintf(line, " %s[%i %s] %s (%s)%s zone: %s%s%s", tmpgm, cle->level(), GetClassIDName(cle->class_(), cle->level()), cle->name(), GetRaceIDName(cle->race()), tmpguild, tmpZone, LFG, accinfo); - fmt::format_to(out, line); + fmt::format_to(std::back_inserter(out), fmt::runtime(line)); if (out.size() >= 3584) { - auto output = fmt::to_string(out); connection->SendEmoteMessageRaw( to, 0, AccountStatus::Player, Chat::NPCQuestSay, - output.c_str() + out.data() ); out.clear(); } else { if (connection->IsConsole()) - fmt::format_to(out, "\r\n"); + fmt::format_to(std::back_inserter(out), "\r\n"); else - fmt::format_to(out, "\n"); + fmt::format_to(std::back_inserter(out), "\n"); } x++; if (x >= 20 && admin < AccountStatus::QuestTroupe) @@ -1188,24 +1185,24 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct* } if (x >= 20 && admin < AccountStatus::QuestTroupe) - fmt::format_to(out, "too many results...20 players shown"); + fmt::format_to(std::back_inserter(out), "too many results...20 players shown"); else - fmt::format_to(out, "{} players online", x); + fmt::format_to(std::back_inserter(out), "{} players online", x); if (admin >= AccountStatus::GMAdmin && (whom == 0 || whom->gmlookup != 0xFFFF)) { if (connection->IsConsole()) - fmt::format_to(out, "\r\n"); + fmt::format_to(std::back_inserter(out), "\r\n"); else - fmt::format_to(out, "\n"); + fmt::format_to(std::back_inserter(out), "\n"); //console_list.SendConsoleWho(connection, to, admin, &output, &outsize, &outlen); } - auto output = fmt::to_string(out); + connection->SendEmoteMessageRaw( to, 0, AccountStatus::Player, Chat::NPCQuestSay, - output.c_str() + out.data() ); } diff --git a/world/expedition_database.cpp b/world/expedition_database.cpp index a3c4ca4d0..670418a87 100644 --- a/world/expedition_database.cpp +++ b/world/expedition_database.cpp @@ -60,9 +60,8 @@ void ExpeditionDatabase::PurgeExpiredExpeditions() if (!expedition_ids.empty()) { - auto joined_expedition_ids = fmt::join(expedition_ids, ","); - ExpeditionsRepository::DeleteWhere(database, fmt::format("id IN ({})", joined_expedition_ids)); - ExpeditionLockoutsRepository::DeleteWhere(database, fmt::format("expedition_id IN ({})", joined_expedition_ids)); + ExpeditionsRepository::DeleteWhere(database, fmt::format("id IN ({})", fmt::join(expedition_ids, ","))); + ExpeditionLockoutsRepository::DeleteWhere(database, fmt::format("expedition_id IN ({})", fmt::join(expedition_ids, ","))); DynamicZoneMembersRepository::RemoveAllMembers(database, dynamic_zone_ids); } } diff --git a/world/zonelist.cpp b/world/zonelist.cpp index d5cff024f..7ba848929 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -311,19 +311,19 @@ void ZSList::SendZoneStatus(const char* to, int16 admin, WorldTCPConnection* con strcpy(locked, "No"); } - fmt::memory_buffer out; + std::vector out; if (connection->IsConsole()) { - fmt::format_to(out, "World Locked: {}\r\n", locked); + fmt::format_to(std::back_inserter(out), "World Locked: {}\r\n", locked); } else { - fmt::format_to(out, "World Locked: {}^", locked); + fmt::format_to(std::back_inserter(out), "World Locked: {}^", locked); } if (connection->IsConsole()) { - fmt::format_to(out, "Zoneservers online:\r\n"); + fmt::format_to(std::back_inserter(out), "Zoneservers online:\r\n"); } else { - fmt::format_to(out, "Zoneservers online:^"); + fmt::format_to(std::back_inserter(out), "Zoneservers online:^"); } int v = 0, w = 0, x = 0, y = 0, z = 0; @@ -363,7 +363,7 @@ void ZSList::SendZoneStatus(const char* to, int16 admin, WorldTCPConnection* con zone_data_string[0] = 0; } - fmt::format_to(out, + fmt::format_to(std::back_inserter(out), "#{:<3} :: {} :: {}:{:<5} :: {:2} :: {}:{} :: {} :: ({})", zone_server_data->GetID(), is_static_string, @@ -377,21 +377,20 @@ void ZSList::SendZoneStatus(const char* to, int16 admin, WorldTCPConnection* con ); if (out.size() >= 3584) { - auto output = fmt::to_string(out); connection->SendEmoteMessageRaw( to, 0, AccountStatus::Player, Chat::NPCQuestSay, - output.c_str() + out.data() ); out.clear(); } else { if (connection->IsConsole()) - fmt::format_to(out, "\r\n"); + fmt::format_to(std::back_inserter(out), "\r\n"); else - fmt::format_to(out, "^"); + fmt::format_to(std::back_inserter(out), "^"); } x++; } @@ -400,24 +399,23 @@ void ZSList::SendZoneStatus(const char* to, int16 admin, WorldTCPConnection* con strcpy(zone_data_string, zone_server_data->GetZoneName()); else zone_data_string[0] = 0; - fmt::format_to(out, " #{} {} {}", zone_server_data->GetID(), is_static_string, zone_data_string); + fmt::format_to(std::back_inserter(out), " #{} {} {}", zone_server_data->GetID(), is_static_string, zone_data_string); if (out.size() >= 3584) { - auto output = fmt::to_string(out); connection->SendEmoteMessageRaw( to, 0, AccountStatus::Player, Chat::NPCQuestSay, - output.c_str() + out.data() ); out.clear(); } else { if (connection->IsConsole()) { - fmt::format_to(out, "\r\n"); + fmt::format_to(std::back_inserter(out), "\r\n"); } else { - fmt::format_to(out, "^"); + fmt::format_to(std::back_inserter(out), "^"); } } x++; @@ -427,21 +425,20 @@ void ZSList::SendZoneStatus(const char* to, int16 admin, WorldTCPConnection* con } if (connection->IsConsole()) { - fmt::format_to(out, "{} servers listed. {} servers online.\r\n", x, y); + fmt::format_to(std::back_inserter(out), "{} servers listed. {} servers online.\r\n", x, y); } else { - fmt::format_to(out, "{} servers listed. {} servers online.^", x, y); + fmt::format_to(std::back_inserter(out), "{} servers listed. {} servers online.^", x, y); } - fmt::format_to(out, "{} zones are static zones, {} zones are booted zones, {} zones available.", z, w, v); + fmt::format_to(std::back_inserter(out), "{} zones are static zones, {} zones are booted zones, {} zones available.", z, w, v); - auto output = fmt::to_string(out); connection->SendEmoteMessageRaw( to, 0, AccountStatus::Player, Chat::NPCQuestSay, - output.c_str() + out.data() ); } diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 783cc5030..1c3d12a88 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) SET(zone_sources aa.cpp diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 4d2420cb3..bfa84662c 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -43,7 +43,7 @@ void EntityList::DescribeAggro(Client *to_who, NPC *from_who, float d, bool verb to_who->Message( Chat::White, fmt::format( - "Describing aggro for {} ({}).", + "Describing aggro for {}.", to_who->GetTargetDescription(from_who) ).c_str() ); diff --git a/zone/cheat_manager.cpp b/zone/cheat_manager.cpp index 30ec922be..f780bb5f1 100644 --- a/zone/cheat_manager.cpp +++ b/zone/cheat_manager.cpp @@ -42,7 +42,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); std::string export_string = fmt::format( "{} {} {}", position1.x, @@ -71,7 +71,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); std::string export_string = fmt::format( "{} {} {}", position1.x, @@ -97,7 +97,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); } break; case MQWarpKnockBack: @@ -115,7 +115,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); } break; @@ -135,7 +135,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); } } break; @@ -155,7 +155,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); } break; case MQZoneUnknownDest: @@ -173,7 +173,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); } break; case MQGate: @@ -191,7 +191,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); } break; case MQGhost: @@ -228,7 +228,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); } break; default: @@ -244,7 +244,7 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 message.c_str(), zone->GetShortName() ); - LogCheat(message); + LogCheat(fmt::runtime(message)); break; } } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 484ad29e1..939bfcc83 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3661,7 +3661,7 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) return; } else { - LogTrading("Malformed BazaarSearch_Struct packe, Action [{}]t received, ignoring"); + LogTrading("Malformed BazaarSearch_Struct packet received, ignoring"); LogError("Malformed BazaarSearch_Struct packet received, ignoring\n"); } diff --git a/zone/dynamic_zone.cpp b/zone/dynamic_zone.cpp index 9243f7b82..0fc9ee4d2 100644 --- a/zone/dynamic_zone.cpp +++ b/zone/dynamic_zone.cpp @@ -27,9 +27,6 @@ extern WorldServer worldserver; -// message string 8312 added in September 08 2020 Test patch (used by both dz and shared tasks) -const char* const CREATE_NOT_ALL_ADDED = "Not all players in your {} were added to the {}. The {} can take a maximum of {} players, and your {} has {}."; - DynamicZone::DynamicZone( uint32_t zone_id, uint32_t version, uint32_t duration, DynamicZoneType type) { diff --git a/zone/dynamic_zone.h b/zone/dynamic_zone.h index bbe21cd46..45d4e93ea 100644 --- a/zone/dynamic_zone.h +++ b/zone/dynamic_zone.h @@ -32,8 +32,6 @@ class Database; class EQApplicationPacket; class ServerPacket; -extern const char* const CREATE_NOT_ALL_ADDED; - class DynamicZone : public DynamicZoneBase { public: diff --git a/zone/expedition.cpp b/zone/expedition.cpp index 8c1b50dfd..0a97e2df7 100644 --- a/zone/expedition.cpp +++ b/zone/expedition.cpp @@ -35,8 +35,6 @@ extern Zone* zone; // message string 8271 (not in emu clients) const char* const DZ_YOU_NOT_ASSIGNED = "You could not use this command because you are not currently assigned to a dynamic zone."; -// message string 9265 (not in emu clients) -const char* const EXPEDITION_OTHER_BELONGS = "{} attempted to create an expedition but {} already belongs to one."; // lockout warnings were added to live in March 11 2020 patch const char* const DZADD_INVITE_WARNING = "Warning! You will be given replay timers for the following events if you enter %s:"; const char* const DZADD_INVITE_WARNING_TIMER = "%s - %sD:%sH:%sM"; @@ -47,6 +45,12 @@ constexpr char LOCK_BEGIN[] = "The trial has begun. You cannot const int32_t Expedition::REPLAY_TIMER_ID = -1; const int32_t Expedition::EVENT_TIMER_ID = 1; +Expedition::Expedition(DynamicZone* dz) : + m_dynamic_zone(dz) +{ + assert(m_dynamic_zone != nullptr); +} + Expedition::Expedition(DynamicZone* dz, uint32_t id, uint32_t dz_id) : m_dynamic_zone(dz), m_id(id), diff --git a/zone/expedition.h b/zone/expedition.h index 73b63ade1..d9d47a34e 100644 --- a/zone/expedition.h +++ b/zone/expedition.h @@ -37,7 +37,6 @@ class ExpeditionRequest; class ServerPacket; extern const char* const DZ_YOU_NOT_ASSIGNED; -extern const char* const EXPEDITION_OTHER_BELONGS; enum class ExpeditionLockMessage : uint8_t { @@ -50,7 +49,7 @@ class Expedition { public: Expedition() = delete; - Expedition(DynamicZone* dz) : m_dynamic_zone(dz) { assert(m_dynamic_zone != nullptr); } + Expedition(DynamicZone* dz); Expedition(DynamicZone* dz, uint32_t id, uint32_t dz_id); static Expedition* TryCreate(Client* requester, DynamicZone& dynamiczone, bool disable_messages); diff --git a/zone/expedition_request.cpp b/zone/expedition_request.cpp index 98cad6050..dfca1d581 100644 --- a/zone/expedition_request.cpp +++ b/zone/expedition_request.cpp @@ -30,6 +30,11 @@ constexpr char SystemName[] = "expedition"; +// message string 8312 added in September 08 2020 Test patch (used by both dz and shared tasks) +constexpr const char* CREATE_NOT_ALL_ADDED = "Not all players in your {} were added to the {}. The {} can take a maximum of {} players, and your {} has {}."; +// message string 9265 (not in emu clients) +constexpr const char* EXPEDITION_OTHER_BELONGS = "{} attempted to create an expedition but {} already belongs to one."; + ExpeditionRequest::ExpeditionRequest(const DynamicZone& dz, bool disable_messages) : m_expedition_name(dz.GetName()), m_min_players(dz.GetMinPlayers()), diff --git a/zone/gm_commands/rules.cpp b/zone/gm_commands/rules.cpp index 2975e4575..e14e95e8d 100755 --- a/zone/gm_commands/rules.cpp +++ b/zone/gm_commands/rules.cpp @@ -73,7 +73,7 @@ void command_rules(Client *c, const Seperator *sep) c->Message( Chat::White, fmt::format( - "Rule Set {} | {} ({})", + "Rule Set {} ({})", e.second, e.first ).c_str() diff --git a/zone/gm_commands/zonelock.cpp b/zone/gm_commands/zonelock.cpp index 3e86a1115..b304f1a0f 100755 --- a/zone/gm_commands/zonelock.cpp +++ b/zone/gm_commands/zonelock.cpp @@ -65,7 +65,7 @@ void command_zonelock(Client *c, const Seperator *sep) c->Message( Chat::White, fmt::format( - "Usage: #zonelock {} [Zone ID] or #zonelock {} [Zone Short Name]", + "Usage: #zonelock {0} [Zone ID] or #zonelock {0} [Zone Short Name]", is_lock ? "lock" : "unlock" ).c_str() ); diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 00394d93f..9e4edc825 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -3506,13 +3506,13 @@ luabind::scope lua_register_client() { luabind::scope lua_register_inventory_where() { return luabind::class_("InventoryWhere") .enum_("constants") - [ + [( luabind::value("Personal", static_cast(invWherePersonal)), luabind::value("Bank", static_cast(invWhereBank)), luabind::value("SharedBank", static_cast(invWhereSharedBank)), luabind::value("Trading", static_cast(invWhereTrading)), luabind::value("Cursor", static_cast(invWhereCursor)) - ]; + )]; } diff --git a/zone/lua_expedition.cpp b/zone/lua_expedition.cpp index 105b5782a..fca207077 100644 --- a/zone/lua_expedition.cpp +++ b/zone/lua_expedition.cpp @@ -284,11 +284,11 @@ luabind::scope lua_register_expedition() { luabind::scope lua_register_expedition_lock_messages() { return luabind::class_("ExpeditionLockMessage") .enum_("constants") - [ + [( luabind::value("None", static_cast(ExpeditionLockMessage::None)), luabind::value("Close", static_cast(ExpeditionLockMessage::Close)), luabind::value("Begin", static_cast(ExpeditionLockMessage::Begin)) - ]; + )]; } #endif // LUA_EQEMU diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 71913815d..b5d6c2d60 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -3836,7 +3836,7 @@ bool get_ruleb(int rule) { luabind::scope lua_register_general() { return luabind::namespace_("eq") - [ + [( luabind::def("load_encounter", &load_encounter), luabind::def("unload_encounter", &unload_encounter), luabind::def("load_encounter_with_data", &load_encounter_with_data), @@ -4449,25 +4449,25 @@ luabind::scope lua_register_general() { luabind::def("remove_expedition_lockout_by_char_id", &lua_remove_expedition_lockout_by_char_id), luabind::def("remove_all_expedition_lockouts_by_char_id", (void(*)(uint32))&lua_remove_all_expedition_lockouts_by_char_id), luabind::def("remove_all_expedition_lockouts_by_char_id", (void(*)(uint32, std::string))&lua_remove_all_expedition_lockouts_by_char_id) - ]; + )]; } luabind::scope lua_register_random() { return luabind::namespace_("Random") - [ + [( luabind::def("Int", &random_int), luabind::def("Real", &random_real), luabind::def("Roll", &random_roll_int), luabind::def("RollReal", &random_roll_real), luabind::def("Roll0", &random_roll0) - ]; + )]; } luabind::scope lua_register_events() { return luabind::class_("Event") .enum_("constants") - [ + [( luabind::value("say", static_cast(EVENT_SAY)), luabind::value("trade", static_cast(EVENT_TRADE)), luabind::value("death", static_cast(EVENT_DEATH)), @@ -4566,13 +4566,13 @@ luabind::scope lua_register_events() { luabind::value("payload", static_cast(EVENT_PAYLOAD)), luabind::value("level_down", static_cast(EVENT_LEVEL_DOWN)), luabind::value("gm_command", static_cast(EVENT_GM_COMMAND)) - ]; + )]; } luabind::scope lua_register_faction() { return luabind::class_("Faction") .enum_("constants") - [ + [( luabind::value("Ally", static_cast(FACTION_ALLY)), luabind::value("Warmly", static_cast(FACTION_WARMLY)), luabind::value("Kindly", static_cast(FACTION_KINDLY)), @@ -4582,13 +4582,13 @@ luabind::scope lua_register_faction() { luabind::value("Dubious", static_cast(FACTION_DUBIOUSLY)), luabind::value("Threatenly", static_cast(FACTION_THREATENINGLY)), luabind::value("Scowls", static_cast(FACTION_SCOWLS)) - ]; + )]; } luabind::scope lua_register_slot() { return luabind::class_("Slot") .enum_("constants") - [ + [( luabind::value("Charm", static_cast(EQ::invslot::slotCharm)), luabind::value("Ear1", static_cast(EQ::invslot::slotEar1)), luabind::value("Head", static_cast(EQ::invslot::slotHead)), @@ -4679,13 +4679,13 @@ luabind::scope lua_register_slot() { luabind::value("PersonalBegin", static_cast(EQ::invslot::GENERAL_BEGIN)), // deprecated luabind::value("PersonalEnd", static_cast(EQ::invslot::GENERAL_END)), // deprecated luabind::value("CursorEnd", 0xFFFE) // deprecated (not in use..and never valid vis-a-vis client behavior) - ]; + )]; } luabind::scope lua_register_material() { return luabind::class_("Material") .enum_("constants") - [ + [( luabind::value("Head", static_cast(EQ::textures::armorHead)), luabind::value("Chest", static_cast(EQ::textures::armorChest)), luabind::value("Arms", static_cast(EQ::textures::armorArms)), @@ -4700,13 +4700,13 @@ luabind::scope lua_register_material() { luabind::value("Bracer", static_cast(EQ::textures::armorWrist)), // deprecated luabind::value("Max", static_cast(EQ::textures::materialCount)) // deprecated - ]; + )]; } luabind::scope lua_register_client_version() { return luabind::class_("ClientVersion") .enum_("constants") - [ + [( luabind::value("Unknown", static_cast(EQ::versions::ClientVersion::Unknown)), luabind::value("Titanium", static_cast(EQ::versions::ClientVersion::Titanium)), luabind::value("SoF", static_cast(EQ::versions::ClientVersion::SoF)), @@ -4715,25 +4715,25 @@ luabind::scope lua_register_client_version() { luabind::value("UF", static_cast(EQ::versions::ClientVersion::UF)), luabind::value("RoF", static_cast(EQ::versions::ClientVersion::RoF)), luabind::value("RoF2", static_cast(EQ::versions::ClientVersion::RoF2)) - ]; + )]; } luabind::scope lua_register_appearance() { return luabind::class_("Appearance") .enum_("constants") - [ + [( luabind::value("Standing", static_cast(eaStanding)), luabind::value("Sitting", static_cast(eaSitting)), luabind::value("Crouching", static_cast(eaCrouching)), luabind::value("Dead", static_cast(eaDead)), luabind::value("Looting", static_cast(eaLooting)) - ]; + )]; } luabind::scope lua_register_classes() { return luabind::class_("Class") .enum_("constants") - [ + [( luabind::value("WARRIOR", WARRIOR), luabind::value("CLERIC", CLERIC), luabind::value("PALADIN", PALADIN), @@ -4779,13 +4779,13 @@ luabind::scope lua_register_classes() { luabind::value("FELLOWSHIP_MASTER", FELLOWSHIP_MASTER), luabind::value("ALT_CURRENCY_MERCHANT", ALT_CURRENCY_MERCHANT), luabind::value("MERCENARY_MASTER", MERCENARY_MASTER) - ]; + )]; } luabind::scope lua_register_skills() { return luabind::class_("Skill") .enum_("constants") - [ + [( luabind::value("1HBlunt", EQ::skills::Skill1HBlunt), luabind::value("Blunt1H", EQ::skills::Skill1HBlunt), luabind::value("1HSlashing", EQ::skills::Skill1HSlashing), @@ -4872,13 +4872,13 @@ luabind::scope lua_register_skills() { luabind::value("2HPiercing", EQ::skills::Skill2HPiercing), luabind::value("Piercing2H", EQ::skills::Skill2HPiercing), luabind::value("HIGHEST_SKILL", EQ::skills::HIGHEST_SKILL) - ]; + )]; } luabind::scope lua_register_bodytypes() { return luabind::class_("BT") .enum_("constants") - [ + [( luabind::value("Humanoid", 1), luabind::value("Lycanthrope", 2), luabind::value("Undead", 3), @@ -4913,13 +4913,13 @@ luabind::scope lua_register_bodytypes() { luabind::value("SwarmPet", 63), luabind::value("InvisMan", 66), luabind::value("Special", 67) - ]; + )]; } luabind::scope lua_register_filters() { return luabind::class_("Filter") .enum_("constants") - [ + [( luabind::value("None", FilterNone), luabind::value("GuildChat", FilterGuildChat), luabind::value("Socials", FilterSocials), @@ -4949,13 +4949,13 @@ luabind::scope lua_register_filters() { luabind::value("Unknown26", FilterUnknown26), luabind::value("Unknown27", FilterUnknown27), luabind::value("Unknown28", FilterUnknown28) - ]; + )]; } luabind::scope lua_register_message_types() { return luabind::class_("MT") .enum_("constants") - [ + [( luabind::value("White", Chat::White), luabind::value("DimGray", Chat::DimGray), luabind::value("Default", Chat::Default), @@ -5059,13 +5059,13 @@ luabind::scope lua_register_message_types() { luabind::value("ItemSpeech", Chat::ItemSpeech), luabind::value("StrikeThrough", Chat::StrikeThrough), luabind::value("Stun", Chat::Stun) - ]; + )]; } luabind::scope lua_register_rules_const() { return luabind::class_("Rule") .enum_("constants") - [ + [( #define RULE_INT(cat, rule, default_value, notes) \ luabind::value(#rule, RuleManager::Int__##rule), #include "../common/ruletypes.h" @@ -5080,7 +5080,7 @@ luabind::scope lua_register_rules_const() { luabind::value(#rule, RuleManager::Bool__##rule), #include "../common/ruletypes.h" luabind::value("_BoolRuleCount", RuleManager::_BoolRuleCount) - ]; + )]; } luabind::scope lua_register_rulei() { @@ -5107,24 +5107,24 @@ luabind::scope lua_register_ruleb() { luabind::scope lua_register_journal_speakmode() { return luabind::class_("SpeakMode") .enum_("constants") - [ + [( luabind::value("Raw", static_cast(Journal::SpeakMode::Raw)), luabind::value("Say", static_cast(Journal::SpeakMode::Say)), luabind::value("Shout", static_cast(Journal::SpeakMode::Shout)), luabind::value("EmoteAlt", static_cast(Journal::SpeakMode::EmoteAlt)), luabind::value("Emote", static_cast(Journal::SpeakMode::Emote)), luabind::value("Group", static_cast(Journal::SpeakMode::Group)) - ]; + )]; } luabind::scope lua_register_journal_mode() { return luabind::class_("JournalMode") .enum_("constants") - [ + [( luabind::value("None", static_cast(Journal::Mode::None)), luabind::value("Log1", static_cast(Journal::Mode::Log1)), luabind::value("Log2", static_cast(Journal::Mode::Log2)) - ]; + )]; } #endif diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index f165aa47f..8038a687a 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -3308,7 +3308,7 @@ luabind::scope lua_register_special_abilities() { return luabind::class_("SpecialAbility") .enum_("constants") - [ + [( luabind::value("summon", static_cast(SPECATK_SUMMON)), luabind::value("enrage", static_cast(SPECATK_ENRAGE)), luabind::value("rampage", static_cast(SPECATK_RAMPAGE)), @@ -3360,7 +3360,7 @@ luabind::scope lua_register_special_abilities() { luabind::value("immune_aggro_npc", static_cast(IMMUNE_AGGRO_NPC)), luabind::value("modify_avoid_damage", static_cast(MODIFY_AVOID_DAMAGE)), luabind::value("immune_open", static_cast(IMMUNE_OPEN)) - ]; + )]; } #endif diff --git a/zone/lua_packet.cpp b/zone/lua_packet.cpp index b07a7011f..1ebb3489e 100644 --- a/zone/lua_packet.cpp +++ b/zone/lua_packet.cpp @@ -365,7 +365,7 @@ luabind::scope lua_register_packet() { luabind::scope lua_register_packet_opcodes() { return luabind::class_("Opcode") .enum_("constants") - [ + [( luabind::value("ExploreUnknown", static_cast(OP_ExploreUnknown)), luabind::value("Heartbeat", static_cast(OP_Heartbeat)), luabind::value("ReloadUI", static_cast(OP_ReloadUI)), @@ -911,7 +911,7 @@ luabind::scope lua_register_packet_opcodes() { luabind::value("ClientTimeStamp", static_cast(OP_ClientTimeStamp)), luabind::value("GuildPromote", static_cast(OP_GuildPromote)), luabind::value("Fling", static_cast(OP_Fling)) - ]; + )]; } #endif diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index 32a0f19ad..942a9e449 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -1159,7 +1159,7 @@ void LuaParser::MapFunctions(lua_State *L) { luabind::open(L); luabind::module(L) - [ + [( lua_register_general(), lua_register_random(), lua_register_events(), @@ -1219,7 +1219,7 @@ void LuaParser::MapFunctions(lua_State *L) { lua_register_journal_mode(), lua_register_expedition(), lua_register_expedition_lock_messages() - ]; + )]; } catch(std::exception &ex) { std::string error = ex.what(); diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 0c2df7d71..77f885513 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -1318,7 +1318,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 const EQ::ItemData* item = RangeWeapon->GetItem(); if (item->ItemType != EQ::item::ItemTypeLargeThrowing && item->ItemType != EQ::item::ItemTypeSmallThrowing) { - LogCombat("Ranged attack canceled. Ranged item [{}] is not a throwing weapon. type [{}]", item->ItemType); + LogCombat("Ranged attack canceled. Ranged item [{}] is not a throwing weapon. type [{}]", item->ID, item->ItemType); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(EQ::invslot::slotRange)); return; } diff --git a/zone/spells.cpp b/zone/spells.cpp index 9ac0ac0e9..908296f41 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1361,7 +1361,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo { if (IsBardSong(spell_id) && slot < CastingSlot::MaxGems) { if (spells[spell_id].buff_duration == 0xFFFF) { - LogSpells("Bard song [{}] not applying bard logic because duration. dur=[{}], recast=[{}]", spells[spell_id].buff_duration); + LogSpells("Bard song [{}] not applying bard logic because duration. dur=[{}], recast=[{}]", spell_id, spells[spell_id].buff_duration, spells[spell_id].recast_time); } else { if (IsPulsingBardSong(spell_id)) { diff --git a/zone/task_client_state.cpp b/zone/task_client_state.cpp index 348685a25..fc009fb5b 100644 --- a/zone/task_client_state.cpp +++ b/zone/task_client_state.cpp @@ -2022,7 +2022,7 @@ void ClientTaskState::AcceptNewTask( else if (timer_type == TaskTimerType::Request) { auto eqstr = TaskStr::Get(TaskStr::ASSIGN_REQUEST_TIMER); - client->Message(Chat::Red, fmt::format(eqstr, days, hours, mins).c_str()); + client->Message(Chat::Red, fmt::format(fmt::runtime(eqstr), days, hours, mins).c_str()); } return; @@ -2284,7 +2284,7 @@ void ClientTaskState::ListTaskTimers(Client* client) else { auto eqstr = TaskStr::Get(TaskStr::REQUEST_TIMER_REMAINING); - client->Message(Chat::Yellow, fmt::format(eqstr, task->title, days, hours, mins).c_str()); + client->Message(Chat::Yellow, fmt::format(fmt::runtime(eqstr), task->title, days, hours, mins).c_str()); } } } diff --git a/zone/task_manager.cpp b/zone/task_manager.cpp index 9e8f0ffb3..f1ff6e8d1 100644 --- a/zone/task_manager.cpp +++ b/zone/task_manager.cpp @@ -274,7 +274,7 @@ bool TaskManager::SaveClientState(Client *client, ClientTaskState *cts) return false; } - const char *ERR_MYSQLERROR = "[TASKS]Error in TaskManager::SaveClientState {}"; + constexpr const char *ERR_MYSQLERROR = "[TASKS]Error in TaskManager::SaveClientState {}"; int character_id = client->CharacterID();