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

login12

void newbie scripter()
Joined
Feb 26, 2011
Messages
134
Reaction score
9
Location
Brazil
Someone have the login.php for 11.03 newversion tibia?
I tryed all scripts here, but when i get character list so i cant enter in game.

and this script is buged... i put just ACC NAME and him got my account... dont need password wtf

Code:
<?php
//really ugly script, feel free to release a better one :)
// be aware that we don't even test the password in this script
$host = "localhost";
$user = "root";
$passwd = "";
$db = "otserv";

$lnk = mysql_connect("$host", "$user", "$passwd") or die ('ERROR MySql: ' . mysql_error());
mysql_select_db("$db", $lnk) or die ('ERROR MySql: ' . mysql_error());   

$request_body = file_get_contents('php://input');
$result = json_decode($request_body, true);

$acc = $result["accountname"];
$password = $result["password"];

$dbResource = mysql_query("SELECT `id` FROM `accounts` WHERE `name` = '$acc' LIMIT 1;");

if(!$dbResource) {
    die("failed to get account.");
}

$dbRet = mysql_fetch_array($dbResource);

$accId = $dbRet[0];

$dbResource = mysql_query("SELECT `name` FROM `players` WHERE `account_id` = '$accId';");
if(!$dbResource) {
    die("failed to get charactters.");
}

$accArray = array();

while ($dbRet = mysql_fetch_array($dbResource, MYSQL_BOTH)) {
    $dict = array("worldid" => 0, "name" => $dbRet["name"]);
    $accArray[] = $dict;
}

$data = array();

$session = array(
    "sessionkey" => $acc . "\n" . $password,
    "lastlogintime" => 1461290246,
    "ispremium" => true,
    "premiumuntil" => 1463788913,
    "status" => "active"   
);

$data["session"] = $session;

$playerData = array();

$world = array(
    "id" => 0,
    "name" => "EveryOTS",
    "externaladdress" => "", // masked ;>
    "externalport" => 7172,
    "previewstate" => 0
);

$worlds = array($world);
$playerData["worlds"] = $worlds;
$playerData["characters"] = $accArray;


$data["playdata"] = $playerData;

echo json_encode($data);


//echo '{   "session": {     "sessionkey": "DhZUxAPjDFQqwCy65z2JQKB145750y",     "lastlogintime": 1461290246,     "ispremium": true,     "premiumuntil": 1463788913,     "status": "active"   },   "playdata": {     "worlds": [       {         "id": 0,         "name": "Amera",         "externaladdress": "127.0.0.1",         "externalport": 7172,         "previewstate": 0       },       {         "id": 1,         "name": "Chrona",         "externaladdress": "127.0.0.1",         "externalport": 7172,         "previewstate": 0       },       {         "id": 2,         "name": "Eldera",         "externaladdress": "127.0.0.1",         "externalport": 7172,         "previewstate": 0       }     ],     "characters": [       {         "worldid": 0,         "name": "Paladin"       },       {         "worldid": 1,         "name": "Sorcerer"       },       {         "worldid": 2,         "name": "Druid"       }     ]   },   "survey": {     "id": 759822,     "invitationtext": "Dear Tibian! A few days ago, you have received an email invitation to join the Beta phase of Tibia 11. We\'d love to hear about your experiences with client version 11.0 so please help us with your feedback by completing this survey.",     "invitationtoken": "9ILillainoj7CsWxxoCRgOqSnGtt3L",     "endtimestamp": 1461535200   } }';

/*
example json
{
  "session": {
    "sessionkey": "DhZUxAPjDFQqwCy65z2JQKB145750y",
    "lastlogintime": 1461290246,
    "ispremium": true,
    "premiumuntil": 1463788913,
    "status": "active"
  },
  "playdata": {
    //an array/list of worlds and theirs data
    "worlds": [
      {
        "id": 0,
        "name": "Amera",
        "externaladdress": "66.150.54.19",
        "externalport": 7171,
        "previewstate": 0
      },
      {
        "id": 1,
        "name": "Chrona",
        "externaladdress": "193.200.156.112",
        "externalport": 7171,
        "previewstate": 0
      },
      {
        "id": 2,
        "name": "Eldera",
        "externaladdress": "66.150.54.94",
        "externalport": 7171,
        "previewstate": 0
      }
    ],
    "characters": [
      {
        "worldid": 0,
        "name": "Paladin"
      },
      {
        "worldid": 1,
        "name": "Sorcerer"
      },
      {
        "worldid": 2,
        "name": "Druid"
      }
    ]
  },
  //i believe this can just be removed, not needed
}
*/
?>
I receveid this msg:
"The remote host closed the connection"

