From ee0867e45271c6864d9c505d343018ba2fa992ea Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Mon, 14 Aug 2017 14:10:11 +0200 Subject: implement the placeholder client shit TODO: to review, debug, etc this change; and amend this description --- src/server/sv_game.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/server/sv_game.c') 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; -- cgit