DukeeH
Active Member
- Joined
- Dec 6, 2010
- Messages
- 550
- Solutions
- 3
- Reaction score
- 39
Hello everyone.
I just got banned from otservlist, and I have this code to follow both rules (not count xlogged and count 4 per ip).
After contacting them by mail and showing the code, he still tells me that i'm counting 5 per ip.
I know that I can just change that 5 to 4, but for me, if it's < 5 it's counting 4.
I want to know if it's really counting 5 from someone that understands it.
Thanks for your time.
I just got banned from otservlist, and I have this code to follow both rules (not count xlogged and count 4 per ip).
After contacting them by mail and showing the code, he still tells me that i'm counting 5 per ip.
I know that I can just change that 5 to 4, but for me, if it's < 5 it's counting 4.
I want to know if it's really counting 5 from someone that understands it.
C++:
uint32_t Game::getPlayersWithMcLimit()
{
std::map<uint32_t, uint32_t> ips;
uint32_t count = 0;
for (AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it)
{
if (!it->second->isRemoved() && it->second->getIdleTime() < 960000)
{
uint32_t ip = it->second->getIP();
if (ips.find(ip) == ips.end())
{
ips[ip] = 1;
count++;
}
else if (ips[ip] < 5)
{
ips[ip]++;
count++;
}
}
}
return count;
}
Thanks for your time.