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!

Tutorial Server/Client Scarlet Blade

Initiate Mage
Joined
Jun 20, 2022
Messages
92
Reaction score
17
This tutorial is work in progress, i will add more and more things for help create your home server for Scarlet Blade.

The game now is not finish, we are working in the client, there are issues with client in game. But the client work like 70%. The biggest issue is you cant sell/buy items, enhance it.

It will be not easy to install all parts and configure it

For help please ask in this thread : https://forum.ragezone.com/f857/scarlet-blade-server-files-client-1163598/


For all this tutorial i will show my config, you can easy change it to your local config, you need only change all IP 192.168.1.14 to your IP

Prerequisites

- Windows SqlServer
- Apache/php server like Wamp

Download

Server :
Client :
Client exe SB2 (we will use SB.exe Jun 14 US) :
API :

Error

You will have many error for start all parts form the server, it will ask for DLL files, this files can be found in Microsoft Visual C++ Redistributable (version 2005-2008-2010)

Installation


Data base Account update table "tbl_WorldList" -> WorldIP and WorldIPForServer to 192.168.1.14
Data base Game update table "tbl_ZoneList" -> ZoneIP and ZoneIPForServer to 192.168.1.14


LoginServer config

<?xml version="1.0" encoding="ansi"?>
<LoginServerConfig>
<!-- 시스템 설정값 AutoStart(0:대기,1:자동시작) -->
<System
AutoRun = 1
></System>
<!-- 네트웍 설정값 -->
<Network
IP = "192.168.1.14"
Port = 10001
IPForServer = "192.168.1.14"
PortForServer = 20001
></Network>
<!-- 데이터베이스 설정값 -->
<Database
IP = "localhost"
Name = "QueensAccount"
ID = "queens_db_login"
Pwd = "queens_db_pass"
></Database>
<!-- 계정 데이터베이스 설정값 -->
<AccountDB
IP = "localhost"
Name = "QueensAccount"
ID = "queens_db_login"
Pwd = "queens_db_pass"
></AccountDB>
<!-- 접속 게임로그 서버 설정값 -->
<GameLogServer
IP = "192.168.1.14"
Port = 20007
PortForServer = 20007
></GameLogServer>
<!-- 접속 PC방 빌링 서버 설정값 -->
<PCBangServer
Enable = 0
IP = "192.168.1.14"
IP_ = "192.168.1.14"
Port = 7520
></PCBangServer>
<!-- api.test.aeriagames.com -->
<WebLogin
WebLogin = 1
Host = "sb"
Protocol = "http"
SecretKey = "41447a2d3b3f3e75bee90e645ae8fdfe41f84a721e99a80f36"
></WebLogin>
<!-- 클라이언트 버전 설정값 -->
<Client
Version = 31
></Client>
</LoginServerConfig>

The Bat file exemple for connect client to server :
SB2.exe /connetip:192.168.1.14 /connetport:10001 /clientauthcode:5529056734e4f67d82d788e01773fa1273488ab4 /clientauthid:d4e4d71b1aff496e9bedd45bf97eb9ebd63f8dfa646fbd90c1
 
Last edited:
Initiate Mage
Joined
Jun 14, 2022
Messages
25
Reaction score
1
Thanks for your contribution, I tried a lot of settings, postman can also debug tokens, but every time I log in it it will show disconnected
INFO[0x00000898][CLoginApplication::OnRecvClient]Undefined Protocol Client MSG!!! : (0, 40) INFO[0x00001d1c][CLoginApplication::OnRecvClient]Undefined Protocol Client MSG!!! : (0, 40)
 
Experienced Elementalist
Joined
Jan 11, 2010
Messages
244
Reaction score
43
Thanks for your contribution, I tried a lot of settings, postman can also debug tokens, but every time I log in it it will show disconnected
INFO[0x00000898][CLoginApplication::OnRecvClient]Undefined Protocol Client MSG!!! : (0, 40) INFO[0x00001d1c][CLoginApplication::OnRecvClient]Undefined Protocol Client MSG!!! : (0, 40)

You are using the wrong version of the client. Take the correct version from the description.
 
Initiate Mage
Joined
Jun 14, 2022
Messages
25
Reaction score
1
I use the client in the link, and the login uses SB2, 14US. Is this the problem with the client?
 
Initiate Mage
Joined
Oct 6, 2014
Messages
3
Reaction score
0
Awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Initiate Mage
Joined
Jun 14, 2022
Messages
25
Reaction score
1
I have solved my problem and I will continue to develop this game



sb2.exe /connetip:192.168.1.78 /connetport:10001 /clientauthcode:0109b8225cada1dee963ea5e5b6b4cab3aa478fd /clientauthid:d4e4d71b1aff496e9bedd45bf97eb9ebd63f8dfa646fbd90c1
Login set up
<WebLogin WebLogin = 1 Host = "192.168.1.78" Protocol = "http" SecretKey = "41447a2d3b3f3e75bee90e645ae8fdfe41f84a721e99a80f36"
192.168.1.78,Is my local IP,
 
Initiate Mage
Joined
Jun 20, 2022
Messages
92
Reaction score
17
Other version for Bat File auto connection :

1st need modify authorize.php to :

<?php

session_start();

