Refactor: use promises instead of callbacks for joining a game#3452
Refactor: use promises instead of callbacks for joining a game#3452
Conversation
|
Caution Review failedFailed to post review comments WalkthroughThis PR enhances UI visual weight by increasing background opacity and blur strength across display layers, replaces an in-game header ad component with a new promo component, refactors the lobby join API from callback-based to promise-based pattern, updates map metadata, adjusts game spawn phases and AI behavior for specific game modes, refactors message rate limiting to use cumulative byte tracking, adds IP-based WebSocket rate limiting, and simplifies game difficulty modifier selection logic. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Main (Client)
participant Lobby as ClientGameRunner
participant EventBus as EventBus
Client->>Lobby: joinLobby(eventBus, lobbyConfig)
activate Lobby
Lobby->>Lobby: Initialize prestartPromise,<br/>joinPromise, resolvers
Lobby-->>Client: Return JoinLobbyResult {<br/>stop(), prestart, join }
deactivate Lobby
EventBus->>Lobby: Emit prestart message
activate Lobby
Lobby->>Lobby: resolvePrestart()
deactivate Lobby
Client->>Client: Await lobbyHandle.prestart
Client->>Client: Run UI/modal setup
EventBus->>Lobby: Emit join message
activate Lobby
Lobby->>Lobby: resolveJoin()
deactivate Lobby
Client->>Client: Await lobbyHandle.join
Client->>Client: Start game
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.Change the |
Description:
Simplifies the interface a bit.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
evan