and i cant enter..
 
Last edited:

Techrlz

System Manager & Programmer
Premium User
Joined
Feb 20, 2014
Messages
1,063
Reaction score
156
Someone have the login.php for 11.03 newversion tibia?
I tryed all scripts here, but when i get character list so i cant enter in game.

and this script is buged... i put just ACC NAME and him got my account... dont need password wtf

Code:
<?php
//really ugly script, feel free to release a better one :)
// be aware that we don't even test the password in this script
$host = "localhost";
$user = "root";
$passwd = "";
$db = "otserv";

$lnk = mysql_connect("$host", "$user", "$passwd") or die ('ERROR MySql: ' . mysql_error());
mysql_select_db("$db", $lnk) or die ('ERROR MySql: ' . mysql_error());  

$request_body = file_get_contents('php://input');
$result = json_decode($request_body, true);

$acc = $result["accountname"];
$password = $result["password"];

$dbResource = mysql_query("SELECT `id` FROM `accounts` WHERE `name` = '$acc' LIMIT 1;");

if(!$dbResource) {
    die("failed to get account.");
}

$dbRet = mysql_fetch_array($dbResource);

$accId = $dbRet[0];

$dbResource = mysql_query("SELECT `name` FROM `players` WHERE `account_id` = '$accId';");
if(!$dbResource) {
    die("failed to get charactters.");
}

$accArray = array();

while ($dbRet = mysql_fetch_array($dbResource, MYSQL_BOTH)) {
    $dict = array("worldid" => 0, "name" => $dbRet["name"]);
    $accArray[] = $dict;
}

$data = array();

$session = array(
    "sessionkey" => $acc . "\n" . $password,
    "lastlogintime" => 1461290246,
    "ispremium" => true,
    "premiumuntil" => 1463788913,
    "status" => "active"  
);

$data["session"] = $session;

$playerData = array();

$world = array(
    "id" => 0,
    "name" => "EveryOTS",
    "externaladdress" => "", // masked ;>
    "externalport" => 7172,
    "previewstate" => 0
);

$worlds = array($world);
$playerData["worlds"] = $worlds;
$playerData["characters"] = $accArray;


$data["playdata"] = $playerData;

echo json_encode($data);


//echo '{   "session": {     "sessionkey": "DhZUxAPjDFQqwCy65z2JQKB145750y",     "lastlogintime": 1461290246,     "ispremium": true,     "premiumuntil": 1463788913,     "status": "active"   },   "playdata": {     "worlds": [       {         "id": 0,         "name": "Amera",         "externaladdress": "127.0.0.1",         "externalport": 7172,         "previewstate": 0       },       {         "id": 1,         "name": "Chrona",         "externaladdress": "127.0.0.1",         "externalport": 7172,         "previewstate": 0       },       {         "id": 2,         "name": "Eldera",         "externaladdress": "127.0.0.1",         "externalport": 7172,         "previewstate": 0       }     ],     "characters": [       {         "worldid": 0,         "name": "Paladin"       },       {         "worldid": 1,         "name": "Sorcerer"       },       {         "worldid": 2,         "name": "Druid"       }     ]   },   "survey": {     "id": 759822,     "invitationtext": "Dear Tibian! A few days ago, you have received an email invitation to join the Beta phase of Tibia 11. We\'d love to hear about your experiences with client version 11.0 so please help us with your feedback by completing this survey.",     "invitationtoken": "9ILillainoj7CsWxxoCRgOqSnGtt3L",     "endtimestamp": 1461535200   } }';