if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: login.php");
exit;
}

// include our OAuth2 Server object
require_once __DIR__.'/server.php';

$request = OAuth2\Request::createFromGlobals();
$response = new OAuth2\Response();
$userid = $_SESSION["username"];

// validate the authorize request
if (!$server->validateAuthorizeRequest($request, $response)) {
$response->send();
die;
}
// display an authorization form


// print the authorization code if the user has authorized your client

$server->handleAuthorizeRequest($request, $response, true, $userid);

// this is only here so that you get to see your code in the cURL request. Otherwise, we'd redirect back to the client
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
exit("$code");

$response->send();

second try this Bat file :

set loginAPI=Elwy1
set passwordAPI=azerty
curl -X GET "http://192.168.1.14/sbauth/logout.php" -H "Cookie: PHPSESSID=uuj02arjrlts8ao37s48lkk98c"
curl -X POST "http://192.168.1.14/sbauth/login.php" -H "Cookie: PHPSESSID=uuj02arjrlts8ao37s48lkk98c" -H "Content-Type: application/x-www-form-urlencoded" --data-raw "username=%loginAPI%&password=%passwordAPI%"
For /F %%R in ('curl "http://192.168.1.14/sbauth/authorize.php?response_type=code&client_id=d4e4d71b1aff496e9bedd45bf97eb9ebd63f8dfa646fbd90c1&state=sb" -H "Referer: http://192.168.1.14/sbauth/login.php" -H "Connection: keep-alive" -H "Cookie: PHPSESSID=uuj02arjrlts8ao37s48lkk98c" -H "Upgrade-Insecure-Requests: 1"') do (set VAR=%%R)echo %VAR%
SB2.exe /connetip:192.168.1.14 /connetport:10001 /clientauthcode:%VAR% /clientauthid:d4e4d71b1aff496e9bedd45bf97eb9ebd63f8dfa646fbd90c1



Say me if this is OK or not
 
Last edited:
Experienced Elementalist
Joined
Jul 22, 2020
Messages
201
Reaction score
240
@Neg035

not working for me

Code:
set loginAPI=matar
set passwordAPI=123456
curl -X GET "http://192.168.1.128/logout.php" -H "Cookie: PHPSESSID=97bue11lp68fn3seb5ph542c03"
curl -X POST "http://192.168.1.128/login.php" -H "Cookie: PHPSESSID=97bue11lp68fn3seb5ph542c03" -H 
"Content-Type: application/x-www-form-urlencoded" --data-raw "username=%loginAPI%&password=%passwordAPI%"
For /F %%R in ('curl "http://192.168.1.128/authorize.php?response_type=code&client_id=d4e4d71b1aff496e9bedd45bf97eb9ebd63f8dfa646fbd90c1&state=sb" -H 
"Referer: http://192.168.1.128/login.php" -H 
"Connection: keep-alive" -H "Cookie: PHPSESSID=97bue11lp68fn3seb5ph542c03" -H 
"Upgrade-Insecure-Requests: 1"') do (set VAR=%%R)echo %VAR%
SB.exe /connetip:192.168.1.128 /connetport:10001 /clientauthcode:%VAR% /clientauthid:d4e4d71b1aff496e9bedd45bf97eb9ebd63f8dfa646fbd90c1
 
Initiate Mage
Joined
Sep 1, 2021
Messages
10
Reaction score
0
@Neg035

not working for me

Code:
set loginAPI=matar
set passwordAPI=123456
curl -X GET "http://192.168.1.128/logout.php" -H "Cookie: PHPSESSID=97bue11lp68fn3seb5ph542c03"
curl -X POST "http://192.168.1.128/login.php" -H "Cookie: PHPSESSID=97bue11lp68fn3seb5ph542c03" -H 
"Content-Type: application/x-www-form-urlencoded" --data-raw "username=%loginAPI%&password=%passwordAPI%"
For /F %%R in ('curl "http://192.168.1.128/authorize.php?response_type=code&client_id=d4e4d71b1aff496e9bedd45bf97eb9ebd63f8dfa646fbd90c1&state=sb" -H 
"Referer: http://192.168.1.128/login.php" -H 
"Connection: keep-alive" -H "Cookie: PHPSESSID=97bue11lp68fn3seb5ph542c03" -H 
"Upgrade-Insecure-Requests: 1"') do (set VAR=%%R)echo %VAR%
SB.exe /connetip:192.168.1.128 /connetport:10001 /clientauthcode:%VAR% /clientauthid:d4e4d71b1aff496e9bedd45bf97eb9ebd63f8dfa646fbd90c1


remove "echo" in "do (set VAR=%%R)echo %VAR%"
works great for me.
 
Initiate Mage
Joined
Sep 1, 2021
Messages
10
Reaction score
0
Interesting situation, I tried to do registration through the domain, and new accounts appear in the database.
If I connect locally, through 192.168.1.234 - everything works. I enter a 6-digit security code and login into the server.
If I connect over the Internet, through 188.*.*.72 - It prompts me to enter the NEW 6-digit code, as if I don't have it. And then mother disconnects me from the server.

port 10001 is forwarded, which allowed at least authorization up to those 6 digits. What port do I need to forward? so that there is a connection to the database from the outside
 
Back
Top