Pol  Revision:4b29d2b
account.h
Go to the documentation of this file.
1 
10 #ifndef ACCOUNT_H
11 #define ACCOUNT_H
12 
13 #include <string>
14 #include <vector>
15 
16 #include "../../clib/refptr.h"
17 #include "../../clib/strset.h"
18 #include "../proplist.h"
19 #include "../reftypes.h"
20 
21 namespace Pol
22 {
23 namespace Mobile
24 {
25 class Character;
26 }
27 namespace Accounts
28 {
29 class Account : public ref_counted
30 {
31 public:
32  explicit Account( Clib::ConfigElem& elem );
33  ~Account();
34 
35  size_t estimatedSize() const;
36 
37  const char* name() const;
38  const std::string password() const;
39  const std::string passwordhash() const;
40  const std::string uo_expansion() const;
41  unsigned short uo_expansion_flag() const;
42  static unsigned short convert_uo_expansion( const std::string& expansion );
43  bool enabled() const;
44  bool banned() const;
45 
46  int numchars() const;
47  int getnextfreeslot() const;
48 
49  Mobile::Character* get_character( int index );
50  void set_character( int index, Mobile::Character* chr );
51  void clear_character( int index );
52 
53  bool has_active_characters();
54 
55  void readfrom( Clib::ConfigElem& elem );
56  void writeto( Clib::StreamWriter& sw ) const;
57  void writeto( Clib::ConfigElem& elem ) const;
58 
59  std::string default_privlist() const;
60  unsigned char default_cmdlevel() const;
61 
62  void set_password( std::string newpass ) { password_ = newpass; };
63  void set_passwordhash( std::string newpass ) { passwordhash_ = newpass; };
64  friend class AccountObjImp;
65 
66 private:
67  std::vector<Core::CharacterRef> characters_;
68  std::string name_;
69  std::string password_;
70  std::string passwordhash_;
71  unsigned short uo_expansion_;
72  bool enabled_;
73  bool banned_;
76  unsigned char default_cmdlevel_;
77 
79 };
80 }
81 }
82 #endif
Core::PropertyList props_
Definition: account.h:74
void set_passwordhash(std::string newpass)
Definition: account.h:63
void set_password(std::string newpass)
Definition: account.h:62
std::string passwordhash_
Definition: account.h:70
Clib::StringSet default_privs_
Definition: account.h:75
Clib::StringSet options_
Definition: account.h:78
std::string password_
Definition: account.h:69
unsigned char default_cmdlevel_
Definition: account.h:76
std::string name_
Definition: account.h:68
std::vector< Core::CharacterRef > characters_
Definition: account.h:67
unsigned short uo_expansion_
Definition: account.h:71
std::string name
Definition: osmod.cpp:943
Definition: berror.cpp:12