cmd efpslist now shows incoming/outgoing packet rates per client, too (expressed in bytes per second - same as rates).

Semi-colon can now be bound properly in the menus.
Fixed a bug with one of my more recent commits.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3229 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2009-06-23 21:49:44 +00:00
parent b2429e478a
commit 06b20185b5
8 changed files with 46 additions and 10 deletions

View file

@ -1526,7 +1526,7 @@ void M_Complex_Key(int key)
if (key != K_ESCAPE && key != '`')
{
Cbuf_InsertText (va("bind %s \"%s\"\n", Key_KeynumToString (key), currentmenu->selecteditem->bind.command), RESTRICT_LOCAL, false);
Cbuf_InsertText (va("bind \"%s\" \"%s\"\n", Key_KeynumToString (key), currentmenu->selecteditem->bind.command), RESTRICT_LOCAL, false);
}
bindingactive = false;
return;

View file

@ -169,7 +169,7 @@ typedef struct
extern int net_drop; // packets dropped before this one
void Netchan_Init (void);
void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate);
int Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate);
void Netchan_OutOfBand (netsrc_t sock, netadr_t adr, int length, qbyte *data);
void VARGS Netchan_OutOfBandPrint (netsrc_t sock, netadr_t adr, char *format, ...);
void VARGS Netchan_OutOfBandTPrintf (netsrc_t sock, netadr_t adr, int language, translation_t text, ...);

View file

@ -349,7 +349,7 @@ transmition / retransmition of the reliable messages.
A 0 length will still generate a packet and deal with the reliable messages.
================
*/
void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
int Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
{
sizebuf_t send;
qbyte send_buf[MAX_OVERALLMSGLEN + PACKET_HEADER];
@ -361,6 +361,8 @@ void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
#ifdef NQPROT
if (chan->isnqprotocol)
{
int sentsize = 0;
send.data = send_buf;
send.maxsize = MAX_NQMSGLEN + PACKET_HEADER;
send.cursize = 0;
@ -398,6 +400,7 @@ void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
NET_SendPacket (chan->sock, send.cursize, send.data, chan->remote_address);
Netchan_Block(chan, send.cursize, rate);
sentsize += send.cursize;
send.cursize = 0;
}
@ -414,9 +417,10 @@ void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
NET_SendPacket (chan->sock, send.cursize, send.data, chan->remote_address);
Netchan_Block(chan, send.cursize, rate);
sentsize += send.cursize;
send.cursize = 0;
}
return;
return sentsize;
}
#endif
@ -426,7 +430,7 @@ void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
chan->fatal_error = true;
Con_TPrintf (TL_OUTMESSAGEOVERFLOW
, NET_AdrToString (remote_adr, sizeof(remote_adr), chan->remote_address));
return;
return 0;
}
// if the remote side dropped the last reliable message, resend it
@ -515,6 +519,8 @@ void Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
, chan->incoming_reliable_sequence
, send.cursize);
return send.cursize;
}
/*

View file

@ -902,7 +902,7 @@ Calculates a PVS that is the inclusive or of all leafs within 8 pixels of the
given point.
=============
*/
void Q1BSP_FatPVS (model_t *mod, vec3_t org, qbyte *pvsbuffer, unsigned int buffersize, qboolean add)
unsigned int Q1BSP_FatPVS (model_t *mod, vec3_t org, qbyte *pvsbuffer, unsigned int buffersize, qboolean add)
{
unsigned int fatbytes = (mod->numleafs+31)>>3;
if (fatbytes > buffersize)
@ -910,6 +910,7 @@ void Q1BSP_FatPVS (model_t *mod, vec3_t org, qbyte *pvsbuffer, unsigned int buff
if (!add)
Q_memset (pvsbuffer, 0, fatbytes);
SV_Q1BSP_AddToFatPVS (mod, org, mod->nodes, pvsbuffer, fatbytes);
return fatbytes;
}
qboolean Q1BSP_EdictInFatPVS(model_t *mod, edict_t *ent, qbyte *pvs)

View file

@ -420,7 +420,7 @@ void Q1BSP_Init(void);
qboolean Q1BSP_Trace(struct model_s *model, int forcehullnum, int frame, vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, struct trace_s *trace);
qboolean Q1BSP_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, struct trace_s *trace);
void Q1BSP_FatPVS (struct model_s *mod, vec3_t org, qbyte *pvsbuffer, unsigned int buffersize, qboolean add);
unsigned int Q1BSP_FatPVS (struct model_s *mod, vec3_t org, qbyte *pvsbuffer, unsigned int buffersize, qboolean add);
qboolean Q1BSP_EdictInFatPVS(struct model_s *mod, struct edict_s *ent, qbyte *pvs);
void Q1BSP_FindTouchedLeafs(struct model_s *mod, struct edict_s *ent, float *mins, float *maxs);
qbyte *Q1BSP_LeafPVS (struct model_s *model, mleaf_t *leaf, qbyte *buffer);

View file

@ -298,6 +298,8 @@ typedef struct
double senttime;
float ping_time;
int move_msecs;
int packetsizein;
int packetsizeout;
packet_entities_t entities; //must come last (mvd states are bigger)
} client_frame_t;

View file

@ -1619,6 +1619,7 @@ qboolean SV_SendClientDatagram (client_t *client)
{
qbyte buf[MAX_DATAGRAM];
sizebuf_t msg;
unsigned int sentbytes, fnum;
msg.data = buf;
msg.maxsize = sizeof(buf);
@ -1677,8 +1678,11 @@ qboolean SV_SendClientDatagram (client_t *client)
SV_DarkPlacesDownloadChunk(client, &msg);
// send the datagram
Netchan_Transmit (&client->netchan, msg.cursize, buf, SV_RateForClient(client));
fnum = client->netchan.outgoing_sequence;
sentbytes = Netchan_Transmit (&client->netchan, msg.cursize, buf, SV_RateForClient(client));
if (client->frameunion.frames)
client->frameunion.frames[fnum & UPDATE_MASK].packetsizeout += sentbytes;
return true;
}
@ -1995,6 +1999,7 @@ void SV_SendClientMessages (void)
{
int i, j;
client_t *c;
int sentbytes, fnum;
float pt = sv.physicstime;
#ifdef Q3SERVER
@ -2163,7 +2168,10 @@ void SV_SendClientMessages (void)
else
{
SV_DarkPlacesDownloadChunk(c, &c->datagram);
Netchan_Transmit (&c->netchan, c->datagram.cursize, c->datagram.data, SV_RateForClient(c)); // just update reliable
fnum = c->netchan.outgoing_sequence;
sentbytes = Netchan_Transmit (&c->netchan, c->datagram.cursize, c->datagram.data, SV_RateForClient(c)); // just update reliable
if (c->frameunion.frames)
c->frameunion.frames[fnum & UPDATE_MASK].packetsizeout += sentbytes;
c->datagram.cursize = 0;
}

View file

@ -3769,6 +3769,9 @@ void Cmd_FPSList_f(void)
double minf = 1000, maxf = 0, this;
double ftime;
int frames;
int inbytes;
int outbytes;
int msecs;
for (c = 0; c < sv.allocated_client_slots; c++)
@ -3776,10 +3779,15 @@ void Cmd_FPSList_f(void)
cl = &svs.clients[c];
ftime = 0;
frames = 0;
inbytes = 0;
outbytes = 0;
if (!cl->state)
continue;
if (cl->protocol != SCP_QUAKEWORLD)
continue;
if (cl->frameunion.frames)
{
for (f = 0; f < UPDATE_BACKUP; f++)
@ -3787,21 +3795,30 @@ void Cmd_FPSList_f(void)
if (cl->frameunion.frames[f].move_msecs >= 0)
{
if (!cl->frameunion.frames[f].move_msecs)
{
this = 1001;
msecs+=1;
}
else
{
this = 1000.0f/cl->frameunion.frames[f].move_msecs;
msecs += cl->frameunion.frames[f].move_msecs;
}
ftime += this;
if (minf > this)
minf = this;
if (maxf < this)
maxf = this;
frames++;
inbytes += cl->frameunion.frames[f].packetsizein;
outbytes += cl->frameunion.frames[f].packetsizeout;
}
}
}
if (frames)
SV_ClientPrintf(host_client, PRINT_HIGH, "%s: %ffps (min%f max %f\n", cl->name, ftime/frames, minf, maxf);
SV_ClientPrintf(host_client, PRINT_HIGH, "%s: %ffps (min%f max %f), in: %fbps, out: %fbps\n", cl->name, ftime/frames, minf, maxf, (1000.0f*inbytes)/msecs, (1000.0f*outbytes)/msecs);
else
SV_ClientPrintf(host_client, PRINT_HIGH, "%s: no information available\n", cl->name);
}
@ -5472,6 +5489,8 @@ void SV_ExecuteClientMessage (client_t *cl)
cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].senttime = realtime;
cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].ping_time = -1;
cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].move_msecs = -1;
cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].packetsizein = net_message.cursize;
cl->frameunion.frames[cl->netchan.outgoing_sequence & UPDATE_MASK].packetsizeout = 0;
}
host_client = cl;