• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

C++ [TFS 0.4] Save CountOfCharacters per IP


Nov 19, 2008
Reaction score

I'd like to know an easier way to create - on the server opening moment - a list where the index is each player IP address and the list[IP] returns the number of characters online (no EXIT) using such IP address.

The idea is to create an ANTI-MC system on protocolgame.cpp.

Nowadays, I am running an non-optimized check. For every login, I check the player's IP and I loop through every player online to get their address. If IP address is equal to the login-character's IP address, I increment a count variable. If >= 4, I send a message window to the player saying that he has already 4 characters online, and refuse the login. This was done in lua via creaturescripts before but it was way less optimized. But I'd like to optimize it more (as my idea above).

How it is done nowadays: