Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

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

TERA Foundation
[VIP] Member
Joined
Jun 3, 2020
Messages
487
Reaction score
781
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 (using arb_gw from TW server distribution).

Last update: 26.06.2023

Changelog:

Update 26.06.2023:
  • Fixed security issue related to the activation of promo codes in the Tera Shop.
Update 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.
Update 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).
Update 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.
Update 21.10.2022:
  • Fixed Shop scripts for supports of 32bit patches.
Update 09.10.2022:
  • Disabled gzip compression for Portal API.
  • Fixed the launcher background mask.
Update 01.09.2022:
  • Added support of KOR (kr) client region language.
Update 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.
Update 26.08.2022:
  • Fixed a bug with saving the number of items when editing a product/box.
Update 23.08.2022:
  • Add feature for disable check of client files when the game start.
Update 22.08.2022:
  • Fixed issue with negative values in server status.
  • Skip error if server is null in Shop Welcome view.
Update 19.08.2022:
  • Fixed issues with SQL transactions in Admin Panel.
Update 12.08.2022:
  • Minor fixes of ejs templates.
  • Added missed webfonts.
Update 10.08.2022:
  • Added serverApi and accountApi endpoints to Gateway API.
  • Highlighting HTTP errors with a warning type in the log.
Update 09.08.2022:
  • Fixed time zone when creating Boxes and Service Items.
Update 08.08.2022:
  • Minor fixes of server availability check algorithm.
Update 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.
Update 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).
Update 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).
Screenshots (Shop and Admin Panel):
KDL8bTN - TERA API (node.js), Shop and Launcher with Client Patcher - RaGEZONE Forums

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

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

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


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

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

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

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

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


Available here:

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 how to add the French language to the Launcher:
  1. Copy the file src\locales\launcher\en.json to src\locales\launcher\fr.json.
  2. Copy the file public\launcher\css\buttons-en.css to public\launcher\css\buttons-fr.css.
  3. Open .env and add the line API_PORTAL_CLIENT_REGIONS_FRA=Français and save.
  4. Restart TeraAPI.
Make sure you have a data center DataCenter_Final_FRA.dat in your Tera Client S1Data folder.
To translate the launcher, you need to edit file src\locales\launcher\fr.json.
If you need to translate buttons, edit the file public\launcher\css\buttons-fr.css with your own images.
Blank images of the buttons available here:

Please note that the TERA Shop and Admin Panel will remain in English. To translate the TERA Shop, you need to copy file src\locales\shop\en.json to src\locales\shop\fr.json and add "fr" language entry to the file config\admin.js. Also you need to extract the necessary XMLs from the French data center and insert it to the API database using the method described here: .

Comparison of data centers 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: en

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).
q7ftDEt - 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



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



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


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
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Oct 14, 2008
Messages
1,277
Reaction score
248
  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.
 
TERA Foundation
[VIP] Member
Joined
Jun 3, 2020
Messages
487
Reaction score
781
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).
 
Joined
Oct 14, 2008
Messages
1,277
Reaction score
248
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:
TERA Foundation
[VIP] Member
Joined
Jun 3, 2020
Messages
487
Reaction score
781
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.
 
Joined
Oct 14, 2008
Messages
1,277
Reaction score
248
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?
 
TERA Foundation
[VIP] Member
Joined
Jun 3, 2020
Messages
487
Reaction score
781
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
 

Attachments

You must be registered for see attachments list
Joined
Oct 14, 2008
Messages
1,277
Reaction score
248
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.
 

Attachments

You must be registered for see attachments list
TERA Foundation
[VIP] Member
Joined
Jun 3, 2020
Messages
487
Reaction score
781
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.
 
TERA Foundation
[VIP] Member
Joined
Jun 3, 2020
Messages
487
Reaction score
781
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
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Oct 14, 2008
Messages
1,277
Reaction score
248
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

You must be registered for see attachments list
TERA Foundation
[VIP] Member
Joined
Jun 3, 2020
Messages
487
Reaction score
781
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.
 
Initiate Mage
Joined
May 23, 2018
Messages
48
Reaction score
1
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:
Initiate Mage
Joined
Apr 3, 2021
Messages
70
Reaction score
18
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
 
Initiate Mage
Joined
Feb 18, 2021
Messages
25
Reaction score
22
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).
 
Initiate Mage
Joined
Apr 3, 2021
Messages
70
Reaction score
18
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
 
Initiate Mage
Joined
Feb 18, 2021
Messages
25
Reaction score
22
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
Top