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

AAC I upated my Website myacc, but have problem

Joker Man

Active Member
Joined
Nov 7, 2021
Messages
106
Reaction score
27
hello everyone
Some one can help me to upated Script
characters.php-guilds.php-highscores.php-whoisonline.php <is Gosier
someone can upated for installation in myacc
 

Attachments

bool IOLoginData::updateOnlineStatus(uint32_t guid, bool login)
{
Database* db = Database::getInstance();
DBQuery query;

uint16_t value = login;
if(g_config.getNumber(ConfigManager::ALLOW_CLONES))
{
query << "SELECT online FROM players WHERE id = " << guid << " AND deleted = 0 LIMIT 1";
DBResult_ptr result;
if(!(result = db->storeQuery(query.str())))
return false;

value = result->getDataInt("online");


if(login)
value++;
else if(value > 0)
value--;

query.str("");
}

query << "UPDATE players SET online = " << value << " WHERE id = " << guid << db->getUpdateLimiter();
return db->query(query.str());
}
 
bool IOLoginData::updateOnlineStatus(uint32_t guid, bool login)
{
Database* db = Database::getInstance();
DBQuery query;

uint16_t value = login;
if(g_config.getNumber(ConfigManager::ALLOW_CLONES))
{
query << "SELECT online FROM players WHERE id = " << guid << " AND deleted = 0 LIMIT 1";
DBResult_ptr result;
if(!(result = db->storeQuery(query.str())))
return false;

value = result->getDataInt("online");


if(login)
value++;
else if(value > 0)
value--;

query.str("");
}

query << "UPDATE players SET online = " << value << " WHERE id = " << guid << db->getUpdateLimiter();
return db->query(query.str());
}
Post automatically merged:

i contacted my partner and he gave me the source we used and i found that it only updates the online column View attachment 73992
 
Yea so you need to either create some trigger (don't like them) or rework AAC to utilize online column instead.
I never used myACC before so hard to tell, maybe there's already some option to configure that but anyway shouldn't be difficult to change that to:
SQL:
SELECT COUNT(1) FROM `players` WHERE `online` > 0


EDIT: It already has such logic to check whether such table exists, so if you delete the table it should work fine:
PHP:
$this->db->hasTable('players_online')
SQL:
DROP TABLE `players_online`
 
Yea so you need to either create some trigger (don't like them) or rework AAC to utilize online column instead.
I never used myACC before so hard to tell, maybe there's already some option to configure that but anyway shouldn't be difficult to change that to:
SQL:
SELECT COUNT(1) FROM `players` WHERE `online` > 0


EDIT: It already has such logic to check whether such table exists, so if you delete the table it should work fine:
PHP:
$this->db->hasTable('players_online')
SQL:
DROP TABLE `players_online`
so strange i tried to delete it couple of hours ago and an error occured but now it works !
Thank you
 
Back
Top