Commit Graph

59 Commits

Author SHA1 Message Date
51b051b34c hiding game mode for now as there's no different game modes for either tictactoe or battleship 2025-12-03 22:05:22 +05:30
eb6749dc0b feat(ui): add dynamic game board selection and hide board until match join
Added renderGameBoard() resolver for dynamic board rendering

Board now hidden before match join

Game auto-selected based on metadata.game from Player matchmaking

Updated header to use dynamic game name

Removed hardcoded Battleship board
2025-12-03 22:01:44 +05:30
ee31b010ac fixes 2025-12-03 21:40:18 +05:30
81a54aa93e feat(ui/battleship): integrate BattleshipBoard and metadata-driven placement/battle flow
- Added metadata state to App and wired incoming match metadata.
- Added Fleet + FLEET_ORDER in BattleShipBoard to drive ship placement order.
- Added nextShip + nextShipSize calculation for guided placement.
- Updated handlePlace and handleShoot to send structured payloads (action + data).
- Added lobby/placement/battle status messages.
- Updated grids to use shipBoard + shipName/shipSize props instead of generic grid.
- Fixed metadata access (state.Metadata vs state.metadata).
- Consolidated PlacementGrid usage and disabled it during battle phase.
- Added logging for debugging incoming battleship boards.
2025-12-03 21:01:41 +05:30
fe1cacb5ed feat(battleship): add complete Battleship game UI with placement & battle phases
- Implement BattleshipBoard with phase-based rendering (placement/battle)
- Add PlacementGrid for ship placement interaction
- Add ShotGrid for firing UI with turn validation
- Integrate match metadata (pX_placed, pX_ready, phase)
- Connect UI to Nakama sendMatchData (place + shoot actions)
- Add real-time board rendering for ships and shots
- Add status line, turn handling, and winner display
- Ensure compatibility with new backend ApplyMove/ApplyPlacement logic
2025-12-03 19:27:47 +05:30
2b0af9fd1f feat(tictactoe): migrate to multi-board state structure
- Replaced single `board` state with `boards` map in App.tsx
- Updated state parsing to use `state.boards` instead of `state.board.grid`
- Updated TicTacToeBoard props to accept `boards` instead of `board`
- Safely extracted TicTacToe board using `boards['tictactoe']?.grid ?? null`
- Added loading fallback when board is not yet available
- Updated rendering guards to prevent undefined map errors

This change fully aligns the frontend with the new multi-board MatchState
introduced on the server (supports TicTacToe, Battleship, and future games).
2025-12-03 17:36:29 +05:30
7b677653a7 cleanup 2025-12-01 20:58:21 +05:30
5c75541c25 de queue on cancle queue rather than before starting new queue 2025-12-01 20:58:08 +05:30
83ae342499 feat(matchmaking): add selectedGame support and implement exitMatchmaker to clear active tickets
Added selectedGame state and UI dropdown

Updated startQueue() to pass { game, mode } metadata

Added exitMatchmaker() to remove existing ticket

Stored active matchmaker ticket in context

Prevents duplicate matchmaker ticket errors
2025-12-01 20:55:24 +05:30
cc1f45457c refactoring game for separate folders for game boards and common logic for player 2025-12-01 20:36:46 +05:30
df0f502191 common files for board games
All checks were successful
continuous-integration/drone/tag Build is passing
v1.1.0
2025-12-01 18:25:22 +05:30
16355d8028 winner 0 index causing it to draw. using username for winner string. break the highliting X or 0 for cell, which was broken anyway 2025-12-01 18:24:52 +05:30
7671e9b2cc feat: add draw-state support using game_over flag and update UI handling
Updated match data callback to interpret { game_over: true, winner: -1 } as a draw.

Added winner = "draw" UI state for display and disabling board interactions.

Updated status text in Board component to show “Draw!” when applicable.

Adjusted winner highlighting logic to avoid highlighting any symbol during draw.

Ensured ongoing games always set winner = null for consistent behavior.
2025-12-01 18:16:46 +05:30
fa02e8b4e4 feat: update UI & Nakama provider for multi-game support and new match state format
Add PlayerModel interface and switch board/player logic to full player objects

