TERA API (node.js), Shop and Launcher with Client Patcher

TERA Foundation
Developer
Joined
Jun 3, 2020
Messages
577
Reaction score
971
TERA API + In-game Shop

API and In-game Shop implementation for the TERA Online retail server on Node.js. The API consists of four independent servers (Arbiter API, Portal API, Shop API and Admin Panel) running on different ports. Support of Arbiter server API functions, authorization, privileges, VIP items/benefits, Shop, Launcher API, SLS generator, etc.

All versions of the game are supported if using arb_gw from TW server distribution.


TERA API has been updated to the version 1.2
Please read the
changelog and instructions for installing the update.


Latest Release: [v1.2.3] - 11.05.2025

Changelog:

[v1.2.3] - 11.05.2025:
  • Fixed the "Cancel" button when installing updates in the Launcher.
  • Fixed the logic for signing into an account after registering in the Launcher.
  • Fixed conditions and validation in the ReportCheater endpoint.
  • Added error handling for writing a report in the ReportCheater endpoint.
[v1.2.2] - 16.03.2025:
  • Fixed loading of DataCenters with 2 letter region codes (problem with loading of DataCenter_Final_TW.dat).
  • Changed the maximum number of Box slots in the Tera Shop to work properly in the patch 31.04.
[v1.2.1] - 10.03.2025:
  • Fixed a caching issue where the "Logout" button in the Launcher would not work correctly.
  • Fixed an issue with sync server state (PlanetDB) task for patch 31.04.
  • Fixed an issue where some fields were missing after migration the database.
  • Fixed an error in TERA Shop when an unsuccessful attempt to update account data occurred.
  • Added check for datasheets during initialization (more informative error about missing files).
  • Added the datasheet model linking for working "en" language with "USA" region (if you use only USA datacenter).
[v1.2.0] - 01.03.2025:
[v1.1.17] - 13.04.2024:
  • Fixed the displaying of long IP addresses in Admin Panel.
[v1.1.16] - 26.06.2023:
  • Fixed security issue related to the activation of promo codes in the Tera Shop.
[v1.1.15] - 30.03.2023:
  • Added new config parameter API_PORTAL_LAUNCHER_DISABLE_REGISTRATION.
  • Fixed generation of the item data in the dataItemsUpdater.js tool.
  • Minor changes for ipFromLauncher routines in the code.
[v1.1.14] - 03.02.2023:
  • Added new config parameter API_ARBITER_USE_IP_FROM_LAUNCHER.
  • Fixed security issue with request IP spoofing (X-Forwarded-For header).
  • Removed fonts from repository (must now be downloaded separately).
[v1.1.13] - 02.02.2023:
  • Added Gateway API method GetAccountBanByUserNo.
  • Fixed variables names and translation.
  • Fixed edit password in Admin Panel when sha512 enabled.
  • Switch from isAlphanumeric to isStrongPassword and increase password max length to 128.
[v1.1.12] - 21.10.2022:
  • Fixed Shop scripts for supports of 32bit patches.
[v1.1.11] - 09.10.2022:
  • Disabled gzip compression for Portal API.
  • Fixed the launcher background mask.
[v1.1.10] - 01.09.2022:
  • Added support of KOR (kr) client region language.
[v1.1.9] - 29.08.2022:
  • Fixed issue with definition of the timezone in Admin Panel.
  • Fix of a possible issues with passing some variables to the Admin Panel session.
[v1.1.8] - 26.08.2022:
  • Fixed a bug with saving the number of items when editing a product/box.
[v1.1.7] - 23.08.2022:
  • Add feature for disable check of client files when the game start.
[v1.1.6] - 22.08.2022:
  • Fixed issue with negative values in server status.
  • Skip error if server is null in Shop Welcome view.
[v1.1.5] - 19.08.2022:
  • Fixed issues with SQL transactions in Admin Panel.
[v1.1.4] - 12.08.2022:
  • Minor fixes of ejs templates.
  • Added missed webfonts.
[v1.1.3] - 10.08.2022:
  • Added serverApi and accountApi endpoints to Gateway API.
  • Highlighting HTTP errors with a warning type in the log.
[v1.1.2] - 09.08.2022:
  • Fixed time zone when creating Boxes and Service Items.
