Launch Diarkis Server on Windows Environment
Introduction
You can also build and run the Diarkis server as a Windows binary.
This allows client engineers developing on a Windows machine to operate the Diarkis server without WSL, aiding in the efficiency of development work.
However, please note that it is not intended for use in production environments, so it should be limited to local or development environments.
Operating Environment
As of 2025-04-04, the operation is assumed in the following environments:
Windows 10/11
Go 1.22 or later
(git, if you're cloning the repository using git)
Procedure
Installing Required Tools
Install Go 1.22 or later. https://go.dev/doc/install
You can also install it using a package manager like scoop.
> scoop install go
Installing Diarkis Server Template
If Cloning the Repository
Clone https://github.com/Diarkis/diarkis-server-template.
> git clone git@github.com:Diarkis/diarkis-server-template.git
# Check out the version tag you need, if necessary
> git checkout v1.1.0-beta1
If Downloading Assets
Open https://github.com/Diarkis/diarkis-server-template/releases, download the latest version Assets, and extract and use them.
Generating the Project
Run the following command in PowerShell to generate the project.
# parameters: {project_id} {builder_token} {output} {module_name}
> .\run-mage.bat init 12345678901 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ../server_bin server_bin
project_id
: Project ID issued by our companybuilder_token
: Builder Token issued by our companyoutput
: Output destination of the generated project. Here, it is explained as../server_bin
module_name
: Module name. Here, it is explained asserver_bin
Project Initialization
Move to the directory where the project was output and execute the following command.
> cd ..\server_bin
> .\run-mage.bat init
Build
Execute the following command to build the Diarkis server binary.
> .\run-mage.bat build:local
Once the build is complete, the binary is output to the remote_bin directory.
Execution
Start mars, http, and udp each in separate PowerShell windows.
> .\run-mage.bat server mars
> .\run-mage.bat server http
> .\run-mage.bat server udp
Verification of Operation
You can verify communication using the Go test client.
# parameters: <HTTP address> <client user ID> <client key> <puffer enabled: true/false>
> .\run-mage.bat goCli 127.0.0.1:7000 user-1 key false
HTTP address: Address of the Diarkis HTTP server
client user ID: ID of the user for authentication.
client Key: Client key. Specify
key
in the development environmentpuffer enabled: Use of the Diarkis Puffer module. Specify false here
If authentication is successful, it will display as follows and enter the command waiting state.
[UID: user-1][SID(UDP): 23942c034d8d4094b09ab7219d28cebc]
> Connected UDP
To create a Room after connection, you can create it by executing the following command.
> Connected UDP
room create
Enter for which protocol to a create a Room (TCP/UDP): (Default: UDP)
Invalid input. Set to default value: UDP
Enter max members [1 - 255] (uint16): (Default: 10)
Invalid input. Set to default value: 10
Enter if allow empty (y/n): (Default: no)
Invalid input. Set to default value: false
Enter if join on creation (y/n): (Default: yes)
Invalid input. Set to default value: true
Enter TTL (seconds) [10 - 65535] (uint16): (Default: 30)
Invalid input. Set to default value: 30
Enter broadcast interval (milliseconds) (uint16): (Default: 100)
Invalid input. Set to default value: 100
# UDP RoomID is displayed on the prompt and you are in the state of joined Room
[UID: 1111][SID(UDP): c51ea8010bc44ea5b6cd6ef2bb788ad8][UDP RoomID: 580e3cef8588bd287f0000011fa5000000000000000000000000]
Supplemental Information
Test Client
In the test client, you can execute various built-in commands in addition to the room create
command to verify. Please check the following page of the help center for details.
magefile
magefile
.¥run-mage.bat
uses a Go tool called magefile internally.
Like make/rake, it is a build tool that allows build flows to be described in Go, enabling platform-independent management.
If you want to check other targets, you can do so by running it without any arguments as follows.
> .\run-mage.bat
Targets:
build:linux Build server binary for linux or container environment
build:local Build server binary for local use
build:mac Build server binary for mac use
diarkis:changeVersion Change diarkis version.
diarkis:version Print the version of diarkis currently used.
goCli Starts Go test client.
init Initialize project
puffer:clean Delete all generated protocol code files.
puffer:gen Generate go, cpp, and cs code files using puffer (Diarkis packet gen module) from packet definition written in json.
server Start a server locally: Required 1 following argument: mars http udp tcp
Last updated
Was this helpful?