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