summaryrefslogtreecommitdiff
path: root/src/server/sv_game.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-08-14 14:10:11 +0200
committer/dev/humancontroller <devhc@example.com>2017-08-28 23:23:25 +0200
commitee0867e45271c6864d9c505d343018ba2fa992ea (patch)
treea5442bbbb7c38852af283268ac2b9bfcec325237 /src/server/sv_game.c
parent3d980bbbc25f21f5d7d8d128f7b2044a9400280b (diff)
implement the placeholder client shit
TODO: to review, debug, etc this change; and amend this description
Diffstat (limited to 'src/server/sv_game.c')
-rw-r--r--src/server/sv_game.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/server/sv_game.c b/src/server/sv_game.c
index 734d4559..0cf5eb4d 100644
--- a/src/server/sv_game.c
+++ b/src/server/sv_game.c
@@ -271,6 +271,24 @@ void SV_GetUsercmd( int clientNum, usercmd_t *cmd ) {
*cmd = svs.clients[clientNum].lastUsercmd;
}
+static int svg_install_placeholder_client(const char *ui)
+{
+ if (!ui)
+ Com_Error(ERR_DROP, "install_placeholder_client(): NULL userinfo argument");
+ return sv_install_placeholder_client(ui);
+}
+
+static void svg_set_client_view_entity(int c, int e)
+{
+ if (c < 0 || c >= sv_maxclients->integer || svs.clients[c].state < CS_PRIMED
+ || (c != e && (e < 0 || e >= sv_maxclients->integer || svs.clients[e].state < CS_ACTIVE)))
+ {
+ Com_Error(ERR_DROP, "set_client_view_entity(): invalid arguments");
+ }
+
+ sv_set_client_view_entity(&svs.clients[c], &svs.clients[e]);
+}
+
//==============================================
static int FloatAsInt( float f ) {
@@ -441,6 +459,13 @@ intptr_t SV_GameSystemCalls( intptr_t *args ) {
Cmd_RemoveCommand( VMA(1) );
return 0;
+ case G_INSTALL_PLACEHOLDER_CLIENT:
+ return svg_install_placeholder_client(VMA(1));
+
+ case G_SET_CLIENT_VIEW_ENTITY:
+ svg_set_client_view_entity(args[1], args[2]);
+ return 0;
+
case TRAP_MEMSET:
Com_Memset( VMA(1), args[2], args[3] );
return 0;