diff options
author | /dev/humancontroller <devhc@example.com> | 2017-04-06 20:39:29 +0200 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-04-06 20:59:01 +0200 |
commit | e984293788358a72dcb57ad5d74402a3f10f0d97 (patch) | |
tree | 125ca886f39bf13f5f8f47f593788d20af684ead /src/game/g_admin.c | |
parent | e8d1308d559e623843737e0fc6793435437a0629 (diff) |
implement Schachtmeister v2 basics
Diffstat (limited to 'src/game/g_admin.c')
-rw-r--r-- | src/game/g_admin.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 49aa46da..41490814 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -214,6 +214,11 @@ g_admin_cmd_t g_admin_cmds[ ] = "(^5name|IP(/mask)^7) (^5start at ban#^7)" }, + {"sm", G_admin_sm, qfalse, "schachtmeister", + "Schachtmeister", + "..." + }, + {"spec999", G_admin_spec999, qfalse, "spec999", "move 999 pingers to the spectator team", ""}, @@ -1669,6 +1674,54 @@ qboolean G_admin_setdisabled( gentity_t *ent ) return qtrue; } +qboolean G_admin_sm( gentity_t *ent ) +{ + const char *s; + char feature[ 16 ]; + + if( trap_Argc() < 2 ) + { + usage: + ADMP( "^3sm: ^7usage: sm ipa <IPA>\n" ); + return qfalse; + } + + s = ConcatArgs( 1 ); + if( strchr( s, '\n' ) || strchr( s, '\r' ) ) + { + ADMP( "^3sm: ^7invalid character\n" ); + return qfalse; + } + + trap_Argv( 1, feature, sizeof( feature ) ); + + if( !Q_stricmp( feature, "ipa" ) ) + { + char ipa[ 32 ]; + + if( trap_Argc() > 3 ) + { + ADMP( "^3sm: ^7excessive arguments\n" ); + goto usage; + } + trap_Argv( 2, ipa, sizeof( ipa ) ); + + if( rand() % 2 /* FIXME cache hit */ ) + { + const char *answer = "interesting"; + ADMP( va( "^3sm: ^7IP address '%s^7' is: %s\n", ipa, answer ) ); + return qtrue; + } + + ADMP( "^3sm: ^7hmm...\n" ); + trap_SendConsoleCommand( EXEC_APPEND, va( "smq ipa \"%s\"\n", ipa ) ); + } + else + goto usage; + + return qtrue; +} + qboolean G_admin_kick( gentity_t *ent ) { int pid; |