LoginDatabase.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 EQ2LOGIN_EMU_DATABASE_H
  7. #define EQ2LOGIN_EMU_DATABASE_H
  8. #ifdef WIN32
  9. #define WIN32_LEAN_AND_MEAN
  10. #include <winsock.h>
  11. #include <windows.h>
  12. #endif
  13. #include <mysql.h>
  14. #include <string>
  15. #include <vector>
  16. #include "../common/database.h"
  17. #include "../common/types.h"
  18. #include "../common/MiscFunctions.h"
  19. #include "../common/servertalk.h"
  20. #include "../common/Mutex.h"
  21. #include "PacketHeaders.h"
  22. #include "LoginAccount.h"
  23. #include "LWorld.h"
  24. #include "../common/PacketStruct.h"
  25. using namespace std;
  26. #pragma pack()
  27. class LoginDatabase : public Database
  28. {
  29. public:
  30. void FixBugReport();
  31. void UpdateAccountIPAddress(int32 account_id, int32 address);
  32. void UpdateWorldIPAddress(int32 world_id, int32 address);
  33. void SaveBugReport(int32 world_id, char* category, char* subcategory, char* causes_crash, char* reproducible, char* summary, char* description, char* version, char* player, int32 account_id, char* spawn_name, int32 spawn_id, int32 zone_id);
  34. LoginAccount* LoadAccount(const char* name, const char* password, bool attemptAccountCreation=true);
  35. int32 CheckServerAccount(char* name, char* passwd);
  36. void GetServerAccounts(vector<LWorld*>* server_list);
  37. char* GetServerAccountName(int32 id);
  38. bool VerifyDelete(int32 account_id, int32 character_id, const char* name);
  39. void SetServerZoneDescriptions(int32 server_id, map<int32, LoginZoneUpdate> zone_descriptions);
  40. void LoadCharacters(LoginAccount* acct, int16 version);
  41. void CheckCharacterTimeStamps(LoginAccount* acct);
  42. string GetCharacterName(int32 char_id , int32 server_id);
  43. void SaveCharacterColors(int32 char_id, char* type, EQ2_Color color);
  44. void SaveCharacterFloats(int32 char_id, char* type, float float1, float float2, float float3);
  45. int16 GetAppearanceID(string name);
  46. void DeactivateCharID(int32 server_id, int32 char_id, int32 exception_id);
  47. int32 SaveCharacter(PacketStruct* create, LoginAccount* acct, int32 world_charid);
  48. void LoadAppearanceData(int32 char_id, PacketStruct* char_select_packet);
  49. bool UpdateCharacterTimeStamp(int32 account_id, int32 character_id, int32 timestamp_update, int32 server_id);
  50. bool UpdateCharacterLevel(int32 account_id, int32 character_id, int8 in_level, int32 server_id);
  51. bool UpdateCharacterRace(int32 account_id, int32 character_id, int16 in_racetype, int8 in_race, int32 server_id);
  52. bool UpdateCharacterClass(int32 account_id, int32 character_id, int8 in_class, int32 server_id);
  53. bool UpdateCharacterZone(int32 account_id, int32 character_id, int32 zone_id, int32 server_id);
  54. bool UpdateCharacterGender(int32 account_id, int32 character_id, int8 in_gender, int32 server_id);
  55. int32 GetRaceID(char* name);
  56. void UpdateRaceID(char* name);
  57. bool DeleteCharacter(int32 account_id, int32 character_id, int32 server_id);
  58. void SaveClientLog(char* type, char* message, char* player_name, int16 version);
  59. bool CheckVersion(char* version);
  60. void GetLatestTableVersions(LatestTableVersions* table_versions);
  61. TableQuery* GetLatestTableQuery(int32 server_ip, char* name, int16 version);
  62. bool VerifyDataTable(char* name);
  63. sint16 GetDataVersion(char* name);
  64. void SetZoneInformation(int32 server_id, int32 zone_id, PacketStruct* packet);
  65. string GetZoneDescription(char* name);
  66. string GetColumnNames(char* name);
  67. TableDataQuery* GetTableDataQuery(int32 server_ip, char* name, int16 version);
  68. void UpdateWorldServerStats( LWorld* world, sint32 status);
  69. bool ResetWorldServerStatsConnectedTime( LWorld* world );
  70. void RemoveOldWorldServerStats();
  71. void ResetWorldStats();
  72. };
  73. #endif