Chat says it's only available in a lobby while you're in one (late leave answer tears down the new lobby)

Đã đóng
#47 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Một pull request liên quan đã được merge.

  • #48 của @Jr-JoshS — đã merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
lua
Lĩnh vực
api, networking

Hướng nghiên cứu

The bug is in the teardown run by lobby:leave() when the lobby_leave RPC callback arrives late. Start with the callback and the cleanup functions it calls: L.cleanup, MPAPI.chat.cleanup(), nakama_lobby.forget() and on_lobby_disconnected(). Done means a late leave answer no longer affects a lobby the player has since joined, which you can check by delaying the callback and confirming chat, match updates and the lobby page still work. Open PR #48 already targets this, so coordinate with its author before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Reported in #bugs-and-issues: "I am in a game and it shows this" — [MultiplayerAPI] Chat is only available while in a lobby.

Why: lobby:leave() tears the lobby down in the lobby_leave RPC's callback. If that answer comes after the player is already in another lobby (left and quickly created, joined or got matched into a new one), the old lobby's L.cleanup runs against the new one:

  • MPAPI.chat.cleanup() switches chat off, so typing in the new lobby shows the message above.
  • nakama_lobby.forget() drops the new lobby's match, so it stops getting lobby updates (its host never sees the next player join).
  • on_lobby_disconnected() sends the player back to the mod menu while they are still in the new lobby.

To reproduce: delay the lobby_leave callback by ~3s (a slow answer), leave a lobby and create a new one right away. Once the late answer lands: chat is off, the host doesn't see a player who joins, and the lobby page is replaced by the mod menu.

Reproduced with two clients on a local server.

Ngôn ngữ chính
Lua
Star
10
Fork
8
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
20

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Balatro-Multiplayer/BalatroMultiplayerAPI

Tất cả issue của Balatro-Multiplayer/BalatroMultiplayerAPI

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.