-
Notifications
You must be signed in to change notification settings - Fork 4
How to build the game and setup local server (for testing development)
Building the game from source code should be quite easy thanks to xmake.
- Download xmake. On Windows the easiest way is to download and execute the xmake installer from the releases (called
xmake-vX.Y.Z.win64.exe
), you can also check the installation manual. - Clone this repository, using a git client (GitHub Desktop, Fork, Git Kraken, ...) or the command-line (
git clone https://github.com/DigitalPulseSoftware/ThisSpaceOfMine.git
). - Open a shell in the cloned repository and run:
-
If you want to compile the game from the command-line:
xmake
, it will ask you to install the dependencies, answery
. - If you want to generate a project:
- Visual Studio:
xmake project -k vsxmake
- CMakeLists.txt (which you can open in CLion and more):
xmake project -k cmake
- Makefile:
xmake project -k make
- Ninja:
xmake project -k ninja
- XCode:
xmake project -k xcode
-
If you want to compile the game from the command-line:
- Download the assets, the latest assets are available in the nightly release (assets.zip), extract them in your game folder (overwrite the assets folder).
- (Optional) Copy and rename the
gameconfig.lua.default
file togameconfig.lua
(to use a custom API or a custom player token for testing). - You should be able to run the game from xmake (
xmake run TSOMGame
) or from the generated project.
If you only want to make client changes you're done, but if you need to setup a server keep reading.
This Space of Mine was designed with multiple servers and storage solution in mind. However this can be a burden when you simply want to test a server change or develop for the game without needing to setup your own API instance.
The current dev branch has a solution for this (note: the current released version, 0.8.2 doesn't have support for that) : developer tokens.
Developer tokens are a special kind of connection token anyone can obtain from the official TSOM API, giving administrator privileges and the ability to use your player data (saved spaceships) from the official server on your own local server.
However, to prevent abuses, developer tokens are read-only and any change you make to your player will not persist in the player database.
Theses tokens are useful for people wanting to test or develop on the current git version.
Note that a developer token will redirect you to localhost automatically and won't allow you to connect to the official server.
- Copy and rename
serverconfig.lua.default
file toserverconfig.lua
(same forgameconfig.lua
if you didn't do it) - Edit
serverconfig.lua
, set theConnectionToken.EncryptionKey
config to"Unsecure+Developer+Token+Giving+Admin+Perms="
, for example:
ConnectionToken = {
EncryptionKey = "Unsecure+Developer+Token+Giving+Admin+Perms="
}
- Edit
gameconfig.lua
, set theApi.DevMode
config totrue
, for example:
Api = {
DevMode = true,
Url = "https://tsom-api.digitalpulse.software"
}
- Start the server using either the generated project or xmake (
xmake run TSOMServer
). - Start the game using either the generated project or xmake (
xmake run TSOMGame
). - Simply play from the game, you should get a developer token which will automatically redirect you to your localhost server.
- Profit.
Simply execute xmake install -o target_folder
, xmake will automatically copy all required .dll and folders inside target_folder/bin folder.