• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Tibia 11 Discussion(+Tutorial how to able to use it)

I have this poblem vs 11(update 12 sprits), cannot enter in game!
And version 10.00 ok


The Open-Tibia BR Server Global - Version: (Based on TFS 1.3.10)
Compiled with: Microsoft Visual C++ version 14.1

Compiled on Jun 18 2019 03:54:04 for platform x64

Lua:
ip = "127.0.0.1"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 0
motd = "Bem vindo a Pandoria"
onePlayerOnlinePerAccount = false
allowClones = false
serverName = "Pandoria"
statusTimeout = 5 * 1000
replaceKickOnLogin = true
maxPacketsPerSecond = 20
maxItem = 2000
maxContainer = 100

autolootmode = 2

clientVersionMin = 1000
clientVersionMax = 1200
clientVersionStr = "Only support outdated 10.00 and versions 11.00 to 11.49"

freeDepotLimit = 2000
premiumDepotLimit = 10000
depotBoxes = 17

gamestoreByModules = true

loadQuestLua = true


enableLiveCasting = true
liveCastPort = 7173


expertPvp = false


deathLosePercent = -1


housePriceEachSQM = 10000
houseRentPeriod = "never"


timeBetweenActions = 1000
timeBetweenExActions = 1200


mapName = "otservbr"
mapAuthor = ""


marketOfferDuration = 30 * 24 * 60 * 60
premiumToCreateMarketOffer = true
checkExpiredMarketOffersEachMinutes = 60
maxMarketOffersAtATimePerPlayer = 100

mysqlHost = "localhost"
mysqlUser = "root"
mysqlPass = ""
mysqlDatabase = "dadosserver"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"

Code:
<?php
require 'config/config.php';

// comment to show E_NOTICE [undefinied variable etc.], comment if you want make script and see all errors
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);

// true = show sent queries and SQL queries status/status code/error message
define('DEBUG_DATABASE', false);
define('INITIALIZED', true);

if (!defined('ONLY_PAGE')) {
    define('ONLY_PAGE', true);
}

// check if site is disabled/requires installation
include_once './system/load.loadCheck.php';

// fix user data, load config, enable class auto loader
include_once './system/load.init.php';

// DATABASE
include_once './system/load.database.php';
if (DEBUG_DATABASE) {
    Website::getDBHandle()->setPrintQueries(true);
}

// DATABASE END
/*error example:
{
"errorCode":3,
"errorMessage":"Account name or password is not correct."
}
 */

# Declare variables with array structure
$characters = array();
$playdata = array();
$data = array();
$isCasting = false;

# error function
function sendError($msg)
{
    $ret = array();
    $ret["errorCode"] = 3;
    $ret["errorMessage"] = $msg;
    die(json_encode($ret));
}

# getting infos
$request = file_get_contents('php://input');
$result = json_decode($request, true);

# account infos
$accountName = $result["accountname"];
$password = $result["password"];

# game port
$port = 7172;

# check if player wanna see cast list
if (strtolower($accountName) == "cast") {
    $isCasting = true;
}

if ($isCasting) {

    $casts = $SQL->query("SELECT `player_id` FROM `live_casts`")->fetchAll();
    if (count($casts[0]) == 0) {
        sendError("There is no live casts right now!");
    }
    foreach ($casts as $cast) {
        $character = new Player();
        $character->load($cast['player_id']);
        if ($character->isLoaded()) {
            $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false);
            $characters[] = $char;
        }
    }
    $port = 7173;
    $lastLogin = 0;
    $premiumAccount = true;
    $timePremium = 0;

} else {

    $account = new Account();
    $account->find($accountName);
    if (!$account->isLoaded()) {
        sendError("Failed to get account. Try again!");
    }
    if ($account->getPassword() != Website::encryptPassword($password)) {
        sendError("The password for this account is wrong. Try again!");
    }
    foreach ($account->getPlayersList() as $character) {
        $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false);
        $characters[] = $char;
    }
    $lastLogin = $account->getLastLogin();
    $premiumAccount = ($account->isPremium()) ? true : false;
    $timePremium = time() + ($account->getPremDays() * 86400);

}

