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

c/c++ mysql to gesior acc

Devlinn

Member
Joined
Mar 25, 2015
Messages
295
Reaction score
6
hi otland.
i have problem on tibiafun source not compatible to acc gesior i need some help to fix this
ioaccountsql.cpp
http://wklej.to/DWTyK
ioplayersql.cpp
http://wklej.to/80sW7

i work on this 8hours and i \dont know how to fix

create account on acc maker dont work
when io try logn to serwer i see wrong password or name
 
Last edited:
Don't edit your sources because the website doesn't work. Edit the website instead. But on topic, check if the server uses any type of encryption or plaintext passwords and then compare it to your website.
 
Don't edit your sources because the website doesn't work. Edit the website instead. But on topic, check if the server uses any type of encryption or plaintext passwords and then compare it to your website.
problem i think is on source
id = login
password = password
so if i have id 57 this is my login
on gesior when i create account login = table name (so if i put name 555) this doesnt work beacuse my source use id to login

if you guys dont understand me i can give you a teamvievier or wideo what I mean
 
problem i think is on source
id = login
password = password
so if i have id 57 this is my login
on gesior when i create account login = table name (so if i put name 555) this doesnt work beacuse my source use id to login

if you guys dont understand me i can give you a teamvievier or wideo what I mean

Then change gesior, what sources are you using?, what gesior version are you using?
 
You will have to do alot of changes to get gesior to work with that AAC (most likely).
Would be simpler to just do a new one or use nicaw aac or w/e it's called.
Also I highly doubt that server even uses salt xD
server do use salt but on this version i can create my own name account
on older acc gesior i automatic create account name
ok i try change but it is easier to change a bit in the source?
 
server do use salt but on this version i can create my own name account
on older acc gesior i automatic create account name
ok i try change but it is easier to change a bit in the source?

Well you will have to rewrite the authenticator code, protocolgame.cpp and protcollogin.cpp aswell as any related files to the authenticator.
 
Well you will have to rewrite the authenticator code, protocolgame.cpp and protcollogin.cpp aswell as any related files to the authenticator.
hmm ok i try i need change id to name? when i change i can login to serwer but i dont see character :D
edit i wrong download :D
 
Last edited:
What you should note is that if you really want to use old codes then you should also be ready to do alot yourself.
Nicaw was the old website that was used before Gesior AAC was created - so in that case you have to find a version of Nicaw AAC that is so old that it will match your server.
Or rewrite the aac to make it serach for the acc id insted of the acc name.
 
What you should note is that if you really want to use old codes then you should also be ready to do alot yourself.
Nicaw was the old website that was used before Gesior AAC was created - so in that case you have to find a version of Nicaw AAC that is so old that it will match your server.
Or rewrite the aac to make it serach for the acc id insted of the acc name.
i change something on source i can login on account but dont see character look here:
Screen_Shot_06_09_15_at_07_07_PM.png

my code ioaccountsql.cpp
Code:
#include "ioaccountsql.h"
#include <iostream>
#include <iomanip>

#include "tools.h"
#include "database.h"

Account IOAccountSQL::loadAccount(uint32_t accno)
{
    Account account;
    time_t lastDay;
    Database* db = Database::getInstance();
    DBQuery query;
                    //id na name                                                                            //id na name
    query << "SELECT `name`, `password`, `premdays`, `rkey`, `email`, `premium_points` FROM `accounts` WHERE `name` = " << accno << " LIMIT 1";
    DBResult* result;
    if(!(result = db->storeQuery(query.str())))
        return account;
                                        //id na name
    account.accnumber = result->getDataInt("name");
    account.password = result->getDataString("password");
    account.premDays = result->getDataInt("premdays");
#ifdef _BBK_PREMMY_AAC
    account.lastday = result->getDataInt("lastday");
#endif //_BBK_PREMMY_AAC
    account.key = result->getDataString("rkey");
    account.email = result->getDataString("email");
    account.premium_points = result->getDataInt("premium_points");

    query.str("");
    result->free();

    query << "SELECT `name` FROM `players` WHERE `account_id` = " << accno << " AND `deleted` = 0";
    if(!(result = db->storeQuery(query.str())))
        return account;

    do
    {
        std::string ss = result->getDataString("name");
        account.charList.push_back(ss.c_str());
    }
    while(result->next());

    result->free();
    account.charList.sort();

    return account;
}

