• 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 login "Connection Refused"

Taurus

Texass
Joined
Jan 11, 2009
Messages
616
Solutions
2
Reaction score
30
Location
United States
My index.php login script... From THIS THREAD

PHP:
<?php
    if($_SERVER['HTTP_USER_AGENT'] == "Mozilla/5.0") {
        @error_reporting(0);
        @ini_set('display_errors', 'Off');
        header("Content-Type: application/json");

        $loginInfo = json_decode(file_get_contents("php://input"));
        $accountName = $loginInfo->{"accountname"};
        $password = $loginInfo->{"password"};

        if($accountName == "" || $password == "") {
            die('{"errorCode":3,"errorMessage":"Account name or password is incorrect."}');
        }

        $MySQL_Host = "127.0.0.1";
        $MySQL_User = "FROM CONFIG.LUA";
        $MySQL_Password = "FROM CONFIG.LUA";
        $MySQL_DB = "FROM CONFIG.LUA";

        $SQL = new mysqli($MySQL_Host, $MySQL_User, $MySQL_Password, $MySQL_DB);

        if(mysqli_connect_error()) {
            die('{"errorCode":3,"errorMessage":"Internal error. Please try again later or contact customer support if the problem persists."}');
        }

        $AccountQuery = $SQL->query("SELECT * FROM `accounts` WHERE `name` = '".$SQL->real_escape_string($accountName)."' AND `password` = '".SHA1($SQL->real_escape_string($password))."'")->fetch_array(MYSQLI_ASSOC);
        if($AccountQuery["name"] != $accountName) {
            die('{"errorCode":3,"errorMessage":"Whoa, wrong password."}');
        }

        $AccountID = $AccountQuery["id"];
        $Secret = $AccountQuery["secret"];
        $Premdays = $AccountQuery["premdays"];

        $CharacterQuery = $SQL->query("SELECT `name` FROM `players` WHERE `account_id` = '".$AccountID."'")->fetch_all(MYSQLI_ASSOC);

        $worldID = 0;
        $worldName = "Classic Community";
        $serverAddress = $_SERVER["SERVER_ADDR"];
        $serverPort = 7172;
        $freePremium = false;

        echo '{"session":{"sessionkey":"'.$accountName.'\n'.$password.'\n'.$secret.'\n'.(floor(time() / 30)).'","lastlogintime":0,"ispremium":'.($Premdays > 0 || $freePremium ? "true" : "false").',"premiumuntil":'.($freePremium ? "0" : time() + ($Premdays * 86400)).',"status":"active"},"playdata":{"worlds":[{"id":'.$worldID.',"name":"'.$worldName.'","externaladdress":"'.$serverAddress.'","externalport":'.$serverPort.',"previewstate":0}],"characters":[';
        foreach($CharacterQuery as $Character) {
            if($Character != $CharacterQuery[0]) {
                echo ',';
            }
            echo '{"worldid":'.$worldID.',"name":"'.$Character["name"].'"}';
        }
        echo ']}}';
    return;
    }
?>

When I connect it says "connection refused" after a few seconds.

In config.lua I have tried all of these:
Lua:
-- Version Manual
clientVersionMin = 1098
clientVersionMax = 1200

-- Version Manual
clientVersionMin = 1098
clientVersionMax = 1100

-- Version Manual
clientVersionMin = 1098
clientVersionMax = 1111

Then in client.exe I edit like they said in that thread. Can anyone tell me what I've missed so far?

TFS 1.3 (OTX)
 
Last edited:
Please read the rules, Rules for the Support board
#5

No TFS version AFAIK has had client versions in config.lua, so im guessing OTX?
In that case what edits did you do to TFS?
Are you sure you edited the client correctly? (Try the IP changer if you are unsure, should be one on github written in C# if I remember correctly).
 
I really appreciate my (tiny) place in the OT community. Please believe me when I say that I have read the rules, and that I just committed an honest mistake.

TFS 1.3 (OTX)

The IPchanger just crashes... at least the one linked in that post does. I am fairly certain the client is edited correctly. Unless there is a trick to adding those "nul" after the ip (to match size..)

I added them until the client would open, most of the time open client, did nothing. (tibia icon flash, then nothing)...

Then once I got it almost right it gave a funky DLL error which went away when I added one more NUL. I appreciate the help WibbenZ, I totally forgot to put version this time.
 
Last edited:
I really appreciate my (tiny) place in the OT community. Please believe me when I say that I have read the rules, and that I just committed an honest mistake.

TFS 1.3 (OTX)

The IPchanger just crashes... at least the one linked in that post does. I am fairly certain the client is edited correctly. Unless there is a trick to adding those "nul" after the ip (to match size..)

I added them until the client would open, most of the time open client, did nothing. (tibia icon flash, then nothing)...

Then once I got it almost right it gave a funky DLL error which went away when I added one more NUL. I appreciate the help WibbenZ, I totally forgot to put version this time.

It happens all of us, np, thats why we inform everyone insted of banning ppl :)

It's been long since I hexed a client, but if I remember correctly it was either 0x00, 00 or 0000 to replace a character (might be toally wrong, but give it a try)
But are you talking about this one? OpenTibia - Tibia 11 IP Changer
No ide if they updated something when they released the new test server, but that might be why???

Not sure if it's my computer or w/e but for some reason Tibia 11 crashes about 50% of the times when I open it, no ide why what I do is use the task manager to close all the process and then it NORMALLY works :D

Once again no worries, as long as you learn your mistake if it's one thing I hate it's when people keep repeating the same mistake (atleast when it's less than a couple of hours ... jesus.. :D)
 
But are you talking about this one?
Yeah, the bingham one.

Well, this was more of a question out of curiosity... I would really like to be able to use Tibia 11, but I know there's really not a lot of support for it yet.

Not giving up, just not gonna mess with it for hours and hours haha.

I'll be focusing on adding content to my server instead. Hopefully someone will have this script for 1.3 soon and then I'll have a LOT of work to do.
 
Yeah, the bingham one.

Well, this was more of a question out of curiosity... I would really like to be able to use Tibia 11, but I know there's really not a lot of support for it yet.

Not giving up, just not gonna mess with it for hours and hours haha.

I'll be focusing on adding content to my server instead. Hopefully someone will have this script for 1.3 soon and then I'll have a LOT of work to do.

There will most likely be alot more support when 1.3 is released or when 2.0 is started / released, till then you need to learn and do alot of the things yourself.
 
most likely be alot more support when 1.3 is released or when 2.0 is started
That's awesome. I really am out of the loop and picking up from a 6 year retirement. So totally lost it's not even funny.


you need to learn
That's my mission all day every day lol.

You're a big help, Thanks dude.
 
Back
Top