input_sequence now formally added, will let the server know which input

sequence we're on when handling input_ globals.


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6061 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Eukara 2021-09-15 20:33:54 +00:00
parent e2e1505e83
commit e69e81b9f5
13 changed files with 32 additions and 15 deletions

View file

@ -2412,7 +2412,7 @@ libs-$(ARCH)/libvorbis.a: libs-$(ARCH)/libogg.a
libs-$(ARCH)/libopus.a: libs-$(ARCH)/libopus.a:
test -f opus-$(OPUSVER).tar.gz || wget https://archive.mozilla.org/pub/opus/opus-$(OPUSVER).tar.gz test -f opus-$(OPUSVER).tar.gz || wget https://archive.mozilla.org/pub/opus/opus-$(OPUSVER).tar.gz
-test -f libs-$(ARCH)/libopus.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../opus-$(OPUSVER).tar.gz && cd opus-$(OPUSVER) && CFLAGS="$(CFLAGS) -Os" $(TOOLOVERRIDES) ./configure $(CONFIGARGS) && $(TOOLOVERRIDES) $(MAKE) && cp .libs/libopus.a ../ && cp include/opus*.h ../) -test -f libs-$(ARCH)/libopus.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../opus-$(OPUSVER).tar.gz && cd opus-$(OPUSVER) && CFLAGS="-D_FORTIFY_SOURCE=0 $(CFLAGS) -Os" $(TOOLOVERRIDES) ./configure $(CONFIGARGS) && $(TOOLOVERRIDES) $(MAKE) && cp .libs/libopus.a ../ && cp include/opus*.h ../)
libs-$(ARCH)/libspeex.a: libs-$(ARCH)/libspeex.a:
test -f speex-$(SPEEXVER).tar.gz || wget http://downloads.us.xiph.org/releases/speex/speex-$(SPEEXVER).tar.gz test -f speex-$(SPEEXVER).tar.gz || wget http://downloads.us.xiph.org/releases/speex/speex-$(SPEEXVER).tar.gz

View file

