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

how to connect using tibia 12?

zerghel

Tsuni
Joined
Jul 1, 2008
Messages
299
Reaction score
9
hello guys
first of all, i know is a stupid question but i can't find a solution anywhere and this client is new to me

how can i connect with tibia 12?, server is set up, im using gpedro's myaac login for tibia 12, and using tibia 12.00 but im getting "login failed. tibia might currently be down for maintenance. please try again later" message dunno what else to do
 
Please check Support Rules. Your post doesn't match Rule #1.
 
Please check Support Rules. Your post doesn't match Rule #1.
ty i'll change it
 
What you have changed? I still can't understand your thread.
So you are hosting a Server on your PC or Dedicated host? or trying to connect to someone's server and cannot login to it?
Which IP are you using? Localhost? or GlobalIP? Please provide more information so we help you.
 
What you have changed? I still can't understand your thread.
So you are hosting a Server on your PC or Dedicated host? or trying to connect to someone's server and cannot login to it?
Which IP are you using? Localhost? or GlobalIP? Please provide more information so we help you.
im hosting a server on my pc, i haven't change anything but the config.lua in the distro, the thing is i can't connect to it using tibia 12 client, is there something im not seeing?
 
What IP you use to connect? Can others connect? Post your config.lua
 
im trying to connect locally
i know i have to use global ip address to make it work, i know how to set up config.lua
-maybe is the login.php?
-i also already changed client ip to 127.0.0.1
-maybe the client's rsa key? (don't know how to search for it)

Code:
-- Connection Config
-- NOTE: maxPlayers set to 0 means no limit
-- NOTE: MaxPacketsPerSeconds if you change you will be subject to bugs by WPE, keep the default value of 25
ip = "111.111.11.11" - not my real ip adress xD
bindOnlyGlobalAddress = false
loginProtocolPort = 7171
gameProtocolPort = 7172
statusProtocolPort = 7171
maxPlayers = 0
motd = "welcome!"
onePlayerOnlinePerAccount = false
allowClones = false
serverName = "server"
statusTimeout = 5 * 1000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
maxItem = 2000
maxContainer = 100

-- 0 = Disable,
-- 1 = onKillMonster,
-- 2 = onOpenCorpse -- restart required]]
autolootmode = 1

-- Version Manual
clientVersionMin = 1100
clientVersionMax = 1220
clientVersionStr = "Only support outdated 10.00 and version 12.00"

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

-- GameStore
gamestoreByModules = true

-- Quest Sytem
loadQuestLua = true

-- Expert Pvp Config
expertPvp = false

-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = -1

-- Houses
-- NOTE: set housePriceEachSQM to -1 to disable the ingame buy house functionality
housePriceEachSQM = 1000
houseRentPeriod = "never"

-- Item Usage
-- Do not touch here
-- Avoid use of WIPE program to crash the distro
timeBetweenActions = 700
timeBetweenExActions = 1200

-- Map
-- NOTE: set mapName WITHOUT .otbm at the end
-- NOTE: unzip the map world.rar
mapName = "realmap"
mapAuthor = "Cipsoft"

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

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

-- Misc.
allowChangeOutfit = true
freePremium = true
kickIdlePlayerAfterMinutes = 15
idleWarningTime = 10 * 60 * 1000
idleKickTime = 15 * 60 * 1000
maxMessageBuffer = 4
emoteSpells = false
classicEquipmentSlots = false
allowWalkthrough = true
coinPacketSize = 1
coinImagesURL = "http://xxxxxxxxxxxxxx/store/"
classicAttackSpeed = false

-- Rates
-- NOTE: rateExp is not used if you have enabled stages in data/XML/stages.xml
rateExp = 1
rateSkill = 50
rateLoot = 10
rateMagic = 25
rateSpawn = 1

-- Monster rates
rateMonsterHealth = 1.0
rateMonsterAttack = 1.0
rateMonsterDefense = 1.0

-- Monsters
deSpawnRange = 2
deSpawnRadius = 50

-- Stamina
staminaSystem = true

-- Scripts
warnUnsafeScripts = true
convertUnsafeScripts = true

-- Startup
-- NOTE: defaultPriority only works on Windows and sets process
-- priority, valid values are: "normal", "above-normal", "high"
defaultPriority = "high"
startupDatabaseOptimization = true

-- Status server information
ownerName = ""
ownerEmail = ""
url = ""
location = ""

login.php
Code:
<?php
require_once('common.php');
require_once('config.php');
require_once('config.local.php');
require_once(SYSTEM . 'functions.php');
require_once(SYSTEM . 'init.php');
require_once(SYSTEM . 'status.php');

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

$request = file_get_contents('php://input');
$result = json_decode($request);
$action = isset($result->type) ? $result->type : '';

switch ($action) {
    case 'cacheinfo':
        die(json_encode([
            'playersonline' => $status['players'],
            'twitchstreams' => 0,
            'twitchviewer' => 0,
            'gamingyoutubestreams' => 0,
            'gamingyoutubeviewer' => 0
        ]));
    break;

    case 'eventschedule':
        die(json_encode([
            'eventlist' => []
        ]));
    break;

    case 'boostedcreature':
        die(json_encode([
            'boostedcreature' => false,
        ]));
    break;

    case 'login':

        $port = $config['lua']['gameProtocolPort'];

        // default world info
        $world = [
            'id' => 0,
            'name' => $config['lua']['serverName'],
            'externaladdressprotected' => $config['lua']['ip'],
            'externalportprotected' => $port,
            'externaladdressunprotected' => $config['lua']['ip'],
            'externalportunprotected' => $port,
            'previewstate' => 0,
            'location' => 'BRA', // BRA, EUR, USA
            'anticheatprotection' => false,
            'pvptype' => array_search($config['lua']['worldType'], ['pvp', 'no-pvp', 'pvp-enforced']),
            'istournamentworld' => false,
            'restrictedstore' => false,
            'currenttournamentphase' => 2
        ];

        $characters = [];
        $account = null;
    
        // common columns
        $columns = 'name, level, sex, vocation, looktype, lookhead, lookbody, looklegs, lookfeet, lookaddons, deletion, lastlogin';
    
        $account = new OTS_Account();
        $account->find($result->accountname);
        $config_salt_enabled = fieldExist('salt', 'accounts');
        $current_password = encrypt(($config_salt_enabled ? $account->getCustomField('salt') : '') . $result->password);

        if (!$account->isLoaded() || $account->getPassword() != $current_password) {
            sendError('Account name or password is not correct.');
        }

        $players = $db->query("select {$columns} from players where account_id = " . $account->getId())->fetchAll();
        foreach ($players as $player) {
            $characters[] = create_char($player);
        }

        $worlds = [$world];
        $playdata = compact('worlds', 'characters');
        $session = [
            'sessionkey' => "$result->accountname\n$result->password",
            'lastlogintime' => (!$account) ? 0 : $account->getLastLogin(),
            'ispremium' => (!$account) ? true : $account->isPremium(),
            'premiumuntil' => (!$account) ? 0 : (time() + ($account->getPremDays() * 86400)),
            'status' => 'active', // active, frozen or suspended
            'returnernotification' => false,
            'showrewardnews' => true,
            'isreturner' => true,
            'fpstracking' => false,
            'optiontracking' => false,
            'tournamentticketpurchasestate' => 0,
            'emailcoderequest' => false
        ];
        die(json_encode(compact('session', 'playdata')));
    break;

    default:
        sendError("Unrecognized event {$action}.");
    break;
}

function create_char($player) {
    global $config;
    return [
        'worldid' => 0,
        'name' => $player['name'],
        'ismale' => intval($player['sex']) === 1,
        'tutorial' => false, //intval($player['lastlogin']) === 0,
        'level' => intval($player['level']),
        'vocation' => $config['vocations'][$player['vocation']],
        'outfitid' => intval($player['looktype']),
        'headcolor' => intval($player['lookhead']),
        'torsocolor' => intval($player['lookbody']),
        'legscolor' => intval($player['looklegs']),
        'detailcolor' => intval($player['lookfeet']),
        'addonsflags' => intval($player['lookaddons']),
        'ishidden' => intval($player['deleted']) === 1,
        'istournamentparticipant' => false,
        'remainingdailytournamentplaytime' => 0
    ];
}
 
Last edited:
Can you try adding your IPv4 Address to your config.lua, Try login with it and add it to your client too? IPv4 Address is the one you opened ports with.
You can find it by writing ipconfig/all in your Command Prompt.
If it still didn't work try following those steps all of them hosts file/firewall ones.
 
weird thing, i switched back to previous update of malucooo's OTX server (11.49 protocol) and everything works fine,
makes me wonder
if isn't port forwarding, ip issues, or bad confug.lua settings, what else could be?
 
weird thing, i switched back to previous update of malucooo's OTX server (11.49 protocol) and everything works fine,
makes me wonder
if isn't port forwarding, ip issues, or bad confug.lua settings, what else could be?
I know that for the otservbr release when using myacc you also need to upload a plugin to login with client 12. Maybe same here.
 
i have the same problem this error and in login php when i try on ,iocal or global {"errorCode":3,"errorMessage":"Unrecognized event ."} i have otserv bvr newest gęsior and newest 1.7 version login.php
 
Back
Top