LoginDatabase.h 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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/DatabaseNew.h"
  18. #include "../common/types.h"
  19. #include "../common/MiscFunctions.h"
  20. #include "../common/servertalk.h"
  21. #include "../common/Mutex.h"
  22. #include "PacketHeaders.h"
  23. #include "LoginAccount.h"
  24. #include "LWorld.h"
  25. #include "../common/PacketStruct.h"
  26. using namespace std;
  27. #pragma pack()
  28. class LoginDatabase : public Database
  29. {
  30. public:
  31. void FixBugReport();
  32. void UpdateAccountIPAddress(int32 account_id, int32 address);
  33. void UpdateWorldIPAddress(int32 world_id, int32 address);
  34. 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);
  35. LoginAccount* LoadAccount(const char* name, const char* password, bool attemptAccountCreation=true);
  36. int32 GetAccountIDByName(const char* name);
  37. int32 CheckServerAccount(char* name, char* passwd);
  38. bool IsServerAccountDisabled(char* name);
  39. bool IsIPBanned(char* ipaddr);
  40. void GetServerAccounts(vector<LWorld*>* server_list);
  41. char* GetServerAccountName(int32 id);
  42. bool VerifyDelete(int32 account_id, int32 character_id, const char* name);
  43. void SetServerZoneDescriptions(int32 server_id, map<int32, LoginZoneUpdate> zone_descriptions);
  44. int32 GetServer(int32 accountID, int32 charID, string name);
  45. void LoadCharacters(LoginAccount* acct, int16 version);
  46. void CheckCharacterTimeStamps(LoginAccount* acct);
  47. string GetCharacterName(int32 char_id , int32 server_id, int32 account_id);
  48. void SaveCharacterColors(int32 char_id, char* type, EQ2_Color color);
  49. void SaveCharacterFloats(int32 char_id, char* type, float float1, float float2, float float3, float multiplier=100.0f);
  50. int16 GetAppearanceID(string name);
  51. void DeactivateCharID(int32 server_id, int32 char_id, int32 exception_id);
  52. int32 SaveCharacter(PacketStruct* create, LoginAccount* acct, int32 world_charid, int32 client_version);
  53. void LoadAppearanceData(int32 char_id, PacketStruct* char_select_packet);
  54. bool UpdateCharacterTimeStamp(int32 account_id, int32 character_id, int32 timestamp_update, int32 server_id);
  55. bool UpdateCharacterLevel(int32 account_id, int32 character_id, int8 in_level, int32 server_id);
  56. bool UpdateCharacterRace(int32 account_id, int32 character_id, int16 in_racetype, int8 in_race, int32 server_id);
  57. bool UpdateCharacterClass(int32 account_id, int32 character_id, int8 in_class, int32 server_id);
  58. bool UpdateCharacterZone(int32 account_id, int32 character_id, int32 zone_id, int32 server_id);
  59. bool UpdateCharacterGender(int32 account_id, int32 character_id, int8 in_gender, int32 server_id);
  60. int32 GetRaceID(char* name);
  61. void UpdateRaceID(char* name);
  62. bool DeleteCharacter(int32 account_id, int32 character_id, int32 server_id);
  63. void SaveClientLog(const char* type, const char* message, const char* player_name, int16 version);
  64. bool CheckVersion(char* version);
  65. void GetLatestTableVersions(LatestTableVersions* table_versions);
  66. TableQuery* GetLatestTableQuery(int32 server_ip, char* name, int16 version);
  67. bool VerifyDataTable(char* name);
  68. sint16 GetDataVersion(char* name);
  69. void SetZoneInformation(int32 server_id, int32 zone_id, int32 version, PacketStruct* packet);
  70. string GetZoneDescription(char* name);
  71. string GetColumnNames(char* name);
  72. TableDataQuery* GetTableDataQuery(int32 server_ip, char* name, int16 version);
  73. void UpdateWorldServerStats( LWorld* world, sint32 status);
  74. bool ResetWorldServerStatsConnectedTime( LWorld* world );
  75. void RemoveOldWorldServerStats();
  76. void ResetWorldStats();
  77. //devn00b temp
  78. bool ConnectNewDatabase();
  79. void SetServerEquipmentAppearances(int32 server_id, map<int32, LoginEquipmentUpdate> equip_updates); // JohnAdams: login appearances
  80. int32 GetLoginCharacterIDFromWorldCharID(int32 server_id, int32 char_id); // JohnAdams: login appearances
  81. void RemoveDeletedCharacterData();
  82. int8 GetMaxCharsSetting();
  83. int16 GetAccountBonus(int32 acct_id);
  84. void UpdateWorldVersion(int32 world_id, char* version);
  85. void UpdateAccountClientDataVersion(int32 account_id, int16 version);
  86. void SaveCharacterPicture(int32 account_id, int32 character_id, int32 server_id, int16 picture_size, uchar* picture);
  87. DatabaseNew dbLogin;
  88. };
  89. #endif