45 Commits

Author SHA1 Message Date
1359a75214 allow games.aetoskia.com
All checks were successful
continuous-integration/drone/tag Build is passing
v0.2.2
2025-11-29 19:41:33 +05:30
6786547950 enabled tag based deployment
All checks were successful
continuous-integration/drone/tag Build is passing
v0.2.1
2025-11-29 19:06:11 +05:30
17a2caea49 fixes
Some checks failed
continuous-integration/drone Build is failing
2025-11-29 19:02:01 +05:30
8ff199ca10 fixes
Some checks failed
continuous-integration/drone Build is failing
2025-11-29 18:59:02 +05:30
62c1f3920b fixes
Some checks failed
continuous-integration/drone/tag Build is failing
v0.2.0.4b
2025-11-29 18:42:41 +05:30
73e3f0a7ac fixes
Some checks failed
continuous-integration/drone/tag Build is failing
v0.2.0.3b
2025-11-29 18:38:13 +05:30
21f6698b89 fixes
Some checks failed
continuous-integration/drone/tag Build is failing
v0.2.0.2b
2025-11-29 18:33:15 +05:30
06904143d6 drone deployment
Some checks reported errors
continuous-integration/drone/push Build encountered an error
continuous-integration/drone/tag Build encountered an error
v0.2.0.1b
2025-11-29 18:27:26 +05:30
ba05aa7c76 removed reference to local.yml as it's never used and passing server_key 2025-11-29 18:27:10 +05:30
bfcf977e13 ignoring .env as it'll be secret 2025-11-29 17:34:24 +05:30
6eca090046 deployment changes for DB_ADDR via env var 2025-11-29 17:25:13 +05:30
07cb519f55 added dockerfile for nakama 2025-11-29 16:59:33 +05:30
840d7701ca UI updated 2025-11-28 20:09:15 +05:30
f1f40f5799 backend update 2025-11-28 19:52:16 +05:30
0d8d3785fc username in leaderboard v0.2.0 2025-11-28 19:42:06 +05:30
65b5ef4660 leaderboard 2025-11-28 19:26:47 +05:30
95381c2a56 feat(matchmaking): enable mode-based matchmaking and improve match initialization
- Added matchmaker configuration to local.yml with support for string property "mode"
- Enabled faster matchmaking via interval_ms and large ticket limit
- Broadcast initial match state when both players join
- Added detailed validation and logging for move processing
- Broadcast game-over and forfeit states immediately on player leave
- Improved MatchLoop robustness with change tracking and clearer diagnostics
v0.1.0
2025-11-28 14:14:03 +05:30
ead7ad2c35 added check for allowing only class and blitz game mode at server 2025-11-27 16:10:04 +05:30
4a833dc258 fixes 2025-11-27 15:36:39 +05:30
37c090cf64 fixes 2025-11-27 15:15:57 +05:30
7bcdc76594 minor fixes v0.0.2 2025-11-26 17:36:58 +05:30
087616a67e fix(matchmaking): correctly group players only after successful match join
- Track matches based solely on `player.match_id`
- Avoid double-counting from presence events or server broadcasts
- Ensure `matches[match_id]` contains only actual participants
- Prevent false 3–4 player matches and scenario execution failures
- Maintain safety check for non-1v1 match sizes

This resolves incorrect match grouping in automated matchmaking tests,
allowing clean 1v1 scenario execution and accurate match counts.
2025-11-26 17:36:49 +05:30
10058710fb Improve client matchmaking flow with ticket handling, auto-join, and mode distribution
### PlayerWebSocketHandler updates
- Track `ticket` and `match_id` per player instance
- Handle `matchmaker_ticket` messages and store ticket
- Handle `matchmaker_matched` and automatically join created match
- Enhance matchmaking debug output
- Update join_matchmaking() to include mode-based string_properties + query

### Matchmaking simulation improvements
- Evenly distribute players between "classic" and "blitz" modes
- Randomize assignment order to simulate real queue behavior
- Log player→mode mapping for visibility during tests

Example:
  player_0 -> classic
  player_3 -> blitz
  player_5 -> classic

Client test harness now accurately reflects multi-mode matchmaking behavior.
2025-11-26 17:11:20 +05:30
eb35ccd180 Enhance matchmaker to validate mode and create authoritative matches
- Implement MatchmakerMatched callback for true matchmaking flow
- Enforce strict 1v1 pairing (ignore non-2 player matches)
- Read `mode` from matchmaker ticket properties
- Prevent mismatched-mode players from being paired
- Automatically create authoritative `tictactoe` match when valid pair found
- Provide match parameters so match handler receives selected mode
- Improve logging for debugging and visibility