[v1.1.1] - 08.08.2022:
  • Minor fixes of server availability check algorithm.
[v1.1.0] - 06.08.2022:
  • Full implementation of the Tera Shop.
  • Full implementation of Admin Panel for API features and Tera Shop.
  • Added language select in the Launcher.
  • Implementation of the promo code system (Tera Shop).
  • New server availability check algorithm.
  • Integration with the Steer Server and Tera Platform Hub.
  • The use of FCGI WebAPI and FCGI Gateway is no longer required.
  • Automatic creation of Service Items (Box).
  • Improve application console logging and debugging.
  • Now a single database for the API is used.
  • Lots of improvements and fixes.
[v1.0.3] - 16.06.2022:
  • Added the initial benefits that will be assigned to the user on registration.
  • Added a separate config file for configuring premium items and benefits.
  • Added integration with FCGI Gateway and Box System.
  • Minor code fixes (sql transactions, code optimization).
[v1.0.2] - 11.06.2022:
  • Fixed issue with automatic login to the last selected server.
  • Update server permissions routines for SLS.
  • Implemented /api/GetServerPermission API endpoint (server permission info).
[v1.0.1] - 26.05.2022:
  • Added missing chronoscroll premium item IDs (358, 372 and 373) to activate premium/VIP status.
  • Added new parameter API_PORTAL_BENEFIT_ID_ELITE_STATUS, allows you to set the premium status benefit identifier (by default 533 - RU VIP is used).
[v1.0.0] - 22.05.2022:
  • Initial release with basic API functionality.
Screenshots:
hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums

hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums
hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums

Available here:

Installation Guide (Video)
TERA Clients and Servers Collection
How to enable Item Claim system
How to allow GM commands for specific accounts

How to read OpArb errors
How to add new language translation (new region of client):
Below is an instructions on how to translate components into French. Translation into other languages is done similarly.

Launcher translation:
  1. Make sure you have a data center DataCenter_Final_FRA.dat in your Tera Client S1Data folder.
  2. Copy the file src\locales\launcher\en.json as src\locales\launcher\fr.json.
  3. To translate, you need to edit file src\locales\launcher\fr.json.
  4. Open .env and add the line API_PORTAL_CLIENT_REGIONS_FRA=Françaisand save.
    • Set parameter API_PORTAL_LOCALE to fr if you want to change the default language.
    • Set parameter API_PORTAL_CLIENT_DEFAULT_REGION to FRA if you want to change the default region.
  5. Restart TeraAPI.
Starting with TERA API version 1.2.x, you no longer need to edit button images or css to add a language.

TERA Shop translation:
  1. Copy the file src\locales\shop\en.json as src\locales\shop\fr.json.
  2. To translate, you need to edit file src\locales\shop\fr.json.
  3. Place the DataCenter_Final_FRA.dat file from the client into the API directory data\datasheets, as described here: .
  4. Restart TeraAPI.
Admin Panel translation:
  1. Copy the file src\locales\admin\en.json as src\locales\admin\fr.json.
  2. To translate, you need to edit file src\locales\admin\fr.json.
  3. Place the DataCenter_Final_FRA.dat file from the client into the API directory data\datasheets, as described here: .
  4. Open .env and set the parameter ADMIN_PANEL_LOCALE to fr and save.
  5. Restart TeraAPI.
Important!
  • For correct display of items in the Admin Panel and TERA Shop, it is important that for all added languages the corresponding DataCenter file is placed in the data\datasheets directory of TERA API.
  • To correctly display localization strings in the Admin Panel (for example, "Additional Information" for products), you must have localization files in the src\locales\shop directory in accordance with the added regions.
Matching game regions with languages:
  • CHN: cn
  • EUR: en
  • FRA: fr
  • GER: de
  • INT: en
  • JPN: jp
  • KOR: kr
  • RUS: ru
  • SE: se
  • THA: th
  • TW: tw
  • USA: us



Launcher

Launcher for Tera Online that supports of all versions of the game. Based on the official version of the BHS launcher that works with the TW/JP localizers. This launcher supports all the functions of automatic game update and file integrity check. For these features to work, you need to use our tera-api. Translations an English and Russian available.

Changelog:
Update 30.06.2022:
  • Updated executable file ( with antivirus false positives).
hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


Available here:



Custom Launcher design:

