aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/server/serverchathooks.h
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2022-12-19 19:32:16 +0100
committerGitHub <noreply@github.com>2022-12-19 19:32:16 +0100
commite04f3b36accccb590a2d51b4829256b9964ac3fd (patch)
tree20ee30c82e6f53e6e772be2e1b9613eebca12bf3 /NorthstarDLL/server/serverchathooks.h
parent33f18a735986dcd136bf8ba70ad8331306c28227 (diff)
downloadNorthstarLauncher-e04f3b36accccb590a2d51b4829256b9964ac3fd.tar.gz
NorthstarLauncher-e04f3b36accccb590a2d51b4829256b9964ac3fd.zip
Restructuring (#365)
* Remove launcher proxy * Restructuring * More restructuring * Fix include dirs * Fix merge * Remove clang thing * Filters * Oops
Diffstat (limited to 'NorthstarDLL/server/serverchathooks.h')
-rw-r--r--NorthstarDLL/server/serverchathooks.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/NorthstarDLL/server/serverchathooks.h b/NorthstarDLL/server/serverchathooks.h
new file mode 100644
index 00000000..1d8a806a
--- /dev/null
+++ b/NorthstarDLL/server/serverchathooks.h
@@ -0,0 +1,25 @@
+#pragma once
+#include "pch.h"
+#include <rapidjson/document.h>
+#include <rapidjson/stringbuffer.h>
+
+enum class CustomMessageType : char
+{
+ Chat = 1,
+ Whisper = 2
+};
+
+constexpr unsigned char CUSTOM_MESSAGE_INDEX_BIT = 0b10000000;
+constexpr unsigned char CUSTOM_MESSAGE_INDEX_MASK = ~CUSTOM_MESSAGE_INDEX_BIT;
+
+// Send a vanilla chat message as if it was from the player.
+void ChatSendMessage(unsigned int playerIndex, const char* text, bool isteam);
+
+// Send a custom message.
+// fromPlayerIndex: set to -1 for a [SERVER] message, or another value to send from a specific player
+// toPlayerIndex: set to -1 to send to all players, or another value to send to a single player
+// isTeam: display a [TEAM] badge
+// isDead: display a [DEAD] badge
+// messageType: send a specific message type
+void ChatBroadcastMessage(
+ int fromPlayerIndex, int toPlayerIndex, const char* text, bool isTeam, bool isDead, CustomMessageType messageType);