mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-08 03:29:44 +00:00
show game map name in public lobby
This commit is contained in:
@@ -20,7 +20,7 @@ export class PublicLobby extends LitElement {
|
|||||||
this.fetchAndUpdateLobbies();
|
this.fetchAndUpdateLobbies();
|
||||||
this.lobbiesInterval = window.setInterval(
|
this.lobbiesInterval = window.setInterval(
|
||||||
() => this.fetchAndUpdateLobbies(),
|
() => this.fetchAndUpdateLobbies(),
|
||||||
1000,
|
1000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +74,11 @@ export class PublicLobby extends LitElement {
|
|||||||
>
|
>
|
||||||
<div class="text-lg md:text-2xl font-semibold mb-2">Next Game</div>
|
<div class="text-lg md:text-2xl font-semibold mb-2">Next Game</div>
|
||||||
<div class="flex items-center justify-center gap-4">
|
<div class="flex items-center justify-center gap-4">
|
||||||
|
<div class="flex flex-col items-start">
|
||||||
|
<div class="text-md font-medium text-blue-100">
|
||||||
|
${lobby.gameConfig.gameMap}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="flex flex-col items-start">
|
<div class="flex flex-col items-start">
|
||||||
<div class="text-md font-medium text-blue-100">
|
<div class="text-md font-medium text-blue-100">
|
||||||
${lobby.numClients}
|
${lobby.numClients}
|
||||||
@@ -106,7 +111,7 @@ export class PublicLobby extends LitElement {
|
|||||||
},
|
},
|
||||||
bubbles: true,
|
bubbles: true,
|
||||||
composed: true,
|
composed: true,
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.dispatchEvent(
|
this.dispatchEvent(
|
||||||
@@ -114,7 +119,7 @@ export class PublicLobby extends LitElement {
|
|||||||
detail: { lobby: this.currLobby },
|
detail: { lobby: this.currLobby },
|
||||||
bubbles: true,
|
bubbles: true,
|
||||||
composed: true,
|
composed: true,
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
this.currLobby = null;
|
this.currLobby = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export interface Lobby {
|
|||||||
id: string;
|
id: string;
|
||||||
msUntilStart?: number;
|
msUntilStart?: number;
|
||||||
numClients?: number;
|
numClients?: number;
|
||||||
|
gameConfig?: GameConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GameConfigSchema = z.object({
|
const GameConfigSchema = z.object({
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export class GameServer {
|
|||||||
public readonly createdAt: number,
|
public readonly createdAt: number,
|
||||||
public readonly isPublic: boolean,
|
public readonly isPublic: boolean,
|
||||||
private config: ServerConfig,
|
private config: ServerConfig,
|
||||||
private gameConfig: GameConfig,
|
public gameConfig: GameConfig,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public updateGameConfig(gameConfig: GameConfig): void {
|
public updateGameConfig(gameConfig: GameConfig): void {
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ function updateLobbies() {
|
|||||||
id: g.id,
|
id: g.id,
|
||||||
msUntilStart: g.startTime() - Date.now(),
|
msUntilStart: g.startTime() - Date.now(),
|
||||||
numClients: g.numClients(),
|
numClients: g.numClients(),
|
||||||
|
gameConfig: g.gameConfig,
|
||||||
}))
|
}))
|
||||||
.sort((a, b) => a.msUntilStart - b.msUntilStart),
|
.sort((a, b) => a.msUntilStart - b.msUntilStart),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user