Android multiplayer server for Unciv
This app has been created from the need of an Unciv multiplayer server when no internet connectivity is available (e.g. travelling abroad on aeroplanes, trains or on the road).
Usage
The idea is to create a local network using the Wi-Fi hotspot capability of your Android phone and to host the server using this application. It implements a basic static HTTP server with a dedicated health endpoint which is used by Unciv to synchronize multiplayer save games.
Instructions
- Create a local hotspot or connect to an open Wi-Fi access point (no internet connectivity is required).
- Ensure that the other players connect as well and can ping your device. The clients in the network may be isolated when using a public access point. If they cannot ping your device, use a hotspot instead.
- Create a folder where the save games will be stored using a file explorer.
- Start the app and select a folder.
- Copy the server's endpoint by tapping on the value of the URL field and send this URL to the other players.
- Open Unciv and go to
Options>Multiplayer>Server addressand enter http://localhost:8080 if you are host. The other players must enter URL displayed in the app.
Build
The application has been generated using Android Studio and can be built using the auto-generated wrapper gradlew found in the root of the repo.
Make sure that ANDROID_HOME points to the Android SDK folder (usually ${HOME}/Android/Sdk).
| Target | Command |
|---|---|
| Debug | ./gradlew assembleDebug |
| Release | ./gradlew assembleRelease |
FAQ
The other players can no longer join the game after the host switched to a different network / restarted the hotspot
The hosts IP address may have changed as the app only displays the IP when the server was started. In this case, restart the server and send then the new IP.