OTcreator
Active Member
- Joined
- Feb 14, 2022
- Messages
- 439
- Solutions
- 1
- Reaction score
- 48
Hi!
Is it possible to change in sources so that before logging in, the client throws out a message that they already have the maximum number of characters logged in on a given IP?
I found something like this, but for (TFS 1.0/1.1/1.2):
Change:
To:
Is it possible to change in sources so that before logging in, the client throws out a message that they already have the maximum number of characters logged in on a given IP?
I found something like this, but for (TFS 1.0/1.1/1.2):
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->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();