summaryrefslogtreecommitdiff
path: root/src/account-server/account.hpp
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.hpp
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.hpp')
-rw-r--r--src/account-server/account.hpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/account-server/account.hpp b/src/account-server/account.hpp
index b3758a2e..71575d78 100644
--- a/src/account-server/account.hpp
+++ b/src/account-server/account.hpp
@@ -45,7 +45,6 @@ class Account
*/
~Account();
-
/**
* Set the user name.
*
@@ -54,7 +53,6 @@ class Account
void setName(const std::string &name)
{ mName = name; }
-
/**
* Get the user name.
*
@@ -63,7 +61,6 @@ class Account
const std::string &getName() const
{ return mName; }
-
/**
* Set the user password. The password is expected to be already
* hashed with a salt.
@@ -114,7 +111,6 @@ class Account
void setLevel(int level)
{ mLevel = level; }
-
/**
* Get the account level.
*
@@ -123,18 +119,15 @@ class Account
int getLevel() const
{ return mLevel; }
-
/**
* Set the characters.
*
* @param characters a list of characters.
*/
- void
- setCharacters(const Characters& characters);
-
+ void setCharacters(const Characters& characters);
/**
- * Add a new character.
+ * Adds a new character.
*
* @param character the new character.
*/
@@ -147,7 +140,6 @@ class Account
*/
void delCharacter(int i);
-
/**
* Get all the characters.
*