X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=host_cmd.c;h=011cea07c1bf081164dff29e1c7e6250901ec822;hb=21beb5fe4fa2e1f1b7591a4a1f6013b82186912f;hp=dbd917dc66b7909b64caa62b4bb8c1b96ba1a89c;hpb=fa8c676e225398a6157e591248a12d6847cef9a4;p=xonotic%2Fdarkplaces.git diff --git a/host_cmd.c b/host_cmd.c index dbd917dc..011cea07 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "sv_demo.h" +#include "image.h" int current_skill; cvar_t sv_cheats = {0, "sv_cheats", "0", "enables cheat commands in any game, and cheat impulses in dpmod"}; @@ -29,6 +30,7 @@ cvar_t rcon_address = {0, "rcon_address", "", "server address to send rcon comma cvar_t team = {CVAR_USERINFO | CVAR_SAVE, "team", "none", "QW team (4 character limit, example: blue)"}; cvar_t skin = {CVAR_USERINFO | CVAR_SAVE, "skin", "", "QW player skin name (example: base)"}; cvar_t noaim = {CVAR_USERINFO | CVAR_SAVE, "noaim", "1", "QW option to disable vertical autoaim"}; +cvar_t r_fixtrans_auto = {0, "r_fixtrans_auto", "0", "automatically fixtrans textures (when set to 2, it also saves the fixed versions to a fixtrans directory)"}; qboolean allowcheats = false; extern qboolean host_shuttingdown; @@ -262,6 +264,10 @@ void Host_Map_f (void) return; } + // GAME_DELUXEQUAKE - clear warpmark (used by QC) + if (gamemode == GAME_DELUXEQUAKE) + Cvar_Set("warpmark", ""); + cls.demonum = -1; // stop demo loop in case this fails CL_Disconnect (); @@ -493,7 +499,7 @@ void Host_Savegame_f (void) FS_Printf(f, "%i\n", SAVEGAME_VERSION); memset(comment, 0, sizeof(comment)); - sprintf(comment, "%-21s kills:%3i/%3i", PRVM_GetString(prog->edicts->fields.server->message), (int)prog->globals.server->killed_monsters, (int)prog->globals.server->total_monsters); + sprintf(comment, "%-21.21s kills:%3i/%3i", PRVM_GetString(prog->edicts->fields.server->message), (int)prog->globals.server->killed_monsters, (int)prog->globals.server->total_monsters); // convert space to _ to make stdio happy // LordHavoc: convert control characters to _ as well for (i=0 ; ifuncoffsets.RestoreGame) { Con_DPrint("Calling RestoreGame\n"); @@ -1430,8 +1440,8 @@ void Host_Spawn_f (void) prog->globals.server->self = PRVM_EDICT_TO_PROG(host_client->edict); PRVM_ExecuteProgram (prog->globals.server->ClientConnect, "QC function ClientConnect is missing"); - if (svs.maxclients > 1 || cls.state == ca_dedicated) - Con_Printf("%s entered the game\n", host_client->name); + if (cls.state == ca_dedicated) + Con_Printf("%s connected\n", host_client->name); PRVM_ExecuteProgram (prog->globals.server->PutClientInServer, "QC function PutClientInServer is missing"); } @@ -1498,7 +1508,6 @@ void Host_Spawn_f (void) MSG_WriteAngle (&host_client->netconnection->message, host_client->edict->fields.server->v_angle[0], sv.protocol); MSG_WriteAngle (&host_client->netconnection->message, host_client->edict->fields.server->v_angle[1], sv.protocol); MSG_WriteAngle (&host_client->netconnection->message, 0, sv.protocol); - sv.loadgame = false; // we're basically done with loading now } else { @@ -1522,6 +1531,20 @@ Host_Begin_f void Host_Begin_f (void) { host_client->spawned = true; + + // LordHavoc: note: this code also exists in SV_DropClient + if (sv.loadgame) + { + int i; + for (i = 0;i < svs.maxclients;i++) + if (svs.clients[i].active && !svs.clients[i].spawned) + break; + if (i == svs.maxclients) + { + Con_Printf("Loaded game, everyone rejoined - unpausing\n"); + sv.paused = sv.loadgame = false; // we're basically done with loading now + } + } } //=========================================================================== @@ -1585,7 +1608,7 @@ void Host_Kick_f (void) if (Cmd_Argc() > 2) { message = Cmd_Args(); - COM_ParseToken_Simple(&message, false); + COM_ParseToken_Simple(&message, false, false); if (byNumber) { message++; // skip the # @@ -2326,6 +2349,8 @@ void Host_Packet_f (void) // credit: taken from QuakeWorld } mysocket = NetConn_ChooseClientSocketForAddress(&address); + if (!mysocket) + mysocket = NetConn_ChooseServerSocketForAddress(&address); if (mysocket) NetConn_Write(mysocket, send, out - send, &address); } @@ -2486,6 +2511,9 @@ void Host_InitCommands (void) Cmd_AddCommand_WithClientCommand ("pings", NULL, Host_Pings_f, "command sent by clients to request updated ping and packetloss of players on scoreboard (originally from QW, but also used on NQ servers)"); Cmd_AddCommand ("pingplreport", Host_PingPLReport_f, "command sent by server containing client ping and packet loss values for scoreboard, triggered by pings command from client (not used by QW servers)"); + Cmd_AddCommand ("fixtrans", Image_FixTransparentPixels_f, "change alpha-zero pixels in an image file to sensible values, and write out a new TGA (warning: SLOW)"); + Cvar_RegisterVariable (&r_fixtrans_auto); + Cvar_RegisterVariable (&team); Cvar_RegisterVariable (&skin); Cvar_RegisterVariable (&noaim); @@ -2494,3 +2522,6 @@ void Host_InitCommands (void) Cvar_RegisterVariable(&sv_adminnick); } +void Host_NoOperation_f(void) +{ +}