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

[IOLoginData::gameworldAuthentication] Wrong Password!

sikret

Member
Joined
Dec 15, 2012
Messages
43
Reaction score
6
Hello,

I use MyAcc maker and I have problem with that. I create character and when i try to login by Tibia Client 12.40 I have that information:
[IOLoginData::gameworldAuthentication] Wrong Password!

My ots engine is TFS 1.3. I compiled from the newest sources.
Changed config.local.php
$config['client'] = '1240';
and used:
myaac tibia 12 login plugin

but problem still is.

Can some one give me advice?
 
Last edited:
Why would you use Znote then add myacc tibia 12 login to it? Both are different, If you gonna use myacc tibia 12 login then use myaac.
 
Myacc od course. My mistake

This will probably fix your issue and fix converting from 12 to 12.40. Rather it will fix people pming that acc name doesn't work in e-mail textview.

iologindata.cpp
Lua:
uint32_t IOLoginData::gameworldAuthentication(const std::string& email, const std::string& password, std::string& characterName)
{
  Database& db = Database::getInstance();

  std::ostringstream query;
  query << "SELECT `id`, `password` FROM `accounts` WHERE `email` = " << db.escapeString(email) << " or `name` = " << db.escapeString(email);
  DBResult_ptr result = db.storeQuery(query.str());
  if (!result) {
    std::cout << "[IOLoginData::gameworldAuthentication] Account not found!" << std::endl;
    return 0;
  }

OTS_Account.php - myAcc
PHP:
    public function findByEmailAndName($email)
    {
        // finds player's ID
        $value =
        $id = $this->db->query('SELECT `id` FROM `accounts` WHERE `email` = ' . $this->db->quote($email) . ' or `name` = ' . $this->db->quote($email) )->fetch();

        // if anything was found
        if( isset($id['id']) )
        {
            $this->load($id['id']);
        }
    }

login.php
PHP:
 $account->findByEmail($result->email);
to
PHP:
 $account->findByEmailAndName($result->email);


It will accept both email and account name. Do not forget to turn unique emails function in myacc.
 
Last edited:
This will probably fix your issue and fix converting from 12 to 12.40. Rather it will fix people pming that acc name doesn't work in e-mail textview.

iologindata.cpp
Lua:
uint32_t IOLoginData::gameworldAuthentication(const std::string& email, const std::string& password, std::string& characterName)
{
  Database& db = Database::getInstance();

  std::ostringstream query;
  query << "SELECT `id`, `password` FROM `accounts` WHERE `email` = " << db.escapeString(email) << " or `name` = " << db.escapeString(email);
  DBResult_ptr result = db.storeQuery(query.str());
  if (!result) {
    std::cout << "[IOLoginData::gameworldAuthentication] Account not found!" << std::endl;
    return 0;
  }

OTS_Account.php - myAcc
PHP:
    public function findByEmailAndName($email)
    {
        // finds player's ID
        $value =
        $id = $this->db->query('SELECT `id` FROM `accounts` WHERE `email` = ' . $this->db->quote($email) . ' or `name` = ' . $this->db->quote($email) )->fetch();

        // if anything was found
        if( isset($id['id']) )
        {
            $this->load($id['id']);
        }
    }

login.php
PHP:
 $account->findByEmail($result->email);
to
PHP:
 $account->findByEmailAndName($result->email);


It will accept both email and account name. Do not forget to turn unique emails function in myacc.


I can't find that line:
PHP:
 $account->findByEmail($result->email);
Post automatically merged:

Ok I find it and changed but problem still is....
Post automatically merged:

Code:
Do not forget to turn unique emails function in myacc.

How?
 
Last edited:
I can't find that line:
PHP:
 $account->findByEmail($result->email);
Post automatically merged:

Ok I find it and changed but problem still is....
Post automatically merged:

Code:
Do not forget to turn unique emails function in myacc.

How?
In config.
 

Post automatically merged:

I use UniServer.
Gesior acc works well but old version so I need myacc to work.
Post automatically merged:

In config.

I did all Your steps (thanks) but now I have that Error ^
 
Last edited:
functions.php
PHP:
function encrypt($str)
{
    global $config;
    if(isset($config['database_salt'])) // otserv
        $str .= $config['database_salt'];

    $encryptionType = $config['database_encryption'];
    if(isset($encryptionType) && strtolower($encryptionType) !== 'plain')
    {
        if($encryptionType === 'vahash')
            return base64_encode(hash('sha256', $str));

        return hash($encryptionType, $str);
    }

    return $str;
}

config.lua

Lua:
-- MySQL
mysqlHost = "127.0.0.1"
mysqlUser = "root"
mysqlPass = "xxx"
mysqlDatabase = "ots"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"
encryptionType = "sha1"
Post automatically merged:

What encryption are u using? Did u do any changes in source?

That one You say in iologindata.cpp and recompile server.
 
functions.php
PHP:
function encrypt($str)
{
    global $config;
    if(isset($config['database_salt'])) // otserv
        $str .= $config['database_salt'];

    $encryptionType = $config['database_encryption'];
    if(isset($encryptionType) && strtolower($encryptionType) !== 'plain')
    {
        if($encryptionType === 'vahash')
            return base64_encode(hash('sha256', $str));

        return hash($encryptionType, $str);
    }

    return $str;
}

config.lua

Lua:
-- MySQL
mysqlHost = "127.0.0.1"
mysqlUser = "root"
mysqlPass = "xxx"
mysqlDatabase = "ots"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"
encryptionType = "sha1"
Post automatically merged:



That one You say in iologindata.cpp and recompile server.
What ots distro are u using?
 
Site > after "Submit" new acc
PHP:
Fatal error: Call to undefined method OTS_Account::findByEMail() in E:\Programy\UniServerZ\www\system\pages\createaccount.php on line 103

createaccount.php
PHP:
    if($config['account_mail_unique'])
    {
        $test_email_account = new OTS_Account();
        $test_email_account->findByEMail($email);
        if($test_email_account->isLoaded())
            $errors['email'] = 'Account with this e-mail address already exist.';
    }
Post automatically merged:

Change

PHP:
$test_email_account->findByEMail($email);

to

PHP:
$test_email_account->findByEMailAndName($email);


and create account is work now, but still can't log to server "Wrong Pasword"

I'm totaly confused :/
Post automatically merged:

delete those 2 lines and try
passwordType = "sha1"
encryptionType = "sha1"

no work
 
Did u use email or account name? Did u try both? Did u set any database_encryption or salt?

Tibia client 12.40 only accept email adress and password to login. In config on my distribution i put 'sha1'. Strange thing is only 1 acc handle with that client every others fail.

Changing UniServer to xampp change something?
 
Tibia client 12.40 only accept email adress and password to login. In config on my distribution i put 'sha1'. Strange thing is only 1 acc handle with that client every others fail.

Changing UniServer to xampp change something?
Check if other accounts got correct hashes in sha-1 not other.
 
Back
Top