Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
# Hosting a Multiplayer server
Due to certain limitations on Dropbox's API, with the current influx of players, we've many times reached the point that Dropbox has become unavailable.
2022-06-02 02:40:20 +07:00
Therefore, you can now host your own Unciv server on any computer that can run Java programs.
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
This guide is written for people with a moderate amount of technical knowledge about computer software and who are able to search the web to learn stuff they might not know. If you're completely new to this, you'll likely not be able to follow without some larger time investment to learn.
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
If you're proficient in server hosting, there's another how-to for you at the end.
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
## How To
2022-03-31 14:47:58 +07:00
2022-06-02 02:40:20 +07:00
Before starting, you must have a Java JDK installed. You'll also have to download the [latest UncivServer.jar ](https://github.com/yairm210/Unciv/releases/latest/download/UncivServer.jar ).
2022-03-28 21:34:08 +07:00
2022-06-02 02:40:20 +07:00
From the directory where the `UncivServer.jar` file is located, create a folder named "MultiplayerFiles", open a terminal (in Windows, Shift+RightClick in the folder) and run the following command in the directory:
`java -jar UncivServer.jar`
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
Your server has now started!
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
To check if everything works, you can start Unciv on the same computer, go to "Options > Multiplayer", then enter `http://localhost` as the "Server address" and click "Check connection to server". You should now get a "Success!" result, which means it's working!
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
To connect with other devices, you'll need the port (default 80) the server is running on to be visible externally (port forwarding) and know your external IP-address.
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
On the other device, enter the URL to your server, click 'check connection' from the new device, and if you get the same "Success!" result - congratulations, you're connected to the same server and can start a multiplayer game!
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
Please note:
* Devices *not* connected to the same server will *not* be able to participate in multiplayer games together
* In many places, your external IP address changes periodically. If that is the case, you either have to update the IP all the time or use something like a dynamic DNS service.
Unciv server (#6384)
* Background implementation for Unciv server with ktor.
Server ip in settings, able to copy your own ip and copy ip from clipboard for easy sharing, created stub for the client-server data transfer. No actual data storage or server implementation.
* Unciv server round 2 - implementing crud for files and it works!
metadata seems to only be in use for mutex, which is currently unused
That's all for today
* When starting a new multiplayer game the files are correctly saved in the server, and the server can return the files, but the function in the game to retrieve the game info is non-blocking so it doesn't work. Still, progress!
* Changed the Gdx http to basic Java http, as used for Dropbox, and now everything works!!!!
* Documentation for running and using the server
* Better texts, translations, etc
* Trog is right this should be a PUT not POST
2022-03-22 02:05:02 +07:00
2022-06-02 02:40:20 +07:00
## How To for people with hosting experience
2022-05-03 11:52:59 +07:00
2022-06-02 02:40:20 +07:00
* Have a Java JDK installed
* Download the [latest UncivServer.jar ](https://github.com/yairm210/Unciv/releases/latest/download/UncivServer.jar ) (can also use that link to automatically update probably)
* See options with `java -jar UncivServer.jar --help`
* The server will run on a specified port (`-p`, default `80` ), writing files in a folder (`-f`, default `./MultiplayerGames/` ), so it needs appropriate permissions.
* Run it: `java -jar UncivServer.jar -p 8080 -f /some/folder/`
* It basically just does simple file storage over HTTP.
* Files are not cleaned automatically if a game ends or is deleted on the client-side