LoginAccount.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. */
  6. #ifndef _LOGINACCOUNT_
  7. #define _LOGINACCOUNT_
  8. #include <iostream>
  9. #include <string>
  10. #include <vector>
  11. #include "../common/linked_list.h"
  12. #include "PacketHeaders.h"
  13. #include "../common/PacketStruct.h"
  14. using namespace std;
  15. class LoginAccount {
  16. public:
  17. LoginAccount();
  18. LoginAccount(int32 id, const char* in_name, const char* in_pass){
  19. account_id = id;
  20. strcpy(name, in_name);
  21. strcpy(password, in_pass);
  22. }
  23. ~LoginAccount();
  24. bool SaveAccount(LoginAccount* acct);
  25. vector<CharSelectProfile*> charlist;
  26. void setName(const char* in_name) { strcpy(name, in_name); }
  27. void setPassword(const char* in_pass) { strcpy(password, in_pass); }
  28. void setAuthenticated(bool in_auth) { authenticated=in_auth; }
  29. void setAccountID(int32 id){ account_id = id; }
  30. void addCharacter(CharSelectProfile* profile){
  31. charlist.push_back(profile);
  32. }
  33. void removeCharacter(PacketStruct* profile);
  34. void removeCharacter(char* name);
  35. void serializeCharacter(uchar* buffer, CharSelectProfile* profile);
  36. void flushCharacters ( );
  37. CharSelectProfile* getCharacter(char* name);
  38. int32 getLoginAccountID(){ return account_id; }
  39. char* getLoginName() { return name; }
  40. char* getLoginPassword() { return password; }
  41. bool getLoginAuthenticated() { return authenticated; }
  42. private:
  43. int32 account_id;
  44. char name[32];
  45. char password[32];
  46. bool authenticated;
  47. };
  48. #endif