// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // $Id: c_cmds.cpp 247 2007-06-28 05:09:14Z zorro $ // // Copyright (C) 1998-2006 by Randy Heit (ZDoom 1.22). // Copyright (C) 2006-2007 by The Odamex Team. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // DESCRIPTION: // C_CMDS // //----------------------------------------------------------------------------- #include "version.h" #include "c_console.h" #include "c_dispatch.h" #include "i_system.h" #include "doomstat.h" #include "dstrings.h" #include "s_sound.h" #include "g_game.h" #include "d_items.h" #include "p_inter.h" #include "z_zone.h" #include "w_wad.h" #include "g_level.h" #include "gi.h" #include "r_defs.h" #include "d_player.h" #include "r_main.h" #include "sv_main.h" extern FILE *Logfile; BEGIN_COMMAND (rquit) { SV_SendReconnectSignal(); exit (0); } END_COMMAND (rquit) BEGIN_COMMAND (quit) { exit (0); } END_COMMAND (quit) BEGIN_COMMAND (gameversion) { Printf (PRINT_HIGH, "%d.%d : " __DATE__ "\n", VERSION / 100, VERSION % 100); } END_COMMAND (gameversion) BEGIN_COMMAND (dumpheap) { int lo = PU_STATIC, hi = PU_CACHE; if (argc >= 2) { lo = atoi (argv[1]); if (argc >= 3) { hi = atoi (argv[2]); } } Z_DumpHeap (lo, hi); } END_COMMAND (dumpheap) BEGIN_COMMAND (logfile) { time_t clock; char *timestr; time (&clock); timestr = asctime (localtime (&clock)); if (Logfile) { Printf (PRINT_HIGH, "Log stopped: %s\n", timestr); fclose (Logfile); Logfile = NULL; } if (argc >= 2) { if ( (Logfile = fopen (argv[1], "w")) ) { Printf (PRINT_HIGH, "Log started: %s", timestr); AddCommandString("version"); } else { Printf (PRINT_HIGH, "Could not start log\n"); } } } END_COMMAND (logfile) VERSION_CONTROL (c_cmds_cpp, "$Id: c_cmds.cpp 247 2007-06-28 05:09:14Z zorro $")