diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-10-15 18:07:06 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-10-15 18:07:06 +0000 |
commit | 58c8e2e0377eddcae7f44d30b78578fbedf0eaa7 (patch) | |
tree | 3643ef5da6e9e397cf4c27ff93b4722843b5c83c /source/mvd_game.c | |
parent | 2ff447b2019b5696375fbc09d87416345418cd9a (diff) |
Added `sv_mvd_allow_stufftext' and `sv_mvd_password' cvars.
MVD admins now can execute arbitrary commands on behaf of the
dummy MVD observer on game server side via `fwd' command, if allowed.
MVD channel is now listed in the menu when it is not suspended, not
just when there are active players.
Made `mvdconnect' command accept --user and --pass options.
When masking off high-bit characters before displaying them on system
console or writing into logfile, ignore any control characters.
Updated documentation.
Diffstat (limited to 'source/mvd_game.c')
-rw-r--r-- | source/mvd_game.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/source/mvd_game.c b/source/mvd_game.c index 240979a..44125ed 100644 --- a/source/mvd_game.c +++ b/source/mvd_game.c @@ -708,6 +708,24 @@ static void MVD_Admin_f( mvd_client_t *client ) { SV_ClientPrintf( client->cl, PRINT_HIGH, "[MVD] Granted admin status.\n" ); } +static void MVD_Forward_f( mvd_client_t *client ) { + mvd_t *mvd = client->mvd; + + if( !client->admin ) { + SV_ClientPrintf( client->cl, PRINT_HIGH, + "[MVD] You don't have admin status.\n" ); + return; + } + + if( !mvd->forward_cmd ) { + SV_ClientPrintf( client->cl, PRINT_HIGH, + "[MVD] This channel does not support command forwarding.\n" ); + return; + } + + mvd->forward_cmd( client ); +} + static void MVD_Say_f( mvd_client_t *client, int argnum ) { mvd_t *mvd = client->mvd; unsigned delta, delay = mvd_flood_waitdelay->value * 1000; @@ -1045,6 +1063,10 @@ static void MVD_GameClientCommand( edict_t *ent ) { MVD_Admin_f( client ); return; } + if( !strcmp( cmd, "fwd" ) ) { + MVD_Forward_f( client ); + return; + } if( !strcmp( cmd, "say" ) || !strcmp( cmd, "say_team" ) ) { MVD_Say_f( client, 1 ); return; @@ -1296,10 +1318,6 @@ static void MVD_GameClientBegin( edict_t *ent ) { if( !client->begin_time ) { MVD_BroadcastPrintf( mvd, PRINT_MEDIUM, UF_MUTE_MISC, "[MVD] %s entered the channel\n", client->cl->name ); - if( Com_IsDedicated() && mvd->state == MVD_WAITING ) { - SV_ClientPrintf( client->cl, PRINT_HIGH, - "[MVD] Buffering data, please wait...\n" ); - } target = MVD_MostFollowed( mvd ); } else { target = client->target; @@ -1439,30 +1457,6 @@ static void MVD_GameClientThink( edict_t *ent, usercmd_t *cmd ) { *old = *cmd; } -void MVD_CheckActive( mvd_t *mvd ) { - mvd_t *cur; - - // demo channels are always marked as active - if( mvd->numplayers /*|| mvd->demoplayback*/ ) { - if( LIST_EMPTY( &mvd->active ) ) { - // sort this one into the list of active channels - LIST_FOR_EACH( mvd_t, cur, &mvd_active_list, active ) { - if( cur->id > mvd->id ) { - break; - } - } - List_Append( &cur->active, &mvd->active ); - mvd_dirty = qtrue; - } - } else if( !mvd->intermission ) { - if( !LIST_EMPTY( &mvd->active ) ) { - // delete this one from the list of active channels - List_Delete( &mvd->active ); - mvd_dirty = qtrue; - } - } -} - static void MVD_IntermissionStart( mvd_t *mvd ) { mvd_client_t *client; |