Added static /launcher/client path for client download for Launcher 1.2.0

This commit is contained in:
Junior 2024-01-04 23:29:55 -03:00
parent de6e509bcc
commit 04aabcc858
6 changed files with 15 additions and 11 deletions

View file

@ -5,6 +5,9 @@ RustyHearts-API is a Node.js-based REST API that enables authentication, billing
The API consists of three independent servers (Auth API, Billing API and Launcher API) running on different ports. The API consists of three independent servers (Auth API, Billing API and Launcher API) running on different ports.
### Preview
![image](api.png)
### API region support ### API region support
The api currently only support the **usa** (PWE) region. The api currently only support the **usa** (PWE) region.
@ -17,13 +20,13 @@ The api currently only support the **usa** (PWE) region.
- The Launcher API is a web server intended to handle the client connection to the gateserver and for the [Rusty Hearts Launcher](https://github.com/JuniorDark/RustyHearts-Launcher), which handles registration, login, client updates, and processing static elements (public directory). This API must be accessible from the outside and proxied by Nginx or bound to an external IP. - The Launcher API is a web server intended to handle the client connection to the gateserver and for the [Rusty Hearts Launcher](https://github.com/JuniorDark/RustyHearts-Launcher), which handles registration, login, client updates, and processing static elements (public directory). This API must be accessible from the outside and proxied by Nginx or bound to an external IP.
## Table of Contents ## Table of Contents
* [Preview](#preview)
* [Public folder](#public-folder-description) * [Public folder](#public-folder-description)
* [Requirements](#requirements) * [Requirements](#requirements)
* [Deployment](#deployment) * [Deployment](#deployment)
* [Basic Installation](#basic-installation) * [Basic Installation](#basic-installation)
* [.env file setup](#env-file-setup) * [.env file setup](#env-file-setup)
* [Available endpoints](#available-endpoints) * [Available endpoints](#available-endpoints)
* [Preview](#preview)
* [License](#license) * [License](#license)
* [Contributing](#contributing) * [Contributing](#contributing)
* [FAQ](#faq) * [FAQ](#faq)
@ -35,6 +38,11 @@ The api currently only support the **usa** (PWE) region.
In order for the launcher to automatically update itself, you need to use the launcher_info.ini in the `launcher_update` directory of the api. This file specifies the version of the launcher. After each update of the launcher, you need to change the version in the ini, as well in the launcher executable file. In order for the launcher to automatically update itself, you need to use the launcher_info.ini in the `launcher_update` directory of the api. This file specifies the version of the launcher. After each update of the launcher, you need to change the version in the ini, as well in the launcher executable file.
### Client download
In order to create client download, you need to use the `client` directory of the api.
The tool for creating the client files is available in the repository: https://github.com/JuniorDark/RustyHearts-MIPTool
### Client patch ### Client patch
In order to create client patches, you need to use the `patch` directory of the api. In order to create client patches, you need to use the `patch` directory of the api.
@ -126,9 +134,6 @@ Endpoint | Method | Arguments | Description
/launcherApi/launcherUpdater/updateLauncherVersion | POST | version | Download the specified launcher versionr from the launcher_update folder. /launcherApi/launcherUpdater/updateLauncherVersion | POST | version | Download the specified launcher versionr from the launcher_update folder.
/serverApi/onlineCount | GET | | Returns the number of online players. Returns a JSON object with the count. /serverApi/onlineCount | GET | | Returns the number of online players. Returns a JSON object with the count.
### Preview
![image](api.png)
## License ## License
This project is licensed under the terms found in [`LICENSE-0BSD`](LICENSE). This project is licensed under the terms found in [`LICENSE-0BSD`](LICENSE).
@ -147,6 +152,4 @@ Contributions from the community are welcome! If you encounter a bug or have a f
If you need help with the api, please submit an issue on GitHub. If you need help with the api, please submit an issue on GitHub.
## Roadmap ## Roadmap
* Add support for client download/repair
* Improve performance and stability
* Add support for other regions * Add support for other regions

View file

@ -1,6 +1,6 @@
{ {
"name": "RustyHearts-API", "name": "RustyHearts-API",
"version": "1.1.0", "version": "1.2.0",
"description": "Rusty Hearts REST API implementation on node.js", "description": "Rusty Hearts REST API implementation on node.js",
"main": "src/app.js", "main": "src/app.js",
"scripts": { "scripts": {

View file

@ -1,2 +1,2 @@
[LAUNCHER] [LAUNCHER]
version=1.1.0 version=1.2.0

View file

@ -83,6 +83,7 @@ app.get('/favicon.ico', (req, res) => {
app.use('/launcher/news/images', express.static(path.join(__dirname, '../public/launcher/news/images'))); app.use('/launcher/news/images', express.static(path.join(__dirname, '../public/launcher/news/images')));
app.use('/launcher/news', express.static(path.join(__dirname, '../public/launcher/news'))); app.use('/launcher/news', express.static(path.join(__dirname, '../public/launcher/news')));
app.use('/launcher/patch', express.static(path.join(__dirname, '../public/launcher/patch'))); app.use('/launcher/patch', express.static(path.join(__dirname, '../public/launcher/patch')));
app.use('/launcher/client', express.static(path.join(__dirname, '../public/launcher/client')));
// Set up error handling middleware // Set up error handling middleware
@ -123,7 +124,7 @@ const port = process.env.PORT || 3000;
const publicIP = process.env.PUBLIC_IP || '0.0.0.0'; const publicIP = process.env.PUBLIC_IP || '0.0.0.0';
console.log('--------------------------------------------------'); console.log('--------------------------------------------------');
console.log(`Rusty Hearts API Version: 1.1`) console.log(`Rusty Hearts API Version: 1.2`)
console.log(`Node.js Version: ${nodeVersion}`); console.log(`Node.js Version: ${nodeVersion}`);
console.log(`Timezone: ${timezone} (${offsetString})`); console.log(`Timezone: ${timezone} (${offsetString})`);
console.log('Memory Usage:'); console.log('Memory Usage:');
@ -150,8 +151,8 @@ function logMemoryUsage() {
console.log('--------------------------------------------------'); console.log('--------------------------------------------------');
} }
// Log memory usage every 10 minutes (600000 milliseconds) // Log memory usage every 30 minutes (1800000 milliseconds)
const memoryLogInterval = 600000; const memoryLogInterval = 1800000;
setInterval(logMemoryUsage, memoryLogInterval); setInterval(logMemoryUsage, memoryLogInterval);