LoginDatabase.h 3.7 KB

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