• 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+ Segmentation fault

leandroluck

New Member
Joined
Dec 24, 2010
Messages
104
Reaction score
1
I'm having this problems and by logging the error is leading to these functions
Code:
void ProtocolGame::updateCoinBalance()
{
    NetworkMessage msg;
    msg.addByte(0xF2);
    msg.addByte(0x00);
    writeToOutputBuffer(msg);
    g_dispatcher.addTask(
        createTask(std::bind([](ProtocolGame_ptr client) {
        client->sendCoinBalance();
    }, getThis()))
    );
}
void ProtocolGame::sendCoinBalance()
{
    Database& db = Database::getInstance();
    std::ostringstream query;
    query << "SELECT `coins` FROM `accounts` WHERE `id`=" + std::to_string(player->getAccount());
    DBResult_ptr result = db.storeQuery(query.str());
    if (!result) {
        return;
    }
    NetworkMessage msg;
    msg.addByte(0xF2);
    msg.addByte(0x01);
    msg.addByte(0xDF);
    msg.addByte(0x01);
    msg.add<uint32_t>(result->getNumber<uint32_t>("coins")); //total coins
    msg.add<uint32_t>(result->getNumber<uint32_t>("coins")); //transferable coins
    writeToOutputBuffer(msg);
}
Link FULL LOG hastebin
 
Back
Top