Commit Graph

330 Commits

Author SHA1 Message Date
tiennm99 2d74117fe2 refactor: rename packages org.nico.ratel.landlords -> com.miti99.caro.{common,server}
- Move all 11 shared sub-packages (channel, entity, enums, exception,
  features, handler, helper, print, robot, transfer, utils) under
  com.miti99.caro.common.
- Move server sub-packages (event, handler, proxy, timer) + SimpleServer
  + ServerContains under com.miti99.caro.server.
- Move tests under com.miti99.caro.common.{helper,robot}.tests.
- Rewrite package declarations and imports across all 58 .java files via
  regex script (server rules applied before common to avoid overlap).
- Update <mainClass> in server/pom.xml to com.miti99.caro.server.SimpleServer.
- Update .proto files' package + java_package to com.miti99.caro.common.entity
  (for future regeneration).
- Fix generate.sh relative output path (common/ no longer exists).
- Include rewrite-packages.py script under plans/ for auditability.

Note: protoc-generated ClientTransferData.java / ServerTransferData.java
retain internal_static_* variable names and embedded descriptor byte strings
with the old package — these are implementation details that do not affect
the public Java package and preserve protobuf wire compatibility.

Validation: mvn -f server/pom.xml clean verify on Java 25 — all 37 tests
pass (29 GomokuHelperTest + 8 GomokuAITest).
2026-04-10 19:14:02 +07:00
tiennm99 5b68ee9cc4 refactor: standalone maven, java 25, shade, gson, junit 5, rename to server/
Build system modernization:
- Delete root parent pom.xml; server/pom.xml is now standalone.
- Drop Spring Boot parent; use maven-shade-plugin 3.6.0 for fat jar.
- Upgrade source/target to Java 25 (LTS); pin explicit dep versions:
    netty-all 4.1.115.Final, protobuf-java 3.25.5, gson 2.11.0,
    junit-jupiter 5.11.3, maven-compiler-plugin 3.13.0,
    maven-surefire-plugin 3.5.2, maven-shade-plugin 3.6.0.
- New coordinates: com.miti99.caro:caro-server:0.0.1-beta.
- Shade transformers: manifest (main class), services, appending
  (Netty io.netty.versions.properties merge).

Dependency migration:
- Replace com.smallnico:noson with gson across 5 files (7 call sites):
    MapHelper, TransferProtocolUtils, ServerEventListener_CODE_GAME_WATCH,
    ServerEventListener_CODE_GET_ROOMS, ServerEventListener_CODE_ROOM_CREATE.
  All call sites now funnel through existing JsonUtils wrapper (DRY).
- Migrate GomokuHelperTest + GomokuAITest from JUnit 4 to JUnit 5
  (org.junit.Test -> org.junit.jupiter.api.Test,
   org.junit.Assert.* -> org.junit.jupiter.api.Assertions.*).

Directory + infra:
- git mv landlords-server/ -> server/.
- Rewrite server/Dockerfile: Java 25 base images
  (maven:3.9-eclipse-temurin-25 build, eclipse-temurin:25-jre-alpine runtime),
  simplified COPY paths (no more multi-module layout).
- docker-compose.yml: dockerfile points to server/Dockerfile.
- .github/workflows/build.yml: setup-java temurin 25,
  `mvn -f server/pom.xml -B clean verify`.

Validation: mvn verify on Java 25 passes all 37 tests (29 GomokuHelper
+ 8 GomokuAI), shade produces caro-server-0.0.1-beta.jar cleanly.

Note: package names remain org.nico.ratel.landlords.* in this phase;
renamed to com.miti99.caro.{common,server}.* in Phase 4.
2026-04-10 19:10:51 +07:00
tiennm99 c71aa6a160 refactor: consolidate landlords-common into landlords-server
- Move all 11 common sub-packages (channel, entity, enums, exception,
  features, handler, helper, print, robot, transfer, utils) into
  landlords-server/src/main/java with git mv (history preserved).
- Move common test sources (helper, robot) into landlords-server/src/test.
- Move protoc-resource (.proto files + generate.sh) into
  landlords-server/src/main/resources/proto/ for future proto-over-WS use.
