Datenbank.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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
  17. {
  18. private:
  19. Datenbank *datenbank;
  20. CRITICAL_SECTION cs;
  21. int ref;
  22. public:
  23. // Konstruktor
  24. ASDatenbank( InitDatei *zIni );
  25. // Destruktor
  26. ~ASDatenbank();
  27. // nicht constant
  28. void lock();
  29. void unlock();
  30. int istAdministrator( const char *name, const char *passwort );
  31. bool adminHatRecht( int id, int recht );
  32. bool proveKlient( int num, int sNum );
  33. Text *getKlientKey( int cId );
  34. void unregisterKlient( int num, int sNum );
  35. bool setServerStatus( int id, int status );
  36. bool setMaxClients( int id, int maxC );
  37. bool serverIstNichtPausiert( int id );
  38. bool getChatServer( int accountId, Text *ip, int *port );
  39. int gruppeErstellen( int accountId, int karteId, int *gruppe_id );
  40. bool gruppeAnmelden( int accountId, int gruppeId );
  41. bool gruppeAbmelden( int accountId, int gruppeId );
  42. bool setGruppeSpielStarten( int accountId, int gruppeId, bool starten );
  43. bool getGruppeSpielStarten( int gruppeId );
  44. bool proveEinladung( int vonAccount, int zuAccount, int gruppeId );
  45. int gruppeBetreten( int accountId, int gruppeId );
  46. int gruppeVerlassen( int accountId, int gruppeId );
  47. bool spielerKannKicken( int accountId, int gruppeId );
  48. bool getSpielerInGruppe( int gruppeId, Array< int > *accountId, int *anzahl );
  49. int getSpielerInGruppeAnzahl( int gruppeId );
  50. int getGruppeAdminId( int gruppeId );
  51. bool gruppeSpielerEinladen( int vonAccount, int zuAccount, int gruppeId );
  52. bool gruppeEinladungAbbrechen( int admin, int gruppeId, int accountId );
  53. bool gruppeSpielerIstEingeladen( int gruppeId, int accountId );
  54. bool gruppeIstInWarteschlange( int gruppeId );
  55. int getAccountId( int clientId );
  56. int accountAnmelden( int accountId, int karteId );
  57. void accountAbmelden( int accountId );
  58. bool spielerBesitztKarte( int accountId, int karteId );
  59. int getGruppenKarte( int gruppeId );
  60. Text *getAccountRufName( int accountId );
  61. // constant
  62. Text *getLetzterFehler() const;
  63. // Reference Counting
  64. ASDatenbank *getThis();
  65. ASDatenbank *release();
  66. };
  67. #endif