------------------------------------------------------------------------
r4166 | acceptthis | 2012-12-22 07:03:26 +0000 (Sat, 22 Dec 2012) | 1 line Should fix 3 bugs in the server. One crash, one that breaks server browsers, and one minor. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4166 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6f539b77fa
commit
4519fe7035
4 changed files with 96 additions and 16 deletions
|
@ -134,6 +134,7 @@ void Cam_Lock(int pnum, int playernum)
|
||||||
if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV)
|
if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV)
|
||||||
{
|
{
|
||||||
memcpy(&cl.playerview[pnum].stats, cl.players[playernum].stats, sizeof(cl.playerview[pnum].stats));
|
memcpy(&cl.playerview[pnum].stats, cl.players[playernum].stats, sizeof(cl.playerview[pnum].stats));
|
||||||
|
locked[pnum] = true; //instantly lock if the player is valid.
|
||||||
}
|
}
|
||||||
|
|
||||||
Sbar_Changed();
|
Sbar_Changed();
|
||||||
|
@ -470,8 +471,6 @@ void Cam_Track(int pnum, usercmd_t *cmd)
|
||||||
if (scr_chatmode != 2)
|
if (scr_chatmode != 2)
|
||||||
cam_lastviewtime[pnum] = realtime;
|
cam_lastviewtime[pnum] = realtime;
|
||||||
|
|
||||||
cmd->forwardmove = cmd->sidemove = cmd->upmove = 0;
|
|
||||||
|
|
||||||
VectorCopy(player->viewangles, cl.playerview[pnum].viewangles);
|
VectorCopy(player->viewangles, cl.playerview[pnum].viewangles);
|
||||||
if (memcmp(player->origin, &self->origin, sizeof(player->origin)) != 0)
|
if (memcmp(player->origin, &self->origin, sizeof(player->origin)) != 0)
|
||||||
{
|
{
|
||||||
|
@ -555,6 +554,7 @@ void Cam_FinishMove(int pnum, usercmd_t *cmd)
|
||||||
int i;
|
int i;
|
||||||
player_info_t *s;
|
player_info_t *s;
|
||||||
int end;
|
int end;
|
||||||
|
extern cvar_t cl_demospeed, cl_splitscreen;
|
||||||
|
|
||||||
if (cls.state != ca_active)
|
if (cls.state != ca_active)
|
||||||
return;
|
return;
|
||||||
|
@ -562,6 +562,64 @@ void Cam_FinishMove(int pnum, usercmd_t *cmd)
|
||||||
if (!cl.spectator && (cls.demoplayback != DPB_MVD && cls.demoplayback != DPB_EZTV)) // only in spectator mode
|
if (!cl.spectator && (cls.demoplayback != DPB_MVD && cls.demoplayback != DPB_EZTV)) // only in spectator mode
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (cls.demoplayback == DPB_MVD || cls.demoplayback == DPB_EZTV)
|
||||||
|
{
|
||||||
|
int nb;
|
||||||
|
nb = (cmd->sidemove<0)?4:0;
|
||||||
|
nb |= (cmd->sidemove>0)?8:0;
|
||||||
|
nb |= (cmd->forwardmove<0)?16:0;
|
||||||
|
nb |= (cmd->forwardmove>0)?32:0;
|
||||||
|
nb |= (cmd->upmove<0)?64:0;
|
||||||
|
nb |= (cmd->upmove>0)?128:0;
|
||||||
|
if (nb & (nb ^ oldbuttons[pnum]) & 4)
|
||||||
|
Cvar_SetValue(&cl_demospeed, max(cl_demospeed.value - 0.1, 0));
|
||||||
|
if (nb & (nb ^ oldbuttons[pnum]) & 8)
|
||||||
|
Cvar_SetValue(&cl_demospeed, min(cl_demospeed.value + 0.1, 10));
|
||||||
|
if (nb & (nb ^ oldbuttons[pnum]) & (4|8))
|
||||||
|
Con_Printf("playback speed: %g%%\n", cl_demospeed.value*100);
|
||||||
|
if (nb & (nb ^ oldbuttons[pnum]) & 16)
|
||||||
|
Cbuf_AddText("demo_jump +10", RESTRICT_LOCAL);
|
||||||
|
if (nb & (nb ^ oldbuttons[pnum]) & 32)
|
||||||
|
Cbuf_AddText("demo_jump -10", RESTRICT_LOCAL);
|
||||||
|
if (nb & (nb ^ oldbuttons[pnum]) & (4|8))
|
||||||
|
Con_Printf("playback speed: %g%%\n", cl_demospeed.value*100);
|
||||||
|
if (nb & (nb ^ oldbuttons[pnum]) & 64)
|
||||||
|
Cvar_SetValue(&cl_splitscreen, max(cl_splitscreen.ival - 1, 0));
|
||||||
|
if (nb & (nb ^ oldbuttons[pnum]) & 128)
|
||||||
|
Cvar_SetValue(&cl_splitscreen, min(cl_splitscreen.ival + 1, MAX_SPLITS-1));
|
||||||
|
oldbuttons[pnum] = (oldbuttons[pnum] & 3) | (nb & ~3);
|
||||||
|
if (cmd->impulse)
|
||||||
|
{
|
||||||
|
int pl = cmd->impulse;
|
||||||
|
for (i = 0; ; i++)
|
||||||
|
{
|
||||||
|
if (i == MAX_CLIENTS)
|
||||||
|
{
|
||||||
|
if (pl == cmd->impulse)
|
||||||
|
break;
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
s = &cl.players[i];
|
||||||
|
if (s->name[0] && !s->spectator)
|
||||||
|
{
|
||||||
|
pl--;
|
||||||
|
if (!pl)
|
||||||
|
{
|
||||||
|
Cam_Lock(pnum, i);
|
||||||
|
|
||||||
|
pnum++;
|
||||||
|
if (pnum < cl.splitclients)
|
||||||
|
pl = 1;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cmd->buttons & BUTTON_ATTACK)
|
if (cmd->buttons & BUTTON_ATTACK)
|
||||||
{
|
{
|
||||||
if (!(oldbuttons[pnum] & BUTTON_ATTACK))
|
if (!(oldbuttons[pnum] & BUTTON_ATTACK))
|
||||||
|
|
|
@ -1047,7 +1047,7 @@ fixedorg:
|
||||||
for (i=0 ; i<3 ; i++)
|
for (i=0 ; i<3 ; i++)
|
||||||
{
|
{
|
||||||
lrp[i] = to->playerstate[spec_track[pnum]].origin[i] +
|
lrp[i] = to->playerstate[spec_track[pnum]].origin[i] +
|
||||||
f * (from->playerstate[spec_track[pnum]].origin[i] - to->playerstate[cl.playernum[pnum]].origin[i]);
|
f * (from->playerstate[spec_track[pnum]].origin[i] - to->playerstate[spec_track[pnum]].origin[i]);
|
||||||
|
|
||||||
lrpv[i] = to->playerstate[spec_track[pnum]].velocity[i] +
|
lrpv[i] = to->playerstate[spec_track[pnum]].velocity[i] +
|
||||||
f * (from->playerstate[spec_track[pnum]].velocity[i] - to->playerstate[spec_track[pnum]].velocity[i]);
|
f * (from->playerstate[spec_track[pnum]].velocity[i] - to->playerstate[spec_track[pnum]].velocity[i]);
|
||||||
|
|
|
@ -1735,6 +1735,7 @@ client_t *SVC_DirectConnect(void)
|
||||||
|
|
||||||
unsigned int protextsupported=0;
|
unsigned int protextsupported=0;
|
||||||
unsigned int protextsupported2=0;
|
unsigned int protextsupported2=0;
|
||||||
|
extern cvar_t pr_maxedicts;
|
||||||
|
|
||||||
|
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -1993,19 +1994,28 @@ client_t *SVC_DirectConnect(void)
|
||||||
newcl->maxmodels = 256;
|
newcl->maxmodels = 256;
|
||||||
if (protocol == SCP_QUAKEWORLD) //readd?
|
if (protocol == SCP_QUAKEWORLD) //readd?
|
||||||
{
|
{
|
||||||
newcl->max_net_ents = 512;
|
if (newcl->fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS)
|
||||||
if (newcl->fteprotocolextensions & PEXT_ENTITYDBL)
|
{
|
||||||
newcl->max_net_ents += 512;
|
//you need to reconnect for this to update, of course. so make sure its not *too* low...
|
||||||
if (newcl->fteprotocolextensions & PEXT_ENTITYDBL2)
|
newcl->max_net_ents = bound(512, pr_maxedicts.ival, 32768);
|
||||||
newcl->max_net_ents += 1024;
|
newcl->maxmodels = MAX_MODELS; //protocol limited to 14 bits.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newcl->max_net_ents = 512;
|
||||||
|
if (newcl->fteprotocolextensions & PEXT_ENTITYDBL)
|
||||||
|
newcl->max_net_ents += 512;
|
||||||
|
if (newcl->fteprotocolextensions & PEXT_ENTITYDBL2)
|
||||||
|
newcl->max_net_ents += 1024;
|
||||||
|
}
|
||||||
|
|
||||||
if (newcl->fteprotocolextensions & PEXT_MODELDBL)
|
if (newcl->fteprotocolextensions & PEXT_MODELDBL)
|
||||||
newcl->maxmodels = MAX_MODELS;
|
newcl->maxmodels = MAX_MODELS;
|
||||||
}
|
}
|
||||||
else if (ISDPCLIENT(newcl))
|
else if (ISDPCLIENT(newcl))
|
||||||
{
|
{
|
||||||
newcl->max_net_ents = 32767;
|
newcl->max_net_ents = bound(512, pr_maxedicts.ival, 32768);
|
||||||
newcl->maxmodels = 1024;
|
newcl->maxmodels = 1024; //protocol limit of 16bits. 15bits for late precaches. client limit of 1k
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
newcl->max_net_ents = 600;
|
newcl->max_net_ents = 600;
|
||||||
|
@ -2371,7 +2381,10 @@ client_t *SVC_DirectConnect(void)
|
||||||
#endif
|
#endif
|
||||||
newcl->datagram.allowoverflow = true;
|
newcl->datagram.allowoverflow = true;
|
||||||
newcl->datagram.data = newcl->datagram_buf;
|
newcl->datagram.data = newcl->datagram_buf;
|
||||||
newcl->datagram.maxsize = sizeof(newcl->datagram_buf);
|
if (mtu >= 64)
|
||||||
|
newcl->datagram.maxsize = sizeof(newcl->datagram_buf);
|
||||||
|
else
|
||||||
|
newcl->datagram.maxsize = MAX_DATAGRAM;
|
||||||
|
|
||||||
newcl->netchan.netprim = svs.netprim;
|
newcl->netchan.netprim = svs.netprim;
|
||||||
newcl->datagram.prim = svs.netprim;
|
newcl->datagram.prim = svs.netprim;
|
||||||
|
@ -2846,10 +2859,10 @@ qboolean SVC_ThrottleInfo (void)
|
||||||
|
|
||||||
/*don't allow it to go beyond curtime or we get issues with the logic above*/
|
/*don't allow it to go beyond curtime or we get issues with the logic above*/
|
||||||
if (inc > curtime-blockuntil)
|
if (inc > curtime-blockuntil)
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
blockuntil += inc;
|
blockuntil += inc;
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
|
@ -3023,7 +3036,7 @@ void SVNQ_ConnectionlessPacket(void)
|
||||||
{
|
{
|
||||||
client_t *newcl;
|
client_t *newcl;
|
||||||
/*okay, so this is a reliable packet from a client, containing a 'cmd challengeconnect $challenge' response*/
|
/*okay, so this is a reliable packet from a client, containing a 'cmd challengeconnect $challenge' response*/
|
||||||
str = va("connect %i %i %s \"\\name\\unconnected\\mod\\%s\\modver\\%s\\flags\\%s\\password\\%s\"", NET_PROTOCOL_VERSION, 0, Cmd_Argv(1), Cmd_Argv(2), Cmd_Argv(3), Cmd_Argv(4));
|
str = va("connect %i %i %s \"\\name\\unconnected\\mod\\%s\\modver\\%s\\flags\\%s\\password\\%s\"", NET_PROTOCOL_VERSION, 0, Cmd_Argv(1), Cmd_Argv(2), Cmd_Argv(3), Cmd_Argv(4), Cmd_Argv(5));
|
||||||
Cmd_TokenizeString (str, false, false);
|
Cmd_TokenizeString (str, false, false);
|
||||||
|
|
||||||
newcl = SVC_DirectConnect();
|
newcl = SVC_DirectConnect();
|
||||||
|
|
|
@ -1598,8 +1598,8 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
|
||||||
demo.recorder.fteprotocolextensions2 = PEXT2_VOICECHAT;
|
demo.recorder.fteprotocolextensions2 = PEXT2_VOICECHAT;
|
||||||
demo.recorder.zquake_extensions = Z_EXT_PM_TYPE | Z_EXT_PM_TYPE_NEW | Z_EXT_VIEWHEIGHT | Z_EXT_SERVERTIME | Z_EXT_PITCHLIMITS | Z_EXT_JOIN_OBSERVE | Z_EXT_VWEP;
|
demo.recorder.zquake_extensions = Z_EXT_PM_TYPE | Z_EXT_PM_TYPE_NEW | Z_EXT_VIEWHEIGHT | Z_EXT_SERVERTIME | Z_EXT_PITCHLIMITS | Z_EXT_JOIN_OBSERVE | Z_EXT_VWEP;
|
||||||
}
|
}
|
||||||
else
|
else if (sv_demoExtensions.ival)
|
||||||
{
|
{ /*everything*/
|
||||||
demo.recorder.fteprotocolextensions = PEXT_CSQC | PEXT_COLOURMOD | PEXT_DPFLAGS | PEXT_CUSTOMTEMPEFFECTS | PEXT_ENTITYDBL | PEXT_ENTITYDBL2 | PEXT_FATNESS | PEXT_HEXEN2 | PEXT_HULLSIZE | PEXT_LIGHTSTYLECOL | PEXT_MODELDBL | PEXT_SCALE | PEXT_SETATTACHMENT | PEXT_SETVIEW | PEXT_SOUNDDBL | PEXT_SPAWNSTATIC2 | PEXT_TRANS | PEXT_VIEW2;
|
demo.recorder.fteprotocolextensions = PEXT_CSQC | PEXT_COLOURMOD | PEXT_DPFLAGS | PEXT_CUSTOMTEMPEFFECTS | PEXT_ENTITYDBL | PEXT_ENTITYDBL2 | PEXT_FATNESS | PEXT_HEXEN2 | PEXT_HULLSIZE | PEXT_LIGHTSTYLECOL | PEXT_MODELDBL | PEXT_SCALE | PEXT_SETATTACHMENT | PEXT_SETVIEW | PEXT_SOUNDDBL | PEXT_SPAWNSTATIC2 | PEXT_TRANS | PEXT_VIEW2;
|
||||||
demo.recorder.fteprotocolextensions2 = PEXT2_VOICECHAT | PEXT2_SETANGLEDELTA | PEXT2_PRYDONCURSOR;
|
demo.recorder.fteprotocolextensions2 = PEXT2_VOICECHAT | PEXT2_SETANGLEDELTA | PEXT2_PRYDONCURSOR;
|
||||||
/*assume that all playback will be done with a valid csprogs that can correctly decode*/
|
/*assume that all playback will be done with a valid csprogs that can correctly decode*/
|
||||||
|
@ -1607,6 +1607,12 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
|
||||||
/*enable these, because we might as well (stat ones are always useful)*/
|
/*enable these, because we might as well (stat ones are always useful)*/
|
||||||
demo.recorder.zquake_extensions = Z_EXT_PM_TYPE | Z_EXT_PM_TYPE_NEW | Z_EXT_VIEWHEIGHT | Z_EXT_SERVERTIME | Z_EXT_PITCHLIMITS | Z_EXT_JOIN_OBSERVE | Z_EXT_VWEP;
|
demo.recorder.zquake_extensions = Z_EXT_PM_TYPE | Z_EXT_PM_TYPE_NEW | Z_EXT_VIEWHEIGHT | Z_EXT_SERVERTIME | Z_EXT_PITCHLIMITS | Z_EXT_JOIN_OBSERVE | Z_EXT_VWEP;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
demo.recorder.fteprotocolextensions = 0;
|
||||||
|
demo.recorder.fteprotocolextensions2 = 0;
|
||||||
|
demo.recorder.zquake_extensions = Z_EXT_PM_TYPE | Z_EXT_PM_TYPE_NEW | Z_EXT_VIEWHEIGHT | Z_EXT_SERVERTIME | Z_EXT_PITCHLIMITS | Z_EXT_JOIN_OBSERVE | Z_EXT_VWEP;
|
||||||
|
}
|
||||||
|
|
||||||
//pointless extensions that are redundant with mvds
|
//pointless extensions that are redundant with mvds
|
||||||
demo.recorder.fteprotocolextensions &= ~PEXT_ACCURATETIMINGS | PEXT_HLBSP|PEXT_Q2BSP|PEXT_Q3BSP;
|
demo.recorder.fteprotocolextensions &= ~PEXT_ACCURATETIMINGS | PEXT_HLBSP|PEXT_Q2BSP|PEXT_Q3BSP;
|
||||||
|
@ -1617,6 +1623,9 @@ static qboolean SV_MVD_Record (mvddest_t *dest)
|
||||||
if (demo.recorder.fteprotocolextensions & PEXT_ENTITYDBL2)
|
if (demo.recorder.fteprotocolextensions & PEXT_ENTITYDBL2)
|
||||||
demo.recorder.max_net_ents += 1024;
|
demo.recorder.max_net_ents += 1024;
|
||||||
|
|
||||||
|
if (demo.recorder.fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS)
|
||||||
|
demo.recorder.max_net_ents = 32767;
|
||||||
|
|
||||||
if (demo.recorder.fteprotocolextensions & PEXT_MODELDBL)
|
if (demo.recorder.fteprotocolextensions & PEXT_MODELDBL)
|
||||||
demo.recorder.maxmodels = MAX_MODELS;
|
demo.recorder.maxmodels = MAX_MODELS;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue