From 0c6e7517789e06c65dfbd58cec1b2f0ba0acb002 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 10 Sep 2007 19:27:39 +0000 Subject: [PATCH] mol#4 this should be the entirety of #4. I suspect #3 too. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2655 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- fteqtv/parse.c | 8 ++++++-- fteqtv/qw.c | 14 +++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/fteqtv/parse.c b/fteqtv/parse.c index 362074768..909aee69f 100644 --- a/fteqtv/parse.c +++ b/fteqtv/parse.c @@ -188,6 +188,10 @@ static void ParseServerData(sv_t *tv, netmsg_t *m, int to, unsigned int playerma } else ConnectionData(tv, (void*)((char*)m->data+m->startpos), m->readpos - m->startpos, to, dem_read, QW); + + if (tv->controller) + QW_ClearViewerState(tv->controller); + strcpy(tv->status, "Receiving soundlist\n"); } @@ -1086,7 +1090,7 @@ static void ParseUpdateUserinfo(sv_t *tv, netmsg_t *m, int to, unsigned int mask } } - Multicast(tv, (char*)m->data+m->startpos, m->readpos - m->startpos, to, mask, QW); + ConnectionData(tv, (char*)m->data+m->startpos, m->readpos - m->startpos, to, mask, QW); } static void ParsePacketloss(sv_t *tv, netmsg_t *m, int to, unsigned int mask) @@ -1118,7 +1122,7 @@ static void ParseUpdateEnterTime(sv_t *tv, netmsg_t *m, int to, unsigned int mas else Sys_Printf(tv->cluster, "svc_updateentertime: invalid player number\n"); - Multicast(tv, (char*)m->data+m->startpos, m->readpos - m->startpos, to, mask, QW); + ConnectionData(tv, (char*)m->data+m->startpos, m->readpos - m->startpos, to, mask, QW); } static void ParseSound(sv_t *tv, netmsg_t *m, int to, unsigned int mask) diff --git a/fteqtv/qw.c b/fteqtv/qw.c index 134df3c98..6de6ff650 100644 --- a/fteqtv/qw.c +++ b/fteqtv/qw.c @@ -284,12 +284,6 @@ void BuildServerData(sv_t *tv, netmsg_t *msg, int servercount, viewer_t *viewer) WriteString2(msg, tv->serverinfo); WriteString(msg, "\"\n"); } - if (viewer) - { - //the quakeworld client will have flushed most of the information that it knows about things - //this is as good a place to flush our cache as any other - memset(viewer->currentstats, 0, sizeof(viewer->currentstats)); - } } void BuildNQServerData(sv_t *tv, netmsg_t *msg, qboolean mvd, int playernum) { @@ -362,6 +356,12 @@ void BuildNQServerData(sv_t *tv, netmsg_t *msg, qboolean mvd, int playernum) } } + +void QW_ClearViewerState(viewer_t *viewer) +{ + memset(viewer->currentstats, 0, sizeof(viewer->currentstats)); +} + void SendServerData(sv_t *tv, viewer_t *viewer) { netmsg_t msg; @@ -387,7 +387,7 @@ void SendServerData(sv_t *tv, viewer_t *viewer) if (tv && (tv->controller == viewer)) viewer->thinksitsconnected = true; - memset(viewer->currentstats, 0, sizeof(viewer->currentstats)); + QW_ClearViewerState(viewer); } void SendNQSpawnInfoToViewer(cluster_t *cluster, viewer_t *viewer, netmsg_t *msg)