Ninja version (based on design by valentine12):
hsdn - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums

(for version 1.2.x) / (for version 1.0.0)

Reaper version (based on design by S37uP!Update):
omelUMQ - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums

(for version 1.2.x) / (for version 1.0.0)

Gunner version (based on official TW Launcher):
GuZxsRL - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums

(for version 1.2.x) / (for version 1.0.0)



Client Patcher

TERA Client patcher and updater (written on node.js) for original BHS Launcher.

Changelog:
Update 22.08.2022:
  • Added the feature to specify the update search directory.
Update 06.06.2022:
  • Fix issuewith packing files of zero size (elzma.exe).
Update 02.06.2022:
  • Fix issue with displaying errors.
VthbtEW - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums


Available here:

Client and Launcher update files structure:
Client update files structure:
  • /tera-api/public/patch/patch/ - game client packed files (like the 1-100.cab, 1-101.cab, etc.).
  • /tera-api/public/patch/db/ - update database files (like the server.db.1.cab).
  • /tera-api/public/patch/version.ini - generated by packer version.ini placed here.
Launcher update files structure:
  • /tera-api/public/patch/launcher_update/ - updates for launcher (files like LauncherInstaller_1.0.1.52.exe, created by Inno Setup script).
  • /tera-api/public/patch/launcher_info.ini - information file of launcher update version (edit manually).
Files and folders that must be removed from the client before packing:
  • \$Patch
  • \Binaries\cookies.dat
  • \S1Game\GuildFlagUpload
  • \S1Game\GuildLogoUpload
  • \S1Game\ImageCache
  • \S1Game\Logs
  • \S1Game\Screenshots
  • \S1Game\Config\S1Engine.ini
  • \S1Game\Config\S1Game.ini
  • \S1Game\Config\S1Input.ini
  • \S1Game\Config\S1Lightmass.ini
  • \S1Game\Config\S1Option.ini
  • \S1Game\Config\S1SystemSettings.ini
  • \S1Game\Config\S1TBASettings.ini
  • \S1Game\Config\S1UI.ini
  • \Launcher.exe
  • \local.db
  • \version.ini
 
Last edited:
  1. Copy the files to the your directory. (Where? What directory?)
  2. Run the npm install command. (How, what do i need to open to run this command?)
  3. Copy the .env.example file to .env. (Should i Rename the file?)
  4. Configure the parameters in the .env file.
  5. Impport the database structure to your MySQL server.
  6. Execute the node src/app command, or run the file tera-api.bat to start API servers.
 
1. Any directory, like c:\tera-api.
2. This command is available after install node.js (just open windows cmd and type cd c:\tera-api and run npm install here).
3. You can copy or just rename (this is a example file).
 
But this is an extra api right? It has nothing to do with TeraAPI right? I mean i start the server, and after starting the server i start this API right?
Edit: and on this .env file i must edit only the username and password from mysql right? or should i change all 127.0.0.1 ips to my public ip? I want it public ip so i can play with friends!
 
Last edited:
This API replaces any old Tera API on Net or Java (laragon, Tera API .NET, grails, xampp etc.).
It is All-in-One solution for game server and launcher services (like the official Tera publisher).



You need to run this API before start of all native/retail Tera Servers (arb_gw, arbiter, etc.).



But this is an extra api right? It has nothing to do with TeraAPI right? I mean i start the server, and after starting the server i start this API right?
Edit: and on this .env file i must edit only the username and password from mysql right? or should i change all 127.0.0.1 ips to my public ip? I want it public ip so i can play with friends!

The Arbiter API (API_ARBITER_LISTEN_HOST) must remain on the local network (at 127.0.0.1). It is needs only for Tera Server.

The Portal API (API_PORTAL_LISTEN_HOST) is needed for user authorization and launcher operation, you must open it outside.
 
So from now on i have to use accountdb instead of accountdb_2008 for registering accounts via website register php script right?
(API_PORTAL_LISTEN_HOST) should i put my public ip there?

Right.

But note: the account database structure used differs from accountdb_2800.
The supported database structure is located in the share folder.

Also registration function is available into the Launcher (with reCAPTCHA secure if enabled).
8F4ME6V - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums
 
In launcher.exe on address what port do i have to use? on old launcher we used it with port 81 to get this.
Also i noticed there is no LauncherMain file inside public/launcher/ folder.

