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

Very important - Rules change on otservlist.org

EDIT: Nevermind, Xinn already answered my email.
 
Last edited:
Hello @xinn. I have problem and doubt. Sorry my bad english.
Well i have the code posted by @gunz in my server. WarkingOT.com

Code:
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();

But i got ban from otservlist because players are using mc. I dont understand.
This code is fail? Can you check that?
 
@xinn
Can we get code for TFS 0.4? Many players can not log because their friends using the same net are already logged in the game.
 
I'm trying use the rule at my iptables but it doesn't make effect. Someone knows why ?

# Debian 8.7
iptables -A INPUT -p tcp --dport 7172 -m connlimit --connlimit-above 4 -j DROP
 
Can someone help me with this? Im on tfs 0.3.6 linux, can someone give me a working code? Dont want to get banned for a month again...
 
I've created a working code you can implement in your server.

protocolstatus.cpp (TFS 1.0/1.1/1.2)
Someone can do it for 8.6

@xinn @Sir Knighter @Flatlander

Change:
Code:
players.append_attribute("online") = std::to_string(g_game.getPlayersOnline()).c_str();

To this:

Code:
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();


Do you know the change for tfs 0.4?
 
Anybody has 0.4 source code?
I didn't set my server on otservlist.org because i dont find it yet and i dont want to be banned.
 
Code for 0.4. (not tested)
@xinn

Change this:
Code:
sprintf(buffer, "%d", g_game.getPlayersOnline());
xmlSetProp(p, (const xmlChar*)"online", (const xmlChar*)buffer);

To this:
Code:
uint32_t real = 0;
std::map<uint32_t, uint32_t> listIP;
for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it) {
   if (it->second->getIP() != 0) {
       uint32_t 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++;
       }
   }
}
sprintf(buffer, "%d", real);
xmlSetProp(p, (const xmlChar*)"online", (const xmlChar*)buffer);
 
Last edited:
Code for 0.4. (not tested)
@xinn

Change this:
Code:
sprintf(buffer, "%d", g_game.getPlayersOnline());
xmlSetProp(p, (const xmlChar*)"online", (const xmlChar*)buffer);

To this:
Code:
uint32_t real = 0;
std::map<uint32_t, uint32_t> listIP;
for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it) {
   if (it->second->getIP() != 0) {
       uint32_t 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++;
       }
   }
}
sprintf(buffer, "%d", real);
xmlSetProp(p, (const xmlChar*)"online", (const xmlChar*)buffer);


Error:
ua62y0.png
 
Why? Have you tried to implement this to your engine before? Don't expect help if you even not try to do it by yourself.
 
Last edited:
Code:
uint32_t real = 0;
std::map<uint32_t, uint32_t> listIP;
for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it) {
   if (it->second->getIP() != 0) {
        if (listIP.find(it->second->getIP()) != listIP.end()) {
             listIP[it->second->getIP()]++;
             if (listIP[it->second->getIP()] < 5) {
               real++;
             }
         } else {
           listIP[it->second->getIP()] = 1;
             real++;
         }
       }
}
sprintf(buffer, "%d", real);
xmlSetProp(p, (const xmlChar*)"online", (const xmlChar*)buffer);
 
For server owners, maybe. Not for players.

Right! But now if all the owners switch, wtf do you think the players are gonna do?

@xinn
(I think you can get only 5-6 players from same IP) So this is not a problem.

Are you seriously mad. I have read and re-read, what you are suggesting is that all servers who want to use your site must sacrifice a possible percentage of their real players online credit.

If 5 players are online instead of 4 I would be pissed as fuck to see 4! That's a slap in the face to the developer when someone put their heart n soul into the server.

Just like previously stated, that kind of reply is like saying, well yeah the bug exists, but its hard to come by, no reason to fix it.
 
I've created a working code you can implement in your server.

protocolstatus.cpp (TFS 1.0/1.1/1.2)
Someone can do it for 8.6

@xinn @Sir Knighter @Flatlander

Change:
Code:
players.append_attribute("online") = std::to_string(g_game.getPlayersOnline()).c_str();

To this:

Code:
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();


PUMP

does it also fix isue of counting people that are X logged in the training arema ?
 
Back
Top