From: havoc Date: Mon, 9 Jul 2007 01:28:47 +0000 (+0000) Subject: allow multiplayer savegames X-Git-Tag: xonotic-v0.1.0preview~2987 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=8601d387b0410acd35294759e5e7a0f126deaf62 allow multiplayer savegames git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7478 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host_cmd.c b/host_cmd.c index 73a34bb1..463fb729 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -428,33 +428,6 @@ LOAD / SAVE GAME #define SAVEGAME_VERSION 5 -/* -=============== -Host_SavegameComment - -Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current -=============== -*/ -void Host_SavegameComment (char *text) -{ - int i; - char kills[20]; - - for (i=0 ; ifields.server->deadflag) { - if (i > 0) - { - Con_Print("Can't save multiplayer games.\n"); - return; - } - if (svs.clients[i].edict->fields.server->deadflag) - { - Con_Print("Can't savegame with a dead player\n"); - return; - } + Con_Print("Can't savegame with a dead player\n"); + return; } } + else + Con_Print("Warning: saving a multiplayer game may have strange results when restored (to properly resume, all players must join in the same player slots and then the game can be reloaded).\n"); if (Cmd_Argc() != 2) { @@ -519,8 +487,19 @@ void Host_Savegame_f (void) return; } + SV_VM_Begin(); + FS_Printf(f, "%i\n", SAVEGAME_VERSION); - Host_SavegameComment (comment); + + 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); + // convert space to _ to make stdio happy + // LordHavoc: convert control characters to _ as well + for (i=0 ; inum_edicts ; i++) PRVM_ED_Write (f, PRVM_EDICT_NUM(i)); @@ -725,7 +702,7 @@ void Host_Loadgame_f (void) SV_VM_End(); // make sure we're connected to loopback - if (cls.state == ca_disconnected || !(cls.state == ca_connected && cls.netcon != NULL && LHNETADDRESS_GetAddressType(&cls.netcon->peeraddress) == LHNETADDRESSTYPE_LOOP)) + if (sv.active && cls.state == ca_disconnected) CL_EstablishConnection("local:1"); } diff --git a/todo b/todo index fdc587b6..7b7cedba 100644 --- a/todo +++ b/todo @@ -59,6 +59,7 @@ 0 change darkplaces menu: move all options into a submenu so that people won't keep ignoring the other submenus 0 change darkplaces networking: make darkplaces detect its *public* client port from master server and send that in nq connect messages (wallace) 0 change darkplaces protocol: PRYDON_CLIENTCURSOR should use a stat and .prydoncursor field instead of the cl_prydoncursor cvar, because stuffcmd is a bit icky (FrikaC) +0 change darkplaces protocol: in dp8 protocol change clc_move to include a separate want-prediction flag rather than sending 0 movesequence for unpredicted moves, this will allow the client to know its own ping regardless of whether prediction is used. 0 change darkplaces protocol: increase maxplayers limit to 65535, send maxplayers as an int in the serverinfo packet, send colormap indices as a short, send svc_update* using short player indices (discoloda) 0 change darkplaces protocol: make svc_cdtrack use strings rather than a numbers in next DP protocol, so that named tracks can be used by maps 0 change darkplaces protocol: send origin and angle updates as individual components in entities like Quake did, rather than combined ORIGIN/ANGLE bits like DP5/6/7 do