Datenbank.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef Datenbank_H
  2. #define Datenbank_H
  3. #include <sql.h>
  4. #include <Text.h>
  5. #include <Array.h>
  6. #include <InitDatei.h>
  7. using namespace Framework;
  8. using namespace sql;
  9. namespace Admin_Recht
  10. {
  11. const int ASStarten = 28;
  12. const int ASBeenden = 29;
  13. const int ASPausieren = 30;
  14. const int ASMCChange = 31;
  15. }
  16. class ASDatenbank : public virtual ReferenceCounter
  17. {
  18. private:
  19. Datenbank* datenbank;
  20. CRITICAL_SECTION cs;
  21. public:
  22. // Konstruktor
  23. ASDatenbank(InitDatei* zIni);
  24. // Destruktor
  25. ~ASDatenbank();
  26. // nicht constant
  27. void lock();
  28. void unlock();
  29. int istAdministrator(const char* name, const char* passwort);
  30. bool adminHatRecht(int id, int recht);
  31. bool proveKlient(int num, int sNum);
  32. Text* getKlientKey(int cId);
  33. void unregisterKlient(int num, int sNum);
  34. bool setServerStatus(int id, int status);
  35. bool setMaxClients(int id, int maxC);
  36. bool serverIstNichtPausiert(int id);
  37. bool getChatServer(int accountId, Text* ip, int* port);
  38. int gruppeErstellen(int accountId, int karteId, int* gruppe_id);
  39. bool gruppeAnmelden(int accountId, int gruppeId);
  40. bool gruppeAbmelden(int accountId, int gruppeId);
  41. bool setGruppeSpielStarten(int accountId, int gruppeId, bool starten);
  42. bool getGruppeSpielStarten(int gruppeId);
  43. bool proveEinladung(int vonAccount, int zuAccount, int gruppeId);
  44. int gruppeBetreten(int accountId, int gruppeId);
  45. int gruppeVerlassen(int accountId, int gruppeId);
  46. bool spielerKannKicken(int accountId, int gruppeId);
  47. bool getSpielerInGruppe(int gruppeId, Array< int >* accountId, int* anzahl);
  48. int getSpielerInGruppeAnzahl(int gruppeId);
  49. int getGruppeAdminId(int gruppeId);
  50. bool gruppeSpielerEinladen(int vonAccount, int zuAccount, int gruppeId);
  51. bool gruppeEinladungAbbrechen(int admin, int gruppeId, int accountId);
  52. bool gruppeSpielerIstEingeladen(int gruppeId, int accountId);
  53. bool gruppeIstInWarteschlange(int gruppeId);
  54. int getAccountId(int clientId);
  55. int accountAnmelden(int accountId, int karteId);
  56. void accountAbmelden(int accountId);
  57. bool spielerBesitztKarte(int accountId, int karteId);
  58. int getGruppenKarte(int gruppeId);
  59. Text* getAccountRufName(int accountId);
  60. // constant
  61. Text* getLetzterFehler() const;
  62. };
  63. #endif