aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/CharacterHandler.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-03-20 23:55:57 -0300
committerariel- <ariel-@users.noreply.github.com>2017-03-21 00:51:13 -0300
commit8be85a54088855b64738e1f1e2bd96b28ccad6b4 (patch)
treefc05e3af19a03af2b25af0bfdf117c2ca73c85cb /src/server/game/Handlers/CharacterHandler.cpp
parent2a462e93093d177a0e0bedf3e94ac2cf4e66a3c3 (diff)
Core/Misc: cache server MOTD and properly format it for RA and when issuing .server motd
Diffstat (limited to 'src/server/game/Handlers/CharacterHandler.cpp')
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 52af8e1d6cc..db482b05b5d 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -41,6 +41,7 @@
#include "ReputationMgr.h"
#include "GitRevision.h"
#include "ScriptMgr.h"
+#include "ServerMotd.h"
#include "SharedDefines.h"
#include "SocialMgr.h"
#include "UpdateMask.h"
@@ -750,33 +751,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
// Send MOTD
{
- data.Initialize(SMSG_MOTD, 50); // new in 2.0.1
- data << (uint32)0;
-
- uint32 linecount=0;
- std::string str_motd = sWorld->GetMotd();
- std::string::size_type pos, nextpos;
-
- pos = 0;
- while ((nextpos= str_motd.find('@', pos)) != std::string::npos)
- {
- if (nextpos != pos)
- {
- data << str_motd.substr(pos, nextpos-pos);
- ++linecount;
- }
- pos = nextpos+1;
- }
-
- if (pos<str_motd.length())
- {
- data << str_motd.substr(pos);
- ++linecount;
- }
-
- data.put(0, linecount);
-
- SendPacket(&data);
+ SendPacket(Motd::GetMotdPacket());
// send server info
if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)