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
2018-11-16 11:04:05 +08:00
2018-11-12 15:30:27 +08:00
2018-10-16 20:00:52 +08:00
2025-07-09 23:15:02 +07:00

Ratel

GitHub forks GitHub release (latest by date) GitHub all releases GitHub stars GitHub license Build ratel(Java with Maven) Docker Image Version (latest by date)

Gomoku Game Server-Client

Introduction

Command-line Gomoku (Five-in-a-Row) game based on Netty, converted from the original Landlords game~

Installation

First download and package, ensure maven and JRE environment are installed locally:

git clone https://github.com/ainilili/ratel.git
cd ratel
mvn install package

Next, run the Jar packages in the target folders of landlords-client and landlords-server respectively:

java -jar landlords-server/target/landlords-server-#{version}.jar -p 1024
java -jar landlords-client/target/landlords-client-#{version}.jar -p 1024 -h 127.0.0.1

The client can also run directly, the program will automatically pull public servers from Serverlist:

java -jar landlords-client/target/landlords-client-#{version}.jar

Note, please replace #{version} with the current running version in actual execution!

Gameplay Introduction

Play Gomoku (Five-in-a-Row) on a 15x15 board!

demo

Game Rules

  • Two players take turns placing black and white pieces on a 15x15 board
  • The first player uses black pieces, the second player uses white pieces
  • The goal is to be the first to form an unbroken line of five pieces horizontally, vertically, or diagonally
  • The game ends when one player achieves five in a row or the board is full (draw)

Game Commands

Board positions are specified as: row,col (e.g., 7,7 for center)

Examples:

  • Make a move: 7,7 (place piece at row 7, column 7)
  • Show board: board or b
  • Show move history: history or h
  • Pass turn: pass or p
  • Exit: exit or e
  • Reset game: reset or r (room owner only)

Protocol Support

  • TCP
  • Websocket

Websocket protocol address is ws://host:port/ratel, Websocket port needs to be original port plus 1 (if tcp port is 1024, then ws port should be 1025)

Game Features

  • Support for Player vs Player (PVP) mode
  • Support for Player vs AI (PVE) mode
  • Real-time spectator mode
  • Move history tracking
  • Automatic win detection

Ecosystem

Tutorial

Changelog

Plans

  • Support for advanced difficulty AI
  • Tournament mode support
  • Ranking system
  • Replay system

More

  • Serverlist.json is the current server list. If your server is deployed with the current latest version of the server and shared with everyone, you can submit it to us through PR!
  • If you want to contribute code, PRs are very welcome, we will merge excellent code.
  • If you found a bug, Issues are very welcome.
  • Welcome to extend clients in other languages.
  • Contact us by email at ainililia@163.com.
S
Description
A caro server, based on [ratel](https://github.com/ainilili/ratel)
Readme Apache-2.0
6.5 MiB
Languages
JavaScript 84.1%
Java 14.6%
HTML 1.1%
Dockerfile 0.2%