Datenbank.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 MSStarten = 0x00000001;
  11. const int MSBeenden = 0x00000002;
  12. }
  13. class MSDatenbank
  14. {
  15. private:
  16. Datenbank *datenbank;
  17. CRITICAL_SECTION ths;
  18. int ref;
  19. public:
  20. // Konstruktor
  21. MSDatenbank( InitDatei *zDat );
  22. // Detruktor
  23. ~MSDatenbank();
  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. unsigned int getNextClientId();
  30. Text *getKlientKey( int cId );
  31. bool proveRegisteredClient( unsigned int num );
  32. int *unregisterClient( unsigned int num );
  33. int suchPatchServer( unsigned int client );
  34. unsigned char *getPatchServerPortIp( int num );
  35. int suchRegisterServer( unsigned int client );
  36. unsigned char *getRegisterServerPortIp( int num );
  37. int suchLoginServer( unsigned int client );
  38. unsigned char *getLoginServerPortIp( int num );
  39. int suchInformationServer( unsigned int client );
  40. unsigned char *getInformationServerPortIp( int num );
  41. int suchChatServer( unsigned int client );
  42. unsigned char *getChatServerPortIp( int num );
  43. int suchAnmeldungServer( unsigned int client );
  44. unsigned char *getAnmeldungServerPortIp( int num );
  45. int suchErhaltungServer( unsigned int client );
  46. unsigned char *getErhaltungServerPortIp( int num );
  47. int suchShopServer( unsigned int client );
  48. unsigned char *getShopServerPortIp( int num );
  49. int suchNewsServer( unsigned int client );
  50. unsigned char *getNewsServerPortIp( int num );
  51. int logoutKlient( int klientId, Array< int > *ret );
  52. bool getSpielServerPortIp( int spielErstelltId, unsigned short *port, Text *ip );
  53. int getSpielerAusGruppe( int gruppeId, Array< int > *accountId );
  54. int kickSpielerAusGruppe( int gruppeId, int accountId );
  55. bool getChatServerPortIp( int accountId, unsigned short *port, Text *ip );
  56. int getGruppeAdmin( int gruppeId );
  57. int getSpielerAusChatroom( int chatroomId, Array< int > *accountId );
  58. int getChatroomAdmin( int chatroomId );
  59. int clientistEingeloggt( int clientId );
  60. bool getPatchServer( int client, Text *ip, int *port );
  61. bool getRegisterServer( int client, Text *ip, int *port );
  62. bool getLoginServer( int client, Text *ip, int *port );
  63. bool getInformationServer( int client, Text *ip, int *port );
  64. bool getChatServer( int client, Text *ip, int *port );
  65. bool getAnmeldungServer( int client, Text *ip, int *port );
  66. bool getSpielServer( int client, Text *ip, int *port );
  67. bool getShopServer( int client, Text *ip, int *port );
  68. bool getNewsServer( int client, Text *ip, int *port );
  69. bool getHistorieServer( int client, Text *ip, int *port );
  70. bool getKartenServer( int client, Text *ip, int *port );
  71. bool getEditorServer( int client, Text *ip, int *port );
  72. // Reference Counting
  73. MSDatenbank *getThis();
  74. MSDatenbank *release();
  75. };
  76. #endif