diff --git a/engine/Makefile b/engine/Makefile index e82de4f30..98d17bc75 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -2412,7 +2412,7 @@ libs-$(ARCH)/libvorbis.a: libs-$(ARCH)/libogg.a libs-$(ARCH)/libopus.a: 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: test -f speex-$(SPEEXVER).tar.gz || wget http://downloads.us.xiph.org/releases/speex/speex-$(SPEEXVER).tar.gz diff --git a/engine/client/cl_input.c b/engine/client/cl_input.c index e4f300479..82dcbf470 100644 --- a/engine/client/cl_input.c +++ b/engine/client/cl_input.c @@ -2576,6 +2576,7 @@ void CL_SendCmd (double frametime, qboolean mainloop) //clear enough of the pending command for the next frame. for (plnum = 0; plnum < cl.splitclients; plnum++) { + cl_pendingcmd[plnum].sequence = cl.movesequence; cl_pendingcmd[plnum].msec = 0; cl_pendingcmd[plnum].impulse = 0; // cl_pendingcmd[plnum].buttons = 0; diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 0d6712d9b..5c8bc4a6a 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -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_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.input_sequence = 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_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) { + if (csqcg.input_sequence) + *csqcg.input_sequence = cmd->sequence; if (csqcg.input_timelength) *csqcg.input_timelength = cmd->msec/1000.0f * cl.gamespeed; 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) { +// if (csqcg.input_sequence) +// cmd->sequence = *csqcg.input_sequence; if (csqcg.input_timelength) cmd->msec = *csqcg.input_timelength*1000; 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)); //debugging field - pmove.sequence = *csqcg.clientcommandframe; 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]); VectorCopy(csqcg.input_angles, pmove.angles); + pmove.cmd.sequence = *csqcg.clientcommandframe; pmove.cmd.forwardmove = csqcg.input_movevalues[0]; pmove.cmd.sidemove = csqcg.input_movevalues[1]; pmove.cmd.upmove = csqcg.input_movevalues[2]; diff --git a/engine/common/bothdefs.h b/engine/common/bothdefs.h index c87b03cc8..889950fc9 100644 --- a/engine/common/bothdefs.h +++ b/engine/common/bothdefs.h @@ -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_VWEP_MODELS 32 -#define MAX_CSMODELS 1024 // these live entirly clientside +#define MAX_CSMODELS 2048 // these live entirly clientside #define MAX_CSPARTICLESPRE 1024 #define SAVEGAME_COMMENT_LENGTH 39 diff --git a/engine/common/pmove.h b/engine/common/pmove.h index a09754371..c307cf7cb 100644 --- a/engine/common/pmove.h +++ b/engine/common/pmove.h @@ -54,8 +54,6 @@ typedef struct typedef struct { - int sequence; // just for debugging prints - // player state vec3_t origin; vec3_t safeorigin; //valid when safeorigin_known. needed for extrasr4's ladders otherwise they bug out. diff --git a/engine/common/pr_common.h b/engine/common/pr_common.h index d5c33a946..2548e0b6c 100644 --- a/engine/common/pr_common.h +++ b/engine/common/pr_common.h @@ -1116,6 +1116,7 @@ enum globalfloat (pmove_waterjumptime) /*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*/ \ globalvector(input_angles) /*vector filled by getinputstate, read by runplayerphysics*/ \ globalvector(input_movevalues) /*vector filled by getinputstate, read by runplayerphysics*/ \ diff --git a/engine/common/protocol.h b/engine/common/protocol.h index 227f25aaa..6dc2fbe20 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -1227,6 +1227,7 @@ typedef struct usercmd_s qbyte lightlevel; //end q2 compat + unsigned int sequence; // just for debugging prints float msec; //replace msec, but with more precision unsigned int buttons; //replaces buttons, but with more bits. unsigned int weapon;//q3 has a separate weapon field to supplement impulse. diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index c24184e32..a6f96580c 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -865,6 +865,7 @@ void PR_LoadGlabalStruct(qboolean muted) static pvec_t zero_default; static pvec_t input_buttons_default; static pvec_t input_timelength_default; + static pvec_t input_sequence_default; static pvec_t input_impulse_default; static pvec3_t input_angles_default; static pvec3_t input_movevalues_default; @@ -940,7 +941,7 @@ void PR_LoadGlabalStruct(qboolean muted) globalfloat (false, dimension_send) \ globalfloat (false, dimension_default) \ \ - globalfloat (false, clientcommandframe) \ + globalfloat (false, input_sequence) \ globalfloat (false, input_timelength) \ globalfloat (false, input_impulse) \ globalvec (false, input_angles) \ @@ -1042,6 +1043,7 @@ void PR_LoadGlabalStruct(qboolean muted) ensureglobal(trace_bone_id, writeonly_int); ensureglobal(trace_triangle_id, writeonly_int); + ensureglobal(input_sequence, input_sequence_default); ensureglobal(input_timelength, input_timelength_default); ensureglobal(input_impulse, input_impulse_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)); - 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) client = &svs.clients[ent->entnum-1]; else @@ -10178,6 +10175,7 @@ static void QCBUILTIN PF_runclientphys(pubprogfuncs_t *prinst, struct globalvars pmove.waterjumptime = ent->v->teleport_time; //set up the movement command + pmove.cmd.sequence = pr_global_struct->input_sequence; msecs = pr_global_struct->input_timelength*1000 + 0.5f; //precision inaccuracies. :( 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) { + if (pr_global_ptrs->input_sequence) + pr_global_struct->input_sequence = ucmd->sequence; if (pr_global_ptrs->input_timelength) pr_global_struct->input_timelength = ucmd->msec/1000.0f * sv.gamespeed; if (pr_global_ptrs->input_impulse) @@ -12897,6 +12897,7 @@ void PR_DumpPlatform_f(void) {"end_sys_fields", "void", QW|NQ|CS|MENU}, {"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_clienttime", "float", QW|NQ|CS, D("This is the timestamp that player prediction is simulating.")}, {"input_timelength", "float", QW|NQ}, diff --git a/engine/server/progdefs.h b/engine/server/progdefs.h index 3c01157fd..072f81707 100644 --- a/engine/server/progdefs.h +++ b/engine/server/progdefs.h @@ -103,7 +103,7 @@ typedef struct nqglobalvars_s pvec_t *physics_mode; - pvec_t *clientcommandframe; + pvec_t *input_sequence; pvec_t *input_servertime; pvec_t *input_clienttime; pvec_t *input_timelength; diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index cbf70cbe2..ca9e520e4 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -7971,6 +7971,7 @@ static double SVFTE_ExecuteClientMove(client_t *controller) for (frame = 0; frame < frames; frame++) { MSGFTE_ReadDeltaUsercmd(&old, &split->lastcmd); + split->lastcmd.sequence = controller->netchan.outgoing_sequence - (frames-frame-1); old = split->lastcmd; split->lastcmd.angles[0] += split->baseangles[0]; 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 (&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) 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.sequence = host_client->last_sequence; + //read the time, woo... should be an ack of our serverside time. cmd.fservertime = MSG_ReadFloat (); if (cmd.fservertime < from->fservertime) diff --git a/engine/server/world.c b/engine/server/world.c index ff5f32920..b2a7ca45a 100644 --- a/engine/server/world.c +++ b/engine/server/world.c @@ -2646,7 +2646,6 @@ qboolean SV_AntiKnockBack(world_t *w, client_t *client) if (frame->sequence != seq) continue; //FIXME: lost - pmove.sequence = seq; pmove.cmd = frame->cmd; // pmove.angles; diff --git a/engine/shaders/glsl/defaultwall.glsl b/engine/shaders/glsl/defaultwall.glsl index 99e9f6807..3d39e613a 100644 --- a/engine/shaders/glsl/defaultwall.glsl +++ b/engine/shaders/glsl/defaultwall.glsl @@ -283,6 +283,9 @@ void main () //Read the base texture (with EIGHTBIT only alpha is needed) 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)) vec3 norm = normalize(texture2D(s_normalmap, tc).rgb - 0.5); #elif defined(PBR) || defined(SPECULAR) || defined(DELUXE) || defined(REFLECTCUBEMASK) diff --git a/engine/web/prejs.js b/engine/web/prejs.js index dfedfd21f..50ae67eee 100644 --- a/engine/web/prejs.js +++ b/engine/web/prejs.js @@ -2,7 +2,9 @@ if (!Module["arguments"]) 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 != "") man = window.location.hash.substring(1); @@ -20,4 +22,4 @@ else if (!document.referrer) Module['arguments'] = Module['arguments'].concat(qstring[i]); } -} \ No newline at end of file +}