$session = array(
    "fpstracking" => false,
    "isreturner" => true,
    "returnernotification" => false,
    "showrewardnews" => false,
    "sessionkey" => $accountName . "\n" . $password,
    "lastlogintime" => $lastLogin,
    "ispremium" => $premiumAccount,
    "premiumuntil" => $timePremium,
    "status" => "active",
);

$world = array(
    "id" => 0,
    "name" => $config['server']['serverName'],
    "externaladdress" => $config['server']['ip'],
    "externalport" => $port,
    "previewstate" => 0,
    "location" => "BRA",
    "anticheatprotection" => false,
    "externaladdressunprotected" => $config['server']['ip'],
    "externaladdressprotected" => $config['server']['ip'],
    "externalportunprotected" => $port,
    "externalportprotected" => $port,
);

$data["session"] = $session;
$playdata["worlds"] = array($world);
$playdata["characters"] = $characters;
$data["playdata"] = $playdata;

echo json_encode($data);

]37486
37487

And in 10.00 imbuing tool is error:
Not show imbuing options
.

37488
 

Attachments

or you can use my automated tool to create your own.
 
hey guys I wanted to try the pull request by @Slavi Dodo (I'm kinda tired of 10.98 and don't wanna use anything that is not tfs if you know what i mean :rolleyes:) but seems like it only supports client 11.10, I've found like 3 versions of it on @jo3bingham awesome folder of tibia clients but none of them opens up when I click them, they just go to the task bar and stay there lol...

DOES ANYONE HERE HAVE A 11.10 WORKING CLIENT somewhere in your possession? 😁
 
I use joe's clients and they work fine.. probably delete the conf folder and start the client
thanks it worked, the client finally opens and loads character list, but says the server is offline, I've triple checked everything else seems to be fine, I give up! 🏳
 
@Slavi Dodo first of all - tyvm for adding the support!

You mentioned you tested it through 11.04~11.11, and that you use joe's clients.
Can you tell us what else you used for testing?

I can't get something other than "The remote host closed the connection. The game server is offline."
I have tested joe's clients (correctly edited - RSA and local IP), versions 11.04.4384, 11.10.4445 and 11.10.4562.
I am using znote.

config.lua
Code:
ip = "127.0.0.1"
gameProtocolPort = 7172
serverName = "forgottenserver"
maxPacketsPerSecond = 150
config.php
Code:
$config['gameserver'] = array(
        'ip' => '127.0.0.1',
        'port' => 7172,
        'name' => 'forgottenserver' // Must be identical to config.lua (OT config file) server name.
    );

In connection.cpp, I placed several flags in this function:
Code:
void Connection::parseProxyWorldNameIdentification(const boost::system::error_code& error)
{
    std::lock_guard<std::recursive_mutex> lockClass(connectionLock);
    readTimer.cancel();

    if (error) {
        std::cout << "flag 01" << std::endl;
        close(FORCE_CLOSE);
        return;
    }
    else if (connectionState == CONNECTION_STATE_DISCONNECTED) {
        std::cout << "flag 02" << std::endl;
        return;
    }

    char b = msg.getBuffer()[0];
    if (b == 0x0A) {
        if (worldName != g_config.getString(ConfigManager::SERVER_NAME)) {
            std::cout << convertIPToString(getIP()) << " disconnected for sending invalid world name." << std::endl;
            std::cout << "flag 03" << std::endl;
            close();
            return;
        }

        connectionState = CONNECTION_STATE_CONNECTED;
    }
    else {
        std::cout << "flag 04" << std::endl;
        worldName.push_back(b);
    }

    accept();
}
The result is I get several "flag 04" printed when trying to log in.
Is this normal behavior?
(I chose this function because I get "flag 03" when using a custom client 10, known as 10.100)

I tested another distribution (OTServBR), which uses 11.49, and I'm able to log in normally using znote, so I'm guessing the problem is TFS.
Has anybody else tested your changes?

