aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/serverchathooks.h
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-08-24 00:32:31 +0100
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-25 21:32:55 +0200
commit46bed8d09f32360377350d71816a76abdfbf2c7c (patch)
tree7feedae4910dbfe0e53d26ea1e00c4616d2c1850 /NorthstarDLL/serverchathooks.h
parenta97f1f07bb5aa31629cd87023e09669eb4bf1fe9 (diff)
downloadNorthstarLauncher-46bed8d09f32360377350d71816a76abdfbf2c7c.tar.gz
NorthstarLauncher-46bed8d09f32360377350d71816a76abdfbf2c7c.zip
Adjust folder structure (#242)v1.9.5-rc1v1.9.5
* Adjust folder structure * change launcher directory name
Diffstat (limited to 'NorthstarDLL/serverchathooks.h')
-rw-r--r--NorthstarDLL/serverchathooks.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/NorthstarDLL/serverchathooks.h b/NorthstarDLL/serverchathooks.h
new file mode 100644
index 00000000..f3425ae6
--- /dev/null
+++ b/NorthstarDLL/serverchathooks.h
@@ -0,0 +1,29 @@
+#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);
+
+void InitialiseServerChatHooks_Engine(HMODULE baseAddress);
+
+void InitialiseServerChatHooks_Server(HMODULE baseAddress);