bool IOAccountSQL::saveAccount(Account account)
{
    Database* db = Database::getInstance();
    DBQuery query;

    query << "UPDATE `accounts` SET `premdays` = " << account.premDays << ", `email` = '" << account.email << "', `premium_points` = " << account.premium_points << " WHERE `id` = " << account.accnumber << db->getUpdateLimiter();

    return db->executeQuery(query.str());
}

bool IOAccountSQL::getPassword(uint32_t accno, const std::string &name, std::string &password)
{
    Database* db = Database::getInstance();
    DBQuery query;                                    //id na name
    query << "SELECT `password` FROM `accounts` WHERE `name` = " << accno << " LIMIT 1";

    DBResult* result;
    if(!(result = db->storeQuery(query.str())))
        return false;

    if(name.empty())
    {
        password = result->getDataString("password");
        result->free();
        return true;
    }

    std::string tmpPassword = result->getDataString("password");
    result->free();
    query.str("");

    query << "SELECT `name` FROM `players` WHERE `account_id` = " << accno;
    if(!(result = db->storeQuery(query.str())))
        return false;

    do
    {
        if(result->getDataString("name") != name)
            continue;

        password = tmpPassword;
        result->free();
        return true;
    }
    while(result->next());

    result->free();
    return false;
}

bool IOAccountSQL::accountExists(uint32_t accno)
{
    Database* db = Database::getInstance();
    DBQuery query;        //id na name                //id na name
    query << "SELECT `name` FROM `accounts` WHERE `name` = " << accno << " LIMIT 1";

    DBResult* result;
    if(!(result = db->storeQuery(query.str())))
        return false;

    result->free();
    return true;
}

i change all (id) to name now i create on gesior account work i can login but i dont see character

i still search acc maker but all xml, when i find sql and use on my server dont work :(
 
Code:
query << "SELECT `name` FROM `players` WHERE `account_id` = " << accno << " AND `deleted` = 0";

You got any characters on the account with that acc id?
Use
Code:
std::cout << accno << std::endl;

To see what acc id its trying to fetch from.
 
Code:
query << "SELECT `name` FROM `players` WHERE `account_id` = " << accno << " AND `deleted` = 0";

You got any characters on the account with that acc id?
Use
Code:
std::cout << accno << std::endl;

To see what acc id its trying to fetch from.
like this?
Code:
query << "SELECT `name` FROM `players` WHERE `account_id` = " << accno << " AND `deleted` = 0";
std::cout << accno << std::endl;
if(!(result = db->storeQuery(query.str())))
return account;

do
Screen_Shot_06_10_15_at_07_01_PM.png

when i login serwer on console is name account
 
like this?
Code:
query << "SELECT `name` FROM `players` WHERE `account_id` = " << accno << " AND `deleted` = 0";
std::cout << accno << std::endl;
if(!(result = db->storeQuery(query.str())))
return account;

do
Screen_Shot_06_10_15_at_07_01_PM.png

when i login serwer on console is name account

You have to modify the query to also fetch the account id in that case and since you don't use the accout name? you don't have to include that in it aswell.
Remember to not only change the query but also the Account struct.
 
You have to modify the query to also fetch the account id in that case and since you don't use the accout name? you don't have to include that in it aswell.
Remember to not only change the query but also the Account struct.
maybe is better add ioaccountsql/ioplayersql.cpp from tfs 7.6?
i try but many error i got :D
im not very good on c/c++ so i think it hard change to me


you think only to change from id/name to account_id etc?
 
maybe is better add ioaccountsql/ioplayersql.cpp from tfs 7.6?
i try but many error i got :D
im not very good on c/c++ so i think it hard change to me


you think only to change from id/name to account_id etc?

You might have to change alot of stuff, since the src code is not build in parts.
You will really have to test stuff out after doing things like this, best things to do would be to rewrite the aac you are using.

With gesior it won't be that hard tbh, everything you need to edit is in the classes aswell as maybe createaccount?
 
Back
Top