@ -2576,6 +2576,7 @@ void CL_SendCmd (double frametime, qboolean mainloop)
//clear enough of the pending command for the next frame. //clear enough of the pending command for the next frame.
for (plnum = 0; plnum < cl.splitclients; plnum++) for (plnum = 0; plnum < cl.splitclients; plnum++)
{ {
cl_pendingcmd[plnum].sequence = cl.movesequence;
cl_pendingcmd[plnum].msec = 0; cl_pendingcmd[plnum].msec = 0;
cl_pendingcmd[plnum].impulse = 0; cl_pendingcmd[plnum].impulse = 0;
// cl_pendingcmd[plnum].buttons = 0; // cl_pendingcmd[plnum].buttons = 0;

View file

@ -242,6 +242,7 @@ static void CSQC_FindGlobals(qboolean nofuncs)
csqcg.pmove_org = NULL; //can't make aimbots if you don't know where you're aiming from. csqcg.pmove_org = NULL; //can't make aimbots if you don't know where you're aiming from.
csqcg.pmove_vel = NULL; //no dead reckoning please csqcg.pmove_vel = NULL; //no dead reckoning please
csqcg.pmove_mins = csqcg.pmove_maxs = csqcg.pmove_jump_held = csqcg.pmove_waterjumptime = csqcg.pmove_onground = NULL; //I just want to kill theses csqcg.pmove_mins = csqcg.pmove_maxs = csqcg.pmove_jump_held = csqcg.pmove_waterjumptime = csqcg.pmove_onground = NULL; //I just want to kill theses
csqcg.input_sequence = NULL;
csqcg.input_angles = csqcg.input_movevalues = csqcg.input_buttons = csqcg.input_impulse = csqcg.input_lightlevel = csqcg.input_servertime = NULL; csqcg.input_angles = csqcg.input_movevalues = csqcg.input_buttons = csqcg.input_impulse = csqcg.input_lightlevel = csqcg.input_servertime = NULL;
csqcg.input_weapon = NULL; csqcg.input_weapon = NULL;
csqcg.input_clienttime = csqcg.input_cursor_screen = csqcg.input_cursor_trace_start = csqcg.input_cursor_trace_endpos = csqcg.input_cursor_entitynumber = NULL; csqcg.input_clienttime = csqcg.input_cursor_screen = csqcg.input_cursor_trace_start = csqcg.input_cursor_trace_endpos = csqcg.input_cursor_entitynumber = NULL;
@ -3813,6 +3814,8 @@ static void QCBUILTIN PF_cs_sendevent (pubprogfuncs_t *prinst, struct globalvars
static void cs_set_input_state (usercmd_t *cmd) static void cs_set_input_state (usercmd_t *cmd)
{ {
if (csqcg.input_sequence)
*csqcg.input_sequence = cmd->sequence;
if (csqcg.input_timelength) if (csqcg.input_timelength)
*csqcg.input_timelength = cmd->msec/1000.0f * cl.gamespeed; *csqcg.input_timelength = cmd->msec/1000.0f * cl.gamespeed;
if (csqcg.input_angles) if (csqcg.input_angles)
@ -3916,6 +3919,8 @@ static void cs_set_input_state (usercmd_t *cmd)
static void cs_get_input_state (usercmd_t *cmd) static void cs_get_input_state (usercmd_t *cmd)
{ {
// if (csqcg.input_sequence)
// cmd->sequence = *csqcg.input_sequence;
if (csqcg.input_timelength) if (csqcg.input_timelength)
cmd->msec = *csqcg.input_timelength*1000; cmd->msec = *csqcg.input_timelength*1000;
if (csqcg.input_angles) if (csqcg.input_angles)
@ -4140,7 +4145,6 @@ static void QCBUILTIN PF_cs_runplayerphysics (pubprogfuncs_t *prinst, struct glo
VALGRIND_MAKE_MEM_UNDEFINED(&pmove, sizeof(pmove)); VALGRIND_MAKE_MEM_UNDEFINED(&pmove, sizeof(pmove));
//debugging field //debugging field
pmove.sequence = *csqcg.clientcommandframe;
pmove.jump_msec = 0;//(cls.z_ext & Z_EXT_PM_TYPE) ? 0 : from->jump_msec; pmove.jump_msec = 0;//(cls.z_ext & Z_EXT_PM_TYPE) ? 0 : from->jump_msec;
@ -4152,6 +4156,7 @@ static void QCBUILTIN PF_cs_runplayerphysics (pubprogfuncs_t *prinst, struct glo
pmove.cmd.angles[2] = ANGLE2SHORT(csqcg.input_angles[2]); pmove.cmd.angles[2] = ANGLE2SHORT(csqcg.input_angles[2]);
VectorCopy(csqcg.input_angles, pmove.angles); VectorCopy(csqcg.input_angles, pmove.angles);
pmove.cmd.sequence = *csqcg.clientcommandframe;
pmove.cmd.forwardmove = csqcg.input_movevalues[0]; pmove.cmd.forwardmove = csqcg.input_movevalues[0];
pmove.cmd.sidemove = csqcg.input_movevalues[1]; pmove.cmd.sidemove = csqcg.input_movevalues[1];
pmove.cmd.upmove = csqcg.input_movevalues[2]; pmove.cmd.upmove = csqcg.input_movevalues[2];

View file

@ -948,7 +948,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MAX_SSPARTICLESPRE 1024 // 14bit. precached particle effect names, for server-side pointparticles/trailparticles. #define MAX_SSPARTICLESPRE 1024 // 14bit. precached particle effect names, for server-side pointparticles/trailparticles.
#define MAX_VWEP_MODELS 32 #define MAX_VWEP_MODELS 32
#define MAX_CSMODELS 1024 // these live entirly clientside #define MAX_CSMODELS 2048 // these live entirly clientside
#define MAX_CSPARTICLESPRE 1024 #define MAX_CSPARTICLESPRE 1024
#define SAVEGAME_COMMENT_LENGTH 39 #define SAVEGAME_COMMENT_LENGTH 39

View file

@ -54,8 +54,6 @@ typedef struct
typedef struct typedef struct
{ {
int sequence; // just for debugging prints
// player state // player state
vec3_t origin; vec3_t origin;
vec3_t safeorigin; //valid when safeorigin_known. needed for extrasr4's ladders otherwise they bug out. vec3_t safeorigin; //valid when safeorigin_known. needed for extrasr4's ladders otherwise they bug out.

View file

@ -1116,6 +1116,7 @@ enum
globalfloat (pmove_waterjumptime) /*deprecated. read/written by runplayerphysics*/ \ globalfloat (pmove_waterjumptime) /*deprecated. read/written by runplayerphysics*/ \
globalfloat (pmove_onground) /*deprecated. read/written by runplayerphysics*/ \ globalfloat (pmove_onground) /*deprecated. read/written by runplayerphysics*/ \
\ \
globalfloat (input_sequence) /*float filled by getinputstate, read by runplayerphysics*/ \
globalfloat (input_timelength) /*float filled by getinputstate, read by runplayerphysics*/ \ globalfloat (input_timelength) /*float filled by getinputstate, read by runplayerphysics*/ \
globalvector(input_angles) /*vector filled by getinputstate, read by runplayerphysics*/ \ globalvector(input_angles) /*vector filled by getinputstate, read by runplayerphysics*/ \
globalvector(input_movevalues) /*vector filled by getinputstate, read by runplayerphysics*/ \ globalvector(input_movevalues) /*vector filled by getinputstate, read by runplayerphysics*/ \

View file

@ -1227,6 +1227,7 @@ typedef struct usercmd_s
qbyte lightlevel; qbyte lightlevel;
//end q2 compat //end q2 compat
unsigned int sequence; // just for debugging prints
float msec; //replace msec, but with more precision float msec; //replace msec, but with more precision
unsigned int buttons; //replaces buttons, but with more bits. unsigned int buttons; //replaces buttons, but with more bits.
unsigned int weapon;//q3 has a separate weapon field to supplement impulse. unsigned int weapon;//q3 has a separate weapon field to supplement impulse.

View file

@ -865,6 +865,7 @@ void PR_LoadGlabalStruct(qboolean muted)
static pvec_t zero_default; static pvec_t zero_default;
static pvec_t input_buttons_default; static pvec_t input_buttons_default;
static pvec_t input_timelength_default; static pvec_t input_timelength_default;
static pvec_t input_sequence_default;
static pvec_t input_impulse_default; static pvec_t input_impulse_default;
static pvec3_t input_angles_default; static pvec3_t input_angles_default;
static pvec3_t input_movevalues_default; static pvec3_t input_movevalues_default;
@ -940,7 +941,7 @@ void PR_LoadGlabalStruct(qboolean muted)
globalfloat (false, dimension_send) \ globalfloat (false, dimension_send) \
globalfloat (false, dimension_default) \ globalfloat (false, dimension_default) \
\ \
globalfloat (false, clientcommandframe) \ globalfloat (false, input_sequence) \
globalfloat (false, input_timelength) \ globalfloat (false, input_timelength) \
globalfloat (false, input_impulse) \ globalfloat (false, input_impulse) \
globalvec (false, input_angles) \ globalvec (false, input_angles) \
@ -1042,6 +1043,7 @@ void PR_LoadGlabalStruct(qboolean muted)
ensureglobal(trace_bone_id, writeonly_int); ensureglobal(trace_bone_id, writeonly_int);
ensureglobal(trace_triangle_id, writeonly_int); ensureglobal(trace_triangle_id, writeonly_int);
ensureglobal(input_sequence, input_sequence_default);
ensureglobal(input_timelength, input_timelength_default); ensureglobal(input_timelength, input_timelength_default);
ensureglobal(input_impulse, input_impulse_default); ensureglobal(input_impulse, input_impulse_default);
ensureglobal(input_angles, input_angles_default); ensureglobal(input_angles, input_angles_default);
@ -10158,11 +10160,6 @@ static void QCBUILTIN PF_runclientphys(pubprogfuncs_t *prinst, struct globalvars
VALGRIND_MAKE_MEM_UNDEFINED(&pmove, sizeof(pmove)); VALGRIND_MAKE_MEM_UNDEFINED(&pmove, sizeof(pmove));
if (pr_global_ptrs->clientcommandframe)
pmove.sequence = *pr_global_ptrs->clientcommandframe;
else
pmove.sequence = 0;
if (ent->entnum >= 1 && ent->entnum <= sv.allocated_client_slots) if (ent->entnum >= 1 && ent->entnum <= sv.allocated_client_slots)
client = &svs.clients[ent->entnum-1]; client = &svs.clients[ent->entnum-1];
else else
@ -10178,6 +10175,7 @@ static void QCBUILTIN PF_runclientphys(pubprogfuncs_t *prinst, struct globalvars
pmove.waterjumptime = ent->v->teleport_time; pmove.waterjumptime = ent->v->teleport_time;
//set up the movement command //set up the movement command
pmove.cmd.sequence = pr_global_struct->input_sequence;
msecs = pr_global_struct->input_timelength*1000 + 0.5f; msecs = pr_global_struct->input_timelength*1000 + 0.5f;
//precision inaccuracies. :( //precision inaccuracies. :(
pmove.cmd.angles[0] = ANGLE2SHORT((pr_global_struct->input_angles)[0]); pmove.cmd.angles[0] = ANGLE2SHORT((pr_global_struct->input_angles)[0]);
@ -10326,6 +10324,8 @@ void SV_SetEntityButtons(edict_t *ent, unsigned int buttonbits)
void SV_SetSSQCInputs(usercmd_t *ucmd) void SV_SetSSQCInputs(usercmd_t *ucmd)
{ {
if (pr_global_ptrs->input_sequence)
pr_global_struct->input_sequence = ucmd->sequence;
if (pr_global_ptrs->input_timelength) if (pr_global_ptrs->input_timelength)
pr_global_struct->input_timelength = ucmd->msec/1000.0f * sv.gamespeed; pr_global_struct->input_timelength = ucmd->msec/1000.0f * sv.gamespeed;
if (pr_global_ptrs->input_impulse) if (pr_global_ptrs->input_impulse)
@ -12897,6 +12897,7 @@ void PR_DumpPlatform_f(void)
{"end_sys_fields", "void", QW|NQ|CS|MENU}, {"end_sys_fields", "void", QW|NQ|CS|MENU},
{"time", "float", MENU, D("The current local time. Increases while paused.")}, {"time", "float", MENU, D("The current local time. Increases while paused.")},
{"input_sequence", "float", QW|NQ|CS, D("This is the client-generated input sequence number. 0 for unsequenced movements.")},
{"input_servertime", "float", QW|NQ|CS, D("Server's timestamp of the client's interpolation state.")}, {"input_servertime", "float", QW|NQ|CS, D("Server's timestamp of the client's interpolation state.")},
// {"input_clienttime", "float", QW|NQ|CS, D("This is the timestamp that player prediction is simulating.")}, // {"input_clienttime", "float", QW|NQ|CS, D("This is the timestamp that player prediction is simulating.")},
{"input_timelength", "float", QW|NQ}, {"input_timelength", "float", QW|NQ},

View file

@ -103,7 +103,7 @@ typedef struct nqglobalvars_s
pvec_t *physics_mode; pvec_t *physics_mode;
pvec_t *clientcommandframe; pvec_t *input_sequence;
pvec_t *input_servertime; pvec_t *input_servertime;
pvec_t *input_clienttime; pvec_t *input_clienttime;
pvec_t *input_timelength; pvec_t *input_timelength;

View file

@ -7971,6 +7971,7 @@ static double SVFTE_ExecuteClientMove(client_t *controller)
for (frame = 0; frame < frames; frame++) for (frame = 0; frame < frames; frame++)
{ {
MSGFTE_ReadDeltaUsercmd(&old, &split->lastcmd); MSGFTE_ReadDeltaUsercmd(&old, &split->lastcmd);
split->lastcmd.sequence = controller->netchan.outgoing_sequence - (frames-frame-1);
old = split->lastcmd; old = split->lastcmd;
split->lastcmd.angles[0] += split->baseangles[0]; split->lastcmd.angles[0] += split->baseangles[0];
split->lastcmd.angles[1] += split->baseangles[1]; split->lastcmd.angles[1] += split->baseangles[1];
@ -8194,6 +8195,9 @@ void SV_ExecuteClientMessage (client_t *cl)
} }
MSGQW_ReadDeltaUsercmd (&oldest, &oldcmd, PROTOCOL_VERSION_QW); MSGQW_ReadDeltaUsercmd (&oldest, &oldcmd, PROTOCOL_VERSION_QW);
MSGQW_ReadDeltaUsercmd (&oldcmd, &newcmd, PROTOCOL_VERSION_QW); MSGQW_ReadDeltaUsercmd (&oldcmd, &newcmd, PROTOCOL_VERSION_QW);
oldest.sequence = cl->netchan.incoming_sequence-2;
oldcmd.sequence = cl->netchan.incoming_sequence-1;
newcmd.sequence = cl->netchan.incoming_sequence;
if (!split) if (!split)
break; // either someone is trying to cheat, or they sent input commands for splitscreen clients they no longer own. break; // either someone is trying to cheat, or they sent input commands for splitscreen clients they no longer own.
@ -8630,6 +8634,8 @@ void SVNQ_ReadClientMove (qboolean forceangle16)
cmd = nullcmd; cmd = nullcmd;
cmd.sequence = host_client->last_sequence;
//read the time, woo... should be an ack of our serverside time. //read the time, woo... should be an ack of our serverside time.
cmd.fservertime = MSG_ReadFloat (); cmd.fservertime = MSG_ReadFloat ();
if (cmd.fservertime < from->fservertime) if (cmd.fservertime < from->fservertime)

View file

@ -2646,7 +2646,6 @@ qboolean SV_AntiKnockBack(world_t *w, client_t *client)
if (frame->sequence != seq) if (frame->sequence != seq)
continue; //FIXME: lost continue; //FIXME: lost
pmove.sequence = seq;
pmove.cmd = frame->cmd; pmove.cmd = frame->cmd;
// pmove.angles; // pmove.angles;

View file

@ -283,6 +283,9 @@ void main ()
//Read the base texture (with EIGHTBIT only alpha is needed) //Read the base texture (with EIGHTBIT only alpha is needed)
vec4 col = texture2D(s_diffuse, tc); vec4 col = texture2D(s_diffuse, tc);
if (bases.rgb == vec3(0.0,0.0,1.0))
bases.a = 0.0;
#if defined(BUMP) && (defined(DELUXE) || defined(SPECULAR) || defined(REFLECTCUBEMASK)) #if defined(BUMP) && (defined(DELUXE) || defined(SPECULAR) || defined(REFLECTCUBEMASK))
vec3 norm = normalize(texture2D(s_normalmap, tc).rgb - 0.5); vec3 norm = normalize(texture2D(s_normalmap, tc).rgb - 0.5);
#elif defined(PBR) || defined(SPECULAR) || defined(DELUXE) || defined(REFLECTCUBEMASK) #elif defined(PBR) || defined(SPECULAR) || defined(DELUXE) || defined(REFLECTCUBEMASK)

View file

@ -2,7 +2,9 @@
if (!Module["arguments"]) if (!Module["arguments"])
Module['arguments'] = ['-nohome']; Module['arguments'] = ['-nohome'];
var man = window.location.protocol+'//'+window.location.host+window.location.pathname + '.fmf'; if (typeof man == "undefined")
var man = window.location.protocol + "//" + window.location.host + window.location.pathname + ".fmf";
if (window.location.hash != "") if (window.location.hash != "")
man = window.location.hash.substring(1); man = window.location.hash.substring(1);