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

TFS 0.X status.cpp (changed to respect the rulles)

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
201
Hi guys, how are U?
I use tfs 0.4
I have changed this part in my source, to not count as online those who are with more than 4 multiclient:

At status.cpp
changed it:
Code:
sprintf(buffer, "%d", g_game.getPlayersOnline());

for it:
Code:
uint32_t total_online = 0;
    std::map<uint32_t, uint32_t> listIP;
    for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it)
    {
        if(it->second->isRemoved())
            continue;

        if (it->second->getIP() != 0) {
        std::map<uint32_t, uint32_t>::iterator ip = listIP.find(it->second->getIP());
            if (ip != listIP.end()) {
                listIP[it->second->getIP()]++;
                if (listIP[it->second->getIP()] < 5) {
                    total_online++;
                }
            } else {
                listIP[it->second->getIP()] = 1;
                total_online++;
            }
        }
    }

    sprintf(buffer, "%d", total_online);

but I just got banned for the reason "This server is currently banned! Reason: Spoofing data info"
is there an error in my new code?
 
Last edited:
Back
Top