diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-07 19:58:52 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-07 19:58:52 +0100 |
commit | 88a64ec40df87f21a89de43fe8bb78f10ee7eeb7 (patch) | |
tree | 631707789a182751d5d7276fb54455d500f94c3b /src/Root.h | |
parent | Server internally uses new functions (diff) | |
download | cuberite-88a64ec40df87f21a89de43fe8bb78f10ee7eeb7.tar cuberite-88a64ec40df87f21a89de43fe8bb78f10ee7eeb7.tar.gz cuberite-88a64ec40df87f21a89de43fe8bb78f10ee7eeb7.tar.bz2 cuberite-88a64ec40df87f21a89de43fe8bb78f10ee7eeb7.tar.lz cuberite-88a64ec40df87f21a89de43fe8bb78f10ee7eeb7.tar.xz cuberite-88a64ec40df87f21a89de43fe8bb78f10ee7eeb7.tar.zst cuberite-88a64ec40df87f21a89de43fe8bb78f10ee7eeb7.zip |
Diffstat (limited to 'src/Root.h')
-rw-r--r-- | src/Root.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Root.h b/src/Root.h index ba106b54e..4cb77a79d 100644 --- a/src/Root.h +++ b/src/Root.h @@ -105,19 +105,20 @@ public: /// Finds a player from a partial or complete player name and calls the callback - case-insensitive bool FindAndDoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS << - void BroadcastChatJoin(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtJoin)); } - void BroadcastChatLeave(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtLeave)); } + void LoopWorldsAndBroadcastChat(const AString & a_Message, ChatPrefixCodes a_ChatPrefix); + void BroadcastChatJoin (const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtJoin); } + void BroadcastChatLeave (const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtLeave); } + void BroadcastChatDeath (const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtDeath); } // tolua_begin /// Sends a chat message to all connected clients (in all worlds) - void BroadcastChat(const AString & a_Message); - void BroadcastChatInfo(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtInformation)); } - void BroadcastChatFailure(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtFailure)); } - void BroadcastChatSuccess(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtSuccess)); } - void BroadcastChatWarning(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtWarning)); } - void BroadcastChatFatal(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtFailure)); } - void BroadcastChatDeath(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtDeath)); } + void BroadcastChat (const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtCustom); } + void BroadcastChatInfo (const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtInformation); } + void BroadcastChatFailure(const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtFailure); } + void BroadcastChatSuccess(const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtSuccess); } + void BroadcastChatWarning(const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtWarning); } + void BroadcastChatFatal (const AString & a_Message) { LoopWorldsAndBroadcastChat(a_Message, mtFailure); } /// Returns the textual description of the protocol version: 49 -> "1.4.4". Provided specifically for Lua API static AString GetProtocolVersionTextFromInt(int a_ProtocolVersionNum); |