mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-13 18:29:15 +00:00
JoinLobbyModal for public and private lobbies (#3097)
## Description: Replaced the src/client/JoinPrivateLobbyModal.ts with a new src/client/JoinLobbyModal.ts which handles both public + private lobbies. <img width="771" height="714" alt="image" src="https://github.com/user-attachments/assets/7ac55d91-3f0c-4f99-b960-cea9e617538d" /> also made a "connecting" to the lobby <img width="772" height="708" alt="image" src="https://github.com/user-attachments/assets/a2812462-c5f4-459a-b63a-49d93bb2a6a2" /> It also needed to be updated to address the issue with the modal using both polling + websockets ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: w.o.n
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
GameID,
|
||||
GameRecord,
|
||||
GameStartInfo,
|
||||
LobbyInfoEvent,
|
||||
PlayerCosmeticRefs,
|
||||
PlayerRecord,
|
||||
ServerMessage,
|
||||
@@ -96,6 +97,10 @@ export function joinLobby(
|
||||
let terrainLoad: Promise<TerrainMapData> | null = null;
|
||||
|
||||
const onmessage = (message: ServerMessage) => {
|
||||
if (message.type === "lobby_info") {
|
||||
eventBus.emit(new LobbyInfoEvent(message.lobby));
|
||||
return;
|
||||
}
|
||||
if (message.type === "prestart") {
|
||||
console.log(
|
||||
`lobby: game prestarting: ${JSON.stringify(message, replacer)}`,
|
||||
|
||||
Reference in New Issue
Block a user