mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-01 09:53:24 +00:00
fix
This commit is contained in:
@@ -126,7 +126,7 @@ export async function readGameRecord(
|
||||
Key: `${gameFolder}/${gameId}`, // Fixed - needed to include gameFolder
|
||||
});
|
||||
// Parse the response body
|
||||
if (typeof response.Body === "undefined") return null;
|
||||
if (response.Body === undefined) return null;
|
||||
const bodyContents = await response.Body.transformToString();
|
||||
return JSON.parse(bodyContents) as GameRecord;
|
||||
} catch (error) {
|
||||
|
||||
@@ -235,7 +235,7 @@ async function fetchLobbies(): Promise<number> {
|
||||
lobbyInfos.forEach((l) => {
|
||||
if (
|
||||
"msUntilStart" in l &&
|
||||
typeof l.msUntilStart !== "undefined" &&
|
||||
l.msUntilStart !== undefined &&
|
||||
l.msUntilStart <= 250
|
||||
) {
|
||||
publicLobbyIDs.delete(l.gameID);
|
||||
@@ -244,11 +244,11 @@ async function fetchLobbies(): Promise<number> {
|
||||
|
||||
if (
|
||||
"gameConfig" in l &&
|
||||
typeof l.gameConfig !== "undefined" &&
|
||||
l.gameConfig !== undefined &&
|
||||
"maxPlayers" in l.gameConfig &&
|
||||
typeof l.gameConfig.maxPlayers !== "undefined" &&
|
||||
l.gameConfig.maxPlayers !== undefined &&
|
||||
"numClients" in l &&
|
||||
typeof l.numClients !== "undefined" &&
|
||||
l.numClients !== undefined &&
|
||||
l.gameConfig.maxPlayers <= l.numClients
|
||||
) {
|
||||
publicLobbyIDs.delete(l.gameID);
|
||||
|
||||
Reference in New Issue
Block a user