- Delete landlords-common/ and protoc-resource/ dirs.
- Drop landlords-common module from root pom.xml.
- Drop landlords-common dependency from landlords-server/pom.xml.
- Simplify Dockerfile COPY lines (only server/ remains).
2026-04-10 19:03:26 +07:00
tiennm99 0b686ef0a5 refactor: delete CLI client, i18n helper, and legacy static web UI
- Remove landlords-client module (CLI client, superseded by web-client).
- Remove I18nHelper + messages_en_US.properties (only used by CLI).
- Remove SimplePrinter.printTranslate() (zero callers after CLI removal).
- Remove StaticFileHandler + static/ resources (legacy built-in web UI).
- Remove StaticFileHandler from WebsocketProxy pipeline + import.
- Drop landlords-client module from parent pom.xml.
- Drop landlords-client COPY lines from server Dockerfile.
2026-04-10 19:00:29 +07:00
tiennm99 705abcd698 docs(plans): add refactor plan to consolidate monorepo structure
6-phase serial plan: remove CLI client + static UI, merge common into
server, collapse to standalone Maven (Java 25, shade, gson, JUnit 5),
rename to com.miti99.caro.{common,server}, rename web-client to client.
2026-04-10 18:56:05 +07:00
tiennm99 ac4bb07d65 docs: reflect Docker Compose setup, GAME_OVER payload, build.yml rename 2026-04-10 18:21:14 +07:00
tiennm99 c3cd3c0f94 fix(server): drop formatted board from GAME_OVER payload to keep JSON parseable 2026-04-10 18:16:28 +07:00
tiennm99 f6b94a6af4 chore: untrack .claude/settings.local.json and add to gitignore 2026-04-10 18:07:57 +07:00
tiennm99 f66a68b590 fix(web-client): surface nickname rejection and stop scene restart loop 2026-04-10 18:03:56 +07:00
tiennm99 3615310335 fix(web-client): determine win/lose by result+piece, align nickname length to server 2026-04-10 18:02:20 +07:00
tiennm99 760ec9cb5e fix(web-client): eliminate hover preview flicker on micro mouse movement 2026-04-10 17:55:55 +07:00
tiennm99 15a88373be fix(web-client): restore canvas clicks by excluding .game-hud from overlay pointer-events 2026-04-10 17:42:12 +07:00
tiennm99 cdddbc4d4f feat: add Docker Compose setup for server and web client 2026-04-10 17:34:53 +07:00
tiennm99 58820fbb9f ci: rename Build.yml to build.yml for naming consistency 2026-04-10 17:23:55 +07:00
tiennm99 c8c2c1f896 docs: add docs-manager completion report, gitignore repomix output 2026-04-10 13:38:43 +07:00
tiennm99 ce101bd778 docs: add comprehensive project documentation
- project-overview-pdr.md: PDR, goals, features, tech stack
- system-architecture.md: diagrams, protocol, event codes, data flow
- codebase-summary.md: module breakdown, key classes, test structure
- code-standards.md: Java/JS conventions, JSDoc, Git rules
- deployment-guide.md: build, run, CI/CD, troubleshooting
- project-roadmap.md: completed phases, future ideas, decision log
2026-04-10 13:37:54 +07:00
tiennm99 e8c08139db ci: modernize GitHub Actions, add Pages deployment
- Replace outdated Build.yml (v2 actions, JDK 1.8, 3-OS matrix)
  with modern workflow (v4 actions, JDK 21, single ubuntu runner)
