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

Authentication failed. Incomplete session key. 12.86 and TFS 1.5

Bandytojas

Member
Joined
Jul 26, 2022
Messages
25
Reaction score
6
Hello everyone!
I am trying to launch OT using Newest TFS for 12.87 client using real map - Account maker is Gesior.

I finally got everything working until I was trying to change ip for 12.86. It was quite hectic until I managed to do so. After multiple login.php ws_login.php changes for Gesior I managed to open character list, however when I select character to login it it says Authentication failed. Incomplete session key.

Any idea?
 
do NOT use tfs 1.5.
it's an untested mess, and has literally zero users except for the remaining xml develepoers. so good luck getting help.
Tfs is a huge mess after the protocol upgrade, and a really sad project sadly.

Use tfs 1.4 10.98 and otcv8, or even better tfs 1.2.
 
do NOT use tfs 1.5.
it's an untested mess, and has literally zero users except for the remaining xml develepoers. so good luck getting help.
Tfs is a huge mess after the protocol upgrade, and a really sad project sadly.

Use tfs 1.4 10.98 and otcv8, or even better tfs 1.2.

Well thank you for the suggestions I maybe will try downgrading it, however I would like to try and get this one fixed as server launches without errors which is good sign just login issue at the moment :)
 
Thank you very much for reply Slaw

That's the one for login.php

PHP:
<?php

$_GET['subtopic'] = 'ws_login';
$_REQUEST['subtopic'] = 'ws_login';
include('index.php');

And that's the ws_login.php


PHP:
<?php

header('Content-Type: application/json');

if (!defined('INITIALIZED')) {
    exit;
}

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

# event schedule function
function parseEvent($table1, $date, $table2, $bool)
{
    if ($table1) {
        if ($date) {
            if ($table2) {
                $date = $table1->getAttribute('startdate');
                return date_create("{$date}")->format('U');
            } else {
                $date = $table1->getAttribute('enddate');
                return date_create("{$date}")->format('U');
            }
        } else {
            foreach ($table1 as $attr) {
                if ($attr) {
                    if ($bool) {
                        if (intval($attr->getAttribute($table2)) > 0) {
                            return true;
                        }
                        return false;
                    }
                    return $attr->getAttribute($table2);
                }
            }
        }
    }
    return;
}

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

switch ($action) {
    case 'cacheinfo':
        $playersonline = $SQL->query("select count(1) from `players_online`")->fetchAll();
        echo json_encode(
            [
                'playersonline' => (intval($playersonline[0][0])),
                'twitchstreams' => 0,
                'twitchviewer' => 0,
                'gamingyoutubestreams' => 0,
                'gamingyoutubeviewer' => 0
            ]
        );
        exit;
    case 'eventschedule':
        $eventlist = array();
        $lastupdatetimestamp = time();
        $file_path = Website::getWebsiteConfig()->getValue('serverPath') . 'data/XML/events.xml';
        if (!Website::fileExists($file_path)) {
            echo json_encode([]);
            exit;
        }
        $xml = new DOMDocument;
        $xml->load($file_path);
        $tableevent = $xml->getElementsByTagName('event');
        foreach ($tableevent as $event) {
            if ($event) {
                $tmplist = array();
                $tmplist['colorlight'] = parseEvent($event->getElementsByTagName('colors'), false, 'colorlight', false);
                $tmplist['colordark'] = parseEvent($event->getElementsByTagName('colors'), false, 'colordark', false);
                $tmplist['description'] = parseEvent(
                    $event->getElementsByTagName('description'),
                    false,
                    'description',
                    false
                );
                $tmplist['displaypriority'] = (intval(
                    parseEvent($event->getElementsByTagName('details'), false, 'displaypriority', false)
                ));
                $tmplist['enddate'] = (intval(parseEvent($event, true, false, false)));
                $tmplist['isseasonal'] = parseEvent($event->getElementsByTagName('details'), false, 'isseasonal', true);
                $tmplist['name'] = $event->getAttribute('name');
                $tmplist['startdate'] = (intval(parseEvent($event, true, true, false)));
                $tmplist['specialevent'] = (intval(
                    parseEvent($event->getElementsByTagName('details'), false, 'specialevent', false)
                ));
                $eventlist[] = $tmplist;
            }
        }
        echo json_encode(compact('eventlist', 'lastupdatetimestamp'));
        exit;
    case 'boostedcreature':
        $boostDB = $SQL->query("select * from " . $SQL->tableName('boosted_creature'))->fetchAll();
        foreach ($boostDB as $Tableboost) {
            echo json_encode(
                [
                    'boostedcreature' => true,
                    'raceid' => intval($Tableboost['raceid'])
                ]
            );
        }
        exit;
    case 'login':

        $characters = [];
        $account = null;

        // common columns
        $columns = 'name, level, sex, vocation, looktype, lookhead, lookbody, looklegs, lookfeet, lookaddons, lastlogin';

        $account = new Account();
        $account->loadByEmail($result->email);
        $current_password = Website::encryptPassword($result->password);
        if (!$account->isLoaded() || !$account->isValidPassword($result->password)) {
            sendError('Email or password is not correct. ' . (int)$account->isLoaded() . $result->email);
            exit;
        }

        $port = Website::getServerConfig()->getValue('gameProtocolPort');

        $response = [
            'playdata' => [
                'worlds' => [
                    [
                        'id' => 0,
                        'name' => Website::getServerConfig()->getValue('serverName'),
                        'externaladdress' => Website::getServerConfig()->getValue('ip'),
                        'externalport' => $port,
                        'externaladdressprotected' => Website::getServerConfig()->getValue('ip'),
                        'externalportprotected' => $port,
                        'externaladdressunprotected' => Website::getServerConfig()->getValue('ip'),
                        'externalportunprotected' => $port,
                        'previewstate' => 0,
                        'location' => 'EUR',
                        'anticheatprotection' => false,
                        'pvptype' => array_search(
                            Website::getServerConfig()->getValue('worldType'),
                            ['pvp', 'no-pvp', 'pvp-enforced']
                        ),
                        'istournamentworld' => false,
                        'restrictedstore' => false,
                        'currenttournamentphase' => 2
                    ]
                ],
                'characters' => [],
            ],
            'session' => [
                'sessionkey' => "$result->email\n$result->password",
                'lastlogintime' => $account->getLastLogin(),
                'ispremium' => Website::getServerConfig()->getValue('freePremium') || $account->isPremium(),
                'premiumuntil' => $account->getPremiumEndsAt(),
                'status' => 'active', // active, frozen or suspended
                'returnernotification' => false,
                'showrewardnews' => true,
                'isreturner' => true,
                'fpstracking' => false,
                'optiontracking' => false,
                'tournamentticketpurchasestate' => 0,
                'emailcoderequest' => false
            ]
        ];

        foreach ($account->getPlayers() as $player) {
            $response['playdata']['characters'][] = [
                'worldid' => 0,
                'name' => $player->getName(),
                'ismale' => intval($player->getSex()) === 1,
                'tutorial' => false,
                'level' => intval($player->getLevel()),
                'vocation' => Website::getVocationName($player->getVocation()),
                'outfitid' => intval($player->getLookType()),
                'headcolor' => intval($player->getLookHead()),
                'torsocolor' => intval($player->getLookBody()),
                'legscolor' => intval($player->getLookLegs()),
                'detailcolor' => intval($player->getLookFeet()),
                'addonsflags' => intval($player->getLookBody()),
                'ishidden' => 0,
                'istournamentparticipant' => false,
                'ismaincharacter' => true,
                'dailyrewardstate' => 0,
                'remainingdailytournamentplaytime' => 0
            ];
        }

        echo(json_encode($response));
        exit;

    default:
        sendError("Unrecognized event {$action}.");
        exit;
}
 
Change:
Code:
'sessionkey' => "$result->email\n$result->password",

To:
Code:
'sessionkey' => "$result->email\n$result->password\n".floor(time() / 30),
 
Try this then:
Code:
'sessionkey' => "$result->email\n$result->password\n\n".floor(time() / 30),

Still same?

This one worked well. I am now able to login. Thank you very much for your help. Much much appreciated and could be updated on github :)
 
do NOT use tfs 1.5.
it's an untested mess, and has literally zero users except for the remaining xml develepoers. so good luck getting help.
Tfs is a huge mess after the protocol upgrade, and a really sad project sadly.

Use tfs 1.4 10.98 and otcv8, or even better tfs 1.2.
What do you use for 12.87?
 
i do not use protocol 12+. theres no point. best client is OTCV8. not the trash tibia 12 client. so protocol does not matter. aslong as you can run otcv8 together with ur server its fine.

if you want to use protocol 12 then use saiyansking distro or even otbr is better quality than tfs this days
 
i do not use protocol 12+. theres no point. best client is OTCV8. not the trash tibia 12 client. so protocol does not matter. aslong as you can run otcv8 together with ur server its fine.

if you want to use protocol 12 then use saiyansking distro or even otbr is better quality than tfs this days