Ensures clean, mode-aware matchmaking queues and proper server-side match creation.
2025-11-26 17:09:49 +05:30
bd376123b3 refactor(matchmaking): migrate Python simulator to native Nakama matchmaker
### Summary
Replaced legacy RPC-based matchmaking flow with proper WebSocket-driven
matchmaker integration. Player simulation now queues via
`matchmaker_add`, auto-joins matches on `matchmaker_matched`, and no
longer depends on `rpc_find_match`.
2025-11-26 16:35:19 +05:30
ea1a70b212 feat(matchmaking): replace legacy rpc_find_match with Nakama native matchmaking
### Summary
This update removes the old RPC-driven matchmaking flow and replaces it
with proper Nakama matchmaker integration. Players now queue using
`matchmaker_add` over WebSockets, and matches are created via
`MatchmakerMatched` callback.

### Changes
- Removed `rpc_find_match` and MatchList polling logic
- Added `MatchmakerMatched` handler to auto-create TicTacToe matches
- Added RPC stubs `join_matchmaking` & `leave_matchmaking` only for
  optional validation (no server-side queueing)
- Updated `main.go` to register:
   `tictactoe` authoritative match
   `matchmaker_matched` callback
   removed obsolete rpc_find_match registration
- Ensured module loads successfully with cleaner InitModule
- Cleaned unused imports and outdated Nakama calls

### Benefits
- Fully scalable & production-ready matchmaking flow
- Eliminates race conditions & manual match assignment
- Supports multiple queues (classic / blitz) via string properties
- Aligns plugin with Nakama best practices
- Enables Python/WebSocket simulation without RPC dependencies
2025-11-26 16:34:55 +05:30
908eebefdd basic matchmaking flow 2025-11-26 16:09:58 +05:30
0fb448dd45 feat: add rpc_find_match for basic 2-player matchmaking
- Implement rpc_find_match Nakama RPC function
- Search for existing authoritative TicTacToe matches via MatchList
- Return first match with available slot (size < 2)
- Create new match using MatchCreate when none available
- Add request/response structs for future extensibility
- Log match search, selection, and creation flow
- Gracefully handle optional JSON payload and invalid input
2025-11-26 16:09:48 +05:30
fa4d4d00be setup player 2025-11-26 16:04:27 +05:30
22993d6d37 minor prints 2025-11-26 15:57:56 +05:30
de4bfb6c07 changed sequence of join match and listener 2025-11-26 15:57:44 +05:30
d260c9a1ef refactor: abstract WebSocket handling into shared base class
- Introduce WebSocketHandler for reusable socket lifecycle management:
  • login, connect, close, start_listener
  • continuous receive loop with on_message callback
  • background listener task support

- Create PlayerWebSocketHandler subclass implementing TicTacToe behavior:
  • match_create, match_join, send_move helpers
  • parse match_data opcodes and pretty-print board state

- Move shared logic (auth, recv loop, WS decoding) out of gameplay module
- Simplifies test scenario execution & enables future bot/test clients
- Reduces duplication and improves separation of concerns
2025-11-26 15:43:25 +05:30
1b4e7a5ee0 feat(test): add comprehensive TicTacToe gameplay scenario flows
- Introduce multiple async test paths for simulation-based validation:
  • happy_path (P1 top-row win)
  • p2_wins_diagonal
  • draw_game (full board, no winner)
  • illegal_occupied_cell
  • illegal_out_of_turn
  • illegal_out_of_bounds
  • midgame_disconnect
  • abandoned_lobby (no opponent joins)
  • spam_moves (anti-flood behavior)
  • random_game (stochastic stress playthrough)

- Add TEST_SCENARIOS registry for automated execution
- Improve coverage of server-side match logic, validation, and cleanup
- Enables CI-driven load, rule enforcement, and termination testing
2025-11-26 14:51:10 +05:30
cb23d3c516 feat: add PlayerWebSocket class abstraction for Nakama TicTacToe client
- Introduce PlayerWebSocket class to encapsulate player behavior
- Handle login, websocket connect, message listening, and cleanup
- Add helpers: create_match, join_match, send_move
- Remove global websocket/session handling
- Update main() to use object-oriented player flow
- Improves readability, scalability, and multiplayer orchestration
2025-11-26 14:34:19 +05:30
37b20c6c36 fixes 2025-11-25 19:15:46 +05:30
97d355464a status update v0.0.1 2025-11-25 19:15:02 +05:30
1af186783f fixes 2025-11-25 18:50:04 +05:30
d3e3036d20 fixes 2025-11-25 18:49:25 +05:30
b0f127e61f fixes for game flow and MOVE logs 2025-11-25 18:49:14 +05:30
e74f15c781 game flow basic 2025-11-25 18:23:05 +05:30
34fbe28b93 ignoring .venv files 2025-11-25 17:50:31 +05:30
69fde11346 ignoring run files 2025-11-25 17:44:24 +05:30
f5e51e4bf2 match.go for tictactoe 2025-11-25 17:44:16 +05:30
7c3e544956 hello world 2025-11-25 17:09:00 +05:30
298efd403e Initial commit 2025-11-25 10:00:58 +00:00