Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Spectate live code battles

Đang mở
#15 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
backend, full-stack

Hướng nghiên cứu

Start with frontend/pages/agent-spectate.js for the existing spectator experience and backend/server.js for battle-room events. Then trace the socket handlers and tests to understand player authorization and hidden-test data boundaries. This spans delayed streaming, snapshots, settings, and load measurement; done means the listed socket tests and commands pass and the pull request includes the required two-browser walkthrough and performance numbers.

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

Mô tả

enhancement help wanted

Agent battles can be watched live (frontend/pages/agent-spectate.js). Human code battles cannot. Watching two strong players race on the same problem is the most compelling thing CodeArena can show, and right now it is invisible.

Design

  • A battle page at /watch/<battleId> showing both editors read-only, the timer, test progress and the result.
  • The server already streams code-update (throttled) and submit-solution into the battle room in backend/server.js. Add a separate spectator room per battle so spectators never receive anything players send each other privately, and players never learn who is watching except a viewer count.
  • Delay the stream for spectators by a configurable amount (default 30 seconds, CODEARENA_SPECTATE_DELAY_MS). Without a delay a friend can relay an opponent's code to a player in real time.
  • Players can opt out in settings. Ranked tournament matches are always watchable; unranked battles follow the player setting.
  • A "Live now" list on the home page or leaderboard, ordered by combined rating.

Things that must hold

  • A spectator cannot emit any battle event. Every battle handler must reject sockets that are not one of the two players (add a test per handler).
  • Hidden tests and their expected outputs never reach spectators, before or after the battle.
  • Spectators joining mid-battle get a consistent snapshot, then the delayed stream, with no gap or duplicate.
  • 200 spectators on one battle must not slow the players. Measure it and put the numbers in the pull request.

Definition of done

  • Two-browser walkthrough recorded in the pull request: two players plus a spectator, including a spectator joining halfway.
  • Socket tests covering the rejection rules and the delay.
  • npm test and node scripts/check-boundary.js pass.
Ngôn ngữ chính
JavaScript
Star
0
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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 sennaicodes/codearena

Tất cả issue của sennaicodes/codearena

Issue tương tự

Thêm issue về JavaScript

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.