LoginDatabase.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 GetAccountIDByName(const char* name);
  36. int32 CheckServerAccount(char* name, char* passwd);
  37. bool IsServerAccountDisabled(char* name);
  38. bool IsIPBanned(char* ipaddr);
  39. void GetServerAccounts(vector<LWorld*>* server_list);
  40. char* GetServerAccountName(int32 id);
  41. bool VerifyDelete(int32 account_id, int32 character_id, const char* name);
  42. void SetServerZoneDescriptions(int32 server_id, map<int32, LoginZoneUpdate> zone_descriptions);
  43. int32 GetServer(int32 accountID, int32 charID, string name);
  44. void LoadCharacters(LoginAccount* acct, int16 version);
  45. void CheckCharacterTimeStamps(LoginAccount* acct);
  46. string GetCharacterName(int32 char_id , int32 server_id);
  47. void SaveCharacterColors(int32 char_id, char* type, EQ2_Color color);
  48. void SaveCharacterFloats(int32 char_id, char* type, float float1, float float2, float float3);
  49. int16 GetAppearanceID(string name);
  50. void DeactivateCharID(int32 server_id, int32 char_id, int32 exception_id);
  51. int32 SaveCharacter(PacketStruct* create, LoginAccount* acct, int32 world_charid, int32 client_version);
  52. void LoadAppearanceData(int32 char_id, PacketStruct* char_select_packet);
  53. bool UpdateCharacterTimeStamp(int32 account_id, int32 character_id, int32 timestamp_update, int32 server_id);
  54. bool UpdateCharacterLevel(int32 account_id, int32 character_id, int8 in_level, int32 server_id);
  55. bool UpdateCharacterRace(int32 account_id, int32 character_id, int16 in_racetype, int8 in_race, int32 server_id);
  56. bool UpdateCharacterClass(int32 account_id, int32 character_id, int8 in_class, int32 server_id);
  57. bool UpdateCharacterZone(int32 account_id, int32 character_id, int32 zone_id, int32 server_id);
  58. bool UpdateCharacterGender(int32 account_id, int32 character_id, int8 in_gender, int32 server_id);
  59. int32 GetRaceID(char* name);
  60. void UpdateRaceID(char* name);
  61. bool DeleteCharacter(int32 account_id, int32 character_id, int32 server_id);
  62. void SaveClientLog(const char* type, const char* message, const char* player_name, int16 version);
  63. bool CheckVersion(char* version);
  64. void GetLatestTableVersions(LatestTableVersions* table_versions);
  65. TableQuery* GetLatestTableQuery(int32 server_ip, char* name, int16 version);
  66. bool VerifyDataTable(char* name);
  67. sint16 GetDataVersion(char* name);
  68. void SetZoneInformation(int32 server_id, int32 zone_id, int32 version, PacketStruct* packet);
  69. string GetZoneDescription(char* name);
  70. string GetColumnNames(char* name);
  71. TableDataQuery* GetTableDataQuery(int32 server_ip, char* name, int16 version);
  72. void UpdateWorldServerStats( LWorld* world, sint32 status);
  73. bool ResetWorldServerStatsConnectedTime( LWorld* world );
  74. void RemoveOldWorldServerStats();
  75. void ResetWorldStats();
  76. };
  77. #endif