mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
back out Misty's realtime reset work. It did achieve its goal, but winding
realtime back caused the problems with clients not reconnect on map change and after my preliminary mucking around with time, I'm convinced there's a better way.
This commit is contained in:
parent
8234988835
commit
7ab3095024
4 changed files with 27 additions and 38 deletions
|
@ -580,7 +580,7 @@ SV_Cuff_f (void)
|
||||||
if (!cl->state)
|
if (!cl->state)
|
||||||
continue;
|
continue;
|
||||||
if (all || (cl->userid == uid)) {
|
if (all || (cl->userid == uid)) {
|
||||||
cl->cuff_time = (Sys_DoubleTime () + mins*60.0);
|
cl->cuff_time = realtime + mins*60.0;
|
||||||
done = true;
|
done = true;
|
||||||
if (mins) {
|
if (mins) {
|
||||||
sprintf(text,
|
sprintf(text,
|
||||||
|
@ -639,7 +639,7 @@ SV_Mute_f (void)
|
||||||
if (!cl->state)
|
if (!cl->state)
|
||||||
continue;
|
continue;
|
||||||
if (all || (cl->userid == uid)) {
|
if (all || (cl->userid == uid)) {
|
||||||
cl->lockedtill = (Sys_DoubleTime () + mins*60.0);
|
cl->lockedtill = realtime + mins*60.0;
|
||||||
done = true;
|
done = true;
|
||||||
if (mins) {
|
if (mins) {
|
||||||
sprintf(text, "You are muted for %.1f minutes\n\n"
|
sprintf(text, "You are muted for %.1f minutes\n\n"
|
||||||
|
|
|
@ -331,9 +331,6 @@ SV_SpawnServer (const char *server)
|
||||||
|
|
||||||
strcpy (sv.name, server);
|
strcpy (sv.name, server);
|
||||||
|
|
||||||
// Misty: What, me worry? (Yes, it's BAAAACK) HACKHACKHACK
|
|
||||||
realtime = 0.1;
|
|
||||||
|
|
||||||
// load progs to get entity field count which determines how big each
|
// load progs to get entity field count which determines how big each
|
||||||
// edict is
|
// edict is
|
||||||
SV_LoadProgs ();
|
SV_LoadProgs ();
|
||||||
|
|
|
@ -565,11 +565,10 @@ SV_CheckLog (void)
|
||||||
|
|
||||||
sz = &svs.log[svs.logsequence & 1];
|
sz = &svs.log[svs.logsequence & 1];
|
||||||
|
|
||||||
// bump sequence if almost full, or ten minutes have passed and
|
// bump sequence if allmost full, or ten minutes have passed and
|
||||||
// there is something still sitting there
|
// there is something still sitting there
|
||||||
if (sz->cursize > LOG_HIGHWATER
|
if (sz->cursize > LOG_HIGHWATER
|
||||||
|| ((realtime - svs.logtime) > LOG_FLUSH && sz->cursize)
|
|| (realtime - svs.logtime > LOG_FLUSH && sz->cursize)) {
|
||||||
|| (realtime - svs.logtime) < 0) {
|
|
||||||
// swap buffers and bump sequence
|
// swap buffers and bump sequence
|
||||||
svs.logtime = realtime;
|
svs.logtime = realtime;
|
||||||
svs.logsequence++;
|
svs.logsequence++;
|
||||||
|
@ -578,6 +577,7 @@ SV_CheckLog (void)
|
||||||
SV_Printf ("beginning fraglog sequence %i\n", svs.logsequence);
|
SV_Printf ("beginning fraglog sequence %i\n", svs.logsequence);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SVC_Log
|
SVC_Log
|
||||||
|
|
||||||
|
@ -1340,7 +1340,7 @@ SV_CleanIPList (void)
|
||||||
char *type;
|
char *type;
|
||||||
|
|
||||||
for (i = 0; i < numipfilters;) {
|
for (i = 0; i < numipfilters;) {
|
||||||
if (ipfilters[i].time && (ipfilters[i].time <= Sys_DoubleTime () )) {
|
if (ipfilters[i].time && (ipfilters[i].time <= realtime)) {
|
||||||
switch (ipfilters[i].type) {
|
switch (ipfilters[i].type) {
|
||||||
case ft_ban: type = "Ban"; break;
|
case ft_ban: type = "Ban"; break;
|
||||||
case ft_mute: type = "Mute"; break;
|
case ft_mute: type = "Mute"; break;
|
||||||
|
@ -1392,7 +1392,7 @@ SV_AddIP_f (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SV_StringToFilter (Cmd_Argv (1), &ipfilters[numipfilters])) {
|
if (SV_StringToFilter (Cmd_Argv (1), &ipfilters[numipfilters])) {
|
||||||
ipfilters[numipfilters].time = bantime ? Sys_DoubleTime () + bantime : 0.0;
|
ipfilters[numipfilters].time = bantime ? realtime + bantime : 0.0;
|
||||||
ipfilters[numipfilters].type = type;
|
ipfilters[numipfilters].type = type;
|
||||||
// FIXME: this should boot any matching clients
|
// FIXME: this should boot any matching clients
|
||||||
for (i = 0; i < MAX_CLIENTS; i++) {
|
for (i = 0; i < MAX_CLIENTS; i++) {
|
||||||
|
@ -1479,8 +1479,7 @@ SV_ListIP_f (void)
|
||||||
|
|
||||||
if (ipfilters[i].time)
|
if (ipfilters[i].time)
|
||||||
snprintf (timestr, sizeof (timestr), "%ds",
|
snprintf (timestr, sizeof (timestr), "%ds",
|
||||||
(int) (ipfilters[i].time ? ipfilters[i].time -
|
(int) (ipfilters[i].time ? ipfilters[i].time - realtime : 0));
|
||||||
Sys_DoubleTime () : 0));
|
|
||||||
else
|
else
|
||||||
strcpy (timestr, "Permanent");
|
strcpy (timestr, "Permanent");
|
||||||
|
|
||||||
|
@ -1595,8 +1594,7 @@ SV_SendBan (double till)
|
||||||
|
|
||||||
if (till) {
|
if (till) {
|
||||||
snprintf (data + 5, sizeof (data) - 5,
|
snprintf (data + 5, sizeof (data) - 5,
|
||||||
"\nbanned for %.1f more minutes.\n", (till -
|
"\nbanned for %.1f more minutes.\n", (till - realtime)/60.0);
|
||||||
Sys_DoubleTime ())/60.0);
|
|
||||||
} else {
|
} else {
|
||||||
snprintf (data + 5, sizeof (data) - 5, "\nbanned permanently.\n");
|
snprintf (data + 5, sizeof (data) - 5, "\nbanned permanently.\n");
|
||||||
}
|
}
|
||||||
|
@ -1625,7 +1623,7 @@ SV_FilterIP (byte *ip, double *until)
|
||||||
if (!ipfilters[i].time) {
|
if (!ipfilters[i].time) {
|
||||||
// normal ban
|
// normal ban
|
||||||
return filterban->int_val;
|
return filterban->int_val;
|
||||||
} else if (ipfilters[i].time > Sys_DoubleTime () ) {
|
} else if (ipfilters[i].time > realtime) {
|
||||||
*until = ipfilters[i].time;
|
*until = ipfilters[i].time;
|
||||||
return true; // banned no matter what
|
return true; // banned no matter what
|
||||||
} else {
|
} else {
|
||||||
|
@ -1643,7 +1641,7 @@ SV_SavePenaltyFilter (client_t *cl, filtertype_t type, double pentime)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
byte *b;
|
byte *b;
|
||||||
if (pentime < Sys_DoubleTime () ) // no point
|
if (pentime < realtime) // no point
|
||||||
return;
|
return;
|
||||||
|
|
||||||
b = cl->netchan.remote_address.ip;
|
b = cl->netchan.remote_address.ip;
|
||||||
|
@ -1886,25 +1884,19 @@ SV_Frame (float time)
|
||||||
if (!sv.paused) {
|
if (!sv.paused) {
|
||||||
static double old_time;
|
static double old_time;
|
||||||
|
|
||||||
// Misty: Make sure we don't set sv_frametime to 0 or less than 0.
|
|
||||||
// Progs HATES it when we do that.
|
|
||||||
if (realtime - old_time > 0) {
|
|
||||||
// don't bother running a frame if sys_ticrate seconds haven't passed
|
// don't bother running a frame if sys_ticrate seconds haven't passed
|
||||||
sv_frametime = realtime - old_time;
|
sv_frametime = realtime - old_time;
|
||||||
if (sv_frametime >= sv_mintic->value) {
|
if (sv_frametime >= sv_mintic->value) {
|
||||||
if (sv_frametime > sv_maxtic->value) {
|
if (sv_frametime > sv_maxtic->value)
|
||||||
sv_frametime = sv_maxtic->value;
|
sv_frametime = sv_maxtic->value;
|
||||||
}
|
|
||||||
old_time = realtime;
|
|
||||||
|
|
||||||
*sv_globals.frametime = sv_frametime;
|
|
||||||
|
|
||||||
SV_Physics ();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
old_time = realtime;
|
old_time = realtime;
|
||||||
|
|
||||||
|
*sv_globals.frametime = sv_frametime;
|
||||||
|
|
||||||
|
SV_Physics ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get packets
|
// get packets
|
||||||
SV_ReadPackets ();
|
SV_ReadPackets ();
|
||||||
|
|
||||||
|
@ -2165,8 +2157,9 @@ Master_Heartbeat (void)
|
||||||
char string[2048];
|
char string[2048];
|
||||||
int active, i;
|
int active, i;
|
||||||
|
|
||||||
if ((realtime - svs.last_heartbeat) < HEARTBEAT_SECONDS)
|
if (realtime - svs.last_heartbeat < HEARTBEAT_SECONDS)
|
||||||
return; // not time to send yet
|
return; // not time to send yet
|
||||||
|
|
||||||
svs.last_heartbeat = realtime;
|
svs.last_heartbeat = realtime;
|
||||||
|
|
||||||
// count active users
|
// count active users
|
||||||
|
|
|
@ -798,11 +798,10 @@ SV_Say (qboolean team)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp_messages) {
|
if (fp_messages) {
|
||||||
if (!sv.paused && Sys_DoubleTime () < host_client->lockedtill) {
|
if (!sv.paused && realtime < host_client->lockedtill) {
|
||||||
SV_ClientPrintf (host_client, PRINT_CHAT,
|
SV_ClientPrintf (host_client, PRINT_CHAT,
|
||||||
"You can't talk for %d more seconds\n",
|
"You can't talk for %d more seconds\n",
|
||||||
(int) (host_client->lockedtill -
|
(int) (host_client->lockedtill - realtime));
|
||||||
Sys_DoubleTime () ));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tmp = host_client->whensaidhead - fp_messages + 1;
|
tmp = host_client->whensaidhead - fp_messages + 1;
|
||||||
|
@ -811,7 +810,7 @@ SV_Say (qboolean team)
|
||||||
if (!sv.paused &&
|
if (!sv.paused &&
|
||||||
host_client->whensaid[tmp]
|
host_client->whensaid[tmp]
|
||||||
&& (realtime - host_client->whensaid[tmp] < fp_persecond)) {
|
&& (realtime - host_client->whensaid[tmp] < fp_persecond)) {
|
||||||
host_client->lockedtill = Sys_DoubleTime () + fp_secondsdead;
|
host_client->lockedtill = realtime + fp_secondsdead;
|
||||||
if (fp_msg[0])
|
if (fp_msg[0])
|
||||||
SV_ClientPrintf (host_client, PRINT_CHAT,
|
SV_ClientPrintf (host_client, PRINT_CHAT,
|
||||||
"FloodProt: %s\n", fp_msg);
|
"FloodProt: %s\n", fp_msg);
|
||||||
|
@ -1506,7 +1505,7 @@ SV_RunCmd (usercmd_t *ucmd, qboolean inside)
|
||||||
SVfloat (sv_player, button2) = (ucmd->buttons & 2) >> 1;
|
SVfloat (sv_player, button2) = (ucmd->buttons & 2) >> 1;
|
||||||
if (ucmd->impulse)
|
if (ucmd->impulse)
|
||||||
SVfloat (sv_player, impulse) = ucmd->impulse;
|
SVfloat (sv_player, impulse) = ucmd->impulse;
|
||||||
if (host_client->cuff_time > Sys_DoubleTime() )
|
if (host_client->cuff_time > realtime)
|
||||||
SVfloat (sv_player, button0) = SVfloat (sv_player, impulse) = 0;
|
SVfloat (sv_player, button0) = SVfloat (sv_player, impulse) = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue