fix recent prediction issue.

added current bandwidth info to the status command. added cl_status command for similar things for client stuff.
minping delays now using floats instead of milliseconds.
fix waterjump bug with qc player physics.
fix flymode friction.
fixed illegible server message with ezquake going through portals. rendering is still ugly, but at least it can be used.


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4708 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-07-02 03:20:40 +00:00
parent 433c7b24c8
commit 4d7cc67ebe
18 changed files with 179 additions and 64 deletions

View File

@ -3388,6 +3388,14 @@ void CL_CrashMeEndgame_f(void)
Host_EndGame("crashme!");
}
void CL_Status_f(void)
{
float pi, po, bi, bo;
NET_PrintAddresses(cls.sockets);
if (NET_GetRates(cls.sockets, &pi, &po, &bi, &bo))
Con_Printf("packets,bytes/sec: in: %g %g out: %g %g\n", pi, bi, po, bo); //not relevent as a limit.
}
void CL_Skygroup_f(void);
/*
=================
@ -3607,6 +3615,7 @@ void CL_Init (void)
Cmd_AddCommand ("skins", Skin_Skins_f);
Cmd_AddCommand ("allskins", Skin_AllSkins_f);
Cmd_AddCommand ("cl_status", CL_Status_f);
Cmd_AddCommand ("quit", CL_Quit_f);
Cmd_AddCommandD ("connect", CL_Connect_f, "connect scheme://address:port\nConnect to a server. Use a scheme of tcp:// or tls:// to connect via non-udp protocols."

View File

@ -460,7 +460,7 @@ int QDECL main(int argc, char **argv)
{
float time, newtime, oldtime;
quakeparms_t parms;
int delay = 1;
float delay = 0.001;
memset(&parms, 0, sizeof(parms));
@ -497,7 +497,7 @@ int QDECL main(int argc, char **argv)
time = newtime - oldtime;
oldtime = newtime;
delay = SV_Frame()*1000;
delay = SV_Frame();
}
else
#endif

View File

@ -3055,7 +3055,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
double time, oldtime, newtime;
char cwd[1024], bindir[1024];
const char *qtvfile = NULL;
int delay = 0;
float delay = 0;
char lang[32];
char ctry[32];
int c;
@ -3308,7 +3308,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
#ifndef CLIENTONLY
if (isDedicated) //compleate denial to switch to anything else - many of the client structures are not initialized.
{
int delay;
float delay;
SV_Init (&parms);
@ -3381,7 +3381,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
time = newtime - oldtime;
oldtime = newtime;
delay = 1000*SV_Frame ();
delay = SV_Frame ();
#else
Sys_Error("wut?");
#endif

View File

@ -1306,7 +1306,7 @@ int QCLibEditor(pubprogfuncs_t *prfncs, char *filename, int line, int statement,
IN_Commands ();
S_ExtraUpdate();
NET_Sleep(20, false); //any os.
NET_Sleep(20/1000.0, false); //any os.
}
realtime = oldrealtime;

View File

@ -92,6 +92,7 @@ qboolean NET_WasSpecialPacket(netsrc_t netsrc);
void NET_CloseServer (void);
void UDP_CloseSocket (int socket);
void NET_Shutdown (void);
qboolean NET_GetRates(struct ftenet_connections_s *collection, float *pi, float *po, float *bi, float *bo);
int NET_GetPacket (netsrc_t netsrc, int firstsock);
qboolean NET_SendPacket (netsrc_t socket, int length, const void *data, netadr_t *to);
int NET_LocalAddressForRemote(struct ftenet_connections_s *collection, netadr_t *remote, netadr_t *local, int idx);
@ -278,4 +279,4 @@ int UDP6_OpenSocket (int port, qboolean bcast);
int IPX_OpenSocket (int port, qboolean bcast);
int NetadrToSockadr (netadr_t *a, struct sockaddr_qstorage *s);
void SockadrToNetadr (struct sockaddr_qstorage *s, netadr_t *a);
qboolean NET_Sleep(int msec, qboolean stdinissocket);
qboolean NET_Sleep(float seconds, qboolean stdinissocket);

View File

@ -4723,11 +4723,23 @@ static ftenet_generic_connection_t *FTENET_WebSocket_EstablishConnection(qboolea
}
#endif
qboolean NET_GetRates(ftenet_connections_t *collection, float *pi, float *po, float *bi, float *bo)
{
if (!collection)
return false;
*pi = collection->packetsinrate;
*po = collection->packetsoutrate;
*bi = collection->bytesinrate;
*bo = collection->bytesoutrate;
return true;
}
/*firstsock is a cookie*/
int NET_GetPacket (netsrc_t netsrc, int firstsock)
{
ftenet_connections_t *collection;
unsigned int ctime;
if (netsrc == NS_SERVER)
{
#ifdef CLIENTONLY
@ -4762,6 +4774,8 @@ int NET_GetPacket (netsrc_t netsrc, int firstsock)
continue;
}
collection->bytesin += net_message.cursize;
collection->packetsin += 1;
net_from.connum = firstsock+1;
return firstsock;
}
@ -4769,6 +4783,21 @@ int NET_GetPacket (netsrc_t netsrc, int firstsock)
firstsock += 1;
}
ctime = Sys_Milliseconds();
if ((ctime - collection->timemark) > 1000)
{
float secs = (ctime - collection->timemark) / 1000.0f;
collection->packetsinrate = collection->packetsin * secs;
collection->packetsoutrate = collection->packetsout * secs;
collection->bytesinrate = collection->bytesin * secs;
collection->bytesoutrate = collection->bytesout * secs;
collection->packetsin = 0;
collection->packetsout = 0;
collection->bytesin = 0;
collection->bytesout = 0;
collection->timemark = ctime;
}
return -1;
}
@ -4818,14 +4847,22 @@ qboolean NET_SendPacket (netsrc_t netsrc, int length, const void *data, netadr_t
if (net_fakeloss.value)
{
if (frandom () < net_fakeloss.value)
{
collection->bytesout += length;
collection->packetsout += 1;
return true;
}
}
if (to->connum)
{
if (collection->conn[to->connum-1])
if (collection->conn[to->connum-1]->SendPacket(collection->conn[to->connum-1], length, data, to))
{
collection->bytesout += length;
collection->packetsout += 1;
return true;
}
}
for (i = 0; i < MAX_CONNECTIONS; i++)
@ -4833,7 +4870,11 @@ qboolean NET_SendPacket (netsrc_t netsrc, int length, const void *data, netadr_t
if (!collection->conn[i])
continue;
if (collection->conn[i]->SendPacket(collection->conn[i], length, data, to))
{
collection->bytesout += length;
collection->packetsout += 1;
return true;
}
}
// Con_Printf("No route to %s - try reconnecting\n", NET_AdrToString(buffer, sizeof(buffer), to));
@ -5261,13 +5302,14 @@ void IPX_CloseSocket (int socket)
//stdin can sometimes be a socket. As a result,
//we give the option to select it for nice console imput with timeouts.
#ifndef CLIENTONLY
qboolean NET_Sleep(int msec, qboolean stdinissocket)
qboolean NET_Sleep(float seconds, qboolean stdinissocket)
{
#ifdef HAVE_PACKET
struct timeval timeout;
fd_set fdset;
int maxfd;
int con, sock;
unsigned int usec;
FD_ZERO(&fdset);
@ -5298,10 +5340,14 @@ qboolean NET_Sleep(int msec, qboolean stdinissocket)
}
}
timeout.tv_sec = msec/1000;
timeout.tv_usec = (msec%1000)*1000;
if (seconds > 4000) //realy? oh well.
seconds = 4000;
usec = seconds*1000*1000;
usec += 1000; //slight extra delay, to ensure we don't wake up with nothing to do.
timeout.tv_sec = usec/(1000*1000);
timeout.tv_usec = usec;
if (!maxfd)
Sys_Sleep(msec/1000.0);
Sys_Sleep(seconds);
else
select(maxfd+1, &fdset, NULL, NULL, &timeout);

View File

@ -275,6 +275,15 @@ typedef struct ftenet_generic_connection_s {
typedef struct ftenet_connections_s
{
qboolean islisten;
unsigned int packetsin;
unsigned int packetsout;
unsigned int bytesin;
unsigned int bytesout;
unsigned int timemark;
float packetsinrate;
float packetsoutrate;
float bytesinrate;
float bytesoutrate;
ftenet_generic_connection_t *conn[MAX_CONNECTIONS];
} ftenet_connections_t;

View File

@ -104,7 +104,7 @@ static qboolean PM_PortalTransform(world_t *w, int portalnum, vec3_t org, vec3_t
PR_ExecuteProgram (w->progs, portal->xv->camera_transform);
//make sure the new origin is okay for the player. back out if its invalid.
if (!PM_TestPlayerPosition(G_VECTOR(OFS_RETURN)))
if (!PM_TestPlayerPosition(G_VECTOR(OFS_RETURN), true))
okay = false;
else
{
@ -180,6 +180,7 @@ int PM_SlideMove (void)
float time_left;
int blocked;
float tookportal;
vec3_t start;
numbumps = 4;
@ -197,7 +198,8 @@ int PM_SlideMove (void)
for (i=0 ; i<3 ; i++)
end[i] = pmove.origin[i] + time_left * pmove.velocity[i];
trace = PM_PlayerTracePortals (pmove.origin, end, MASK_PLAYERSOLID, &tookportal);
VectorCopy(pmove.origin, start);
trace = PM_PlayerTracePortals (start, end, MASK_PLAYERSOLID, &tookportal);
if (tookportal)
{
//made progress, but hit a portal
@ -474,6 +476,7 @@ void PM_Friction (void)
start[0] = stop[0] = pmove.origin[0] + pmove.velocity[0]/speed*16;
start[1] = stop[1] = pmove.origin[1] + pmove.velocity[1]/speed*16;
//FIXME: gravitydir.
//id bug: this is a tracebox, NOT a traceline.
start[2] = pmove.origin[2] + pmove.player_mins[2];
stop[2] = start[2] - 34;
trace = PM_PlayerTrace (start, stop, MASK_PLAYERSOLID);
@ -1071,7 +1074,7 @@ void PM_NudgePosition (void)
base[i] = ((int)(base[i]*8)) * 0.125;
if (pmove.velocity[0] || pmove.velocity[1])
if (PM_TestPlayerPosition (pmove.origin))
if (PM_TestPlayerPosition (pmove.origin, false))
return;
for (z=0 ; z<=4 ; z++)
@ -1083,7 +1086,7 @@ void PM_NudgePosition (void)
pmove.origin[0] = base[0] + (sign[x] * 1.0/8);
pmove.origin[1] = base[1] + (sign[y] * 1.0/8);
pmove.origin[2] = base[2] + (sign[z] * 1.0/8);
if (PM_TestPlayerPosition (pmove.origin))
if (PM_TestPlayerPosition (pmove.origin, false))
return;
}
}
@ -1189,6 +1192,9 @@ were contacted during the move.
*/
void PM_PlayerMove (float gamespeed)
{
int i;
int tmp; //for rounding
frametime = pmove.cmd.msec * 0.001*gamespeed;
pmove.numtouch = 0;
@ -1260,4 +1266,13 @@ void PM_PlayerMove (float gamespeed)
{
PM_ClipVelocity (pmove.velocity, groundplane.normal, pmove.velocity, 1);
}
//round to network precision
for (i = 0; i < 3; i++)
{
tmp = floor(pmove.velocity[i]*8 + 0.5);
pmove.velocity[i] = tmp/8.0;
tmp = floor(pmove.origin[i]*8 + 0.5);
pmove.origin[i] = tmp/8.0;
}
}

View File

@ -125,7 +125,7 @@ int PM_HullPointContents (hull_t *hull, int num, vec3_t p);
int PM_ExtraBoxContents (vec3_t p); //Peeks for HL-style water.
int PM_PointContents (vec3_t point);
qboolean PM_TestPlayerPosition (vec3_t point);
qboolean PM_TestPlayerPosition (vec3_t point, qboolean ignoreportals);
#ifndef __cplusplus
struct trace_s PM_PlayerTrace (vec3_t start, vec3_t stop, unsigned int solidmask);
#endif

View File

@ -358,7 +358,7 @@ PM_TestPlayerPosition
Returns false if the given player position is not valid (in solid)
================
*/
qboolean PM_TestPlayerPosition (vec3_t pos)
qboolean PM_TestPlayerPosition (vec3_t pos, qboolean ignoreportals)
{
int i, j;
physent_t *pe;
@ -366,8 +366,6 @@ qboolean PM_TestPlayerPosition (vec3_t pos)
hull_t *hull;
trace_t trace;
trace.allsolid = false;
for (i=0 ; i< pmove.numphysent ; i++)
{
pe = &pmove.physents[i];
@ -375,38 +373,61 @@ qboolean PM_TestPlayerPosition (vec3_t pos)
if (pe->info == pmove.skipent)
continue;
if (pe->nonsolid || pe->isportal)
if (pe->nonsolid)
continue;
if (pe->forcecontentsmask && !(pe->forcecontentsmask & MASK_PLAYERSOLID))
continue;
// get the clipping hull
if (pe->model)
if (pe->isportal)
{
if (!PM_TransformedHullCheck (pe->model, pos, pos, pmove.player_mins, pmove.player_maxs, &trace, pe->origin, pe->angles))
if (ignoreportals)
continue;
if (trace.allsolid)
//if the trace ended up inside a portal region, then its not valid.
if (pe->model)
{
for (j = i+1; j < pmove.numphysent && trace.allsolid; j++)
{
pe = &pmove.physents[j];
if (pe->isportal)
PM_PortalCSG(pe, j, pmove.player_mins, pmove.player_maxs, pos, pos, &trace);
}
if (!PM_TransformedHullCheck (pe->model, pos, pos, vec3_origin, vec3_origin, &trace, pe->origin, pe->angles))
continue;
if (trace.allsolid)
return false;
}
else
{
hull = PM_HullForBox (pe->mins, pe->maxs);
VectorSubtract(pos, pe->origin, mins);
if (Q1BSP_HullPointContents(hull, mins) & MASK_PLAYERSOLID)
return false;
}
}
else
{
VectorSubtract (pe->mins, pmove.player_maxs, mins);
VectorSubtract (pe->maxs, pmove.player_mins, maxs);
hull = PM_HullForBox (mins, maxs);
VectorSubtract(pos, pe->origin, mins);
if (pe->model)
{
if (!PM_TransformedHullCheck (pe->model, pos, pos, pmove.player_mins, pmove.player_maxs, &trace, pe->origin, pe->angles))
continue;
if (trace.allsolid)
{
for (j = i+1; j < pmove.numphysent && trace.allsolid; j++)
{
pe = &pmove.physents[j];
if (pe->isportal)
PM_PortalCSG(pe, j, pmove.player_mins, pmove.player_maxs, pos, pos, &trace);
}
if (trace.allsolid)
return false;
}
}
else
{
VectorSubtract (pe->mins, pmove.player_maxs, mins);
VectorSubtract (pe->maxs, pmove.player_mins, maxs);
hull = PM_HullForBox (mins, maxs);
VectorSubtract(pos, pe->origin, mins);
if (Q1BSP_HullPointContents(hull, mins) & MASK_PLAYERSOLID)
return false;
if (Q1BSP_HullPointContents(hull, mins) & MASK_PLAYERSOLID)
return false;
}
}
}
@ -482,9 +503,10 @@ trace_t PM_PlayerTrace (vec3_t start, vec3_t end, unsigned int solidmask)
if (trace.allsolid)
trace.startsolid = true;
if (trace.startsolid && pe->isportal)
trace.startsolid = false;
// if (trace.startsolid)
// trace.fraction = 0;
// did we clip the move?
if (trace.fraction < total.fraction || (trace.startsolid && !total.startsolid))
@ -493,9 +515,11 @@ trace_t PM_PlayerTrace (vec3_t start, vec3_t end, unsigned int solidmask)
total = trace;
total.entnum = i;
}
}
//this is needed to avoid *2 friction. some id bug.
if (total.startsolid)
total.fraction = 0;
return total;
}

View File

@ -166,7 +166,6 @@ Global
{2866F783-6B44-4655-A38D-D53874037454}.MRelease|Win32.Build.0 = Release|Win32
{2866F783-6B44-4655-A38D-D53874037454}.MRelease|x64.ActiveCfg = Debug|Win32
{2866F783-6B44-4655-A38D-D53874037454}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{2866F783-6B44-4655-A38D-D53874037454}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{2866F783-6B44-4655-A38D-D53874037454}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{2866F783-6B44-4655-A38D-D53874037454}.Release|Win32.ActiveCfg = Release|Win32
{2866F783-6B44-4655-A38D-D53874037454}.Release|Win32.Build.0 = Release|Win32
@ -195,7 +194,6 @@ Global
{62669E6C-7E18-4E4D-BA54-DFBE29E7D24E}.MRelease|Win32.Build.0 = Release|Win32
{62669E6C-7E18-4E4D-BA54-DFBE29E7D24E}.MRelease|x64.ActiveCfg = Debug|Win32
{62669E6C-7E18-4E4D-BA54-DFBE29E7D24E}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{62669E6C-7E18-4E4D-BA54-DFBE29E7D24E}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{62669E6C-7E18-4E4D-BA54-DFBE29E7D24E}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{62669E6C-7E18-4E4D-BA54-DFBE29E7D24E}.Release|Win32.ActiveCfg = Release|Win32
{62669E6C-7E18-4E4D-BA54-DFBE29E7D24E}.Release|Win32.Build.0 = Release|Win32
@ -247,7 +245,6 @@ Global
{873CCE24-3549-49D4-A4B4-653F91B1532A}.MRelease|Win32.Build.0 = Release|Win32
{873CCE24-3549-49D4-A4B4-653F91B1532A}.MRelease|x64.ActiveCfg = Debug|Win32
{873CCE24-3549-49D4-A4B4-653F91B1532A}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{873CCE24-3549-49D4-A4B4-653F91B1532A}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{873CCE24-3549-49D4-A4B4-653F91B1532A}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{873CCE24-3549-49D4-A4B4-653F91B1532A}.Release|Win32.ActiveCfg = Release|Win32
{873CCE24-3549-49D4-A4B4-653F91B1532A}.Release|Win32.Build.0 = Release|Win32
@ -278,7 +275,6 @@ Global
{4877586B-E85B-4DF8-BCCE-59D31514D240}.MRelease|Win32.Build.0 = Release|Win32
{4877586B-E85B-4DF8-BCCE-59D31514D240}.MRelease|x64.ActiveCfg = Debug|Win32
{4877586B-E85B-4DF8-BCCE-59D31514D240}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{4877586B-E85B-4DF8-BCCE-59D31514D240}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{4877586B-E85B-4DF8-BCCE-59D31514D240}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{4877586B-E85B-4DF8-BCCE-59D31514D240}.Release|Win32.ActiveCfg = Release|Win32
{4877586B-E85B-4DF8-BCCE-59D31514D240}.Release|Win32.Build.0 = Release|Win32
@ -309,7 +305,6 @@ Global
{32B12987-DF8C-4E40-B07C-B18586A4CA65}.MRelease|Win32.Build.0 = Release|Win32
{32B12987-DF8C-4E40-B07C-B18586A4CA65}.MRelease|x64.ActiveCfg = Debug|Win32
{32B12987-DF8C-4E40-B07C-B18586A4CA65}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{32B12987-DF8C-4E40-B07C-B18586A4CA65}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{32B12987-DF8C-4E40-B07C-B18586A4CA65}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{32B12987-DF8C-4E40-B07C-B18586A4CA65}.Release|Win32.ActiveCfg = Release|Win32
{32B12987-DF8C-4E40-B07C-B18586A4CA65}.Release|Win32.Build.0 = Release|Win32
@ -337,7 +332,6 @@ Global
{4735677B-6D5A-4BE6-A945-CB32DEADBEEF}.MRelease|Win32.Build.0 = Release|Win32
{4735677B-6D5A-4BE6-A945-CB32DEADBEEF}.MRelease|x64.ActiveCfg = Debug|Win32
{4735677B-6D5A-4BE6-A945-CB32DEADBEEF}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{4735677B-6D5A-4BE6-A945-CB32DEADBEEF}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{4735677B-6D5A-4BE6-A945-CB32DEADBEEF}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{4735677B-6D5A-4BE6-A945-CB32DEADBEEF}.Release|Win32.ActiveCfg = Release|Win32
{4735677B-6D5A-4BE6-A945-CB32DEADBEEF}.Release|Win32.Build.0 = Release|Win32
@ -370,7 +364,6 @@ Global
{9767E236-8454-44E9-8999-CD5BDAFBE9BA}.MRelease|Win32.Build.0 = Release|Win32
{9767E236-8454-44E9-8999-CD5BDAFBE9BA}.MRelease|x64.ActiveCfg = Release|Win32
{9767E236-8454-44E9-8999-CD5BDAFBE9BA}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{9767E236-8454-44E9-8999-CD5BDAFBE9BA}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{9767E236-8454-44E9-8999-CD5BDAFBE9BA}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{9767E236-8454-44E9-8999-CD5BDAFBE9BA}.Release|Win32.ActiveCfg = Release|Win32
{9767E236-8454-44E9-8999-CD5BDAFBE9BA}.Release|Win32.Build.0 = Release|Win32
@ -405,7 +398,6 @@ Global
{72269FEE-293D-40BC-A7AE-E429F4496869}.MRelease|Win32.Build.0 = Release|Win32
{72269FEE-293D-40BC-A7AE-E429F4496869}.MRelease|x64.ActiveCfg = Release|Win32
{72269FEE-293D-40BC-A7AE-E429F4496869}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{72269FEE-293D-40BC-A7AE-E429F4496869}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{72269FEE-293D-40BC-A7AE-E429F4496869}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{72269FEE-293D-40BC-A7AE-E429F4496869}.Release|Win32.ActiveCfg = Release|Win32
{72269FEE-293D-40BC-A7AE-E429F4496869}.Release|Win32.Build.0 = Release|Win32
@ -600,7 +592,6 @@ Global
{6ABD62A3-C5A0-43E8-BA4F-84606057774F}.MRelease|Win32.Build.0 = Release|Win32
{6ABD62A3-C5A0-43E8-BA4F-84606057774F}.MRelease|x64.ActiveCfg = Release|Win32
{6ABD62A3-C5A0-43E8-BA4F-84606057774F}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{6ABD62A3-C5A0-43E8-BA4F-84606057774F}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{6ABD62A3-C5A0-43E8-BA4F-84606057774F}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{6ABD62A3-C5A0-43E8-BA4F-84606057774F}.Release|Win32.ActiveCfg = Release|Win32
{6ABD62A3-C5A0-43E8-BA4F-84606057774F}.Release|Win32.Build.0 = Release|Win32
@ -636,7 +627,6 @@ Global
{74542CA7-48C1-4664-9007-66F751131EA3}.MRelease|Win32.Build.0 = Release|Win32
{74542CA7-48C1-4664-9007-66F751131EA3}.MRelease|x64.ActiveCfg = Release|Win32
{74542CA7-48C1-4664-9007-66F751131EA3}.Release Dedicated Server|Win32.ActiveCfg = Release|Win32
{74542CA7-48C1-4664-9007-66F751131EA3}.Release Dedicated Server|Win32.Build.0 = Release|Win32
{74542CA7-48C1-4664-9007-66F751131EA3}.Release Dedicated Server|x64.ActiveCfg = Release|Win32
{74542CA7-48C1-4664-9007-66F751131EA3}.Release|Win32.ActiveCfg = Release|Win32
{74542CA7-48C1-4664-9007-66F751131EA3}.Release|Win32.Build.0 = Release|Win32

