summaryrefslogtreecommitdiffstats
path: root/src/Root.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Root.h')
-rw-r--r--src/Root.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Root.h b/src/Root.h
index c59afc810..fa52c21a1 100644
--- a/src/Root.h
+++ b/src/Root.h
@@ -3,6 +3,7 @@
#include "Authenticator.h"
#include "HTTPServer/HTTPServer.h"
+#include "Defines.h"
@@ -98,9 +99,6 @@ public:
/// Saves all chunks in all worlds
void SaveAllChunks(void); // tolua_export
- /// Sends a chat message to all connected clients (in all worlds)
- void BroadcastChat(const AString & a_Message); // tolua_export
-
/// Calls the callback for each player in all worlds
bool ForEachPlayer(cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
@@ -109,6 +107,16 @@ public:
// 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 BroadcastChatPrivateMsg(const AString & a_Message) { BroadcastChat(AppendChatEpithet(a_Message, mtPrivateMessage)); }
+
/// Returns the textual description of the protocol version: 49 -> "1.4.4". Provided specifically for Lua API
static AString GetProtocolVersionTextFromInt(int a_ProtocolVersionNum);