mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-01 15:46:37 +00:00
[C++20] Enable C++20 + Fixes + FMT 9.1 (#2664)
* [CPP] Enable and build compliance with cpp20 * Windows build fix * bump fmt version * Updated fmt to 9.1, updated cmake minimum and verified preprocessor stuff works. * Missing : * Fix warning: top-level comma expression in array subscript is deprecated * Fix warning: top-level comma expression in array subscript is deprecated Co-authored-by: KimLS <KimLS@peqtgc.com>
This commit is contained in:
+23
-26
@@ -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<char> 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<char> 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()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user