Quake-2

Quake 2 GPL Source Release
Log | Files | Refs

g_svcmds.c (1234B)


      1 /*
      2 Copyright (C) 1997-2001 Id Software, Inc.
      3 
      4 This program is free software; you can redistribute it and/or
      5 modify it under the terms of the GNU General Public License
      6 as published by the Free Software Foundation; either version 2
      7 of the License, or (at your option) any later version.
      8 
      9 This program is distributed in the hope that it will be useful,
     10 but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     12 
     13 See the GNU General Public License for more details.
     14 
     15 You should have received a copy of the GNU General Public License
     16 along with this program; if not, write to the Free Software
     17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     18 
     19 */
     20 
     21 #include "g_local.h"
     22 
     23 
     24 void	Svcmd_Test_f (void)
     25 {
     26 	gi.cprintf (NULL, PRINT_HIGH, "Svcmd_Test_f()\n");
     27 }
     28 
     29 /*
     30 =================
     31 ServerCommand
     32 
     33 ServerCommand will be called when an "sv" command is issued.
     34 The game can issue gi.argc() / gi.argv() commands to get the rest
     35 of the parameters
     36 =================
     37 */
     38 void	ServerCommand (void)
     39 {
     40 	char	*cmd;
     41 
     42 	cmd = gi.argv(1);
     43 	if (Q_stricmp (cmd, "test") == 0)
     44 		Svcmd_Test_f ();
     45 	else
     46 		gi.cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
     47 }
     48