Datenbank.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 AppSStarten = 57;
  11. const int AppSBeenden = 58;
  12. }
  13. class AppSDatenbank
  14. {
  15. private:
  16. Datenbank *datenbank;
  17. CRITICAL_SECTION ths;
  18. int ref;
  19. public:
  20. // Konstruktor
  21. AppSDatenbank( InitDatei *zDat );
  22. // Detruktor
  23. ~AppSDatenbank();
  24. // nicht constant
  25. void lock();
  26. void unlock();
  27. int istAdministrator( const char *name, const char *passwort );
  28. bool adminHatRecht( int id, int recht );
  29. Text *getKey();
  30. int login( char *name, char *passwort );
  31. bool istNeu( int account );
  32. int getWeltBloeckeScore( int anz, Array< int > *score, RCArray< Text > *namen );
  33. int getWeltMauerScore( int anz, Array< int > *score, RCArray< Text > *namen );
  34. int getWeltFarbenScore( int anz, Array< int > *score, RCArray< Text > *namen );
  35. int getWeltFangenScore( int anz, Array< int > *score, RCArray< Text > *namen );
  36. int getWeltRennenScore( int anz, Array< int > *score, RCArray< Text > *namen );
  37. int getWeltGesamtScore( int anz, Array< int > *score, RCArray< Text > *namen );
  38. int getBloeckeScore( int account );
  39. int getMauerScore( int account );
  40. int getMauerZeit( int account, int level );
  41. int getFarbenScore( int account );
  42. int getFangenScore( int account );
  43. int getRennenScore( int account );
  44. int getGesamtScore( int account );
  45. void setBloeckeScore( int account, int score );
  46. void setFarbenScore( int account, int score );
  47. void setFangenScore( int account, int score );
  48. void setRennenScore( int account, int score );
  49. void setMauerZeit( int account, int level, int zeit );
  50. void calkMauerScore( int account );
  51. void calkGesamtScore( int account );
  52. int pruefNeuAccount( const char *name, const char *eMail );
  53. bool neuAccount( const char *name, const char *pass, const char *geheim, const char *eMail, const char *gebDatum, InitDatei *zIni );
  54. void markballsFinish( int level, int sek, int account, char *device, int diff, int kupfer, int gId );
  55. int getMarkballsScore( Array< int > *level, Array< int > *score, RCArray< Text > *name, int diff );
  56. int getMarkballsScore( Array< int > *level, Array< int > *score, int diff );
  57. void deviceAccount( char *device, int account );
  58. int getGegenstaende( int accountId, char *device, Array< int > *gId, Array< int > *diff );
  59. int getKupfer( int accountId );
  60. int getMarkballsFortschritt( int accountId, char *device, Array< int > *f );
  61. void addKupfer( int account, int kupfer );
  62. bool getFreeAds( int account );
  63. // Reference Counting
  64. AppSDatenbank *getThis();
  65. AppSDatenbank *release();
  66. };
  67. #endif