Homeslice
-anoyn/Rage the Mage
I added not counting afk players to gunz's version.
So with this you can have no logout zones or above 15 min kick time and still be within otservlist rules.
This also has gunz's not counting more than 4 mcs per IP.
protocolstatus.cpp (TFS 1.0/1.1/1.2) (1.3 Version available below)
Change:
to
For TFS 1.3
protocolstatus.cpp
Change:
to
in player.h move
from the private: section to below "public:" (up)
So with this you can have no logout zones or above 15 min kick time and still be within otservlist rules.
This also has gunz's not counting more than 4 mcs per IP.
protocolstatus.cpp (TFS 1.0/1.1/1.2) (1.3 Version available below)
Change:
C++:
players.append_attribute("online") = std::to_string(g_game.getPlayersOnline()).c_str();
to
C++:
uint32_t real = 0;
std::map<uint32_t, uint32_t> listIP;
for (const auto& it : g_game.getPlayers()) {
if (it.second->getIdleTime() < 960000 && it.second->getIP() != 0) {
auto ip = listIP.find(it.second->getIP());
if (ip != listIP.end()) {
listIP[it.second->getIP()]++;
if (listIP[it.second->getIP()] < 5) {
real++;
}
}
else {
listIP[it.second->getIP()] = 1;
real++;
}
}
}
players.append_attribute("online") = std::to_string(real).c_str();
For TFS 1.3
protocolstatus.cpp
Change:
C++:
players.append_attribute("online") = std::to_string(g_game.getPlayersOnline()).c_str();
to
C++:
uint32_t real = 0;
std::map<uint32_t, uint32_t> listIP;
for (const auto& it : g_game.getPlayers()) {
if (it.second->idleTime < 960000 && it.second->getIP() != 0) {
auto ip = listIP.find(it.second->getIP());
if (ip != listIP.end()) {
listIP[it.second->getIP()]++;
if (listIP[it.second->getIP()] < 5) {
real++;
}
}
else {
listIP[it.second->getIP()] = 1;
real++;
}
}
}
players.append_attribute("online") = std::to_string(real).c_str();
in player.h move
C++:
int32_t idleTime = 0;
from the private: section to below "public:" (up)