- Add separate web client build job
- Add deploy-pages.yml for auto-deploying web-client to GitHub Pages
  on push to master (web-client/** changes only)
- Set Vite base path to /caro/ for GitHub Pages compatibility
2026-04-10 10:29:36 +07:00
tiennm99 4bad51314d docs: comprehensive README with setup, architecture, and credits
- Full project README: quick start, game rules, project structure,
  server/client architecture diagrams, CLI/web options, protocol docs
- Web client README: setup, scripts, tech stack
- Credit to ainilili/ratel original project
2026-04-10 10:15:53 +07:00
tiennm99 22bb9c1371 feat: add Phaser 3 web client with Vite scaffold
Separate web-client/ directory with Phaser 3 + Vite + vanilla JS:
- Services: event bus, WebSocket connection (heartbeat, reconnect),
  game state, protocol constants matching server enums
- Scenes: BootScene (connect), MenuScene (DOM overlay), GameScene
  (canvas board with grid, stones, hover, click-to-move, animations)
- Objects: Board (wood grid, star points, labels), Stone (gradient
  circles with drop tween animation)
- UI: DOM overlays for nickname, lobby, PVP/PVE menus, room list,
  waiting room, game HUD, game over, toast notifications
- Audio: Web Audio API stone click + win/lose tones
- Full game flow: nickname → lobby → create/join/PVE → play → game over
2026-04-10 09:46:06 +07:00
tiennm99 cb0761bedd plan: Phaser 3 web client - 6 phases, separate deployment
Standalone Phaser 3 + Vite + vanilla JS (JSDoc) Gomoku web client.
Connects to existing server via WebSocket. DOM overlays for menus,
Canvas for board. 6 phases, ~12h effort.
2026-04-10 09:34:45 +07:00
tiennm99 77e141c017 feat: add professional web 2D Gomoku client
- Add StaticFileHandler to serve static files from Netty WS server
- Create single-page HTML with 8 screens (nickname, lobby, PVP/PVE
  menus, room list, waiting room, game, game over)
- Dark theme CSS with responsive layout and animations
- WebSocket connection with heartbeat and auto-reconnect toast
- Event bus state machine for screen transitions
- Canvas board: wood texture, grid, gradient stones, hover preview,
  last-move indicator, placement animation (easeOutBack)
- Full lobby: create/join rooms, room list, spectator mode
- Move history panel with coordinate display
- Game over with personalized win/lose/draw result
- Web Audio API sound effects (no external files needed)
- Toast notification system for errors
2026-04-10 09:03:37 +07:00
tiennm99 c8a933a786 plan: web 2D Gomoku client - 7 phases, served from Netty server
Professional vanilla JS/Canvas game client with lobby, PVP/PVE,
spectator mode, animations, and audio. No build tools required.
2026-04-10 08:37:31 +07:00
tiennm99 c2573fe31b test: add comprehensive Gomoku tests, fix redundant win check
- Fix Board.checkWin: remove redundant duplicate direction checks
- Expand GomokuHelperTest: 29 tests covering win detection (all 4 axes,
  edges, middle-piece, overline), move validation, turn management,
  game flow, utilities, and reset
- Add GomokuAITest: 8 tests covering all difficulties, win-taking,
  opponent-blocking, empty board, and fallback behavior
2026-04-09 18:04:31 +07:00
tiennm99 aaafb9509a fix: upgrade maven-surefire-plugin to 3.2.5 for JDK 21 compat 2026-04-09 17:38:03 +07:00
tiennm99 b2e489f16a refactor: final cleanup - remove dead code, fix broken refs, update README
- Remove unused currentPlayer field from Room
- Remove unused RobotEventListener interface
- Remove RobotDecisionMakers.init() calls from proxy classes
- Delete dead RegxUtils class
- Fix poker javadoc in TransferProtocolUtils
- Remove Chinese date in TimeHelper
- Update README for Gomoku project
2026-04-09 17:30:11 +07:00
tiennm99 8ed528fce6 feat(client): rewrite event handlers for Gomoku game flow
- Rewrite GAME_STARTING to display board info and prompt moves
- Rewrite GAME_OVER for Gomoku win/draw display
- Create 5 new move handlers (success, invalid, occupied, OOB, not turn)
- Rewrite GAME_WATCH for Gomoku spectator mode
- Simplify SimpleClient (remove remote server list fetching)
- Simplify settings handler (remove poker display format)
- Remove all Chinese comments from client code
2026-04-09 17:27:56 +07:00
tiennm99 13ee8ea7f3 feat(server): rewrite event handlers for Gomoku game flow
- Create ServerEventListener_CODE_GAME_MOVE with move validation,
  win detection, and inline AI response for PVE
- Rewrite GAME_STARTING for 2-player Gomoku (black/white assignment)
- Rewrite ROOM_JOIN to auto-start at 2 players
- Rewrite ROOM_CREATE_PVE for single AI opponent
- Simplify RoomClearTask (remove robot substitution logic)
- Fix ClientRole.PLAYER references in handlers
- Replace Chinese comments with English
2026-04-09 17:25:56 +07:00
tiennm99 640fce79e8 refactor: clean shared code - remove poker/score/landlord fields
- Delete ClientType enum (LANDLORD/PEASANT)
- Remove score, scoreRate, baseScore from Room
- Remove score, scoreInc, type, next, pre, round from ClientSide
- Simplify ClientRole to BLACK_PLAYER, WHITE_PLAYER, SPECTATOR
- Remove CALL_LANDLORD from ClientStatus
- Strip poker imports from SimplePrinter and ClientEventListener
- Remove initLastSellInfo() calls from client handlers
2026-04-09 17:23:20 +07:00
tiennm99 d871cc2352 refactor: delete all landlords card game code and obsolete docs
Remove ~35 files: poker entities/enums/helpers, old robot AI,
legacy server/client event handlers, Chinese i18n, docker configs,
and obsolete markdown docs.
2026-04-09 17:16:04 +07:00
tiennm99 0d71b39f60 plan: caro simplification - remove landlords code, implement gomoku flow
5-phase plan to strip card game remnants, clean enums/entities,
rewrite server/client event handlers for Gomoku, and verify build.
2026-04-09 17:10:17 +07:00
tiennm99 1ea2b3d118 feat(gomoku): init 2025-07-09 23:15:02 +07:00
tiennm99 6741b26fea chore: translate to EN 2025-07-09 21:59:01 +07:00
Nico c470c6c2f5 Update README.md 2025-01-22 10:13:23 +08:00
Nico 6bb16d8927 Update README.md 2024-12-05 11:55:08 +08:00
Nico 06f3222fd5 Update README.md 2024-12-05 11:54:26 +08:00
dependabot[bot] 36505c5a04 Bump com.google.protobuf:protobuf-java from 3.16.3 to 3.25.5 (#114)
Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.16.3 to 3.25.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.16.3...v3.25.5)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 18:14:39 +08:00
wangxiaoyan fa2a3fde0d [feature]新增国际化帮助类,添加3条国际化文本 (#113)
Co-authored-by: wangxiaoyan <phonixivan@163.com>
2024-06-22 19:05:03 +08:00
Nico 135c2e3cd7 Update README.md 2024-04-12 14:49:18 +08:00
Nico 6c0bb3c1b2 Update README.md 2024-04-11 13:42:40 +08:00
Nico c7d7eac609 Update README.md 2024-04-10 20:54:37 +08:00
Nico 325d99c7a6 Merge pull request #111 from Xuer123/patch-1
Update serverlist.json
2024-03-29 10:20:59 +08:00
xuer 13ba09ab60 Update serverlist.json
删除失效的服务器
2024-03-07 09:58:51 +08:00
Nico 9918cd08bb Merge pull request #102 from mydcwfy/test
支持地主叫分
2023-03-13 11:18:08 +08:00
mydcwfy b87e661639 在翻地主牌时显示基础倍率 2023-03-07 22:04:03 +08:00
mydcwfy ef2d9f133a 细微修改了缩进. 2023-02-28 12:55:02 +08:00
mydcwfy 783660312d add baseScore select 2023-02-28 12:01:39 +08:00
mydcwfy 018c975fb9 test 2023-02-28 11:45:41 +08:00
Nico 41029fdfcd Merge pull request #101 from Xuer123/master
Update serverlist.json
2023-02-10 14:46:31 +08:00
xuer 1d0d4bc9a9 Update serverlist.json 2023-01-14 19:13:31 +08:00
Nico 32539e6155 Merge pull request #97 from ainilili/dependabot/maven/com.google.protobuf-protobuf-java-3.16.3
Bump protobuf-java from 3.16.1 to 3.16.3
2023-01-09 11:15:04 +08:00