Datenbank.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef Datenbank_H
  2. #define Datenbank_H
  3. #include <sql.h>
  4. #include "SSDatenbankV.h"
  5. #include <Text.h>
  6. #include <Array.h>
  7. #include <Zeit.h>
  8. #include <InitDatei.h>
  9. using namespace Framework;
  10. using namespace sql;
  11. namespace Admin_Recht
  12. {
  13. const int SSStarten = 32;
  14. const int SSBeenden = 34;
  15. const int SSPausieren = 35;
  16. const int SSMSChange = 36;
  17. }
  18. class SSDatenbank : public SSDatenbankV
  19. {
  20. private:
  21. Datenbank *datenbank;
  22. CRITICAL_SECTION cs;
  23. InitDatei *ini;
  24. public:
  25. // Konstruktor
  26. SSDatenbank( InitDatei *zIni );
  27. // Destruktor
  28. virtual ~SSDatenbank();
  29. // nicht constant
  30. void lock();
  31. void unlock();
  32. Text *getKlientKey( int cId );
  33. int istAdministrator( const char *name, const char *passwort );
  34. bool adminHatRecht( int id, int recht );
  35. bool setServerStatus( int id, int status );
  36. bool setMaxSpiele( int id, int maxS );
  37. bool serverIstNichtPausiert( int id );
  38. virtual int getAccountId( int clientId );
  39. virtual Text *getSpielArtName( int spielId );
  40. virtual Text *getKarteName( int karteId );
  41. virtual int getSpielArtId( int karteId );
  42. int erstelleSpiel( int serverId );
  43. bool deleteSpielErstelltNext( int serverId );
  44. int getSpielErstelltId( int serverId );
  45. int getSpielErstelltSpieler( int spielErstelltId, Array< int > *accountIds );
  46. int getKarteVonErstelltemSpiel( int spielErstelltId );
  47. bool getChatServerPortIp( int accountId, int *port, Text *zIp );
  48. bool spielErstelltAbbruch( int spielErstelltId, int anzahl, Array< int > *accounts, Array< int > *status, Array< bool > *inWarteschlange, RCArray< Zeit > *zeit );
  49. int spielErstelltFortsetzen( int spielErstelltId );
  50. void spielSetTeams( int spielId, int sAnzahl, Array< int > *accounts, Array< int > *team );
  51. void spielSetSpielerNummern( int spielId, int sAnzahl, Array< int > *accounts, Array< int > *spielerNummern );
  52. int getSpielerAusGruppe( int gruppeId, Array< int > *accounts );
  53. int getAktionForKlient( int serverId, int accountId, int *id );
  54. bool setSpielStatusIsRunning( int spielId );
  55. virtual bool setSpielStatusBeendet( int spielId, int status );
  56. virtual bool setSpielSpielerStatus( int spielId, int accountId, int punkte, int status );
  57. virtual bool addSpielerStatistik( int accountId, int spielId );
  58. virtual Text *getAccountRufName( int accountId );
  59. bool suchHistorieServer( short *port, Text *ip );
  60. bool getKartenServer( int karteId, int *port, Text *ip );
  61. Text *getSpielPfad( int karteId );
  62. // constant
  63. Text *getLetzterFehler() const;
  64. };
  65. #endif