From d4d84aec9de5e22e7e0e8a296886263899843add Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 9 Jan 2023 05:14:26 +0000 Subject: [PATCH] Show at least one address for each socket we're listening on, even if its loopback, instead of nothing at all. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6334 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/net_wins.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/engine/common/net_wins.c b/engine/common/net_wins.c index c40e68bc2..6b7b2534f 100644 --- a/engine/common/net_wins.c +++ b/engine/common/net_wins.c @@ -8383,8 +8383,9 @@ void NET_PrintAddresses(ftenet_connections_t *collection) int i; char adrbuf[MAX_ADR_SIZE]; int m; + qboolean shown = false; netadr_t addr[64]; - struct ftenet_generic_connection_s *con[sizeof(addr)/sizeof(addr[0])]; + struct ftenet_generic_connection_s *con[sizeof(addr)/sizeof(addr[0])], *nc; int flags[sizeof(addr)/sizeof(addr[0])]; const char *params[sizeof(addr)/sizeof(addr[0])]; qboolean warn = true; @@ -8401,8 +8402,19 @@ void NET_PrintAddresses(ftenet_connections_t *collection) if (addr[i].type != NA_INVALID) { enum addressscope_e scope = NET_ClassifyAddress(&addr[i], &desc); + if (i+1 < m) + nc = con[i+1]; + else + nc = NULL; + if (nc != con[i]) + { //next is a different family. + if (!shown && (scope == ASCOPE_LINK || scope == ASCOPE_HOST)) + scope = ASCOPE_LAN; //force it visible. + shown = false; + } if (developer.ival || scope >= ASCOPE_LAN) { + shown = true; warn = false; if ((addr[i].prot == NP_RTC_TCP || addr[i].prot == NP_RTC_TLS) && params[i]) {