• 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++ Doubt IOLoginData::savePlayer [source 0.4] [BugSaveItems]

milbradt

New Member
Joined
Dec 25, 2011
Messages
177
Solutions
1
Reaction score
4
Source: otxserver/path_8_6x/sources at otxserv2 · mattyx14/otxserver · GitHub

C++:
    //item saving
    query.str("");
    query << "DELETE FROM `player_items` WHERE `player_id` = " << player->getGUID();
    if(!db->query(query.str()))
    {
        std::clog << "[Warning - IOLoginData::saveItems] PlayerId: '" << player->getGUID() << "'." << std::endl;
        return false;
    }

items are deleted but are not inserted.
the error is random and happens when the player log out


What can happen to return false?

Link code line:
otxserver/iologindata.cpp at otxserv2 · mattyx14/otxserver · GitHub
 
Hello Milbradt,

basically the only thing that could happen when false returns is that the server clogs then doesn't run further due to std::clog.

If you mean what can happen so the function returns false is that the query doesn't work due to any missing tables or any other problem related to the database.

Kindest Regards,
Okke.
 
Hello Milbradt,

basically the only thing that could happen when false returns is that the server clogs then doesn't run further due to std::clog.

If you mean what can happen so the function returns false is that the query doesn't work due to any missing tables or any other problem related to the database.

Kindest Regards,
Okke.

Is not there anything wrong with the code then?
Not even a security breach?
 
Back
Top