{"id":30852614,"url":"https://github.com/kigster/gomoku-cpp-client-server","last_synced_at":"2026-05-15T12:02:16.738Z","repository":{"id":306016005,"uuid":"1021269494","full_name":"kigster/gomoku-cpp-client-server","owner":"kigster","description":"Client/Server Gomoku implementation based on the ANSI C version","archived":false,"fork":false,"pushed_at":"2025-08-18T20:10:22.000Z","size":2473,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T00:25:04.225Z","etag":null,"topics":["client-server","gomoku","http","json","websockets"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kigster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-17T06:38:40.000Z","updated_at":"2025-08-18T20:10:25.000Z","dependencies_parsed_at":"2025-07-23T07:51:59.052Z","dependency_job_id":"f43f35c6-7b32-44bf-9e59-2b5139a5ac28","html_url":"https://github.com/kigster/gomoku-cpp-client-server","commit_stats":null,"previous_names":["kigster/gomoku-cpp-client-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kigster/gomoku-cpp-client-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kigster%2Fgomoku-cpp-client-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kigster%2Fgomoku-cpp-client-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kigster%2Fgomoku-cpp-client-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kigster%2Fgomoku-cpp-client-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kigster","download_url":"https://codeload.github.com/kigster/gomoku-cpp-client-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kigster%2Fgomoku-cpp-client-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33066132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client-server","gomoku","http","json","websockets"],"created_at":"2025-09-07T08:06:35.454Z","updated_at":"2026-05-15T12:02:16.698Z","avatar_url":"https://github.com/kigster.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gomoku C++ Client-Server Architecture\n\nA modern C++ implementation of the Gomoku game with a client-server architecture, featuring WebSocket communication, AI optimization, and a clean separation of concerns.\n\n## Architecture Overview\n\nThis project has been refactored from a monolithic C application into a modern C++ client-server architecture with the following components:\n\n### Shared Library (`libgomoku_shared.so`)\n- **Board**: Game board management and validation\n- **GameState**: Complete game state management\n- **AIEngine**: Advanced AI with optimizations (transposition tables, killer moves, etc.)\n- **JSONSerializer**: JSON serialization/deserialization for network communication\n\n### Server (`gomoku-server`)\n- **HTTPServer**: HTTP request handling and session management\n- **WebSocketHandler**: Real-time WebSocket communication\n- **GameSession**: Individual game session management\n- **RedisPublisher**: Optional Redis integration for pub/sub\n\n### Client (`gomoku-client`)\n- **TerminalUI**: Console-based user interface\n- **WebSocketClient**: WebSocket client for real-time updates\n- **HTTPClient**: HTTP client for game state synchronization\n- **GameController**: Client-side game orchestration\n\n## Features\n\n- **Modern C++20**: Leverages latest C++ features and best practices\n- **Single Responsibility Principle**: Each class has a focused, well-defined purpose\n- **Real-time Communication**: WebSocket-based real-time updates\n- **Advanced AI**: Optimized AI engine with multiple search optimizations\n- **Stateless Server**: Server maintains minimal state, relying on client-provided game state\n- **Cross-platform**: Works on Linux, macOS, and Windows\n- **Optional Redis**: Can use Redis for additional pub/sub capabilities\n\n## Building\n\n### Prerequisites\n\nInstall the required dependencies:\n\n**Ubuntu/Debian:**\n```bash\nmake install-deps\n```\n\n**macOS:**\n```bash\nmake install-deps-macos\n```\n\n**CentOS/RHEL/Fedora:**\n```bash\nmake install-deps-rhel\n```\n\n### Build Options\n\n**Using Make (Recommended):**\n```bash\n# Build both server and client\nmake\n\n# Build with debug flags\nmake debug\n\n# Enable Redis support\nUSE_REDIS=1 make\n```\n\n**Using CMake:**\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n## Running\n\n### Start the Server\n```bash\n# Using Make\nmake run-server\n\n# Or directly\n./bin/gomoku-server -p 3030 -b 0.0.0.0\n```\n\n### Start the Client\n```bash\n# Using Make\nmake run-client\n\n# Or directly\n./bin/gomoku-client -h localhost -p 3030 -l hard\n```\n\n## Game Flow\n\n1. **Client starts**: Connects to server via HTTP and WebSocket\n2. **Game initialization**: Client sends game configuration to server\n3. **Human move**: Client sends move via HTTP POST to `/games/gomoku/play`\n4. **AI thinking**: Server processes move and starts AI calculation\n5. **Real-time updates**: Server sends AI progress via WebSocket\n6. **AI move**: Server sends completed AI move via WebSocket\n7. **Game continues**: Process repeats until game ends\n\n## API Endpoints\n\n### HTTP Endpoints\n\n- `POST /games/gomoku/start` - Start a new game\n- `POST /games/gomoku/play` - Make a move\n\n### WebSocket Messages\n\n- `MOVE_MADE` - Move completed notification\n- `AI_PROGRESS` - AI thinking progress update\n- `GAME_OVER` - Game completion notification\n- `ERROR` - Error notification\n- `PING` - Keep-alive ping\n\n## Configuration\n\n### Server Configuration\n- `-p, --port`: Server port (default: 3030)\n- `-b, --bind`: Bind address (default: 0.0.0.0)\n- `-v, --verbose`: Enable verbose logging\n\n### Client Configuration\n- `-h, --host`: Server host (default: localhost)\n- `-p, --port`: Server port (default: 3030)\n- `-l, --level`: AI difficulty level (easy, medium, hard)\n- `-t, --timeout`: Move timeout in seconds\n- `-s, --size`: Board size (15 or 19)\n\n## JSON Format\n\n### Game State Data\n```json\n{\n  \"move\": {\n    \"game_id\": \"uuid\",\n    \"session_id\": \"uuid\",\n    \"game_type\": \"gomoku\",\n    \"name\": \"Gomoku\",\n    \"status\": \"in_progress\",\n    \"players\": {\n      \"x\": {\"name\": \"Human\", \"type\": \"human\"},\n      \"o\": {\"name\": \"Computer\", \"type\": \"ai\"}\n    },\n    \"depth\": 5,\n    \"moves\": [\n      {\"x\": [10, 10], \"timing\": 34.34},\n      {\"o\": [11, 12], \"timing\": 0.00, \"moves_evaluated\": 1}\n    ],\n    \"current_player\": \"o\"\n  }\n}\n```\n\n## AI Optimizations\n\nThe AI engine includes several advanced optimizations:\n\n- **Transposition Tables**: Cache evaluated positions\n- **Killer Moves**: Prioritize moves that caused beta cutoffs\n- **Iterative Deepening**: Start with shallow searches and deepen\n- **Alpha-Beta Pruning**: Efficient search space reduction\n- **Move Ordering**: Sort moves for better pruning\n- **Threat-Space Search**: Focus on threatening positions\n- **Null-Move Pruning**: Skip moves to detect zugzwang\n\n## Development\n\n### Project Structure\n```\ngomoku-cpp/\n├── include/           # Header files\n│   ├── shared/       # Shared library headers\n│   ├── server/       # Server headers\n│   └── client/       # Client headers\n├── src/              # Source files\n│   ├── shared/       # Shared library implementation\n│   ├── server/       # Server implementation\n│   └── client/       # Client implementation\n├── tests/            # Test files\n├── build/            # Build artifacts\n├── bin/              # Executables\n├── lib/              # Libraries\n├── CMakeLists.txt    # CMake configuration\n└── Makefile          # Make configuration\n```\n\n### Testing\n```bash\n# Run tests (when implemented)\nmake test\n```\n\n### Code Style\n- Follow modern C++ best practices\n- Use RAII and smart pointers\n- Prefer const correctness\n- Use meaningful names and documentation\n- Follow the Single Responsibility Principle\n\n## Performance\n\nThe AI engine is optimized for:\n- **Search Depth**: Up to 8 plies in reasonable time\n- **Move Evaluation**: 1000+ positions per second\n- **Memory Usage**: Efficient transposition table management\n- **Network Latency**: Minimal overhead for real-time play\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes following the coding standards\n4. Add tests for new functionality\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- **libwebsockets**: WebSocket library for C/C++\n- **jsoncpp**: JSON parsing and generation\n- **hiredis**: Redis client library (optional)\n- **Google Test**: Testing framework\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkigster%2Fgomoku-cpp-client-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkigster%2Fgomoku-cpp-client-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkigster%2Fgomoku-cpp-client-server/lists"}