aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/gameutils.h
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/gameutils.h
parent02e422166baa12bbdc8af8806376cb2340fef896 (diff)
downloadNorthstarLauncher-4d0e4679d05b146e5e43a1a707708c6451099c54.tar.gz
NorthstarLauncher-4d0e4679d05b146e5e43a1a707708c6451099c54.zip
add support for connecting to servers from masterserver
Diffstat (limited to 'NorthstarDedicatedTest/gameutils.h')
-rw-r--r--NorthstarDedicatedTest/gameutils.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/gameutils.h b/NorthstarDedicatedTest/gameutils.h
new file mode 100644
index 00000000..4c2254e7
--- /dev/null
+++ b/NorthstarDedicatedTest/gameutils.h
@@ -0,0 +1,57 @@
+#pragma once
+
+// cmd.h
+
+enum class ECommandTarget_t
+{
+ CBUF_FIRST_PLAYER = 0,
+ CBUF_LAST_PLAYER = 1, // MAX_SPLITSCREEN_CLIENTS - 1, MAX_SPLITSCREEN_CLIENTS = 2
+ CBUF_SERVER = CBUF_LAST_PLAYER + 1,
+
+ CBUF_COUNT,
+};
+
+enum class cmd_source_t
+{
+ // Added to the console buffer by gameplay code. Generally unrestricted.
+ kCommandSrcCode,
+
+ // Sent from code via engine->ClientCmd, which is restricted to commands visible
+ // via FCVAR_CLIENTCMD_CAN_EXECUTE.
+ kCommandSrcClientCmd,
+
+ // Typed in at the console or via a user key-bind. Generally unrestricted, although
+ // the client will throttle commands sent to the server this way to 16 per second.
+ kCommandSrcUserInput,
+
+ // Came in over a net connection as a clc_stringcmd
+ // host_client will be valid during this state.
+ //
+ // Restricted to FCVAR_GAMEDLL commands (but not convars) and special non-ConCommand
+ // server commands hardcoded into gameplay code (e.g. "joingame")
+ kCommandSrcNetClient,
+
+ // Received from the server as the client
+ //
+ // Restricted to commands with FCVAR_SERVER_CAN_EXECUTE
+ kCommandSrcNetServer,
+
+ // Being played back from a demo file
+ //
+ // Not currently restricted by convar flag, but some commands manually ignore calls
+ // from this source. FIXME: Should be heavily restricted as demo commands can come
+ // from untrusted sources.
+ kCommandSrcDemoFile,
+
+ // Invalid value used when cleared
+ kCommandSrcInvalid = -1
+};
+
+typedef ECommandTarget_t(*Cbuf_GetCurrentPlayerType)();
+extern Cbuf_GetCurrentPlayerType Cbuf_GetCurrentPlayer;
+
+// compared to the defs i've seen, this is missing an arg, it could be nTickInterval or source, not sure, guessing it's source
+typedef void(*Cbuf_AddTextType)(ECommandTarget_t eTarget, const char* text, cmd_source_t source);
+extern Cbuf_AddTextType Cbuf_AddText;
+
+void InitialiseEngineGameUtilFunctions(HMODULE baseAddress); \ No newline at end of file