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

TFS 1.X+ [looking for help]log in problem nekiro's multiworld system [source and commit included]

ForgottenNot

Member
Joined
Feb 10, 2023
Messages
175
Reaction score
14
Have added aurelion's multiworld system into nekiro's 8.0 downgraded server. Have no errors in console. When i press enter in order to search character list, the client stays waiting for ever
give me a hand
Lua:
The Forgotten Server - Version 1.5 (Nekiro's 8.00 downgrade)


Compiled with Microsoft Visual C++ version 1933
Compiled on Jun 18 2023 11:20:11 for platform x64
Linked with LuaJIT 2.1.0-beta3 for Lua support

A server developed by Mark Samman
A server downgraded by Nekiro
Visit our forum for updates, support, and resources: https://otland.net/.

>> Loading config
>> Loading multiworld config...
>>>> World Forgotten (ID 0) - Loaded successfully.
>>>> World Second (ID 1) - Loaded successfully.
>> Loading RSA key
>> Establishing database connection... MySQL 3.3.1
>> Running database manager
>> Loading vocations
>> Loading items... OTB v1.3.50
>> Loading script systems
>> Using LuaJIT 2.1.0-beta3
>> Loading lua libs
> create_functions.lua [loaded]
> defaults_move_event.lua [loaded]
> event_callbacks.lua [loaded]
> helper_constructors.lua [loaded]
> register_monster_type.lua [loaded]
>> Loading lua scripts
> #dqh_walls.lua [disabled]
> #multiple_lever.lua [disabled]
> #onstep_in_out_tile.lua [disabled]
> #change_gold.lua [disabled]
> #dolls.lua [disabled]
> #doors 7.6 actualizado backup.lua [disabled]
> #doors.old.lua [disabled]
> #doors.rl by xikina.lua [disabled]
> #spellbook.lua [disabled]
> #transforms.lua [disabled]
> #vertical_horizontal_doors.lua [disabled]
> #voodoo_doll.lua [disabled]
> #gold_converter.lua [disabled]
> #saw.lua [disabled]
> #default_onDropLoot  original.lua [disabled]
> #vertical_horizontal_doors.lua [disabled]
> #example.lua [disabled]
> #example.lua [disabled]
>> ["others"]
> change_gold.lua [loaded]
> dolls.lua [loaded]
> doors.lua [loaded]
> voodoo_doll.lua [loaded]
>> ["actions"]
> spellbook.lua [loaded]
>> ["scripts"]
> bless_check.lua [loaded]
>> ["creaturescripts"]
> scarab_death.lua [loaded]
>> ["scripts"]
> ctf.lua [loaded]
>> ["monster"]
> default_onDropLoot.lua [loaded]
>> ["player"]
> default_onLook.lua [loaded]
> default_onLookInBattleList.lua [loaded]
> default_onMoveItem.lua [loaded]
> default_onReportBug.lua [loaded]
> default_onReportRuleViolation.lua [loaded]
>> ["scripts"]
> mana_stacables.lua [error]
^ ...\Documents\GitHub\pro-ot\data\scripts\mana_stacables.lua:30: 'end' expected (to close 'function' at line 3) near '<eof>'
>> ["movements"]
> closing_door.lua [loaded]
>> ["scripts"]
> onlosspremium.lua [loaded]
> sorcerer_guild_thais_step_in.lua [loaded]
>> ["talkactions"]
> notation_ban.lua [loaded]
> position.lua [loaded]
>> Loading monsters
>> Loading lua monsters
>> Loading outfits
>> Checking world type... PVP
>> Loading map
> Map size: 33500x33500.
> Map loading time: 3.436 seconds.
[Warning - Monsters::loadMonster] Cant load spell. data/monster/bosses/mahrdis.xml
> Loaded house items in: 0.001 s
>> Initializing gamestate
>> Loaded all modules, server starting up...
>> RPG Server Online!
sources and commits
 
Well now i know is something merely related with loading acc/pass or character list because if i left the character list pre-loaded im able to log in to the server
how do i do this?
with a server with no multiworld system i log in the character list then i close that server,nand open the multiworld one, and i'm able to access to the server that way.
please help
Lua:
The Forgotten Server - Version 1.5 (Nekiro's 8.00 downgrade)

Compiled with Microsoft Visual C++ version 1933
Compiled on Jun 20 2023 14:38:46 for platform x64
Linked with LuaJIT 2.1.0-beta3 for Lua support

A server developed by Mark Samman
A server downgraded by Nekiro
Visit our forum for updates, support, and resources: https://otland.net/.

>> Loading config
>> Loading multiworld config...
>>>> World Forgotten (ID 0) - Loaded successfully.
>>>> World Second (ID 1) - Loaded successfully.
>> Loading RSA key
>> Establishing database connection... MySQL 3.3.1
>> Running database manager
>> Loading vocations
>> Loading items... OTB v1.3.50
[Warning - Items::parseItemNode] Unknown shootType: demonicarrow
[Warning - Items::parseItemNode] Unknown shootType: energycarrow
[Warning - Items::parseItemNode] Unknown shootType: blessedbolt
[Warning - Items::parseItemNode] Unknown shootType: zaoanspear
[Warning - Items::parseItemNode] Unknown shootType: nordicspear
[Warning - Items::parseItemNode] Unknown shootType: patinabolt
[Warning - Items::parseItemNode] Unknown shootType: blessedarrow
[Warning - Items::parseItemNode] Unknown shootType: spinalarrow
[Warning - Items::parseItemNode] Unknown shootType: calcocitabolt
[Warning - Items::parseItemNode] Unknown shootType: patinaarrow
>> Loading script systems
>> Using LuaJIT 2.1.0-beta3
>> Loading lua libs
> create_functions.lua [loaded]
> defaults_move_event.lua [loaded]
> event_callbacks.lua [loaded]
> helper_constructors.lua [loaded]
> register_monster_type.lua [loaded]
>> Loading lua scripts
> #dqh_walls.lua [disabled]
> #multiple_lever.lua [disabled]
> #onstep_in_out_tile.lua [disabled]
> #change_gold.lua [disabled]
> #dolls.lua [disabled]
> #doors 7.6 actualizado backup.lua [disabled]
> #doors.old.lua [disabled]
> #doors.rl by xikina.lua [disabled]
> #spellbook.lua [disabled]
> #transforms.lua [disabled]
> #vertical_horizontal_doors.lua [disabled]
> #voodoo_doll.lua [disabled]
> #gold_converter.lua [disabled]
> #saw.lua [disabled]
> #default_onDropLoot  original.lua [disabled]
> #vertical_horizontal_doors.lua [disabled]
> #example.lua [disabled]
> #example.lua [disabled]
>> ["others"]
> change_gold.lua [loaded]
> dolls.lua [loaded]
> doors.lua [loaded]
> voodoo_doll.lua [loaded]
>> ["actions"]
> spellbook.lua [loaded]
>> ["scripts"]
> bless_check.lua [loaded]
>> ["creaturescripts"]
> scarab_death.lua [loaded]
>> ["scripts"]
> ctf.lua [loaded]
>> ["monster"]
> default_onDropLoot.lua [loaded]
>> ["player"]
> default_onLook.lua [loaded]
> default_onLookInBattleList.lua [loaded]
> default_onMoveItem.lua [loaded]
> default_onReportBug.lua [loaded]
> default_onReportRuleViolation.lua [loaded]
>> ["scripts"]
> mana_stacables.lua [error]
^ ...\Documents\GitHub\pro-ot\data\scripts\mana_stacables.lua:30: 'end' expected (to close 'function' at line 3) near '<eof>'
>> ["movements"]
> closing_door.lua [loaded]
>> ["scripts"]
> onlosspremium.lua [loaded]
> sorcerer_guild_thais_step_in.lua [loaded]
>> ["talkactions"]
> notation_ban.lua [loaded]
> position.lua [loaded]
>> Loading monsters
>> Loading lua monsters
>> Loading outfits
>> Checking world type... PVP
>> Loading map
> Map size: 33500x33500.
> Map loading time: 4.569 seconds.
[Warning - Monsters::loadMonster] Cant load spell. data/monster/bosses/mahrdis.xml
> Loaded house items in: 0.013 s
>> Initializing gamestate
>> Loaded all modules, server starting up...


>> Forgotten Server Online!

GM Ratx has logged in.
[Error - mysql_real_query] Query: INSERT INTO `players_online` VALUES (1)
Message: Column count doesn't match value count at row 1

I think the problem could reside here:
Code:
bool IOLoginData::loginserverAuthentication(const std::string& name, const std::string& password, Account& account)
{
    Database& db = Database::getInstance();

    std::ostringstream query;
    query << "SELECT `id`, `name`, `password`, `secret`, `type`, `premium_ends_at` FROM `accounts` WHERE `name` = {:s}" << db.escapeString(name);
    //query << "SELECT `id`, `name`, `password`, `secret`, `type`, `premdays`, `lastday` FROM `accounts` WHERE `name` = " << db.escapeString(name);
    //query << "SELECT `id`, `name`, `password`, `secret`, `type`, `premdays`, `lastday` FROM `accounts` WHERE `name` = " << db.escapeString(accno);
    //DBResult_ptr result = Database::getInstance().storeQuery(fmt::format("SELECT `id`, `name`, `password`, `type`, `premium_ends_at` FROM `accounts` WHERE `id` = {:d}", accno));
    //DBResult_ptr result = db.storeQuery(fmt::format("SELECT `id`, `name`, `password`, `secret`, `type`, `premium_ends_at` FROM `accounts` WHERE `name` = {:s}", db.escapeString(name)));
    DBResult_ptr result = db.storeQuery(query.str());
    if (!result) {
        return false;
    }

    if (transformToSHA1(password) != result->getString("password")) {
        return false;
    }

    account.id = result->getNumber<uint32_t>("id");
    account.name = result->getString("name");
    account.key = decodeSecret(result->getString("secret"));
    account.accountType = static_cast<AccountType_t>(result->getNumber<int32_t>("type"));
    account.premiumEndsAt = result->getNumber<time_t>("premium_ends_at");
    //return account;


    #ifdef MULTIWORLD_SYSTEM
        query.str(std::string());
        query << "SELECT `name`, `deletion`, `world_id` FROM `players` WHERE `account_id` = " << account.id;
        result = db.storeQuery(query.str());
        if (result) {
            do {
                if (result->getNumber<uint64_t>("deletion") == 0) {
                    Character character;
                    character.name = result->getString("name");
                    character.worldid = result->getNumber<uint16_t>("world_id");
                    account.characters.push_back(character);
                }
            } while (result->next());
        }
    #else
        query.str(std::string());
        query << "SELECT `name`, `deletion` FROM `players` WHERE `account_id` = " << account.id;
        result = db.storeQuery(query.str());
        if (result) {
            do {
                if (result->getNumber<uint64_t>("deletion") == 0) {
                    account.characters.push_back(result->getString("name"));
                }
            } while (result->next());
            std::sort(account.characters.begin(), account.characters.end());
        }
    #endif
    return true;
}
Sin título.png
Post automatically merged:

For example if i write this
Code:
    query << "SELECT `id`, `name`, `password`, `secret`, `type`, `premium_ends_at` FROM `accounts` WHERE `name` = {:s}" << db.escapeString(accno);
i get this error while loeading character list:
Lua:
Message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':s}'xxxxx'' at line 1
 
Last edited:
C++:
DBResult_ptr result = db.storeQuery(fmt::format(
    "SELECT `id`, `name`, `password`, `secret`, `type`, `premium_ends_at` FROM `accounts` WHERE `name` = {:s}",
    db.escapeString(name)));
 
C++:
DBResult_ptr result = db.storeQuery(fmt::format(
    "SELECT `id`, `name`, `password`, `secret`, `type`, `premium_ends_at` FROM `accounts` WHERE `name` = {:s}",
db.escapeString(name)));
Going to the dentist ATM I'll check it as soon. As I arrive , home thank you for your reply man !
Post automatically merged:

Could you help me editing this line?
Lua:
    #ifdef MULTIWORLD_SYSTEM
    //std::ostringstream query;
    result = db.storeQuery(fmt::format("SELECT `name` `deletion`, `world_id`, FROM `players` WHERE `account_id` = {:d} AND `deletion` = 0 ORDER BY `name` ASC", account.id)); //promisiorio
    //result = db.storeQuery(fmt::format("SELECT `name` FROM `players` WHERE `name` = {:s} AND `account_id` = {:d} AND `deletion` = 0", db.escapeString(characterName), accountId));
    

    //Database& db = Database::getInstance();

    //std::ostringstream query;
    //query.str(std::string());
//    DBResult_ptr result = db.storeQuery(fmt::format(
        //"SELECT `name` FROM `players` WHERE `name` = {:s} AND `account_id` = {:d} AND `deletion` = 0", db.escapeString(characterName), accountId));
    //query << "SELECT `name`, `deletion`, `world_id` FROM `players` WHERE `account_id` = " << account.id; // eERA EL ORIGINAL
    //result = db.storeQuery(query.str());
    if (result) {
Code:
ror - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'deletion' doesn't exist in the result set
[Error - DBResult::getNumber] Column 'world_id' doesn't exist in the result set
 
Last edited:
Back
Top