ErhaltungServer.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. #ifndef ErhaltungServer_H
  2. #define ErhaltungServer_H
  3. #include <Server.h>
  4. #include <Thread.h>
  5. #include <Datei.h>
  6. #include <Text.h>
  7. #include <InitDatei.h>
  8. #include <Zeit.h>
  9. #ifdef WIN32
  10. #include "..\Datenbank\Datenbank.h"
  11. #else
  12. #include "Datenbank.h"
  13. #endif
  14. using namespace Network;
  15. class ErhaltungServer : public Thread
  16. {
  17. private:
  18. Server *server;
  19. SSLServer *aServer;
  20. InitDatei *ini;
  21. ESDatenbank *db;
  22. Text *fehler;
  23. int clients;
  24. int id;
  25. bool nichtPausiert;
  26. int empfangen;
  27. int gesendet;
  28. bool end;
  29. public:
  30. // Konstruktor
  31. ErhaltungServer( InitDatei *zIni );
  32. // Destruktor
  33. virtual ~ErhaltungServer();
  34. // nicht constant
  35. void runn();
  36. void thread();
  37. void close();
  38. bool serverStarten();
  39. bool serverPause();
  40. bool serverFortsetzen();
  41. bool serverBeenden();
  42. bool setMaxKlients( unsigned char mc );
  43. void addGesendet( int bytes );
  44. void addEmpfangen( int bytes );
  45. void clientTrennung();
  46. // constant
  47. bool istAn() const;
  48. Server *zServer() const;
  49. ESDatenbank *zDB() const;
  50. bool hatClients() const;
  51. int getId() const;
  52. char *getLetzterFehler() const;
  53. };
  54. class ESAKlient : public Thread
  55. {
  56. private:
  57. SSLSKlient *klient;
  58. Text *name;
  59. Text *passwort;
  60. int adminId;
  61. ErhaltungServer *es;
  62. int version;
  63. public:
  64. // Konstruktor
  65. ESAKlient( SSLSKlient *klient, ErhaltungServer *es );
  66. // Destruktor
  67. virtual ~ESAKlient();
  68. // nicht constant
  69. void thread();
  70. void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum AKlient
  71. };
  72. class ESKlient;
  73. class ESKThread : public Thread
  74. {
  75. private:
  76. ESKlient *zKlient;
  77. public:
  78. // Konstruktor
  79. ESKThread( ESKlient *zKlient );
  80. // Destruktor
  81. virtual ~ESKThread();
  82. // nicht constant
  83. virtual void thread();
  84. // constant
  85. };
  86. class ESKlient : public Thread
  87. {
  88. private:
  89. ESKThread *th;
  90. SKlient *klient;
  91. ZeitMesser *zeit;
  92. double sekunden;
  93. double letzteErhaltung;
  94. bool abgemeldet;
  95. unsigned int klientNummer;
  96. ErhaltungServer *es;
  97. bool encrypted;
  98. public:
  99. // Konstruktor
  100. ESKlient( SKlient *klient, ErhaltungServer *es );
  101. // Destruktor
  102. virtual ~ESKlient();
  103. // nicht constant
  104. bool erhalten();
  105. virtual void thread();
  106. // constant
  107. void errorZuKlient( const char *nachricht ) const;
  108. };
  109. class ESGWeiterleitung
  110. {
  111. private:
  112. ErhaltungServer *es;
  113. int ref;
  114. public:
  115. // Konstruktor
  116. ESGWeiterleitung( ErhaltungServer *es );
  117. // Destruktor
  118. ~ESGWeiterleitung();
  119. // nicht constant
  120. bool patchServerKlientAbsturz( int klientId );
  121. bool registerServerKlientAbsturz( int klientId );
  122. bool loginServerKlientAbsturz( int klientId );
  123. bool informationServerKlientAbsturz( int klientId );
  124. bool chatServerKlientAbsturz( int klientId );
  125. bool anmeldungServerKlientAbsturz( int klientId );
  126. bool spielServerKlientAbsturz( int klientId );
  127. bool shopServerKlientAbsturz( int klientId );
  128. bool historieServerKlientAbsturz( int klientId );
  129. bool newsServerKlientAbsturz( int klientId );
  130. bool kartenServerKlientAbsturz( int klientId );
  131. bool editorServerKlientAbsturz( int klientId );
  132. bool minigameServerKlientAbsturz( int klientId );
  133. bool spielErstelltAbbrechen( int spielErstelltId );
  134. bool spielerLeavesGruppe( int gruppeId, int accountId );
  135. bool setGruppeAdmin( int gruppeId, int adminId );
  136. bool spielerLeavesChatroom( int chatroomId, int accountId );
  137. bool setChatroomAdmin( int chatroomId, int adminId );
  138. bool kickSpielerAusGruppe( int gruppeId );
  139. // constant
  140. // Reference Counting
  141. ESGWeiterleitung *getThis();
  142. ESGWeiterleitung *release();
  143. };
  144. #endif