mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-10 23:32:06 +00:00
Backing out of most of unlagged. Only optimized prediction and smooth clients
remains.
This commit is contained in:
parent
2424ccaae7
commit
c23d31995b
14 changed files with 106 additions and 262 deletions
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.43 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.42 2003/04/02 17:58:03 jbravo
|
||||
// Ammo skin only replacements now work.
|
||||
//
|
||||
|
@ -888,9 +892,6 @@ CG_CalcEntityLerpPositions
|
|||
*/
|
||||
static void CG_CalcEntityLerpPositions(centity_t * cent)
|
||||
{
|
||||
// JBravo: unlagged
|
||||
int timeshift = 0;
|
||||
|
||||
// this is done server-side now - cg_smoothClients is undefined
|
||||
// players will always be TR_INTERPOLATE
|
||||
// if this player does not want to see extrapolated players
|
||||
|
@ -922,35 +923,9 @@ static void CG_CalcEntityLerpPositions(centity_t * cent)
|
|||
cent->currentState.pos.trDuration = 1000 / sv_fps.integer;
|
||||
}
|
||||
|
||||
if (cent->currentState.eType == ET_MISSILE) {
|
||||
// if it's one of ours
|
||||
if (cent->currentState.otherEntityNum == cg.clientNum) {
|
||||
timeshift = 1000 / sv_fps.integer;
|
||||
} else if ( cent->currentState.weapon != WP_GRENADE) {
|
||||
timeshift = cg_projectileNudge.integer + 1000 / sv_fps.integer;
|
||||
}
|
||||
}
|
||||
|
||||
// just use the current frame and evaluate as best we can
|
||||
// CG_EvaluateTrajectory(¢->currentState.pos, cg.time, cent->lerpOrigin);
|
||||
// CG_EvaluateTrajectory(¢->currentState.apos, cg.time, cent->lerpAngles);
|
||||
BG_EvaluateTrajectory(¢->currentState.pos, cg.time + timeshift, cent->lerpOrigin);
|
||||
BG_EvaluateTrajectory(¢->currentState.apos, cg.time + timeshift, cent->lerpAngles);
|
||||
|
||||
if (timeshift != 0) {
|
||||
trace_t tr;
|
||||
vec3_t lastOrigin;
|
||||
|
||||
BG_EvaluateTrajectory (¢->currentState.pos, cg.time, lastOrigin);
|
||||
CG_Trace(&tr, lastOrigin, vec3_origin, vec3_origin, cent->lerpOrigin, cent->currentState.number, MASK_SHOT);
|
||||
|
||||
// don't let the projectile go through the floor
|
||||
if (tr.fraction < 1.0f) {
|
||||
cent->lerpOrigin[0] = lastOrigin[0] + tr.fraction * (cent->lerpOrigin[0] - lastOrigin[0]);
|
||||
cent->lerpOrigin[1] = lastOrigin[1] + tr.fraction * (cent->lerpOrigin[1] - lastOrigin[1]);
|
||||
cent->lerpOrigin[2] = lastOrigin[2] + tr.fraction * (cent->lerpOrigin[2] - lastOrigin[2]);
|
||||
}
|
||||
}
|
||||
CG_EvaluateTrajectory(¢->currentState.pos, cg.time, cent->lerpOrigin);
|
||||
CG_EvaluateTrajectory(¢->currentState.apos, cg.time, cent->lerpAngles);
|
||||
|
||||
// adjust for riding a mover if it wasn't rolled into the predicted
|
||||
// player state
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.145 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.144 2003/04/13 21:58:00 slicer
|
||||
// Added a Zoom Sensitivity Lock during fire sequence of ssg; removed unnecessary code
|
||||
//
|
||||
|
@ -1860,16 +1864,11 @@ extern vmCvar_t cg_trueLightning;
|
|||
|
||||
// JBravo: unlagged
|
||||
extern vmCvar_t cg_delag;
|
||||
extern vmCvar_t cg_debugDelag;
|
||||
extern vmCvar_t cg_drawBBox;
|
||||
extern vmCvar_t cg_cmdTimeNudge;
|
||||
extern vmCvar_t sv_fps;
|
||||
extern vmCvar_t cg_projectileNudge;
|
||||
extern vmCvar_t cg_optimizePrediction;
|
||||
extern vmCvar_t cl_timeNudge;
|
||||
extern vmCvar_t cg_latentSnaps;
|
||||
extern vmCvar_t cg_latentCmds;
|
||||
extern vmCvar_t cg_plOut;
|
||||
extern vmCvar_t cl_timeNudge;
|
||||
|
||||
// NiceAss: No longer part of the MissionPack
|
||||
extern vmCvar_t cg_enableBreath;
|
||||
|
@ -1927,7 +1926,7 @@ extern vmCvar_t cg_RQ3_matchmode;
|
|||
extern vmCvar_t cg_atmosphericEffects;
|
||||
extern vmCvar_t cg_lowEffects;
|
||||
|
||||
void CG_PredictWeaponEffects(centity_t *cent);
|
||||
//void CG_PredictWeaponEffects(centity_t *cent);
|
||||
void CG_AddBoundingBox(centity_t *cent);
|
||||
qboolean CG_Cvar_ClampInt(const char *name, vmCvar_t *vmCvar, int min, int max);
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.134 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.133 2003/04/07 18:21:34 niceass
|
||||
// teamplay irvision
|
||||
//
|
||||
|
@ -599,16 +603,11 @@ vmCvar_t cg_trueLightning;
|
|||
|
||||
// JBravo: unlagged
|
||||
vmCvar_t cg_delag;
|
||||
vmCvar_t cg_debugDelag;
|
||||
vmCvar_t cg_drawBBox;
|
||||
vmCvar_t cg_cmdTimeNudge;
|
||||
vmCvar_t sv_fps;
|
||||
vmCvar_t cg_projectileNudge;
|
||||
vmCvar_t cg_optimizePrediction;
|
||||
vmCvar_t cl_timeNudge;
|
||||
vmCvar_t cg_latentSnaps;
|
||||
vmCvar_t cg_latentCmds;
|
||||
vmCvar_t cg_plOut;
|
||||
vmCvar_t cl_timeNudge;
|
||||
|
||||
//Blaze: cheat struct
|
||||
cheat_cvar cheats[30];
|
||||
|
@ -884,16 +883,11 @@ static cvarTable_t cvarTable[] = { // bk001129
|
|||
{&cg_lowEffects, "cg_lowEffects", "0", CVAR_ARCHIVE},
|
||||
// JBravo: unlagged
|
||||
{&cg_delag, "cg_delag", "1", CVAR_ARCHIVE | CVAR_USERINFO},
|
||||
{&cg_debugDelag, "cg_debugDelag", "0", CVAR_USERINFO | CVAR_CHEAT},
|
||||
{&cg_drawBBox, "cg_drawBBox", "0", CVAR_CHEAT},
|
||||
{&cg_cmdTimeNudge, "cg_cmdTimeNudge", "0", CVAR_ARCHIVE | CVAR_USERINFO},
|
||||
{&sv_fps, "sv_fps", "20", 0},
|
||||
{&cg_projectileNudge, "cg_projectileNudge", "0", CVAR_ARCHIVE},
|
||||
{&cg_optimizePrediction, "cg_optimizePrediction", "1", CVAR_ARCHIVE},
|
||||
{&cl_timeNudge, "cl_timeNudge", "0", CVAR_ARCHIVE},
|
||||
{&cg_latentSnaps, "cg_latentSnaps", "0", CVAR_USERINFO | CVAR_CHEAT},
|
||||
{&cg_latentCmds, "cg_latentCmds", "0", CVAR_USERINFO | CVAR_CHEAT},
|
||||
{&cg_plOut, "cg_plOut", "0", CVAR_USERINFO | CVAR_CHEAT},
|
||||
{&cl_timeNudge, "cl_timeNudge", "0", CVAR_ARCHIVE}
|
||||
|
||||
//{ &cg_RQ3_RefID, "g_RQ3_RefID", "0", 0}
|
||||
//{ &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }
|
||||
|
@ -1043,16 +1037,8 @@ void CG_UpdateCvars(void)
|
|||
|
||||
for (i = 0, cv = cvarTable; i < cvarTableSize; i++, cv++) {
|
||||
// JBravo: unlagged
|
||||
if (cv->vmCvar == &cg_cmdTimeNudge) {
|
||||
CG_Cvar_ClampInt(cv->cvarName, cv->vmCvar, 0, 999);
|
||||
} else if (cv->vmCvar == &cl_timeNudge) {
|
||||
CG_Cvar_ClampInt( cv->cvarName, cv->vmCvar, -50, 50);
|
||||
} else if (cv->vmCvar == &cg_latentSnaps) {
|
||||
CG_Cvar_ClampInt( cv->cvarName, cv->vmCvar, 0, 10);
|
||||
} else if (cv->vmCvar == &cg_latentCmds) {
|
||||
CG_Cvar_ClampInt( cv->cvarName, cv->vmCvar, 0, MAX_LATENT_CMDS - 1);
|
||||
} else if (cv->vmCvar == &cg_plOut) {
|
||||
CG_Cvar_ClampInt( cv->cvarName, cv->vmCvar, 0, 100);
|
||||
if (cv->vmCvar == &cl_timeNudge) {
|
||||
CG_Cvar_ClampInt(cv->cvarName, cv->vmCvar, -50, 50);
|
||||
}
|
||||
trap_Cvar_Update(cv->vmCvar);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.8 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.7 2003/03/09 21:30:38 jbravo
|
||||
// Adding unlagged. Still needs work.
|
||||
//
|
||||
|
@ -272,17 +276,6 @@ static snapshot_t *CG_ReadNextSnapshot(void)
|
|||
cgs.processedSnapshotNum++;
|
||||
r = trap_GetSnapshot(cgs.processedSnapshotNum, dest);
|
||||
|
||||
// JBravo: unlagged
|
||||
if (cg_latentSnaps.integer && r) {
|
||||
int i = 0, time = dest->serverTime;
|
||||
while (dest->serverTime > time - cg_latentSnaps.integer * (1000 / sv_fps.integer)) {
|
||||
if (!(r = trap_GetSnapshot(cgs.processedSnapshotNum - i, dest))) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: why would trap_GetSnapshot return a snapshot with the same server time
|
||||
if (cg.snap && r && dest->serverTime == cg.snap->serverTime) {
|
||||
//continue;
|
||||
|
@ -337,11 +330,7 @@ void CG_ProcessSnapshots(void)
|
|||
if (n != cg.latestSnapshotNum) {
|
||||
if (n < cg.latestSnapshotNum) {
|
||||
// this should never happen
|
||||
if (cg_latentSnaps.integer) {
|
||||
CG_Printf("WARNING: CG_ProcessSnapshots: n < cg.latestSnapshotNum\n");
|
||||
} else {
|
||||
CG_Error("CG_ProcessSnapshots: n < cg.latestSnapshotNum");
|
||||
}
|
||||
CG_Error("CG_ProcessSnapshots: n < cg.latestSnapshotNum");
|
||||
}
|
||||
cg.latestSnapshotNum = n;
|
||||
}
|
||||
|
@ -379,11 +368,7 @@ void CG_ProcessSnapshots(void)
|
|||
|
||||
// if time went backwards, we have a level restart
|
||||
if (cg.nextSnap->serverTime < cg.snap->serverTime) {
|
||||
if (cg_latentSnaps.integer) {
|
||||
CG_Printf("WARNING: CG_ProcessSnapshots: Server time went backwards\n");
|
||||
} else {
|
||||
CG_Error("CG_ProcessSnapshots: Server time went backwards");
|
||||
}
|
||||
CG_Error("CG_ProcessSnapshots: Server time went backwards");
|
||||
}
|
||||
}
|
||||
// if our time is < nextFrame's, we have a nice interpolating state
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.3 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.2 2003/03/10 07:07:58 jbravo
|
||||
// Small unlagged fixes and voting delay added.
|
||||
//
|
||||
|
@ -17,11 +21,11 @@
|
|||
#include "cg_local.h"
|
||||
|
||||
// we'll need these prototypes
|
||||
void CG_ShotgunPattern(vec3_t origin, vec3_t origin2, int seed, int otherEntNum);
|
||||
//void CG_ShotgunPattern(vec3_t origin, vec3_t origin2, int seed, int otherEntNum);
|
||||
//void CG_Bullet(vec3_t end, int sourceEntityNum, vec3_t normal, qboolean flesh, int fleshEntityNum);
|
||||
|
||||
// and this as well
|
||||
#define MACHINEGUN_SPREAD 200
|
||||
//#define MACHINEGUN_SPREAD 200
|
||||
|
||||
/*
|
||||
=======================
|
||||
|
@ -32,7 +36,7 @@ lightning gun is done in CG_LightningBolt, since it was just a matter
|
|||
of setting the right origin and angles.
|
||||
=======================
|
||||
*/
|
||||
void CG_PredictWeaponEffects(centity_t * cent)
|
||||
/*void CG_PredictWeaponEffects(centity_t * cent)
|
||||
{
|
||||
vec3_t muzzlePoint, forward, right, up;
|
||||
entityState_t *ent = ¢->currentState;
|
||||
|
@ -223,7 +227,7 @@ void CG_PredictWeaponEffects(centity_t * cent)
|
|||
//Com_Printf( "Predicted bullet\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
=================
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.33 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.32 2003/04/13 21:58:00 slicer
|
||||
// Added a Zoom Sensitivity Lock during fire sequence of ssg; removed unnecessary code
|
||||
//
|
||||
|
@ -1007,8 +1011,6 @@ void CG_DrawActiveFrame(int serverTime, stereoFrame_t stereoView, qboolean demoP
|
|||
|
||||
//end Blaze
|
||||
cg.time = serverTime;
|
||||
// JBravo: unlagged
|
||||
cg.time -= cg_latentSnaps.integer * (1000 / sv_fps.integer);
|
||||
|
||||
cg.demoPlayback = demoPlayback;
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.99 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.98 2003/03/22 20:29:26 jbravo
|
||||
// wrapping linkent and unlinkent calls
|
||||
//
|
||||
|
@ -1108,54 +1112,8 @@ void ClientThink_real(gentity_t * ent)
|
|||
if (ucmd->serverTime < level.time - 1000) {
|
||||
ucmd->serverTime = level.time - 1000;
|
||||
}
|
||||
// JBravo: unlagged
|
||||
client->frameOffset = trap_Milliseconds() - level.frameStartTime;
|
||||
if (client->pers.plOut) {
|
||||
float thresh = (float)client->pers.plOut / 100.0f;
|
||||
if (random() < thresh) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
client->pers.pingsamples[client->pers.samplehead] = level.previousTime + client->frameOffset - ucmd->serverTime;
|
||||
client->pers.samplehead++;
|
||||
if ( client->pers.samplehead >= NUM_PING_SAMPLES ) {
|
||||
client->pers.samplehead -= NUM_PING_SAMPLES;
|
||||
}
|
||||
|
||||
if (g_truePing.integer) {
|
||||
int i, sum = 0;
|
||||
|
||||
for (i = 0; i < NUM_PING_SAMPLES; i++) {
|
||||
sum += client->pers.pingsamples[i];
|
||||
}
|
||||
client->pers.realPing = sum / NUM_PING_SAMPLES;
|
||||
} else {
|
||||
client->pers.realPing = client->ps.ping;
|
||||
}
|
||||
client->pers.cmdqueue[client->pers.cmdhead] = client->pers.cmd;
|
||||
client->pers.cmdhead++;
|
||||
if (client->pers.cmdhead >= MAX_LATENT_CMDS) {
|
||||
client->pers.cmdhead -= MAX_LATENT_CMDS;
|
||||
}
|
||||
if (client->pers.latentCmds) {
|
||||
int time = ucmd->serverTime;
|
||||
|
||||
int cmdindex = client->pers.cmdhead - client->pers.latentCmds - 1;
|
||||
while (cmdindex < 0) {
|
||||
cmdindex += MAX_LATENT_CMDS;
|
||||
}
|
||||
client->pers.cmd = client->pers.cmdqueue[cmdindex];
|
||||
client->pers.realPing += time - ucmd->serverTime;
|
||||
}
|
||||
client->attackTime = ucmd->serverTime;
|
||||
client->lastUpdateFrame = level.framenum;
|
||||
if (client->pers.latentSnaps) {
|
||||
client->pers.realPing += client->pers.latentSnaps * (1000 / sv_fps.integer);
|
||||
client->attackTime -= client->pers.latentSnaps * (1000 / sv_fps.integer);
|
||||
}
|
||||
if (client->pers.realPing < 0) {
|
||||
client->pers.realPing = 0;
|
||||
}
|
||||
|
||||
msec = ucmd->serverTime - client->ps.commandTime;
|
||||
// following others may result in bad times, but we still want
|
||||
|
@ -1277,11 +1235,7 @@ void ClientThink_real(gentity_t * ent)
|
|||
if (ent->client->ps.eventSequence != oldEventSequence) {
|
||||
ent->eventTime = level.time;
|
||||
}
|
||||
/* if (g_smoothClients.integer) {
|
||||
BG_PlayerStateToEntityStateExtraPolate(&ent->client->ps, &ent->s, ent->client->ps.commandTime, qtrue);
|
||||
} else {
|
||||
BG_PlayerStateToEntityState(&ent->client->ps, &ent->s, qtrue);
|
||||
} */
|
||||
|
||||
BG_PlayerStateToEntityState(&ent->client->ps, &ent->s, qtrue);
|
||||
SendPendingPredictableEvents(&ent->client->ps);
|
||||
|
||||
|
@ -1506,9 +1460,8 @@ while a slow client may have multiple ClientEndFrame between ClientThink.
|
|||
*/
|
||||
void ClientEndFrame(gentity_t * ent)
|
||||
{
|
||||
int i;
|
||||
int i, frames;
|
||||
clientPersistant_t *pers;
|
||||
int frames;
|
||||
|
||||
if (ent->client->sess.sessionTeam == TEAM_SPECTATOR) {
|
||||
SpectatorClientEndFrame(ent);
|
||||
|
@ -1549,18 +1502,8 @@ void ClientEndFrame(gentity_t * ent)
|
|||
// apply all the damage taken this frame
|
||||
P_DamageFeedback(ent);
|
||||
|
||||
// add the EF_CONNECTION flag if we haven't gotten commands recently
|
||||
/* if (level.time - ent->client->lastCmdTime > 1000) {
|
||||
ent->s.eFlags |= EF_CONNECTION;
|
||||
} else {
|
||||
ent->s.eFlags &= ~EF_CONNECTION;
|
||||
} */
|
||||
|
||||
// Begin Duffman
|
||||
// Update the clips Amount in weapon for the client
|
||||
ent->client->ps.stats[STAT_CLIPS] = ent->client->numClips[ent->client->ps.weapon];
|
||||
|
||||
// End Duffman
|
||||
ent->client->ps.stats[STAT_HEALTH] = ent->health; // FIXME: get rid of ent->health...
|
||||
|
||||
//Elder: bleeding notification
|
||||
|
@ -1597,13 +1540,6 @@ void ClientEndFrame(gentity_t * ent)
|
|||
Cmd_Weapon(ent);
|
||||
|
||||
G_SetClientSound(ent);
|
||||
|
||||
// set the latest infor
|
||||
/* if (g_smoothClients.integer) {
|
||||
BG_PlayerStateToEntityStateExtraPolate(&ent->client->ps, &ent->s, ent->client->ps.commandTime, qtrue);
|
||||
} else {
|
||||
BG_PlayerStateToEntityState(&ent->client->ps, &ent->s, qtrue);
|
||||
} */
|
||||
BG_PlayerStateToEntityState(&ent->client->ps, &ent->s, qtrue);
|
||||
SendPendingPredictableEvents(&ent->client->ps);
|
||||
|
||||
|
@ -1619,5 +1555,4 @@ void ClientEndFrame(gentity_t * ent)
|
|||
G_PredictPlayerMove(ent, (float)frames / sv_fps.integer);
|
||||
SnapVector(ent->s.pos.trBase);
|
||||
}
|
||||
G_StoreHistory(ent);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.131 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.130 2003/04/09 02:00:43 jbravo
|
||||
// Fixed team none in DM and some final cleanups for the 3.0 release
|
||||
//
|
||||
|
@ -1045,21 +1049,7 @@ void ClientUserinfoChanged(int clientNum)
|
|||
} else {
|
||||
client->pers.delag = atoi(s);
|
||||
}
|
||||
s = Info_ValueForKey(userinfo, "cg_cmdTimeNudge");
|
||||
client->pers.cmdTimeNudge = atoi(s);
|
||||
s = Info_ValueForKey(userinfo, "cg_debugDelag");
|
||||
if (!atoi(s)) {
|
||||
client->pers.debugDelag = qfalse;
|
||||
} else {
|
||||
client->pers.debugDelag = qtrue;
|
||||
}
|
||||
s = Info_ValueForKey(userinfo, "cg_latentSnaps");
|
||||
client->pers.latentSnaps = atoi(s);
|
||||
s = Info_ValueForKey(userinfo, "cg_latentCmds");
|
||||
client->pers.latentCmds = atoi(s);
|
||||
s = Info_ValueForKey(userinfo, "cg_plOut");
|
||||
client->pers.plOut = atoi(s);
|
||||
|
||||
|
||||
// set name
|
||||
Q_strncpyz(oldname, client->pers.netname, sizeof(oldname));
|
||||
s = Info_ValueForKey(userinfo, "name");
|
||||
|
@ -1420,12 +1410,6 @@ char *ClientConnect(int clientNum, qboolean firstTime, qboolean isBot)
|
|||
client->specMode = SPECTATOR_NOT;
|
||||
}
|
||||
|
||||
// JBravo: unlagged
|
||||
/* if (g_delagHitscan.integer) {
|
||||
trap_SendServerCommand(clientNum, "print \"^3This server is Unlagged: full lag compensation is ^1ON!\n\"");
|
||||
} else {
|
||||
trap_SendServerCommand(clientNum, "print \"^3This server is Unlagged: full lag compensation is ^1OFF!\n\"");
|
||||
} */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1710,8 +1694,7 @@ void ClientSpawn(gentity_t * ent)
|
|||
flags ^= EF_TELEPORT_BIT;
|
||||
|
||||
// JBravo: unlagged
|
||||
G_ResetHistory(ent);
|
||||
ent->client->saved.leveltime = 0;
|
||||
//ent->client->saved.leveltime = 0;
|
||||
|
||||
// clear everything but the persistant data
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.187 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.186 2003/04/09 20:57:21 jbravo
|
||||
// DM team none was missing a suicide.
|
||||
//
|
||||
|
@ -506,8 +510,8 @@ void DeathmatchScoreboardMessage(gentity_t * ent)
|
|||
if (cl->pers.connected == CON_CONNECTING) {
|
||||
ping = -1;
|
||||
} else {
|
||||
//ping = cl->ps.ping < 999 ? cl->ps.ping : 999;
|
||||
ping = cl->pers.realPing < 999 ? cl->pers.realPing : 999;
|
||||
ping = cl->ps.ping < 999 ? cl->ps.ping : 999;
|
||||
//ping = cl->pers.realPing < 999 ? cl->pers.realPing : 999;
|
||||
}
|
||||
|
||||
if (cl->accuracy_shots) {
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.137 2003/04/19 15:27:30 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.136 2003/04/07 12:29:33 jbravo
|
||||
// Minor FF system fix
|
||||
//
|
||||
|
@ -1189,8 +1193,6 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
|
|||
if (level.intermissiontime) {
|
||||
return;
|
||||
}
|
||||
// JBravo: unlagged
|
||||
// G_UnTimeShiftClient(self);
|
||||
|
||||
// JBravo: lets not bother with those CTF functions in Teamplay
|
||||
if (g_gametype.integer == GT_CTF) {
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.139 2003/04/19 15:27:31 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.138 2003/04/02 22:23:51 jbravo
|
||||
// More replacements tweaks. Added zcam_stfu
|
||||
//
|
||||
|
@ -340,7 +344,7 @@
|
|||
//==================================================================
|
||||
|
||||
// the "gameversion" client command will print this plus compile date
|
||||
#define GAMEVERSION "reaction"
|
||||
#define GAMEVERSION "rq3"
|
||||
#define BODY_QUEUE_SIZE 8
|
||||
|
||||
// JBravo: Max number of killed enemys to track
|
||||
|
@ -607,7 +611,6 @@ typedef struct {
|
|||
//
|
||||
#define MAX_NETNAME 36
|
||||
#define MAX_VOTE_COUNT 3
|
||||
#define NUM_PING_SAMPLES 64
|
||||
|
||||
// client data that stays across multiple respawns, but is cleared
|
||||
// on each level change or team change at ClientBegin()
|
||||
|
@ -640,26 +643,8 @@ typedef struct {
|
|||
int records[REC_NUM_RECORDS]; // Elder: for our statistics tracking
|
||||
// JBravo: unlagged
|
||||
int delag;
|
||||
int debugDelag;
|
||||
int cmdTimeNudge;
|
||||
int latentSnaps;
|
||||
int latentCmds;
|
||||
int plOut;
|
||||
usercmd_t cmdqueue[MAX_LATENT_CMDS];
|
||||
int cmdhead;
|
||||
int realPing;
|
||||
int pingsamples[NUM_PING_SAMPLES];
|
||||
int samplehead;
|
||||
} clientPersistant_t;
|
||||
|
||||
// JBravo: unlagged
|
||||
#define NUM_CLIENT_HISTORY 17
|
||||
typedef struct {
|
||||
vec3_t mins, maxs;
|
||||
vec3_t currentOrigin;
|
||||
int leveltime;
|
||||
} clientHistory_t;
|
||||
|
||||
struct camera_s;
|
||||
|
||||
// Elder: spam prevention defaults
|
||||
|
@ -807,12 +792,6 @@ struct gclient_s {
|
|||
// JBravo: time of death for delayed CTB respawns
|
||||
int time_of_death;
|
||||
int flagMessageTime;// NiceAss: Newb message for pistol/knife w/ enemy case
|
||||
// JBravo: unlagged
|
||||
int attackTime;
|
||||
int historyHead;
|
||||
clientHistory_t history[NUM_CLIENT_HISTORY];
|
||||
clientHistory_t saved;
|
||||
int frameOffset;
|
||||
int lastUpdateFrame;
|
||||
};
|
||||
|
||||
|
@ -951,7 +930,6 @@ typedef struct {
|
|||
qboolean teams_assigned[MAX_TEAMS];
|
||||
gentity_t *potential_spawns[MAX_TEAMS][MAX_SPAWN_POINTS];
|
||||
gentity_t *used_farteamplay_spawns[MAX_TEAMS][MAX_SPAWN_POINTS];
|
||||
int frameStartTime;
|
||||
} level_locals_t;
|
||||
|
||||
//
|
||||
|
@ -1155,14 +1133,14 @@ void CalcMuzzlePoint(gentity_t * ent, vec3_t forward, vec3_t right, vec3_t up, v
|
|||
//void SnapVectorTowards(vec3_t v, vec3_t to);
|
||||
qboolean CheckGauntletAttack(gentity_t * ent);
|
||||
|
||||
// JBrabo: unlagged - g_unlagged.c
|
||||
void G_ResetHistory(gentity_t *ent);
|
||||
// JBravo: unlagged - g_unlagged.c
|
||||
/*void G_ResetHistory(gentity_t *ent);
|
||||
void G_StoreHistory(gentity_t *ent);
|
||||
void G_TimeShiftAllClients(int time, gentity_t *skip);
|
||||
void G_UnTimeShiftAllClients(gentity_t *skip);
|
||||
void G_DoTimeShiftFor(gentity_t *ent);
|
||||
void G_UndoTimeShiftFor(gentity_t *ent);
|
||||
void G_UnTimeShiftClient(gentity_t *client);
|
||||
void G_UnTimeShiftClient(gentity_t *client); */
|
||||
void G_PredictPlayerMove(gentity_t *ent, float frametime);
|
||||
|
||||
//void Knife_Touch (gentity_t *ent, gentity_t *other,trace_t *trace);
|
||||
|
@ -1415,8 +1393,6 @@ extern vmCvar_t g_proxMineTimeout;
|
|||
// JBravo: unlagged
|
||||
extern vmCvar_t g_delagHitscan;
|
||||
extern vmCvar_t g_unlaggedVersion;
|
||||
extern vmCvar_t g_truePing;
|
||||
extern vmCvar_t g_lightningDamage;
|
||||
extern vmCvar_t sv_fps;
|
||||
|
||||
//Slicer: Matchmode
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.143 2003/04/19 15:27:31 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.142 2003/04/13 01:08:02 jbravo
|
||||
// typo in cvar name
|
||||
//
|
||||
|
@ -548,8 +552,6 @@ vmCvar_t g_enableDust;
|
|||
// JBravo: unlagged
|
||||
vmCvar_t g_delagHitscan;
|
||||
vmCvar_t g_unlaggedVersion;
|
||||
vmCvar_t g_truePing;
|
||||
vmCvar_t g_lightningDamage;
|
||||
vmCvar_t sv_fps;
|
||||
|
||||
//Blaze let cvar.cfg be set by server admins
|
||||
|
@ -624,8 +626,6 @@ static cvarTable_t gameCvarTable[] = {
|
|||
{&pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO, 0, qfalse},
|
||||
{&g_delagHitscan, "g_delagHitscan", "1", CVAR_ARCHIVE | CVAR_SERVERINFO, 0, qtrue},
|
||||
{&g_unlaggedVersion, "g_unlaggedVersion", "2.0", CVAR_ROM | CVAR_SERVERINFO, 0, qfalse},
|
||||
{&g_truePing, "g_truePing", "1", CVAR_ARCHIVE, 0, qtrue},
|
||||
{&g_lightningDamage, "g_lightningDamage", "8", 0, 0, qtrue},
|
||||
{&sv_fps, "sv_fps", "20", CVAR_SYSTEMINFO | CVAR_ARCHIVE, 0, qfalse},
|
||||
{&g_rankings, "g_rankings", "0", 0, 0, qfalse},
|
||||
//Slicer: Matchmode
|
||||
|
@ -2674,10 +2674,10 @@ void G_RunFrame(int levelTime)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* if (ent->s.eType == ET_MISSILE) {
|
||||
if (ent->s.eType == ET_MISSILE) {
|
||||
G_RunMissile(ent);
|
||||
continue;
|
||||
} */
|
||||
}
|
||||
|
||||
if (ent->s.eType == ET_ITEM || ent->physicsObject) {
|
||||
G_RunItem(ent);
|
||||
|
@ -2696,21 +2696,6 @@ void G_RunFrame(int levelTime)
|
|||
|
||||
G_RunThink(ent);
|
||||
}
|
||||
// JBravo: unlagged
|
||||
// G_TimeShiftAllClients(level.previousTime, NULL);
|
||||
ent = &g_entities[0];
|
||||
for (i=0 ; i<level.num_entities ; i++, ent++) {
|
||||
if (!ent->inuse) {
|
||||
continue;
|
||||
}
|
||||
if (ent->freeAfterEvent) {
|
||||
continue;
|
||||
}
|
||||
if (ent->s.eType == ET_MISSILE) {
|
||||
G_RunMissile(ent);
|
||||
}
|
||||
}
|
||||
// G_UnTimeShiftAllClients(NULL);
|
||||
|
||||
end = trap_Milliseconds();
|
||||
|
||||
|
@ -2773,7 +2758,7 @@ void G_RunFrame(int levelTime)
|
|||
}
|
||||
trap_Cvar_Set("g_listEntity", "0");
|
||||
}
|
||||
level.frameStartTime = trap_Milliseconds();
|
||||
// level.frameStartTime = trap_Milliseconds();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.70 2003/04/19 15:27:31 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.69 2003/04/03 17:18:25 makro
|
||||
// dlights
|
||||
//
|
||||
|
@ -408,7 +412,7 @@ void TeleportPlayer(gentity_t * player, vec3_t origin, vec3_t angles)
|
|||
player->client->ps.eFlags ^= EF_TELEPORT_BIT;
|
||||
|
||||
// JBravo: unlagged
|
||||
G_ResetHistory(player);
|
||||
// G_ResetHistory(player);
|
||||
|
||||
// set angles
|
||||
// SetClientViewAngle( player, angles );
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.3 2003/04/19 15:27:31 jbravo
|
||||
// Backing out of most of unlagged. Only optimized prediction and smooth clients
|
||||
// remains.
|
||||
//
|
||||
// Revision 1.2 2003/03/22 20:29:26 jbravo
|
||||
// wrapping linkent and unlinkent calls
|
||||
//
|
||||
|
@ -23,7 +27,7 @@ G_ResetHistory
|
|||
Clear out the given client's history (should be called when the teleport bit is flipped)
|
||||
============
|
||||
*/
|
||||
void G_ResetHistory(gentity_t * ent)
|
||||
/*void G_ResetHistory(gentity_t * ent)
|
||||
{
|
||||
int i, time;
|
||||
|
||||
|
@ -35,7 +39,7 @@ void G_ResetHistory(gentity_t * ent)
|
|||
VectorCopy(ent->r.currentOrigin, ent->client->history[i].currentOrigin);
|
||||
ent->client->history[i].leveltime = time;
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
============
|
||||
|
@ -44,7 +48,7 @@ G_StoreHistory
|
|||
Keep track of where the client's been
|
||||
============
|
||||
*/
|
||||
void G_StoreHistory(gentity_t * ent)
|
||||
/*void G_StoreHistory(gentity_t * ent)
|
||||
{
|
||||
int head, frametime;
|
||||
|
||||
|
@ -63,7 +67,7 @@ void G_StoreHistory(gentity_t * ent)
|
|||
VectorCopy(ent->s.pos.trBase, ent->client->history[head].currentOrigin);
|
||||
SnapVector(ent->client->history[head].currentOrigin);
|
||||
ent->client->history[head].leveltime = level.time;
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
=============
|
||||
|
@ -73,8 +77,8 @@ Used below to interpolate between two previous vectors
|
|||
Returns a vector "frac" times the distance between "start" and "end"
|
||||
=============
|
||||
*/
|
||||
static void TimeShiftLerp(float frac, vec3_t start, vec3_t end, vec3_t result)
|
||||
{
|
||||
//static void TimeShiftLerp(float frac, vec3_t start, vec3_t end, vec3_t result)
|
||||
//{
|
||||
// From CG_InterpolateEntityPosition in cg_ents.c:
|
||||
/*
|
||||
cent->lerpOrigin[0] = current[0] + f * ( next[0] - current[0] );
|
||||
|
@ -83,10 +87,10 @@ static void TimeShiftLerp(float frac, vec3_t start, vec3_t end, vec3_t result)
|
|||
*/
|
||||
// Making these exactly the same should avoid floating-point error
|
||||
|
||||
result[0] = start[0] + frac * (end[0] - start[0]);
|
||||
/* result[0] = start[0] + frac * (end[0] - start[0]);
|
||||
result[1] = start[1] + frac * (end[1] - start[1]);
|
||||
result[2] = start[2] + frac * (end[2] - start[2]);
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -95,10 +99,10 @@ G_TimeShiftClient
|
|||
Move a client back to where he was at the specified "time"
|
||||
=================
|
||||
*/
|
||||
void G_TimeShiftClient(gentity_t * ent, int time, qboolean debug, gentity_t * debugger)
|
||||
/*void G_TimeShiftClient(gentity_t * ent, int time, qboolean debug, gentity_t * debugger)
|
||||
{
|
||||
int j, k;
|
||||
char msg[2048];
|
||||
char msg[2048]; */
|
||||
|
||||
// this will dump out the head index, and the time for all the stored positions
|
||||
/*
|
||||
|
@ -131,7 +135,7 @@ void G_TimeShiftClient(gentity_t * ent, int time, qboolean debug, gentity_t * de
|
|||
|
||||
// find two entries in the history whose times sandwich "time"
|
||||
// assumes no two adjacent records have the same timestamp
|
||||
j = k = ent->client->historyHead;
|
||||
/* j = k = ent->client->historyHead;
|
||||
do {
|
||||
if (ent->client->history[j].leveltime <= time)
|
||||
break;
|
||||
|
@ -226,7 +230,7 @@ void G_TimeShiftClient(gentity_t * ent, int time, qboolean debug, gentity_t * de
|
|||
trap_SendServerCommand(debugger - g_entities, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
=====================
|
||||
|
@ -236,7 +240,7 @@ Move ALL clients back to where they were at the specified "time",
|
|||
except for "skip"
|
||||
=====================
|
||||
*/
|
||||
void G_TimeShiftAllClients(int time, gentity_t * skip)
|
||||
/*void G_TimeShiftAllClients(int time, gentity_t * skip)
|
||||
{
|
||||
int i;
|
||||
gentity_t *ent;
|
||||
|
@ -250,7 +254,7 @@ void G_TimeShiftAllClients(int time, gentity_t * skip)
|
|||
G_TimeShiftClient(ent, time, debug, skip);
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
================
|
||||
|
@ -259,7 +263,7 @@ G_DoTimeShiftFor
|
|||
Decide what time to shift everyone back to, and do it
|
||||
================
|
||||
*/
|
||||
void G_DoTimeShiftFor(gentity_t * ent)
|
||||
/* void G_DoTimeShiftFor(gentity_t * ent)
|
||||
{
|
||||
//int wpflags[WP_NUM_WEAPONS] = { 0, 0, 2, 4, 0, 0, 8, 16, 0, 0, 0 };
|
||||
int wpflags[WP_NUM_WEAPONS] = { 0, 2, 4, 2, 4, 16, 2, 2, 0, 0 };
|
||||
|
@ -280,7 +284,7 @@ void G_DoTimeShiftFor(gentity_t * ent)
|
|||
}
|
||||
|
||||
G_TimeShiftAllClients(time, ent);
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
===================
|
||||
|
@ -289,7 +293,7 @@ G_UnTimeShiftClient
|
|||
Move a client back to where he was before the time shift
|
||||
===================
|
||||
*/
|
||||
void G_UnTimeShiftClient(gentity_t * ent)
|
||||
/* void G_UnTimeShiftClient(gentity_t * ent)
|
||||
{
|
||||
// if it was saved
|
||||
if (ent->client->saved.leveltime == level.time) {
|
||||
|
@ -302,7 +306,7 @@ void G_UnTimeShiftClient(gentity_t * ent)
|
|||
// this will recalculate absmin and absmax
|
||||
trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
=======================
|
||||
|
@ -312,7 +316,7 @@ Move ALL the clients back to where they were before the time shift,
|
|||
except for "skip"
|
||||
=======================
|
||||
*/
|
||||
void G_UnTimeShiftAllClients(gentity_t * skip)
|
||||
/*void G_UnTimeShiftAllClients(gentity_t * skip)
|
||||
{
|
||||
int i;
|
||||
gentity_t *ent;
|
||||
|
@ -323,7 +327,7 @@ void G_UnTimeShiftAllClients(gentity_t * skip)
|
|||
G_UnTimeShiftClient(ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
==================
|
||||
|
@ -332,7 +336,7 @@ G_UndoTimeShiftFor
|
|||
Put everyone except for this client back where they were
|
||||
==================
|
||||
*/
|
||||
void G_UndoTimeShiftFor(gentity_t * ent)
|
||||
/*void G_UndoTimeShiftFor(gentity_t * ent)
|
||||
{
|
||||
|
||||
// don't un-time shift for mistakes or bots
|
||||
|
@ -341,7 +345,7 @@ void G_UndoTimeShiftFor(gentity_t * ent)
|
|||
}
|
||||
|
||||
G_UnTimeShiftAllClients(ent);
|
||||
}
|
||||
} */
|
||||
|
||||
/*
|
||||
===========================
|
||||
|
|
Loading…
Reference in a new issue