https://github.com/jacadzaca/monopoly
A Monopoly (the game) server
https://github.com/jacadzaca/monopoly
game kotlin monopoly-game server vertx
Last synced: 5 months ago
JSON representation
A Monopoly (the game) server
- Host: GitHub
- URL: https://github.com/jacadzaca/monopoly
- Owner: jacadzaca
- License: gpl-3.0
- Created: 2020-06-26T07:16:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-25T22:51:10.000Z (over 4 years ago)
- Last Synced: 2023-09-04T13:25:02.315Z (over 2 years ago)
- Topics: game, kotlin, monopoly-game, server, vertx
- Language: Kotlin
- Homepage: https://jacadzaca.github.io/blog/monopoly.html
- Size: 845 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## About
This repository contains code for a simple [Monopoly](https://en.wikipedia.org/wiki/Monopoly_(game\)) server. The server's written in [Kotlin](https://kotlinlang.org/) using the [vert.x](https://vertx.io/) framework.
## What's missing?
- a sane looking frontend
- a (Go to jail)/Jail tile
- the free parking tile
- the chance/Community Chest cards and tiles
- train stations
- multiple rooms support (not as an big of an issues as it sounds)
- some win condition; the game will go on as long as their is someone who is not bankrupt
## Building
```bash
git clone https://github.com/jacadzaca/monopoly.git && cd monopoly && ./gradlew shadowJar
```
## Running
```bash
java -jar build/libs/monopoly-1.0.0-SNAPSHOT.jar run com.jacadzaca.monopoly.HttpServer --launcher-class=io.vertx.core.Launcher -Dstarting_balance=2000
```
## The 'Protocol'
See [GameStateController.js](https://github.com/jacadzaca/monopoly/blob/master/resources/GameStateController.js) for an example implementation and [Delta.kt](https://github.com/jacadzaca/monopoly/blob/master/src/main/kotlin/com/jacadzaca/monopoly/gamelogic/Delta.kt) for the 'protocol definition'
## The program's flow
First there is a request that's intercepted by the [Web socket server](https://github.com/jacadzaca/monopoly/blob/master/src/main/kotlin/com/jacadzaca/monopoly/WebSocketGameServer.kt), validate by one of the [validators](https://github.com/jacadzaca/monopoly/tree/master/src/main/kotlin/com/jacadzaca/monopoly/requests/validators) and then either converted into an error message or an [command](https://github.com/jacadzaca/monopoly/tree/master/src/main/kotlin/com/jacadzaca/monopoly/gamelogic/commands).
The command is then executed and a [change](https://github.com/jacadzaca/monopoly/blob/master/src/main/kotlin/com/jacadzaca/monopoly/gamelogic/Delta.kt) [is propagated](https://github.com/jacadzaca/monopoly/blob/master/src/main/kotlin/com/jacadzaca/monopoly/gameroom/GameRoomVerticle.kt).
## Disclaimer
This project is in no way affiliated with, authorized, maintained or endorsed by Hasbro or any of its affiliates or subsidiaries. This is an independent and unofficial project. Use at your own risk.
The code is licensed under an GPL license. Refer to the [LICENSE](https://raw.githubusercontent.com/jacadzaca/monopoly/master/LICENSE) file for more information.