Update matchmaking to require { game, mode } metadata

Replace lastModeRef with unified gameMetadataRef

Fix sendMatchData to send wrapped {data:{row,col}} payload

Update TicTacToe state handling (winner logic, board.grid)

Adjust UI to read symbols from player.metadata.symbol

Update matching logic to find player index via player.user_id

Improve safety checks for missing game/mode in matchmaking
2025-12-01 18:12:18 +05:30
fc29111fe1 Update README.md 2025-12-01 08:30:29 +00:00
5b49e5d584 proper ci cd
All checks were successful
continuous-integration/drone/tag Build is passing
v1.0.0
2025-11-30 01:23:51 +05:30
55aac72bd2 git gud
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-29 23:24:30 +05:30
b10639316e adding port as defaults to 7340
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-29 23:15:50 +05:30
d782832fc5 logging connection params
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-29 23:08:27 +05:30
b25cd1a039 logging connection params
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-29 23:06:34 +05:30
e269dfc208 direct push
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-29 19:28:08 +05:30
066f8fbea5 fixes 2025-11-29 19:27:59 +05:30
4a3daf7d8c SSL configuration in Dockerfile and drone.yml
Some checks reported errors
continuous-integration/drone/tag Build was killed
v0.2.5
2025-11-29 19:22:06 +05:30
13ad4e08d2 SSL configuration
All checks were successful
continuous-integration/drone/tag Build is passing
v0.2.4
2025-11-29 19:16:15 +05:30
7e35cf0c31 fixes
All checks were successful
continuous-integration/drone/tag Build is passing
v0.2.3
2025-11-29 19:04:17 +05:30
18d43f9481 fixes
All checks were successful
continuous-integration/drone/tag Build is passing
v0.2.2.1b
2025-11-29 18:50:57 +05:30
5662d22481 deployment files 2025-11-29 18:49:40 +05:30
a996fe7b3c bug fix where new username cannot be fully entered 2025-11-29 18:44:33 +05:30
ecb8825734 client config via .env file 2025-11-29 16:46:56 +05:30
d4edf049ed title fix 2025-11-29 04:21:34 +05:30
d1f4ec0266 bumped up version 2025-11-29 04:01:38 +05:30
56de23f153 timings and haiku changes v0.2.2 2025-11-29 03:58:18 +05:30
c4b44e872a feat(ui): implement timed haiku rotation with staggered line reveal and group fade-out
- Added haiku display block under board with Framer Motion animations
- Implement sequential line-by-line fade-in (staggered 2.4s per line)
- Implement full-haiku fade-out using AnimatePresence keyed by haikuIndex
- Added timed rotation logic using total animation duration (~14.4s)
- Integrated getHaiku() random selector for new haiku each cycle
- Ensured smooth transitions by updating haikuIndex on cycle end
- Added no-winner condition wrapper to show haikus during gameplay
2025-11-29 03:42:33 +05:30
0e22d1cd53 cleanup 2025-11-29 03:15:01 +05:30
0fa644dbc0 - Added full-height flex layout with fixed header and centered main content.
- Locked page scroll via body overflow hidden to prevent outer page scrolling.
- Moved game content into scrollable middle pane.
- Removed global top padding from styles.css to match new fixed-header layout.
- Simplified layout structure and removed unused commented code.
2025-11-29 03:11:33 +05:30
0d167b8ccc - Disabled game mode selector while matchmaking is active.
- Updated match start header in Player to match new UI theme.
- Reworked TicTacToe layout with dark theme, centered layout, and Framer Motion transitions.
- Added animated header bar and unified styling across Player, Board, and main screen.
- Improved opacity/transition behavior for the board based on session state.
- Cleaned up unused code and reorganized match data callback handling.
2025-11-29 03:05:33 +05:30
601048f0e4 matchId check in Board instead of TicTacToe.tsx 2025-11-29 02:52:34 +05:30
ebc6906bf6 - Introduced animated Board component with smooth mount transitions.
- Added hover scale, tap animations, and cell pop-in effects for moves.
- Implemented animated status transitions and winner pulse effect.
- Highlighted winning symbols with glow styling.
- Improved game feel with responsive and modern interaction feedback.
2025-11-29 02:48:10 +05:30
ca7ff9d38e moved logout to bottom instead of hogging matchmaking animation 2025-11-29 02:46:01 +05:30
8555675740 - Added isQueueing state to Player component to track matchmaking state.
- Implemented animated "Finding opponent…" UI with pulsing dots using Framer Motion.
- Added cancelQueue() to allow players to cancel matchmaking mid-search.
- Updated startQueue() to set queueing state immediately for instant feedback.
- Improved player experience by clearly showing matchmaking progress instead of silent waiting.
2025-11-29 02:44:54 +05:30
a9e2d50b16 - Rebuilt Player.tsx with full UI overhaul using Framer Motion animations.
- Added animated transitions between login, lobby, and match states.
- Improved layout, spacing, and visual styling for modern game feel.
- Added smooth auto-connect flow and integrated username lock-in behavior.
- Updated matchmaking and logout buttons with animated interactions.
- Integrated Leaderboard cleanly inside lobby panel.
2025-11-29 02:37:27 +05:30
d962d9c5eb - Created new Player.tsx component to handle username input, auto-connect, matchmaking, and logout.
- Moved all login, session UI, mode selection, and matchmaking logic from TicTacToe.tsx into Player.tsx.
- Added onMatchDataCallback prop support for Player component.
- Cleaned up TicTacToe.tsx by removing duplicated login/matchmaking UI and connect logic.
- Improved auto-connect on mount via Player.tsx.
v0.2.1
2025-11-29 02:29:31 +05:30
94bdec8cb4 - Added username persistence via localStorage with read-only input behavior.
- Added automatic connect() invocation on page load.
- Implemented robust login flow: register or auto-login based on local flags.
- Added logout support with clean WebSocket disconnect + state reset.
- Updated NakamaProvider with getSession(), autoLogin(), registerWithUsername().
- Connected logout button and integrated updated login behavior into UI.
2025-11-29 02:09:51 +05:30
f7929b10ef DRY 2025-11-29 01:49:30 +05:30
f341251812 bumped up to v0.2.0 v0.2.0 2025-11-28 19:44:24 +05:30
5fb3ad4205 feat(tictactoe): integrate leaderboard UI, provider API hook, and new styles
- Add *_BKP* ignore rule to .gitignore
- Insert Leaderboard component into TicTacToe screen
- Add getLeaderboardTop() API method to NakamaProvider and expose via context
- Add full leaderboard polling logic (interval-based) in new Leaderboard.tsx
- Style leaderboard in styles.css (rows, rank, name, score, empty state, card UI)
- Modernize TicTacToe UI styles (board, squares, buttons, layout)
- Replace matchmaking view with leaderboard integration
- Import ApiLeaderboardRecordList and ApiMatch types cleanly
2025-11-28 19:43:59 +05:30
33d917c8f2 bumped up tag to v0.1.1 v0.1.1 2025-11-28 17:01:57 +05:30
d129458039 - Added clear turn messaging for both players (Your Turn / Opponent's Turn).
- Fixed initial board state to avoid showing incorrect spectator/opponent status.
- Introduced players[] tracking in React state to correctly reflect match readiness.
- Updated Board component to derive turn text based on player index and session user ID.
- Ensured proper handling of initial match state broadcast from backend.
- Improved overall clarity of gameplay state for both clients on match start.
2025-11-28 16:56:34 +05:30
8284815337 feat(matchmaking): add automatic requeue on match rejection
- Detect Nakama error code 3 ("No match ID or token found") when a
  match is rejected due to incompatible match properties (e.g., mode mismatch).
- Preserve last selected game mode using a ref so client can requeue
  automatically without user interaction.
- Implement fallback logic to call joinMatchmaker() again after server
  rejection.
- Improve robustness of matchmaking flow by ensuring players remain
  in queue until a valid match is formed.
2025-11-28 16:40:28 +05:30
5b30ac8d83 commenting open matches 2025-11-28 16:08:33 +05:30