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

Fix/Patch Level instead of world name on character login (Help)

try

uint32_t IOLoginData::getCheckPlayerLevel(const std::string& name) const
{
Database* db = Database::getInstance();
DBQuery query;
query << "SELECT `level` FROM `players` WHERE `name` " << db->getStringComparison() << " " << db->escapeString(name) << ";";

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

const uint32_t pLevel = result->getDataInt("level");
result->free();
return pLevel;

}
 
@ up

sources\iologindata.cpp In member function `uint32_t IOLoginData::getCheckPlayerLevel(const std::string&) const':
sources\iologindata.cpp 'class _Database' has no member named 'getStringComparisonOperator'
sources\dev-cpp\Makefile.win [Build Error] [obj//iologindata.o] Error 1
 
@ up

sources\iologindata.cpp In member function `uint32_t IOLoginData::getCheckPlayerLevel(const std::string&) const':
sources\iologindata.cpp 'class _Database' has no member named 'getStringComparisonOperator'
sources\dev-cpp\Makefile.win [Build Error] [obj//iologindata.o] Error 1


as it did in my last post?

getStringComparisonOperator() ?? i write: getStringComparison()





What, but show the error.
 
bump! for this my chilean friend~
is there any way to make this without compile?.. actually i dont have the source files of the OT im running :'c
 
bump! for this my chilean friend~
is there any way to make this without compile?.. actually i dont have the source files of the OT im running :'c


olny edit source.




Ok, i check...


fix: (complete code)


iologindata.h

find:
Code:
uint32_t getAccountIdByName(const std::string& name) const;
paste under:
Code:
uint32_t getCheckPlayerLevel(const std::string& name) const;

iologindata.cpp (paste end file..)

uint32_t IOLoginData::getCheckPlayerLevel(const std::string& name) const
{
Database* db = Database::getInstance();
DBQuery query;
query << "SELECT `level` FROM `players` WHERE `name` " << db->getStringComparer() << db->escapeString(name) << ";";

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

const uint32_t pLevel = result->getDataInt("level");
result->free();
return pLevel;

}




protocollogin.cpp
find:
for(Characters::iterator it = account.charList.begin(); it != account.charList.end(); it++)

paste before:
char levelText[50];

find:
output->putString(g_config.getString(ConfigManager::SERVER_NAME));

set to:
//output->putString(g_config.getString(ConfigManager::SERVER_NAME));

paste under:

sprintf(levelText, "Lvl: %d", IOLoginData::getInstance()->getCheckPlayerLevel((*it)));
output->putString(levelText);



result:
sss.JPG
 
Error:
Code:
protocollogin.cpp: In member function âbool ProtocolLogin::parseFirstPacket(NetworkMessage&)â:
protocollogin.cpp:206: error: âlevelTextâ was not declared in this scope
protocollogin.cpp:206: error: name lookup of âitâ changed for ISO âforâ scoping
protocollogin.cpp:206: note: (if you use â-fpermissiveâ G++ will accept your code)
protocollogin.cpp:206: error: no matching function for call to âIOLoginData::getCheckPlayerLevel(std::pair<unsigned int, unsigned int>&)â
iologindata.h:102: note: candidates are: uint32_t IOLoginData::getCheckPlayerLevel(const std::string&) const
make[1]: *** [protocollogin.o] Error 1
make[1]: *** Se espera a que terminen otras tareas....
make[1]: se sale del directorio `/home/serv/sources_r11_dupe'
make: *** [all] Error 2

Traduction Google:

Code:
protocollogin.cpp: In member function âbool ProtocolLogin :: parseFirstPacket (NetworkMessage &) â:
protocollogin.cpp: 206: error: âlevelTextâ Declared In This not was scope
protocollogin.cpp: 206: error: name lookup of Aita changed for ISO Afora scoping
protocollogin.cpp: 206: note: (if you use beta-fpermissiveâ G + + will accept your code)
protocollogin.cpp: 206: error: no matching function for call to âIOLoginData :: getCheckPlayerLevel (std :: pair <unsigned int> int, unsigned &) â
iologindata.h: 102: note: candidates are: :: uint32_t IOLoginData getCheckPlayerLevel (const std :: string &) const
make [1]: *** [protocollogin.o] Error 1
make [1]: *** is expected to finish other tasks ....
make [1]: Leaving directory `/ home/serv/sources_r11_dupe '
make: *** [all] Error 2
 
Yes, I pasted.

It was like this:

Code:
char levelText[50];
for(Characters::iterator it = account.charList.begin(); it != account.charList.end(); it++
 
That's correct Kito2 but you have pasted this in the wrong place.

Code:
sprintf(levelText, "Lvl: %d", IOLoginData::getInstance()->getCheckPlayerLevel((*it)));
output->putString(levelText);

This is how it should look like :p

Code:
        char levelText[50];
        for(Characters::iterator it = account.charList.begin(); it != account.charList.end(); it++)
        {
            #ifndef __LOGIN_SERVER__
            output->putString((*it));
            if(g_config.getBool(ConfigManager::ON_OR_OFF_CHARLIST))
            {
                if(g_game.getPlayerByName((*it)))
                    output->putString("Online");
                else
                    output->putString("Offline");
            }
            else
                //output->putString(g_config.getString(ConfigManager::SERVER_NAME));
            sprintf(levelText, "Lvl: %d", IOLoginData::getInstance()->getCheckPlayerLevel((*it)));
            output->putString(levelText); 

            output->put<uint32_t>(serverIp);
            output->put<uint16_t>(g_config.getNumber(ConfigManager::GAME_PORT));
 
So your before means after then? Could you post the other files, cause I don't know what means for you under xD
 
It's in protocollogin.cpp
 
Hahah you didn't get it, right? You said "before" but you meant "after", so "under" will mean "over"?
 
nice code ^^, thanks for share it, i've made a little modification of your code hehe;
LK3SG.jpg
 
Dude, I made what you said and keep bugging:

iologindata.cpp:1769: error: expected initializer before âuint32_tâ
iologindata.cpp:1784: error: expected unqualified-id before â{â token
make[1]: *** [iologindata.o] Error 1
make[1]: *** Se espera a que terminen otras tareas....
make[1]: se sale del directorio `/home/serv/sources_r11_dupe/sources_r11_dupe'
make: *** [all] Error 2

iologindata.cpp -> //////////////////////////////////////////////////////////////////////// // Ope - Pastebin.com
iologindata.h -> //////////////////////////////////////////////////////////////////////// // Ope - Pastebin.com
protocollogin.cpp -> //////////////////////////////////////////////////////////////////////// // Ope - Pastebin.com

Check it, it is as the same as you said.
 
Back
Top