diff options
author | Heiko Hund <heiko.hund@sophos.com> | 2017-05-27 03:15:56 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2017-05-27 03:15:56 +0200 |
commit | a0341d561a177bcd1ed45229129065556c261049 (patch) | |
tree | c67f40459dfe67a331511ac6255d9fb2cae9f87c /src | |
parent | Exported boat (diff) | |
download | cuberite-a0341d561a177bcd1ed45229129065556c261049.tar cuberite-a0341d561a177bcd1ed45229129065556c261049.tar.gz cuberite-a0341d561a177bcd1ed45229129065556c261049.tar.bz2 cuberite-a0341d561a177bcd1ed45229129065556c261049.tar.lz cuberite-a0341d561a177bcd1ed45229129065556c261049.tar.xz cuberite-a0341d561a177bcd1ed45229129065556c261049.tar.zst cuberite-a0341d561a177bcd1ed45229129065556c261049.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/ClientHandle.cpp | 6 | ||||
-rw-r--r-- | src/Entities/Player.cpp | 18 | ||||
-rw-r--r-- | src/Entities/Player.h | 6 |
3 files changed, 29 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 17b93a62c..efd592405 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1562,7 +1562,11 @@ void cClientHandle::HandleChat(const AString & a_Message) { Color.clear(); } - Msg.AddTextPart(AString("<") + m_Player->GetName() + "> ", Color); + Msg.AddTextPart("<"); + Msg.ParseText(m_Player->GetPrefix()); + Msg.AddTextPart(m_Player->GetName(), Color); + Msg.ParseText(m_Player->GetSuffix()); + Msg.AddTextPart("> "); Msg.ParseText(Message); Msg.UnderlineUrls(); cRoot::Get()->BroadcastChat(Msg); diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 94398c258..c0a078bcb 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1828,6 +1828,24 @@ AString cPlayer::GetColor(void) const +AString cPlayer::GetPrefix(void) const +{ + return m_MsgPrefix; +} + + + + + +AString cPlayer::GetSuffix(void) const +{ + return m_MsgSuffix; +} + + + + + AString cPlayer::GetPlayerListName(void) const { const AString & Color = GetColor(); diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 02f187e31..d25432e9f 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -285,6 +285,12 @@ public: The returned value either is empty, or includes the cChatColor::Delimiter. */ AString GetColor(void) const; + /** Returns the player name prefix, may contain @ format directives */ + AString GetPrefix(void) const; + + /** Returns the player name suffix, may contain @ format directives */ + AString GetSuffix(void) const; + /** Returns the name that is used in the playerlist. */ AString GetPlayerListName(void) const; |