This repository contains the backend API server for the Blade & Soul private game server. The API facilitates user registration, login, profile management, virtual currency transactions, and character management. It integrates multiple databases and provides secure and scalable routes to handle user data efficiently. Currently, it is designed only for the 2020 version of the game.
This API server has been tested on the server found at RaGEZONE, ensuring compatibility and performance within that specific environment.
- Key Features
- Requirements
- Installation
- API Endpoints
- Environment Variables
- Dependencies
- B&S Game Launcher
- License
- Discussion
- Additions / Fixes
- User Authentication: Secure user registration and login with email and password validation.
- Profile Management: Full support for viewing and updating user profiles, including character data and account information.
- Character Management: Tools for editing character details like faction, race, job, and other attributes.
- Virtual Currency Transactions: APIs to manage and add in-game currency to user accounts.
- Database Integration: Utilizes Microsoft SQL Server for managing user accounts, in-game data, and virtual currencies.
- Logging: Optional logging feature, controlled through environment variables, allows detailed logging to console for debugging and monitoring.
- Scalability: Designed to support a large number of users and database operations, ensuring performance and security for a Blade & Soul private server.
- Coupon System: Manage promotional campaigns, generate and redeem coupons, and deliver rewards directly to users' in-game mail.
- Node.js (v14.0.0 or higher)
- Microsoft SQL Server (no lower than version 2017) for handling game-related data
- npm (Node Package Manager)
To set up the API server, follow these steps:
-
Clone the repository:
git clone https://github.com/war100ck/Server-Api-BnS-Server.git cd Server-Api-BnS-Server -
Run the Database Setup Script:
Before installing the server, make sure to run the
add_column_webadmin.batscript, which adds theWebsitePasswordandadmincolumn to theUserstable in thePlatformAcctDbdatabase.To run the script, use the following command (on Windows):
add_column_webadmin.bat
This script will:
- Check if the
WebsitePasswordandadmincolumn exists in theUserstable of thePlatformAcctDbdatabase. - If the column does not exist, it will add it.
- Confirm success or report any issues encountered during the operation.
- Check if the
-
Run the Installation Script:
After running the database setup script, you can proceed to install the server. Use the provided
Install.batscript to automatically create necessary configuration files and install all required dependencies.To run the script, use the following command (on Windows):
Install.bat
This script will:
- Generate a
package.jsonfile with all the necessary npm dependencies. - Create
Start_Api.batfor easy server startup. - Create the
.envfile with essential configuration for connecting to the game databases. - Install the required npm packages:
express,mssql,dotenv,axios,cors,ejs,argon2,bcrypt,chalk,express-session,mysql2,os-utils,pidusage.
- Generate a
-
Configuration:
After running the installation script, the
.envfile will be generated with default configurations. Make sure to adjust database credentials and other environment variables if needed:PLATFORM_ACCT_DB_USERPLATFORM_ACCT_DB_PASSWORDPLATFORM_ACCT_DB_SERVERBLGAME_DB_USERSERVICE_URL
These variables are used to connect to the Blade & Soul platform accounts, game data, and other services.
-
Start the API Server:
Once everything is installed, you can start the server using the provided
Start_Api.batfile or manually via:npm start
The server will be accessible at
http://localhost:3000. -
Admin Panel:
The admin panel for managing game-related data can be accessed via the following URL:
http://<server_address>:3000/admin
Replace
<server_address>with the actual address of your server.
-
Initial Administrator Setup:
The first web administrator is assigned directly in the database:Database:
PlatformAcctDb
Table:Users
Column:admin(type:bit)Set the value of the
admincolumn to1for the corresponding user to grant them administrative privileges. -
Adding New Administrators:
Once the initial web administrator is assigned, they gain access to special features in the admin panel. This includes the ability to add or remove other administrators directly through the website, ensuring efficient and secure delegation of administrative tasks.
-
GET /check-availability: Checks if a username or email is available for registration.
- Query parameters:
account_name: The desired username.email: The user's email.
- Query parameters:
-
POST /signin: Authenticates a user based on their email and password.
- Body parameters:
signin_email: The user's email.signin_password: The user's password.
- Body parameters:
- GET /admin: Provides access to the administrative panel, where the following information is displayed:
- List of all users from the
PlatformAcctDbdatabase. - The total number of characters created in the game from the
BlGamedatabase. - The total number of deleted characters from the game (
deletion = 1in theCreaturePropertytable).
- List of all users from the
- GET /profile: Retrieves detailed profile information, including in-game character stats and settings.
- POST /edit-character: Allows users to edit character attributes such as:
- Faction
- Race
- Job
- In-game currency
- POST /add-deposit: Adds virtual currency to a user's account.
The .env file contains all the necessary configuration for running the server:
-
Server Configuration:
PORT: The port on which the server will run (default:3000).LOG_TO_CONSOLE: Whether to enable logging to console (trueorfalse).
-
Database Configuration:
PLATFORM_ACCT_DB_USER,PLATFORM_ACCT_DB_PASSWORD,PLATFORM_ACCT_DB_SERVER,PLATFORM_ACCT_DB_DATABASE: Credentials and details for the platform accounts database.BLGAME_DB_USER,BLGAME_DB_PASSWORD,BLGAME_DB_SERVER,BLGAME_DB_DATABASE: Credentials for the in-game database (Blade & Soul).VIRTUAL_CURRENCY_DB_USER,VIRTUAL_CURRENCY_DB_PASSWORD,VIRTUAL_CURRENCY_DB_SERVER,VIRTUAL_CURRENCY_DB_DATABASE: Database for managing virtual currency transactions.
This project relies on the following npm packages:
- express: Web framework for building RESTful APIs.
- mssql: A library for connecting and querying Microsoft SQL Server.
- dotenv: Loads environment variables from a
.envfile intoprocess.env. - axios: A promise-based HTTP client for making requests to external services.
- cors: Enables Cross-Origin Resource Sharing for allowing requests from different domains.
- ejs: Template engine for rendering dynamic HTML.
- argon2 and bcrypt: Libraries for secure password hashing.
- chalk: Adds colorful output for logging and debugging.
- express-session: Manages user sessions.
- mysql2: MySQL database connection support.
Note: The game launcher for this server can be downloaded from B&S Game Launcher.
This project is licensed under the MIT License - see the LICENSE file for details.
For further information and discussions related to the Blade & Soul Game API Server and Game Launcher, visit the active discussion on the forum:
Here you will find project details, exchange of experiences, and solutions to various technical issues related to the setup and launch of the Blade & Soul API server.
...
If you are looking for the Blade & Soul Game API Server for the 2017 version, you can download it here:
Download Blade & Soul Game API Server 2017
Change Log: 30/08/2025
- Added new functionality in BNS API:
- Promo Issue Management (create and manage campaigns)
- Coupon Generation (bulk/single codes)
- Reward System (multiple rewards per campaign)
- User Redemption (simple coupon redemption)
- Activation Tracking (monitor coupon usage)
- Admin Dashboard (statistics, activity, quick actions, CRUD)
- Advanced Features (search, bulk ops, expiration, usage limits, reset)
- 📬 Rewards after activation are automatically delivered to in-game mail
⚙️ Important: After updating via the web interface, make sure to run install.bat to install dependencies and apply changes.
Change Log: 12/08/2025
- Added character blocking functionality:
Implemented a system for temporary and permanent character bans with recorded reasons and durations.
Administrators can now effectively prevent rule violations, ensuring a fair and secure gaming environment.
Change Log: 06/08/2025
⚠️ Critical Update NoticeThis update introduces fundamental architectural changes across the system. File names and folder structures have been significantly reorganized. **It is strongly recommended to perform a clean reinstallation** by cloning the latest version directly from the official GitHub repository. Continuing with a previously installed version may result in conflicts due to outdated or relocated files.
A new category has been added to the admin panel, allowing real-time management of .env parameters through the web interface. Features include:
- Sections: Server Configuration, Database Configurations, and Registration Log
- Automatic backup of the
.envfile upon any change - Ability to restart the API server directly from the interface
Provides tools for managing server-side daemons and individual background processes.
Administrators can start, stop, and monitor processes via the admin panel.
Introduces a user-friendly editor for managing and publishing news on the website's main page.
All content is controlled from the admin panel.
Adds a system to manage promotional in-game events:
- Manual start/stop of the Daily Dash (daily login reward)
- Optional auto-renewal configuration
Before applying any API updates via the web interface, the system now automatically backs up all affected files, allowing for safe rollback.
Introduces automated integration with Discord:
- Periodically sends server monitoring data to a specified Discord channel (interval configurable)
- Supports the
/onlinecommand in chat to view the current online player count
(Requires bot creation at Discord Developer Portal)
Adds context-sensitive informational modals to each admin panel page for quick reference and improved user onboarding.
The admin UI has been completely rebuilt with:
- A refreshed design
- Improved responsiveness and performance
- Enhanced UX and removal of outdated components
Made small improvements and optimizations to enhance code stability and readability.
- Before starting the server, run
Install.batto install dependencies and initialize the database. - Restart the API server after updating to apply all changes.
- A clean installation is strongly recommended to prevent legacy file conflicts.
Change Log: 13/11/2024
-
Added authentication for accessing the admin panel:
Implemented a credential verification system to ensure that only authorized administrators can access the admin panel. -
Added a navigation panel to the Admin Panel:
Introduced a navigation bar to improve usability, providing quick access to key sections of the admin panel. -
Minor code tweaks and adjustments:
Made small improvements and optimizations to enhance code stability and readability.














