Ejemplo n.º 1
0
/*
 * 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();
	}
	else
	{
		gi.cprintf(NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
	}
}
Ejemplo n.º 2
0
/*
=================
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, "respawn") == 0)
		Chicken_Respawn(NULL, 0);
	else
		gi.cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
}
Ejemplo n.º 3
0
Archivo: g_svcmds.c Proyecto: 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);
}
Ejemplo n.º 4
0
Archivo: g_svcmds.c Proyecto: 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, "savechain") == 0)
        SaveChain ();
    else if (Q_stricmp (cmd, "spb") == 0)
    {
        if(gi.argc() <= 1) SpawnCommand(1);
        else SpawnCommand (atoi(gi.argv(2)));
    }
    else if (Q_stricmp (cmd, "rspb") == 0)
    {
        if(gi.argc() <= 1) RandomSpawnCommand(1);
        else RandomSpawnCommand (atoi(gi.argv(2)));
    }
    else if (Q_stricmp (cmd, "rmb") == 0)
    {
        if(gi.argc() <= 1) RemoveCommand(1);
        else RemoveCommand (atoi(gi.argv(2)));
    }
    else if (Q_stricmp (cmd, "dsp") == 0)
    {
        if(gi.argc() <= 1) DebugSpawnCommand(1);
        else DebugSpawnCommand (atoi(gi.argv(2)));
    }
    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 ();
    else
        gi.cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
}
Ejemplo n.º 5
0
/*
=================
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);
}
Ejemplo n.º 6
0
void	ServerCommand (void)
{
	char	*cmd;

	cmd = gi.argv(1);
	if (Q_stricmp (cmd, "test") == 0)
		Svcmd_Test_f ();
	else if (Q_stricmp(cmd, "addbots") == 0)
		Svcmd_addbots_f();
	else if (Q_stricmp(cmd, "killbot") == 0)
		Svcmd_killbot_f(gi.argv(2));
	else if (Q_stricmp(cmd, "nextmap") == 0)
		Svcmd_nextmap_f();
	else if (Q_stricmp(cmd, "ml") == 0)
	{
		if (Q_stricmp(gi.argv(2), "0") == 0)	//maprotation off
		{
			ClearMaplist();
			maplist.mlflag = 0; //off
			gi.cprintf (NULL, PRINT_HIGH, "Map rotation OFF!\n\n");
		}
		else if (Q_stricmp(gi.argv(2), "1") == 0)	//start sequential rotation
		{
			if (maplist.nummaps > 0)  // does a maplist exist? 
			{
				maplist.mlflag = 1; //sequential
				maplist.currentmap = -1;
				gi.cprintf (NULL, PRINT_HIGH, "Sequential map rotation ON!\n\n");
                EndDMLevel();
			}
            else 
                 gi.cprintf (NULL, PRINT_HIGH, "You have to load a maplist first!\n\n");
			
		}
		else if (Q_stricmp(gi.argv(2), "2") == 0)	//start random rotation
		{
			if (maplist.nummaps > 0)  // does a maplist exist? 
			{
				maplist.mlflag = 2; //random
				maplist.currentmap = -1;
				gi.cprintf (NULL, PRINT_HIGH, "Random map rotation ON!\n\n");
                EndDMLevel();
			}
            else 
                 gi.cprintf (NULL, PRINT_HIGH, "You have to load a maplist first!\n\n");
		}
		/*else if (Q_stricmp(gi.argv(2), "goto") == 0)	//jump to map X in list
		{
			if (maplist.nummaps > 0)  // does a maplist exist? 
			{
				if (maplist.mlflag > 0)
				{
					int num = atoi(gi.argv(3));

					if (num < maplist.nummaps)
					{
						maplist.currentmap = num;
						gi.cprintf (NULL, PRINT_HIGH, "Current map is %d!\n\n", num);
						EndDMLevel();
					}
					else
						gi.cprintf (NULL, PRINT_HIGH, "Map number %d not found!\n\n", num);
				}
				else
					gi.cprintf (NULL, PRINT_HIGH, "You have to start the maprotation with <sv ml 1 or 2> first!\n\n");
			}
            else 
                 gi.cprintf (NULL, PRINT_HIGH, "You have to load a maplist first!\n\n");
			
		}*/
		else if (Q_stricmp(gi.argv(2), "") == 0)	//print maplist
		{
			if (maplist.nummaps > 0)  // does a maplist exist? 
			{
				int i;

				gi.cprintf(NULL, PRINT_HIGH, "Current maplist:\n");
				
				for (i = 0;i < maplist.nummaps;i++)
				{ 
					gi.cprintf(NULL, PRINT_HIGH, "...%s,ctf=%c,lightsoff=%c\n", maplist.mapnames[i], maplist.ctf[i], maplist.lightsoff[i]);
				}
				gi.cprintf(NULL, PRINT_HIGH, "\n");
			}
            else 
                 gi.cprintf (NULL, PRINT_HIGH, "Load a maplist with <sv ml maplistname>!\n\n");
			
		}
		else	//load maplist
		{
			ClearMaplist();
			LoadMaplist(gi.argv(2));
		}
	}
	else
		gi.cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
}