summaryrefslogtreecommitdiff
path: root/src/account-server/account.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2009-10-03 22:14:24 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2009-10-03 22:21:41 +0200
commit4cbf5877c9ca5d3e5754e568fbadd670fe1f7ff6 (patch)
treee50cdb70ec69af7d7b1af79fbef13b78a4015aca /src/account-server/account.cpp
parentaf0d672fcb9fb8da583f014b9875350e7480f467 (diff)
downloadmanaserv-4cbf5877c9ca5d3e5754e568fbadd670fe1f7ff6.tar.gz
manaserv-4cbf5877c9ca5d3e5754e568fbadd670fe1f7ff6.tar.bz2
manaserv-4cbf5877c9ca5d3e5754e568fbadd670fe1f7ff6.tar.xz
manaserv-4cbf5877c9ca5d3e5754e568fbadd670fe1f7ff6.zip
Limit login attempt frequency based on IP address
The previous method was broken because it set the "last time" to the current time when the client connected. So login would fail when the username and password were sent within a second from connecting, which is not desirable. If I'd have fixed this by setting the "last time" to login time minus one second, then an attacker would just need to reconnect for each login attempt. So now it uses an IP address based approach, where each IP can only try to log in once per second.
Diffstat (limited to 'src/account-server/account.cpp')
-rw-r--r--src/account-server/account.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/account-server/account.cpp b/src/account-server/account.cpp
index 246442fd..55f521b9 100644
--- a/src/account-server/account.cpp
+++ b/src/account-server/account.cpp
@@ -22,9 +22,6 @@
#include "account-server/account.hpp"
-/**
- * Destructor.
- */
Account::~Account()
{
for (Characters::iterator i = mCharacters.begin(),
@@ -34,20 +31,11 @@ Account::~Account()
}
}
-
-/**
- * Set the characters.
- */
-void
-Account::setCharacters(const Characters& characters)
+void Account::setCharacters(const Characters& characters)
{
mCharacters = characters;
}
-
-/**
- * Add a new character.
- */
void Account::addCharacter(Character *character)
{
mCharacters.push_back(character);