Could you please share your opinion why 12.87 is no point? I haven't played Tibia since It was 7.6 :D
Did they messed tibia so badly? I got it loaded and seems that everything working except if there is no interest of players for OT 12.87 client then maybe there is no point of running it.
 
Could you please share your opinion why 12.87 is no point? I haven't played Tibia since It was 7.6 :D
Did they messed tibia so badly? I got it loaded and seems that everything working except if there is no interest of players for OT 12.87 client then maybe there is no point of running it.

tibia 12+ client has like 100 different buttons with different systems and shit. to me this is very ugly, just go check some real tibia streamer. client is such a mess. and none of these systems even work on current tfs. and there are barely any tools to customize the client, so u are stuck just copying real tibia. and overall this client is just very laggy compared to otclient and the old clients

meanwhile with otcv8 you can customize EVERYTHING with just lua. there are ready features to enable to get amazing features working, no coding requirement
and i do not think tibia 12 servers are popular. check otservlist. there is literally only giveria on otservlist that is pure tibia 12 client, the rest tibia 12+ servers on otservlist also allow lower clients and majority of the players play on those.servers like gunzodus tried making pure tibia 12 servers, but it ended up failing more hard then their previous servers

Post automatically merged:

pretty much all servers use otcv8 this days. if you're a custom server, making cool custom ots. you use otcv8 because it has the best features and performance. if you're a random player playing on real tibia ots, you use otcv8 because it has also the best bot, it's smoothest client.
it is a revolutionary client sadly tfs devs and otland discouarges it, because the owner used to charge money for the source (which is not needed at all)
 
tibia 12+ client has like 100 different buttons with different systems and shit. to me this is very ugly, just go check some real tibia streamer. client is such a mess. and none of these systems even work on current tfs. and there are barely any tools to customize the client, so u are stuck just copying real tibia. and overall this client is just very laggy compared to otclient and the old clients

meanwhile with otcv8 you can customize EVERYTHING with just lua. there are ready features to enable to get amazing features working, no coding requirement
and i do not think tibia 12 servers are popular. check otservlist. there is literally only giveria on otservlist that is pure tibia 12 client, the rest tibia 12+ servers on otservlist also allow lower clients and majority of the players play on those.servers like gunzodus tried making pure tibia 12 servers, but it ended up failing more hard then their previous servers

Post automatically merged:

pretty much all servers use otcv8 this days. if you're a custom server, making cool custom ots. you use otcv8 because it has the best features and performance. if you're a random player playing on real tibia ots, you use otcv8 because it has also the best bot, it's smoothest client.
it is a revolutionary client sadly tfs devs and otland discouarges it, because the owner used to charge money for the source (which is not needed at all)
Its 4k for the source files still. There are limits to what you can do with it if you don't have the sources. With that being said if you don't need to modify some of the more critical systems then otcv8 is the way to go. It includes an auto updater and being able to secure your client files.
 
tibia 12+ client has like 100 different buttons with different systems and shit. to me this is very ugly, just go check some real tibia streamer. client is such a mess. and none of these systems even work on current tfs. and there are barely any tools to customize the client, so u are stuck just copying real tibia. and overall this client is just very laggy compared to otclient and the old clients

meanwhile with otcv8 you can customize EVERYTHING with just lua. there are ready features to enable to get amazing features working, no coding requirement
and i do not think tibia 12 servers are popular. check otservlist. there is literally only giveria on otservlist that is pure tibia 12 client, the rest tibia 12+ servers on otservlist also allow lower clients and majority of the players play on those.servers like gunzodus tried making pure tibia 12 servers, but it ended up failing more hard then their previous servers

Post automatically merged:

pretty much all servers use otcv8 this days. if you're a custom server, making cool custom ots. you use otcv8 because it has the best features and performance. if you're a random player playing on real tibia ots, you use otcv8 because it has also the best bot, it's smoothest client.
it is a revolutionary client sadly tfs devs and otland discouarges it, because the owner used to charge money for the source (which is not needed at all)

Thank you for your extended reply. I will keep it all in mind.

Meanwhile I will test everything and see how it goes :) If needed I will change the client.

I can see that most popular servers are 8.6 but there are few 12+ that has 100+ players and I wanted to make one which would be close to real.

For now I have no issues with TFS 1.5, if there are known bugs please link me up :) Client works fine, server works fine most of features on the client working - however there are a lot of client features new for me so I will be testing.

By the way I was into very first otservers where everything you try were buggy :D So far I see huge improvement in now a days server systems. Apart from few monsters who failed to spawn as I don't have scripts yet I have no issues at all.
 
Back
Top