You need specify your external IP. The port is specified the same as in API_PORTAL_LISTEN_PORT, for example 80.
If you want other users to be able to access you server - this port must be forwarded via NAT on your router.
 
For the Tera server to work, you only need to forward two ports: port 80 (Portal API) and port 7801 (Game Server).

In order for your server to appear in the list of servers, you need to add it to the server_info database table.
Based on this table, a Server List (SLS) is generated. Note that the isEnabled field must be set to 1.
RCwHmq7 - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums





I know, i mean the entire address, where is this LauncherMain file located?
I have this error

You can copy the launcher_info.ini into c:\tera-api\public\patch\launcher_update and edit this file to specity path to launcher installer (for launcher auto updates).



I will also note that this launcher will not launch the game if you do not have a patcher configured and a packages of the Tera client has not been created.

This project was created for those who want to open their server for public use with all the features: client auto-update, logging, registration with protection, etc.

For tests, you can switch the account to QA mode, to do this, set the value 10 in the privilege field in the account_info table.

QA menu in the Launcher:
yEg0Iu4 - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums
 
Last edited:
Thank you, right now i have this error.
PS: I managed to register account using the launcher, after that i got error on api console with version.ini file not being found, i've copied the version.ini from client to public\patch where launcher_info.ini is located and after that i get this error without launcher closing.
public/patch/db/server.db shows up in api. i don't have those files...
 

Attachments

  • Untitled - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums
    Untitled.webp
    40.7 KB · Views: 512
Thank you, right now i have this error.

Please read the information above.
You must make a pack of client using tera-client-packer, or set the account to QA mode for disable file checks and updates.



The "/public/patch/db/server.db.#.cab" file and other .cab (update) files is generated by tera-client-packer while packing of tera client for auto updates.

If you want your client to be updated automatically for you and all your users, follow the client packaging instructions described here:



Added new API config parameter: API_PORTAL_CLIENT_PATCH_NO_CHECK
If set to true, the Launcher will not check for client updates.
 
hsdn, would u pls give some help? when i click play, why the launcher show Error 274(0):ini error.

when i open the website 192.168.200.3:81&192.168.200.3:8080, the web shows Invalid endpoint: /
 
Last edited:
My arb_gw is failing to run now :(

[2022/05/23 00:11:32.510] Socket reconnection failed with No connection could be made because the target machine actively refused it
[2022/05/23 00:11:32.523] Socket closed with The operation completed successfully [d513fc]
[2022/05/23 00:11:32.530] **** SLOW Call 1031[/systemApi/RequestAPIServerStatusAvailable]
[2022/05/23 00:11:32.537] RequestAPIServerStatusAvailable
[2022/05/23 00:11:32.541] RequestAPIServerStatusAvailable failed -1[]
[2022/05/23 00:11:32.545] REST CheckServer failed
 
Thank you so much hsdn for sharing your wealth of knowledge along with this new API & Launcher. It took me a bit to figure it out but managed to get it going and was able to unlock the account benefits just fine. Love that you can also select the language right from the launcher and that you can see the available player count on the server list, truly fantastic work. THANK YOU! :thumbup:

My arb_gw is failing to run now :(

[2022/05/23 00:11:32.510] Socket reconnection failed with No connection could be made because the target machine actively refused it
[2022/05/23 00:11:32.523] Socket closed with The operation completed successfully [d513fc]
[2022/05/23 00:11:32.530] **** SLOW Call 1031[/systemApi/RequestAPIServerStatusAvailable]
[2022/05/23 00:11:32.537] RequestAPIServerStatusAvailable
[2022/05/23 00:11:32.541] RequestAPIServerStatusAvailable failed -1[]
[2022/05/23 00:11:32.545] REST CheckServer failed

Make sure you are binding it to the correct IP in 'API_ARBITER_LISTEN_HOST', also double check your ports (if you've changed them).
 
tera-api gives me this when I run arb_gw

error: SequelizeDatabaseError: No database selected

And before it says that its connected to accountdb etc. Have no idea what this means
 
Did you import the new 'accountdb' found inside the share folder? Because this new API does not make use of the old 'accountdb_2800' database. Once you do that open up your .env file and double check that you've added your user/pass to the database configuration sections.
 
Back