diff --git a/ext/cfx-ui/src/cfx/common/services/servers/transformers.ts b/ext/cfx-ui/src/cfx/common/services/servers/transformers.ts index 7fc07a991a..86e56e0828 100644 --- a/ext/cfx-ui/src/cfx/common/services/servers/transformers.ts +++ b/ext/cfx-ui/src/cfx/common/services/servers/transformers.ts @@ -22,6 +22,13 @@ import { ServerViewDetailsLevel, } from './types'; +// Add new convars to hide here. All sv_* convars filtered out by default. +const convarsToHide = new Set([ + 'mapname', + 'onesync', + 'gametype', +]); + export function serverAddress2ServerView(address: string): IServerView { const fakeHostname = `⚠️ Server is loading or failed to load (${address}) ⚠️`; @@ -187,6 +194,10 @@ function getSortableName(searchableName: string): string { .toLowerCase(); } +function shouldVarBeShown(key: string): boolean { + return !convarsToHide.has(key) && !key.startsWith('sv_'); +} + type VarsView = Partial< Pick< IServerView, @@ -294,21 +305,11 @@ export function processServerDataVariables(vars?: IServer['data']['vars']): Vars } case key === 'sv_pureLevel': { view.pureLevel = value as ServerPureLevel; - continue; } - - case key === 'sv_poolSizesIncrease': - case key === 'sv_disableClientReplays': - case key === 'onesync': - case key === 'gametype': - case key === 'mapname': - case key === 'sv_enhancedHostSupport': - case key === 'sv_lan': - case key === 'sv_maxClients': { + case !shouldVarBeShown(key): { continue; } - case lckey.includes('banner_'): case lckey.includes('sv_project'): case lckey.includes('version'):