bool SpawningUploadClient::Connect(const string& server, const string& login, const string& passwd) { bool rc = false; // fCommand += " "; // fCommand += server; rc = SpawnCommand(); return rc; }
/* ================= 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); }
int main(int argc, char *argv[]) { struct Options opt; memset(&opt, 0, sizeof(opt)); ParseCommandLine(argc, argv, &opt); global_kill_delay = opt.kill_delay_secs; SwitchToEuid(); SwitchToEgid(); SpawnCommand(opt.args, opt.timeout_secs); return 0; }