• 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!

Windows Tibia 11 - Can connect to character list, but not gameworld!

Fablow

Intermediate OT User
Content Editor
Joined
May 7, 2008
Messages
1,565
Solutions
6
Reaction score
145
Location
Canada
GitHub
Fablow77
Hello all,

I'm new to this Tibia 11 client stuff, and I am wondering if anyone could help me or shed some light on it. I am trying just to login to any server through localhost.

The error I get is this (on 127.0.0.1):
Screenshot
The error I get when I switch from 127.0.0.1 to my IP address:
Screenshot

This is what I have done/tried:
-Ports open 80/7171/7172/7173/7174
-Turned off all Anti-virus / Firewalls
-Different login scripts
-Hex edit Tibia Client (someone was trying to help me)
-Changed distro
-Added 'world_ID' to players (in PHPMYADMIN)
-Added 'secret' to players (in PHPMYADMIN)

What am I using?:
-OTX 3.9
-Gesior Acc

My Login.php script:
PHP:
<?php
/**
* Created by Notepad++.
* User: Malucooo - Erick Nunes
* Remaked of login.php by JLCVP and parts of login.php by Monteiro. Thanks for both!
* Date: 18/09/17
* Time: 03:01
*/

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();
$playerData = 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;
} 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();
}

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

$world = array(
    "id" => 0,
    "name" => "RealOTS",
    "externaladdress" => "75.154.187.59",
    "externalport" => 7172,
    "previewstate" => 0,
    "location" => "BRA",
    "anticheatprotection" => false
);

$worlds = array($world);

$data["session"] = $session;
$playerData["worlds"] = $worlds;
$playerData["characters"] = $characters;
$data["playdata"] = $playerData;

echo json_encode($data);

My Config.lua:
Lua:
-- Combat settings
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 100
killsToRedSkull = 6
killsToBlackSkull = 15
pzLocked = 30 * 1000
removeChargesFromRunes = true
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 7 * 60 * 1000
stairJumpExhaustion = 1 * 1000
experienceByKillingPlayers = true
expFromPlayersLevelRange = 100

-- Connection Config
ip = "75.154.187.59"
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 2000
motd = "RealOpenTibia.com!"
onePlayerOnlinePerAccount = false
allowClones = false
serverName = "RealOTS"
statusTimeout = 5 * 1000
replaceKickOnLogin = true
maxPacketsPerSecond = 300

-- Store in-Game Config
coinPacketSize = 50
coinImagesURL = "http://localhost/images/store/"

-- PVP-Expert Config
expertPvp = false

-- Version Manual
clientVersionMin = 1100
clientVersionMax = 1149
clientVersionStr = "Only clients with protocol 11.49 are allowed!"

-- Depot Limit
freeDepotLimit = 2000
premiumDepotLimit = 10000
depotBoxes = 17

-- Casting System
enableLiveCasting = true
liveCastPort = 7173

-- Deaths
deathLosePercent = -1

-- Houses
housePriceEachSQM = 5000
houseRentPeriod = "weekly"

-- Item Usage
timeBetweenActions = 500
timeBetweenExActions = 1000

-- Map
mapName = "global"
mapAuthor = "cipsoft"

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

-- MySQL
sqltype = "MySQL"
mysqlHost = "127.0.0.1"
mysqlUser = "root"
mysqlPass = ""
mysqlDatabase = "realots"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"

-- Misc.
allowChangeOutfit = true
freePremium = true
kickIdlePlayerAfterMinutes = 15
maxMessageBuffer = 4
emoteSpells = true
classicEquipmentSlots = true
allowWalkthrough = true

-- Rates
rateExp = 500
rateSkill = 30
rateLoot = 2
rateMagic = 15
rateSpawn = 2

-- Monsters
deSpawnRange = 2
deSpawnRadius = 50

-- Stamina
staminaSystem = true

-- Scripts
warnUnsafeScripts = true
convertUnsafeScripts = true

-- Startup
defaultPriority = "high"
startupDatabaseOptimization = true

-- Status server information
ownerName = "RealOpenTibia.com"
ownerEmail = ""
url = ""
location = "United States"

Any help is appreciated! If someone does help me fix this problem, I could also send a donation your way, or if you fix this as a 'job' and I also send a donation your way (Just my way of saying thank you).

I few days ago when I started to try, I couldn't even load the character list, and now I get to this point. I feel like I'm close but need some help!

Thanks in advance!
 
This is probably client related, I'm not an expert on tibia 11 whatsoever but I've tried once, had this error as well
your config.lua is fine.. are you sure your custom client is working? right version as well?
there are some localhost clients version 11 on the internert for you to download and try
 
I have used both, custom client that I did and clients from the Web. Both same result, thank you for your response!
 
I'm using 11.49:5884. For me, this has been happening to any version of Tibia 11 I have tried.
I use 11.49.5813 for my OT and its working fine. But with 5884 i was able to login, but some interactions caused debug.
 
I'm using 11.49:5884. For me, this has been happening to any version of Tibia 11 I have tried.
I believe that specific client version expects "externaladdressunprotected" and "externaladdressprotected" in the world array. Since it looks like you want to support 11.00-11.49 then your world array should contain all of them:
PHP:
$world = array(
    "id" => 0,
    "name" => "RealOTS",
    "externaladdress" => "75.154.187.59",
    "externaladdressprotected" => "75.154.187.59",
    "externaladdressunprotected" => "75.154.187.59",
    "externalport" => 7172,
    "externalportprotected" => 7172,
    "externalportunprotected" => 7172,
    "previewstate" => 0,
    "location" => "BRA",
    "anticheatprotection" => false
);
It's fine to do this because the client will ignore the values it doesn't care about, and just use the ones it needs.

Also, you may want to add "'optiontracking' => false," to your session array. I don't think it matters, but it's always a good idea to send as much information as possible that the client could be expecting.

I'm using 11.49:5884. For me, this has been happening to any version of Tibia 11 I have tried.
If this is still the case after doing what I've outlined above, then there may be an issue with your ip/port. Go to canyouseeme.org from whatever machine you're hosting from, make sure the IP address shown is the IP you have in your config.lua and login.php world array, then check that your ports are actually open.
 
Last edited:
I use 11.49.5813 for my OT and its working fine. But with 5884 i was able to login, but some interactions caused debug.

I've tried all versions of 11.49, thank you!

I believe that specific client version expects "externaladdressunprotected" and "externaladdressprotected" in the world array. Since it looks like you want to support 11.00-11.49 then your world array should contain all of them:
PHP:
$world = array(
    "id" => 0,
    "name" => "RealOTS",
    "externaladdress" => "75.154.187.59",
    "externaladdressprotected" => "75.154.187.59",
    "externaladdressunprotected" => "75.154.187.59",
    "externalport" => 7172,
    "externalportprotected" => 7172,
    "externalportunprotected" => 7172,
    "previewstate" => 0,
    "location" => "BRA",
    "anticheatprotection" => false
);
It's fine to do this because the client will ignore the values it doesn't care about, and just use the ones it needs.

Also, you may want to add "'optiontracking' => false," to your session array. I don't think it matters, but it's always a good idea to send as much information as possible that the client could be expecting.


If this is still the case after doing what I've outlined above, then there may be an issue with your ip/port. Go to canyouseeme.org from whatever machine you're hosting from, make sure the IP address shown is the IP you have in your config.lua and login.php world array, then check that your ports are actually open.

I will try that, and see what comes about. I also double checked my ports being open with canyouseeme.org and ISP provider (was tryin got get them to unblock a port anyways). I think I might just give up, and just use 10.00 client and modify myself to fit 11.49 graphics.

Thanks, I really do appreciate it!
 
Back
Top