An open API service indexing awesome lists of open source software.

https://github.com/openlegends/server

OpenLegends Game Server
https://github.com/openlegends/server

api diesel game game-server openlegends rust server socket sqlite tls

Last synced: 3 months ago
JSON representation

OpenLegends Game Server

Awesome Lists containing this project

README

        

# OpenLegends Game Server

![Build](https://github.com/openlegends/server/actions/workflows/build.yml/badge.svg)
[![Dependencies](https://deps.rs/repo/github/openlegends/server/status.svg)](https://deps.rs/repo/github/openlegends/server)
[![crates.io](https://img.shields.io/crates/v/openlegends-server.svg)](https://crates.io/crates/openlegends-server)

A lightweight, power-efficient server with in-memory session storage for playing multiplayer games using the local [Asset API](https://github.com/openlegends/asset)

> [!IMPORTANT]
> Project in development!
>

## Install

### Dependencies

Debian


sudo apt install curl

Fedora


sudo dnf install curl

### Rust

Use [rustup](https://rustup.rs) installer to setup latest Rust environment:

``` bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

### Server

``` bash
cargo install openlegends-server
```

## Launch

### Arguments

* `--asset`, `-a` required, game [Asset](https://github.com/openlegends/asset)
* `--bind`, `-b` required, bind server `host:port` to listen incoming connections on it
* `--log`, `-l` optional, log level (`ednw` by default):
* `e` error
* `d` debug
* `n` notice
* `w` warning

### Start

``` bash
openlegends-server --bind 127.0.0.1:4321 --asset test
```

Test connection


nc 127.0.0.1 4321

Create systemd service

1. Install openlegends-server by copy the binary compiled into the native system apps destination:

``` bash
cp /home/openlegends/.cargo/bin/openlegends-server /usr/local/bin
```

2. Create configuration file:

``` openlegends-server.service
# /etc/systemd/system/openlegends-server.service

[Unit]
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=openlegends
Group=openlegends
ExecStart=/usr/local/bin/openlegends-server -b 127.0.0.1:4321 -a test

[Install]
WantedBy=multi-user.target
```

3. Run in priority:

* `systemctl daemon-reload` - reload systemd configuration
* `systemctl enable openlegends-server` - enable new service
* `systemctl start openlegends-server` - start the process
* `systemctl status openlegends-server` - check process launched

## See also

* [OpenLegends Client Library](https://github.com/openlegends/client)