summaryrefslogtreecommitdiff
path: root/src/account-server/account.hpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-30 16:20:33 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-30 16:20:33 +0000
commit25914cddf606e683a4226f46b56f800400d633d3 (patch)
tree58a95b50fc59a45459906d109b4768aa4124951d /src/account-server/account.hpp
parent5af1c90d2f86e10de74285d89ee975bd959a6556 (diff)
downloadmanaserv-25914cddf606e683a4226f46b56f800400d633d3.tar.gz
manaserv-25914cddf606e683a4226f46b56f800400d633d3.tar.bz2
manaserv-25914cddf606e683a4226f46b56f800400d633d3.tar.xz
manaserv-25914cddf606e683a4226f46b56f800400d633d3.zip
Got rid of abstract storage and reference-counted pointers. Fixed lifetime of accounts and characters in server memory. Cleaned some code.
Diffstat (limited to 'src/account-server/account.hpp')
-rw-r--r--src/account-server/account.hpp37
1 files changed, 7 insertions, 30 deletions
diff --git a/src/account-server/account.hpp b/src/account-server/account.hpp
index 7c5b5703..dfc5210f 100644
--- a/src/account-server/account.hpp
+++ b/src/account-server/account.hpp
@@ -24,9 +24,9 @@
#define _TMWSERV_ACCOUNT_H_
#include <string>
+#include <vector>
-#include "account-server/characterdata.hpp"
-#include "utils/countedptr.h"
+#include "account-server/character.hpp"
/**
* Notes:
@@ -47,18 +47,10 @@ class Account
{
public:
/**
- * Constructor with initial account info.
- *
- * @param name the user name.
- * @param password the user password.
- * @param email the user email.
+ * Constructor.
*/
- Account(const std::string& name,
- const std::string& password,
- const std::string& email,
- int level,
- int id = -1);
-
+ Account(int id = -1): mID(id)
+ {}
/**
* Destructor.
@@ -152,8 +144,7 @@ class Account
*
* @param character the new character.
*/
- void
- addCharacter(CharacterPtr character);
+ void addCharacter(Character *character);
/**
* Remove a character.
@@ -181,14 +172,6 @@ class Account
{ return mCharacters; }
/**
- * Get a character by name.
- *
- * @return the character if found, NULL otherwise.
- */
- CharacterPtr
- getCharacter(const std::string& name);
-
- /**
* Get account ID.
*
* @return the unique ID of the account, a negative number if none yet.
@@ -203,7 +186,6 @@ class Account
void setID(int);
private:
- Account();
Account(Account const &rhs);
Account &operator=(Account const &rhs);
@@ -217,11 +199,6 @@ class Account
unsigned char mLevel; /**< account level */
};
-
-/**
- * Type definition for a smart pointer to Account.
- */
-typedef utils::CountedPtr<Account> AccountPtr;
-
+typedef std::vector< Account * > Accounts;
#endif // _TMWSERV_ACCOUNT_H_