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

oszyx329

New Member
Joined
Mar 6, 2012
Messages
18
Reaction score
0
Hello, could anyone write a little fix/script or something to level instead of world name on character login? (like: Oszy (100), instead of Oszy (Nerana) I have this, but for 7.6, and in 7.6, all is in other file, it's written in another style, i dont know what to do.

I will be thankfull.

TFS 8.54, 0.3.6
 
It's gotta be in the sources somewhere, too lazy too look.
 
It's too easy for a source edit. Simply search for the config variable name where you edit world name, in the sources then take that key (e.g. CONFIG_WORLDNAME) and search for it... Replace that with his level
Use search it's been asked 100 times
 
Search in all sources this: ConfigManager::SERVER_NAME
There will be 8 hits, one of them is and need to be changed to the level of the character.

PS: I searched it and nothing... And how I don't know C++ I cant make it by myself, since I dont know if it works with objects existing in database or need to be created on the simulation to then adquire the information.
 
I will search in sources, lets see if i found it :)
Code:
//Add char list
		output->put<char>(0x64);
		if(g_config.getBool(ConfigManager::ACCOUNT_MANAGER) && id != 1)
		{
			output->put<char>(account.charList.size() + 1);
			output->putString("Account Manager");
			output->putString(g_config.getString(ConfigManager::SERVER_NAME));
			output->put<uint32_t>(serverIp);
			output->put<uint16_t>(g_config.getNumber(ConfigManager::GAME_PORT));
		}
		else
 
That's only account manager, there should be another as well
 
iologindata.cpp:
[CPP]
if(GameServer* server = GameServers::getInstance()->getServerById(result->getDataInt("world_id")))
account.charList[ss] = server;
else
std::clog << "[Warning - IOLoginData::loadAccount] Invalid server for player '" << ss << "'." << std::endl;[/CPP]
Found it.
...What do now? The last thing I learned of C++ was how to properly use conditional ops...
 
Last edited:
try this (no test!)



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

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

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

}

iologindata.h (under uint32_t getAccountIdByName(const std::string& name) const; )
uint32_t getCheckPlayerLevel(const std::string& name) const;


and
protocollogin.cpp
change:
output->AddString(g_config.getString(ConfigManager::SERVER_NAME));
to
output->AddString(IOLoginData::getInstance()->getCheckPlayerLevel((*it)));
 
I will test it in a few days since Im not at home... If someone can test it before, let us know the result :)
 
Code:
iologindata.cpp In member function `uint32_t IOLoginData::getCheckPlayerLevel(const std::string&) const': 
iologindata.cpp 'class _Database' has no member named 'getStringComparisonOperator'
 
try:

Code:
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;

}
 
Back
Top