예제 #1
0
파일: g_svcmds.c 프로젝트: ZwS/qudos
/*
=================
ServerCommand

ServerCommand will be called when an "sv" command is issued.
The game can issue gi.argc() / gi.argv() commands to get the rest
of the parameters
=================
*/
void	ServerCommand (void)
{
	char	*cmd;

	cmd = gi.argv(1);
	if (Q_stricmp (cmd, "test") == 0)
		Svcmd_Test_f ();
	else if (Q_stricmp (cmd, "addip") == 0)
		SVCmd_AddIP_f ();
	else if (Q_stricmp (cmd, "removeip") == 0)
		SVCmd_RemoveIP_f ();
	else if (Q_stricmp (cmd, "listip") == 0)
		SVCmd_ListIP_f ();
	else if (Q_stricmp (cmd, "writeip") == 0)
		SVCmd_WriteIP_f ();
#ifdef WITH_ACEBOT
// ACEBOT_ADD
	else if(Q_stricmp (cmd, "acedebug") == 0)
 		if (strcmp(gi.argv(2),"on")==0)
		{
			safe_bprintf (PRINT_MEDIUM, "ACE: Debug Mode On\n");
			debug_mode = true;
		}
		else
		{
			safe_bprintf (PRINT_MEDIUM, "ACE: Debug Mode Off\n");
			debug_mode = false;
		}
	else if (Q_stricmp (cmd, "addbot") == 0)
		ACESP_SpawnBot (NULL, gi.argv(2), gi.argv(3), NULL);
	// removebot
	else if(Q_stricmp (cmd, "removebot") == 0)
    	ACESP_RemoveBot(gi.argv(2));
	
	// Node saving
	else if(Q_stricmp (cmd, "savenodes") == 0)
    	ACEND_SaveNodes();
// ACEBOT_END
#endif
	else
#ifdef WITH_ACEBOT
		safe_cprintf 
#else
		gi.cprintf
#endif
		 (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
}
예제 #2
0
파일: g_svcmds.c 프로젝트: qbism/qbq2
/*
=================
ServerCommand

ServerCommand will be called when an "sv" command is issued.
The game can issue gi.argc() / gi.argv() commands to get the rest
of the parameters
=================
*/
void	ServerCommand (void)
{
	char	*cmd;

	cmd = gi.argv(1);
	if (Q_strcasecmp (cmd, "test") == 0)
		Svcmd_Test_f ();
	else if (Q_strcasecmp (cmd, "addip") == 0)
		SVCmd_AddIP_f ();
	else if (Q_strcasecmp (cmd, "removeip") == 0)
		SVCmd_RemoveIP_f ();
	else if (Q_strcasecmp (cmd, "listip") == 0)
		SVCmd_ListIP_f ();
	else if (Q_strcasecmp (cmd, "writeip") == 0)
		SVCmd_WriteIP_f ();

// ACEBOT_ADD
	else if(Q_strcasecmp (cmd, "acedebug") == 0)
 		if (strcmp(gi.argv(2),"on")==0)
		{
			safe_bprintf (PRINT_MEDIUM, "ACE: Debug Mode On\n");
			debug_mode = true;
		}
		else
		{
			safe_bprintf (PRINT_MEDIUM, "ACE: Debug Mode Off\n");
			debug_mode = false;
		}

	else if (Q_strcasecmp (cmd, "addbot") == 0)
	{
		if (!deathmatch->value) // Knightmare added
		{
			safe_bprintf (PRINT_MEDIUM, "ACE: Can only spawn bots in deathmatch mode.\n");
			return;
		}
		if(ctf->value) // name, skin, team
			ACESP_SpawnBot (gi.argv(2), gi.argv(3), gi.argv(4), NULL);
		else // name, skin
			ACESP_SpawnBot (NULL, gi.argv(2), gi.argv(3), NULL);
	}	

	// removebot
    else if(Q_strcasecmp (cmd, "removebot") == 0)
    	ACESP_RemoveBot(gi.argv(2));
	// Node saving
	else if(Q_strcasecmp (cmd, "savenodes") == 0)
    	ACEND_SaveNodes();
// ACEBOT_END
	// Knightmare added- DM pause
    else if(Q_strcasecmp (cmd, "dmpause") == 0)
	{
		if (!deathmatch->value) {
			safe_cprintf (NULL, PRINT_HIGH, "Dmpause only works in deathmatch.\n", cmd);
			paused = false;
			return;
		}
		paused = !paused;
		if (!paused) // unfreeze players
		{
			int	i;
			edict_t *player;
			for (i=0; i<game.maxclients; i++)
			{
				player = &g_edicts[1+i];
				if (!player->inuse || !player->client)
					continue;
				if (player->is_bot || player->client->ctf_grapple)
					continue;
				player->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
			}
			safe_bprintf (PRINT_HIGH, "Game unpaused\n");
		}
	}
	else
		safe_cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
}