From 933a727b3542d43e284890fd11fca2fa2493bd01 Mon Sep 17 00:00:00 2001 From: timiimit Date: Wed, 15 Mar 2023 12:02:29 +0100 Subject: [PATCH 1/5] Remove empty QP from servers tab --- UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts b/UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts index ee9c0b9a..68fce4f7 100644 --- a/UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts +++ b/UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts @@ -16,6 +16,7 @@ export function useServers() { r.attributes[ServerAttribute.gameInstance] !== 1 && r.attributes[ServerAttribute.serverInstanceGuid] === r.attributes[ServerAttribute.hubGuid] && + r.attributes[ServerAttribute.gameMode] !== 'EMPTY' && !hubFilter(r) ); } From 83a5b4b1f13ea44fb544ef3ba118239c8457d462 Mon Sep 17 00:00:00 2001 From: timiimit Date: Wed, 15 Mar 2023 12:04:19 +0100 Subject: [PATCH 2/5] Remove unneccessary HubGUID condition --- UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts b/UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts index 68fce4f7..9e1ab97d 100644 --- a/UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts +++ b/UT4MasterServer.Web/src/pages/Servers/hooks/use-servers.hook.ts @@ -14,8 +14,6 @@ export function useServers() { function serverFilter(r: IMatchmakingResponse) { return ( r.attributes[ServerAttribute.gameInstance] !== 1 && - r.attributes[ServerAttribute.serverInstanceGuid] === - r.attributes[ServerAttribute.hubGuid] && r.attributes[ServerAttribute.gameMode] !== 'EMPTY' && !hubFilter(r) ); From d80e0528bb84962c23a2e16b369159fbf3a93d07 Mon Sep 17 00:00:00 2001 From: timiimit Date: Wed, 15 Mar 2023 12:12:51 +0100 Subject: [PATCH 3/5] Fix elapsed time on servers --- UT4MasterServer.Web/src/pages/Servers/components/Server.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UT4MasterServer.Web/src/pages/Servers/components/Server.vue b/UT4MasterServer.Web/src/pages/Servers/components/Server.vue index 1e0c3823..c6d8280a 100644 --- a/UT4MasterServer.Web/src/pages/Servers/components/Server.vue +++ b/UT4MasterServer.Web/src/pages/Servers/components/Server.vue @@ -13,7 +13,7 @@
{{ server.matchState }}
Elapsed Time: - {{ toMinutesSeconds(server.duration) }} + {{ toMinutesSeconds(server.elapsedTime) }}
From 2c545fd8f58311f81b90266b0442242b5ac75024 Mon Sep 17 00:00:00 2001 From: timiimit Date: Wed, 15 Mar 2023 13:51:58 +0100 Subject: [PATCH 4/5] Display accurate elapsed time --- .../src/pages/Servers/hooks/use-match.hook.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UT4MasterServer.Web/src/pages/Servers/hooks/use-match.hook.ts b/UT4MasterServer.Web/src/pages/Servers/hooks/use-match.hook.ts index 7ae2c17c..0e3badf1 100644 --- a/UT4MasterServer.Web/src/pages/Servers/hooks/use-match.hook.ts +++ b/UT4MasterServer.Web/src/pages/Servers/hooks/use-match.hook.ts @@ -56,7 +56,13 @@ export function useMatch() { ServerAttribute.playersOnline ] as number, duration: response.attributes[ServerAttribute.matchDuration] as number, - elapsedTime: response.attributes[ServerAttribute.elapsedTime] as number, + elapsedTime: Math.round( + (Date.now() - + (new Date(response.lastUpdated).getTime() - + (response.attributes[ServerAttribute.elapsedTime] as number) * + 1000)) / + 1000 + ), publicPlayers: response.publicPlayers, mutators, gameMode, From b62540e5b47b5c7289892ce8d2b34518fdf2cb52 Mon Sep 17 00:00:00 2001 From: timiimit Date: Wed, 15 Mar 2023 13:59:40 +0100 Subject: [PATCH 5/5] Show accurate elapsed time only when useful --- .../src/pages/Servers/hooks/use-match.hook.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/UT4MasterServer.Web/src/pages/Servers/hooks/use-match.hook.ts b/UT4MasterServer.Web/src/pages/Servers/hooks/use-match.hook.ts index 0e3badf1..ab6458a7 100644 --- a/UT4MasterServer.Web/src/pages/Servers/hooks/use-match.hook.ts +++ b/UT4MasterServer.Web/src/pages/Servers/hooks/use-match.hook.ts @@ -42,6 +42,14 @@ export function useMatch() { ServerAttribute.uuForcedMutators ] as string; const forcedMutators = forcedMutatorsString?.split(',') ?? []; + const elapsedTimeRaw = response.attributes[ + ServerAttribute.elapsedTime + ] as number; + const elapsedTimeAccurate = Math.round( + (Date.now() - + (new Date(response.lastUpdated).getTime() - elapsedTimeRaw * 1000)) / + 1000 + ); return { id, name: @@ -49,20 +57,14 @@ export function useMatch() { (response.attributes[ServerAttribute.serverName] as string), gameType: response.attributes[ServerAttribute.gameType] as string, map: response.attributes[ServerAttribute.mapName] as string, - matchState, + matchState: matchState, matchStateDisplay: matchStateMap[matchState] ?? matchState, maxPlayers: response.attributes[ServerAttribute.maxPlayers] as number, playersOnline: response.attributes[ ServerAttribute.playersOnline ] as number, duration: response.attributes[ServerAttribute.matchDuration] as number, - elapsedTime: Math.round( - (Date.now() - - (new Date(response.lastUpdated).getTime() - - (response.attributes[ServerAttribute.elapsedTime] as number) * - 1000)) / - 1000 - ), + elapsedTime: elapsedTimeRaw > 0 ? elapsedTimeAccurate : elapsedTimeRaw, publicPlayers: response.publicPlayers, mutators, gameMode,