/*
example json
{
  "session": {
    "sessionkey": "DhZUxAPjDFQqwCy65z2JQKB145750y",
    "lastlogintime": 1461290246,
    "ispremium": true,
    "premiumuntil": 1463788913,
    "status": "active"
  },
  "playdata": {
    //an array/list of worlds and theirs data
    "worlds": [
      {
        "id": 0,
        "name": "Amera",
        "externaladdress": "66.150.54.19",
        "externalport": 7171,
        "previewstate": 0
      },
      {
        "id": 1,
        "name": "Chrona",
        "externaladdress": "193.200.156.112",
        "externalport": 7171,
        "previewstate": 0
      },
      {
        "id": 2,
        "name": "Eldera",
        "externaladdress": "66.150.54.94",
        "externalport": 7171,
        "previewstate": 0
      }
    ],
    "characters": [
      {
        "worldid": 0,
        "name": "Paladin"
      },
      {
        "worldid": 1,
        "name": "Sorcerer"
      },
      {
        "worldid": 2,
        "name": "Druid"
      }
    ]
  },
  //i believe this can just be removed, not needed
}
*/
?>
I receveid this msg:
"The remote host closed the connection"

and i cant enter..

//really ugly script, feel free to release a better one :)
// be aware that we don't even test the password in this script

^ ^ ^
 

ArkSeyonet

Chancho
Joined
Nov 11, 2008
Messages
201
Reaction score
11
Location
Louisiana, USA
Has anyone else ran into the problem using this script where it will allow the actual localhost to enter the game, but if another computer on the same network tries to enter the game it just fails to enter gameworld?
 
OP
Yamaken

Yamaken

Pro OpenTibia Developer
Premium User
Joined
Jul 27, 2013
Messages
457
Reaction score
326
Has anyone else ran into the problem using this script where it will allow the actual localhost to enter the game, but if another computer on the same network tries to enter the game it just fails to enter gameworld?
I think its because its using 127.0.0.1 as the game world ip.
 

ArkSeyonet

Chancho
Joined
Nov 11, 2008
Messages
201
Reaction score
11
Location
Louisiana, USA
I think its because its using 127.0.0.1 as the game world ip.
You're correct, I figured it out a couple days ago after realizing I had spent so much time playing around with the script and source edit that I forgot to adjust the ip and other basic settings. I didn't want to double post so I never said anything. Thank you anyway.
 

comedinha

Member
Joined
Apr 27, 2008
Messages
52
Reaction score
84
Location
Brazil
The new 11.10 change the login:
{"session":{"sessionkey":"sessionkey","lastlogintime":1486580678,"ispremium":false,"premiumuntil":0,"status":"active"},"playdata":{"worlds":[{"id":0,"name":"Fidera","externaladdress":"tibia-ip-us.ciproxy.com","externalport":7171,"previewstate":0,"location":"USA","externaladdressunprotected":"tibia-pool-us.ciproxy.com","externaladdressprotected":"tibia-ip-us.ciproxy.com"},{"id":1,"name":"Quilia","externaladdress":"tibia-ip-eu.ciproxy.com","externalport":7171,"previewstate":0,"location":"EUR","externaladdressunprotected":"tibia-pool-eu.ciproxy.com","externaladdressprotected":"tibia-ip-eu.ciproxy.com"}],"characters":[{"worldid":1,"name":"Char1","ismale":true,"tutorial":false},{"worldid":1,"name":"Char2","ismale":true,"tutorial":false},{"worldid":1,"name":"Char3","ismale":true,"tutorial":false},{"worldid":0,"name":"Char4","ismale":true,"tutorial":false}]}}
 

Zak.Tibiam

Member
Joined
Mar 25, 2012
Messages
123
Reaction score
2
The new 11.10 change the login:
{"session":{"sessionkey":"sessionkey","lastlogintime":1486580678,"ispremium":false,"premiumuntil":0,"status":"active"},"playdata":{"worlds":[{"id":0,"name":"Fidera","externaladdress":"tibia-ip-us.ciproxy.com","externalport":7171,"previewstate":0,"location":"USA","externaladdressunprotected":"tibia-pool-us.ciproxy.com","externaladdressprotected":"tibia-ip-us.ciproxy.com"},{"id":1,"name":"Quilia","externaladdress":"tibia-ip-eu.ciproxy.com","externalport":7171,"previewstate":0,"location":"EUR","externaladdressunprotected":"tibia-pool-eu.ciproxy.com","externaladdressprotected":"tibia-ip-eu.ciproxy.com"}],"characters":[{"worldid":1,"name":"Char1","ismale":true,"tutorial":false},{"worldid":1,"name":"Char2","ismale":true,"tutorial":false},{"worldid":1,"name":"Char3","ismale":true,"tutorial":false},{"worldid":0,"name":"Char4","ismale":true,"tutorial":false}]}}
where is this change? @comedinha @Jo3Bingham
 

comedinha

