mameca123
www.TheHeroesOfTime.com
- Joined
- Nov 19, 2008
- Messages
- 37
- Reaction score
- 8
Hello,
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:
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: