Skip to content

Releases: JohnFromSpace/Chess

v0.1.2 - MVC and Repositories Implementations

30 Nov 22:41

Choose a tag to compare

Chess v0.1.2 - Major Architecture Refactor (MVC, Rules Engine, Repositories)

This release delivers a fully structured and maintainable architecture, replacing the old monolithic approach with clean modules, repositories, and a Rules Engine. It significantly improves client design, server logic, file storage, and overall extensibility.

What's New

1. MVC Client Architecture

  • Introduced Model-View-Controller separation.
  • Added ClientModel, ConsoleView, and ClientController.
  • No more static or procedural code.
  • User messages now display cleanly instead of raw JSON.

2. RulesEngine - Clean Chess Logic

  • All piece movement rules, check/checkmate, and stalemate detection moved into a dedicated RulesEngine.
  • GameCoordinator is now much lighter and easier to maintain.
  • Prepares the project for castling, en passant, and promotion.

3. Repositories & File Storage Overhaul

  • Added UserRepository and GameRepository.
  • FileStores now stores each game in its own file.
  • Greatly reduced lock contention and improved performance.
  • All I/O operations now include proper error handling.

4. Message Abstraction Layer

  • Introduced a Message class (type, corrId, payload).
  • Only one serializer/deserializer interacts with JSON.
  • The protocol can now be switched to XML/YAML/Binary without refactoring game logic.

5. GameCoordinator Improvements

  • Uses the RulesEngine instead of huge embedded move logic.
  • Clearer responsibilities, smaller synchronized sections.
  • Improved stats updating, rating updates, and game lifecycle management.

6. Statistics, Ratings & Game History

  • Added win/loss/draw tracking.
  • Implemented ELO rating (K=32).
  • Game history is now stored and can be replayed.
  • Added menu options to list games and replay past matches.

General Cleanup

  • Added deterministic game file naming.
  • Removed dead code and unused methods.
  • Improved error messages and console formatting.
  • Better separation of concerns across the entire codebase.

Artifacts

Downloadables included in this release:

  • Server JAR: server/target/server-1.0.jar
  • Client JAR: client/target/client-1.0.jar

Next Steps

  • Castling
  • En passant
  • Pawn promotion
  • Optional GUI/Web interface thanks to MVC design

v0.1.1 - First Playable Console Release

22 Nov 21:39

Choose a tag to compare

Highlights

  • Console-based client–server chess
  • Multiple users: register + login with JSON file persistence
  • Server-side move validation for all basic piece moves
  • Check, checkmate, stalemate detection
  • Timed games with base time + increment
  • Game history stored and viewable from client
  • In-client replay viewer (replays moves on a local board)
  • User statistics:
    • games played / won / drawn
    • basic rating
  • Elo rating updates after each finished game

How to run

Server

# In project root
mvn -pl server exec:java
# or run ServerMain from IntelliJ

Client

# In a separate terminal
mvn -pl client exec:java
# or run ClientMain from IntelliJ

You need two client instances (two terminals or two IntelliJ runs):

  • Register/login as two different users.
  • Each selects "Request game".
  • Play using moves like e2e4, g8f6, etc. (long algebraic notation).