Member
Joined
Apr 27, 2008
Messages
52
Reaction score
84
Location
Brazil
where is this change? @comedinha @Jo3Bingham
Only need add the changes on world...

$dict = array(
"id" => (int)$dbRet["id"],
"name" => $dbRet["name"],
"externaladdress" => $dbRet["ip"],
"externalport" => (int)$ServerPort,
"previewstate" => (int)$dbRet["previewer"],
"location" => $dbRet["location"],
"externaladdressunprotected" => $dbRet["ip"],
"externaladdressprotected" => $dbRet["ip"]
);

$dict = array(
"worldid" => (int)$dbRet["world_id"],
"name" => $dbRet["name"],
"ismale" => $isMale,
"tutorial" => false
);
 
Last edited:

silveralol

Veteran OT User
Joined
Mar 16, 2010
Messages
1,461
Reaction score
182
with this chances is possible to connect using 11.10 ? or need the changes like your connection.cpp @comedinha
 

silveralol

Veteran OT User
Joined
Mar 16, 2010
Messages
1,461
Reaction score
182
I have one more question, also how to make this changes in login.php ?
this is how it look atm
Code:
$gameserver = $config['gameserver'];
            $response = array(
                'session' => array(
                    'sessionkey' => $username."\n".$jsonObject->password."\n".$token."\n".floor(time() / 30),
                    'lastlogintime' => 0,
                    'ispremium' => ($account['premdays'] > 0) ? true : false,
                    'premiumuntil' => time() + ($account['premdays'] * 86400),
                    'status' => 'active'
                ),
                'playdata' => array(
                    'worlds' => array(
                        array(
                            'id' => 0,
                            'name' => $gameserver['name'],
                            'externaladdress' => $gameserver['ip'],
                            'externalport' => $gameserver['port'],
                            'previewstate' => 0
                        )
                    ),
                    'characters' => array(
                        //array( 'worldid' => ASD, 'name' => asd ),
                    )
                )
            );
 

comedinha

Member
Joined
Apr 27, 2008
Messages
52
Reaction score
84
Location
Brazil
I have one more question, also how to make this changes in login.php ?
this is how it look atm
Code:
$gameserver = $config['gameserver'];
            $response = array(
                'session' => array(
                    'sessionkey' => $username."\n".$jsonObject->password."\n".$token."\n".floor(time() / 30),
                    'lastlogintime' => 0,
                    'ispremium' => ($account['premdays'] > 0) ? true : false,
                    'premiumuntil' => time() + ($account['premdays'] * 86400),
                    'status' => 'active'
                ),
                'playdata' => array(
                    'worlds' => array(
                        array(
                            'id' => 0,
                            'name' => $gameserver['name'],
                            'externaladdress' => $gameserver['ip'],
                            'externalport' => $gameserver['port'],
                            'previewstate' => 0,
                            'location' => "US", //Server Location
                            'externaladdressunprotected' => $gameserver['ip'],
                            'externaladdressprotected' => $gameserver['ip']
                        )
                    ),
                    'characters' => array(
                        //array(
                            'worldid' => ASD,
                            'name' => asd,
                            'ismale' => false, //Put to check sex
                            'tutorial' => false
                        ),
                    )
                )
            );
 

Marahin

New Member
Joined
Jan 28, 2009
Messages
4
Reaction score
0
Is there any way to run 11.01 on Forgotten Server? Can someone point me where to look? I can get to the character screen, but after selecting a character - TFS closes the socket and connection :'(
 

FealsaN

New Member
Joined
Aug 31, 2010
Messages
1
Reaction score
1
Hi guys! I can go to character lista but when i try to enter i get that messenger

Screenshot

Im on 11.32.5287

Is there a solution for it?
 

CipsoftStinks

www.relicaria.com
Joined
Oct 1, 2016
Messages
905
Reaction score
113
Location
Chile
@silveralol Znote AAC now supports Client 11 loginWebService.
Client 11 support. (loginWebService) · Znote/[email protected] · GitHub

Grab and configure latest version of Znote AAC, point the @Jo3Bingham Client 11 IP changer toward your URL and your good to go.
do i have to edit something in login.php @Znote ??? im pretty sure i did everything okey with the client i have the same name t config-lua and config.php
i can get the character list ut whee i try to log in i get erros as these
im using otx 11.47- tfs1.3
char list



errors...



we should stop using tibia clients u.u
 
Top