• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

C++ Help to a little change in cast system

douglasscherner

New Member
Joined
Aug 15, 2014
Messages
64
Reaction score
3
I want to don't show castings live with password in first page at login when the password board is empty.
Because it's flood the cast page with not necessary casts.

aaaaa.png

Lua:
const auto& casts = ProtocolGame::getLiveCasts();
    output->addByte(casts.size());
    for (const auto& cast : casts)
    {
        std::ostringstream entry;
        entry << cast.first->getName() << " [" << cast.second->getSpectatorCount() << (cast.second->isPasswordProtected() ? "*]" : "]");
        output->addString(entry.str());
        entry.str(std::string());
        output->addString("Level " + std::to_string(cast.first->getLevel()));
        output->add<uint32_t>(serverIp);
        output->add<uint16_t>(g_config.getNumber(ConfigManager::GAME_PORT));
    }
        
    output->add<uint16_t>(0);
    send(std::move(output));
    disconnect();

Is possible hide and not show casts with * ?
Thank you.
 

Boy67

Veteran OT User
Joined
Jul 4, 2007
Messages
468
Solutions
26
Reaction score
371
C++:
const auto& casts = ProtocolGame::getLiveCasts();
output->addByte(casts.size());
for (const auto& cast : casts)
{
    if(!cast.second->isPasswordProtected()){
        std::ostringstream entry;
        entry << cast.first->getName() << " [" << cast.second->getSpectatorCount() << "]";
        output->addString(entry.str());
        entry.str(std::string());
        output->addString("Level " + std::to_string(cast.first->getLevel()));
        output->add<uint32_t>(serverIp);
        output->add<uint16_t>(g_config.getNumber(ConfigManager::GAME_PORT));
    }
}

output->add<uint16_t>(0);
send(std::move(output));
disconnect();
 

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,279
Solutions
68
Reaction score
919
We need more info bud. Can you post a link to the cast system files or something? What cast system is it, where can we find info on it.
 
Top