/* * 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); } }
/* ================= G_ServerCommand G_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 G_ServerCommand( void ) { const char *cmd; cmd = gi.argv(1); 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.SendServerCommand( NULL, "print \"Unknown server command %s.\n\"", cmd ); } }
/** * @brief ServerCommand will be called when an "sv" command is issued. * The game can issue gi.Cmd_Argc() / gi.Cmd_Argv() commands to get the rest * of the parameters * @sa serverCommandList */ void G_ServerCommand (void) { const char* cmd; cmd = gi.Cmd_Argv(1); 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(); else if (Q_strcasecmp(cmd, "ai_add") == 0) SVCmd_AI_Add_f(); else if (Q_strcasecmp(cmd, "win") == 0) SVCmd_Win_f(); #ifdef DEBUG else if (Q_strcasecmp(cmd, "debug_showall") == 0) SVCmd_ShowAll_f(); else if (Q_strcasecmp(cmd, "debug_additem") == 0) SVCmd_AddItem_f(); else if (Q_strcasecmp(cmd, "debug_actorinvlist") == 0) SVCmd_ActorInvList_f(); else if (Q_strcasecmp(cmd, "debug_listedicts") == 0) SVCmd_ListEdicts_f(); #endif else gi.DPrintf("Unknown server command \"%s\"\n", cmd); }
/* ================= 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); }
/* ================= 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); }
/* ================= 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); }