Thanks in advance!

@Evil Puncker
 
Last edited:
What is going on? Login.php for 11.49 this is tibia 11.49 guys help please! Tfs 1.2
Post automatically merged:

now i change login.php for @chucky91 login.php (5 comments upper) now i see character list but if i want join server, server if OFFLINE
Post automatically merged:

login.php
PHP:
<?php
require 'config/config.php';

// comment to show E_NOTICE [undefinied variable etc.], comment if you want make script and see all errors
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);

// true = show sent queries and SQL queries status/status code/error message
define('DEBUG_DATABASE', false);
define('INITIALIZED', true);

if (!defined('ONLY_PAGE')) {
    define('ONLY_PAGE', true);
}

// check if site is disabled/requires installation
include_once './system/load.loadCheck.php';

// fix user data, load config, enable class auto loader
include_once './system/load.init.php';

// DATABASE
include_once './system/load.database.php';
if (DEBUG_DATABASE) {
    Website::getDBHandle()->setPrintQueries(true);
}

// DATABASE END
/*error example:
{
"errorCode":3,
"errorMessage":"Account name or password is not correct."
}
 */

# Declare variables with array structure
$characters = array();
$playdata = array();
$data = array();
$isCasting = false;

# error function
function sendError($msg)
{
    $ret = array();
    $ret["errorCode"] = 3;
    $ret["errorMessage"] = $msg;
    die(json_encode($ret));
}

# getting infos
$request = file_get_contents('php://input');
$result = json_decode($request, true);

# account infos
$accountName = $result["accountname"];
$password = $result["password"];

# game port
$port = 7172;

# check if player wanna see cast list
if (strtolower($accountName) == "cast") {
    $isCasting = true;
}

if ($isCasting) {

    $casts = $SQL->query("SELECT `player_id` FROM `live_casts`")->fetchAll();
    if (count($casts[0]) == 0) {
        sendError("There is no live casts right now!");
    }
    foreach ($casts as $cast) {
        $character = new Player();
        $character->load($cast['player_id']);
        if ($character->isLoaded()) {
            $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false);
            $characters[] = $char;
        }
    }
    $port = 7173;
    $lastLogin = 0;
    $premiumAccount = true;
    $timePremium = 0;

} else {

    $account = new Account();
    $account->find($accountName);
    if (!$account->isLoaded()) {
        sendError("Failed to get account. Try again!");
    }
    if ($account->getPassword() != Website::encryptPassword($password)) {
        sendError("The password for this account is wrong. Try again!");
    }
    foreach ($account->getPlayersList() as $character) {
        $char = array("worldid" => 0, "name" => $character->getName(), "ismale" => (($character->getSex() == 1) ? true : false), "tutorial" => false);
        $characters[] = $char;
    }
    $lastLogin = $account->getLastLogin();
    $premiumAccount = ($account->isPremium()) ? true : false;
    $timePremium = time() + ($account->getPremDays() * 86400);

}

$session = array(
    "fpstracking" => false,
    "isreturner" => true,
    "returnernotification" => false,
    "showrewardnews" => false,
    "sessionkey" => $accountName . "\n" . $password,
    "lastlogintime" => $lastLogin,
    "ispremium" => $premiumAccount,
    "premiumuntil" => $timePremium,
    "status" => "active",
);

$world = array(
    "id" => 0,
    "name" => 'HexOTS',
    "externaladdress" => '145.239.81.189',
    "externalport" => '7172',
    "previewstate" => 0,
    "location" => "PL",
    "anticheatprotection" => false,
    "externaladdressunprotected" => '145.239.81.189',
    "externaladdressprotected" => '145.239.81.189',
    "externalportunprotected" => '7172',
    "externalportprotected" => '7172',
);

$data["session"] = $session;
$playdata["worlds"] = array($world);
$playdata["characters"] = $characters;
$data["playdata"] = $playdata;

echo json_encode($data);
 

Attachments

Last edited:
Back
Top