View File

@ -4114,15 +4114,11 @@ static void ted_itterate(heightmap_t *hm, int distribution, float *pos, float ra
{
wy = (sy*(steps-1.0) + ty)*sc[1];
yd = wy - pos[1];// - sc[1]/4;
// if (yd < 0)
// yd = 0;
for (tx = 0; tx < steps; tx++)
{
/*both heights and textures have an overlapping/matching sample at the edge, there's no need for any half-pixels or anything here*/
wx = (sx*(steps-1.0) + tx)*sc[0];
xd = wx - pos[0];// - sc[0]/4;
// if (xd < 0)
// xd = 0;
switch(distribution)
{

View File

@ -8584,10 +8584,13 @@ static void QCBUILTIN PF_runclientphys(pubprogfuncs_t *prinst, struct globalvars
else
pmove.pm_type = PM_NORMAL;
pmove.jump_msec = 0;//(cls.z_ext & Z_EXT_PM_TYPE) ? 0 : from->jump_msec;
pmove.jump_msec = 0;
pmove.jump_held = ((int)ent->xv->pmove_flags)&PMF_JUMP_HELD;
pmove.waterjumptime = ent->v->teleport_time;
if (progstype != PROG_QW) //this is just annoying.
pmove.waterjumptime = sv_player->v->teleport_time - sv.time;
else
pmove.waterjumptime = ent->v->teleport_time;
//set up the movement command
msecs = pr_global_struct->input_timelength*1000 + 0.5f;
@ -8606,12 +8609,20 @@ static void QCBUILTIN PF_runclientphys(pubprogfuncs_t *prinst, struct globalvars
VectorCopy(ent->v->velocity, pmove.velocity);
VectorCopy(ent->v->maxs, pmove.player_maxs);
VectorCopy(ent->v->mins, pmove.player_mins);
VectorCopy(ent->xv->gravitydir, pmove.gravitydir);
pmove.numtouch = 0;
pmove.world = &sv.world;
pmove.skipent = -1;
pmove.numphysent = 1;
pmove.physents[0].model = sv.world.worldmodel;
pmove.onladder = false;
pmove.onground = false;
pmove.groundent = 0;
pmove.waterlevel = 0;
pmove.watertype = 0;
for (i=0 ; i<3 ; i++)
{
pmove_mins[i] = pmove.origin[i] - 256;
@ -8634,7 +8645,10 @@ static void QCBUILTIN PF_runclientphys(pubprogfuncs_t *prinst, struct globalvars
ent->xv->pmove_flags = 0;
ent->xv->pmove_flags += ((int)pmove.jump_held?PMF_JUMP_HELD:0);
ent->xv->pmove_flags += ((int)pmove.onladder?PMF_LADDER:0);
ent->v->teleport_time = pmove.waterjumptime;
if (progstype != PROG_QW) //this is just annoying.
sv_player->v->teleport_time = sv.time + pmove.waterjumptime;
else
ent->v->teleport_time = pmove.waterjumptime;
VectorCopy(pmove.origin, ent->v->origin);
VectorCopy(pmove.velocity, ent->v->velocity);

View File

@ -1624,6 +1624,7 @@ static void SV_Status_f (void)
float cpu, avg, pak;
char *s;
char adr[MAX_ADR_SIZE];
float pi, po, bi, bo;
int columns = 80;
extern cvar_t sv_listen_qw, sv_listen_nq, sv_listen_dp, sv_listen_q3;
@ -1655,6 +1656,8 @@ static void SV_Status_f (void)
Con_Printf("cpu utilization : %3i%%\n",(int)cpu);
Con_Printf("avg response time: %i ms\n",(int)avg);
Con_Printf("packets/frame : %5.2f\n", pak); //not relevent as a limit.
if (NET_GetRates(svs.sockets, &pi, &po, &bi, &bo))
Con_Printf("packets,bytes/sec: in: %g %g out: %g %g\n", pi, bi, po, bo); //not relevent as a limit.
Con_Printf("server uptime : %s\n", ShowTime(realtime));
if (sv.state == ss_clustermode)
return;

View File

@ -2525,6 +2525,6 @@ void SV_SetMoveVars(void)
movevars.entgravity = 1.0;
movevars.stepheight = *sv_stepheight.string?sv_stepheight.value:PM_DEFAULTSTEPHEIGHT;
movevars.watersinkspeed = *pm_watersinkspeed.string?pm_watersinkspeed.value:60;
movevars.flyfriction = *pm_flyfriction.string?pm_flyfriction.value:60;
movevars.flyfriction = *pm_flyfriction.string?pm_flyfriction.value:4;
}
#endif

View File

@ -681,7 +681,7 @@ main
*/
int main(int argc, char *argv[])
{
int maxsleep;
float maxsleep;
quakeparms_t parms;
// fd_set fdset;
// extern int net_socket;
@ -717,7 +717,7 @@ int main(int argc, char *argv[])
SV_Init (&parms);
// run one frame immediately for first heartbeat
maxsleep = SV_Frame()*1000;
maxsleep = SV_Frame();
//
// main loop
@ -732,7 +732,7 @@ int main(int argc, char *argv[])
stdin_ready = false;
}
maxsleep = SV_Frame()*1000;
maxsleep = SV_Frame();
// extrasleep is just a way to generate a fucked up connection on purpose
if (sys_extrasleep.value)

View File

@ -1192,7 +1192,7 @@ int servicecontrol;
void ServerMainLoop(void)
{
double newtime, time, oldtime;
int delay = 1;
float delay = 0.001;
//
// main loop
//
@ -1205,7 +1205,7 @@ void ServerMainLoop(void)
newtime = Sys_DoubleTime ();
time = newtime - oldtime;
oldtime = newtime;
delay = SV_Frame()*1000;
delay = SV_Frame();
#ifdef USESERVICE
@ -1330,7 +1330,6 @@ SERVICE_TABLE_ENTRY DispatchTable[] =
};
#endif
qboolean NET_Sleep(int msec, qboolean stdinissocket);
int main (int argc, char **argv)
{
#ifdef USESERVICE

View File

@ -6121,9 +6121,18 @@ if (sv_player->v->health > 0 && before && !after )
if (delta[0] || delta[1] || delta[2])
{
client_t *cl = ClientReliableWrite_BeginSplit(host_client, svcfte_setangledelta, 7);
for (i=0 ; i < 3 ; i++)
ClientReliableWrite_Angle16 (cl, delta[i]);
if (host_client->fteprotocolextensions2 & PEXT2_SETANGLEDELTA)
{
client_t *cl = ClientReliableWrite_BeginSplit(host_client, svcfte_setangledelta, 7);
for (i=0 ; i < 3 ; i++)
ClientReliableWrite_Angle16 (cl, delta[i]);
}
else
{
client_t *cl = ClientReliableWrite_BeginSplit(host_client, svc_setangle, 7);
for (i=0 ; i < 3 ; i++)
ClientReliableWrite_Angle (cl, pmove.angles[i]);
}
}
}