Datenbank.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef Datenbank_H
  2. #define Datenbank_H
  3. #include <sql.h>
  4. #include <Text.h>
  5. #include <InitDatei.h>
  6. using namespace Framework;
  7. using namespace sql;
  8. namespace Admin_Recht
  9. {
  10. const int PSStarten = 3;
  11. const int PSBeenden = 4;
  12. const int PSPausieren = 5;
  13. const int PSMCChange = 6;
  14. const int KSGCUpdate = 7;
  15. }
  16. struct FileGroupInfo
  17. {
  18. int id;
  19. Text name;
  20. Text status;
  21. Text pfad;
  22. int version;
  23. };
  24. class PSDatenbank : public virtual ReferenceCounter
  25. {
  26. private:
  27. Datenbank* datenbank;
  28. CRITICAL_SECTION cs;
  29. public:
  30. // Konstruktor
  31. PSDatenbank(InitDatei* zIni);
  32. // Destruktor
  33. ~PSDatenbank();
  34. // nicht constant
  35. void lock();
  36. void unlock();
  37. int istAdministrator(const char* name, const char* passwort);
  38. bool adminHatRecht(int id, int recht);
  39. bool proveKlient(int num, int sNum);
  40. Text* getKlientKey(int cId);
  41. void unregisterKlient(int num, int sNum);
  42. bool setServerStatus(int id, int status);
  43. bool setMaxClients(int id, int maxC);
  44. bool serverIstNichtPausiert(int id);
  45. Result getSystemListe();
  46. Result getDateiListe(int system, int gruppe);
  47. Result getDateiListeSMP(int system, int gruppe);
  48. Result getDateiListeOhneOrdner(int system, int gruppe);
  49. Result getDeletedFiles(int system, int gruppe);
  50. Text* getSystemName(int system);
  51. Text* getDateiGruppeName(int gruppe);
  52. bool supportedDateiGruppe(int server, int gruppe);
  53. bool istDateigruppeStatusUpdate(int server, int gruppe);
  54. bool setDateiGruppe(int server, int gruppe, int version);
  55. bool setDateiGruppe(int server, int gruppe, bool update);
  56. bool dateiGruppeUpdateFertig(int server, int gruppe);
  57. int getDateiGruppePatchServer(int client, int gruppe);
  58. bool getPatchServerPortIp(int server, int* port, Text* zIp);
  59. Result getGruppeIds();
  60. Result getDateiGruppeListe();
  61. int getDateiGruppeVersion(int gruppe);
  62. int getDateiVersion(const char* pfad, int system, int gruppe);
  63. bool getFileGroupInfoList(int serverId, Array< FileGroupInfo* >* list);
  64. bool updateDatei(const char* pfad, char status, char* letzteAEnderung, int system, int gruppe);
  65. bool dateiGruppeUpdate(int gruppe);
  66. // constant
  67. Text* getLetzterFehler() const;
  68. };
  69. #endif