From 2b6fc5fd03d48ef05bdc3d5352d8369d96c4cd16 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 3 Oct 2024 00:39:23 +0200 Subject: [PATCH] Include qtv proxies in SRCVIEWS count. This correctly reflects the number of viewers consuming QTV over WebSocket stream. --- fteqtv/forward.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fteqtv/forward.c b/fteqtv/forward.c index 5579b2cae..508abe631 100644 --- a/fteqtv/forward.c +++ b/fteqtv/forward.c @@ -1047,19 +1047,25 @@ qboolean SV_ReadPendingProxy(cluster_t *cluster, oproxy_t *pend) if (clientversion > 1) { int plyrs = 0; + int prox = 0; int i; + oproxy_t *o; for (i = 0; i < MAX_CLIENTS; i++) { if (*qtv->map.players[i].userinfo) plyrs++; } + for (o = qtv->proxies; o; o = o->next) + { + prox++; + } sprintf(tempbuf, "SRCSRV: %s\n", qtv->server); Net_ProxySendString(cluster, pend, tempbuf); sprintf(tempbuf, "SRCHOST: %s\n", qtv->map.hostname); Net_ProxySendString(cluster, pend, tempbuf); sprintf(tempbuf, "SRCPLYRS: %i\n", plyrs); Net_ProxySendString(cluster, pend, tempbuf); - sprintf(tempbuf, "SRCVIEWS: %i\n", qtv->numviewers); + sprintf(tempbuf, "SRCVIEWS: %i\n", qtv->numviewers+prox); Net_ProxySendString(cluster, pend, tempbuf); sprintf(tempbuf, "SRCID: %i\n", qtv->streamid); //final part of each source Net_ProxySendString(cluster, pend, tempbuf);