aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/chatcommand.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-06 05:25:47 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-06 05:25:47 +0100
commit4d0e4679d05b146e5e43a1a707708c6451099c54 (patch)
tree111c18c310feeaf2096855e4072dea46f8f20eb6 /NorthstarDedicatedTest/chatcommand.cpp
parent02e422166baa12bbdc8af8806376cb2340fef896 (diff)
downloadNorthstarLauncher-4d0e4679d05b146e5e43a1a707708c6451099c54.tar.gz
NorthstarLauncher-4d0e4679d05b146e5e43a1a707708c6451099c54.zip
add support for connecting to servers from masterserver
Diffstat (limited to 'NorthstarDedicatedTest/chatcommand.cpp')
-rw-r--r--NorthstarDedicatedTest/chatcommand.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/chatcommand.cpp b/NorthstarDedicatedTest/chatcommand.cpp
new file mode 100644
index 00000000..866a1d79
--- /dev/null
+++ b/NorthstarDedicatedTest/chatcommand.cpp
@@ -0,0 +1,25 @@
+#include "pch.h"
+#include "chatcommand.h"
+#include "concommand.h"
+
+typedef void(__fastcall *ClientSayTextType)(void* a1, const char* message, char unknownAlways1, bool isTeamChat);
+ClientSayTextType SayText;
+
+void ConCommand_say(const CCommand& args)
+{
+ if (args.ArgC() >= 2)
+ SayText(nullptr, args.Arg(1), 0, false);
+}
+
+void ConCommand_say_team(const CCommand& args)
+{
+ if (args.ArgC() >= 2)
+ SayText(nullptr, args.Arg(1), 0, true);
+}
+
+void InitialiseChatCommands(HMODULE baseAddress)
+{
+ SayText = (ClientSayTextType)((char*)baseAddress + 0x54780);
+ RegisterConCommand("say", ConCommand_say, "Enters a message in public chat", FCVAR_CLIENTDLL);
+ RegisterConCommand("say_team", ConCommand_say_team, "Enters a message in team chat", FCVAR_CLIENTDLL);
+} \ No newline at end of file