Big update.

This commit is contained in:
UltraNix
2022-03-12 22:28:00 +01:00
parent 6006eeeb01
commit 12d41d1314
2064 changed files with 427245 additions and 268481 deletions

View File

@@ -16,13 +16,12 @@
*/
#include "ServerMotd.h"
#include "Common.h"
#include "Opcodes.h"
#include "ScriptMgr.h"
#include "Util.h"
#include "WorldPacket.h"
#include "Tokenize.h"
#include <iterator>
#include <sstream>
namespace
{
@@ -44,10 +43,10 @@ void Motd::SetMotd(std::string motd)
WorldPacket data(SMSG_MOTD); // new in 2.0.1
Tokenizer motdTokens(motd, '@');
std::vector<std::string_view> motdTokens = Acore::Tokenize(motd, '@', true);
data << uint32(motdTokens.size()); // line count
for (Tokenizer::const_reference token : motdTokens)
for (std::string_view token : motdTokens)
data << token;
MotdPacket = data;
@@ -56,7 +55,7 @@ void Motd::SetMotd(std::string motd)
return;
std::ostringstream oss;
std::copy(motdTokens.begin(), motdTokens.end() - 1, std::ostream_iterator<char const*>(oss, "\n"));
std::copy(motdTokens.begin(), motdTokens.end() - 1, std::ostream_iterator<std::string_view>(oss, "\n"));
oss << *(motdTokens.end() - 1); // copy back element
FormattedMotd = oss.str();
}