MainServer.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #ifndef MainServer_H
  2. #define MainServer_H
  3. #include <Server.h>
  4. #include <Thread.h>
  5. #include <InitDatei.h>
  6. #include "Datenbank.h"
  7. #include <AsynchronCall.h>
  8. using namespace Framework;
  9. using namespace Network;
  10. class MainServer : public Thread
  11. {
  12. private:
  13. Server* server;
  14. SSLServer* aServer;
  15. SSLServer* serverSSL;
  16. InitDatei* dat;
  17. MSDatenbank* db;
  18. CRITICAL_SECTION cs;
  19. int empfangen;
  20. int gesendet;
  21. int clients;
  22. bool end;
  23. public:
  24. // Konstruktor
  25. MainServer(InitDatei* zDat);
  26. // Destruktor
  27. virtual ~MainServer();
  28. // nicht constant
  29. void runn();
  30. void thread();
  31. void close();
  32. bool serverStarten();
  33. void serverBeenden();
  34. void addGesendet(int bytes);
  35. void addEmpfangen(int bytes);
  36. void clientTrennung();
  37. // constant
  38. Server* zServer() const;
  39. MSDatenbank* zDB() const;
  40. bool hatClients() const;
  41. InitDatei* zInit() const;
  42. };
  43. class MSAKlient : public Thread
  44. {
  45. private:
  46. SSLSKlient* klient;
  47. Text* name;
  48. Text* passwort;
  49. int adminId;
  50. MainServer* ms;
  51. public:
  52. // Konstruktor
  53. MSAKlient(SSLSKlient* klient, MainServer* ms);
  54. // Destruktor
  55. virtual ~MSAKlient();
  56. // nicht constant
  57. void thread();
  58. void errorZuKlient(const char* nachricht) const; // sendet eine Fehlernachricht zum AKlient
  59. };
  60. class MSKlient : public Thread
  61. {
  62. private:
  63. SKlient* klient;
  64. unsigned int klientNummer;
  65. MainServer* ms;
  66. bool encrypted;
  67. public:
  68. // Konstruktor
  69. MSKlient(SKlient* klient, MainServer* ms);
  70. // Destruktor
  71. virtual ~MSKlient();
  72. // nicht constant
  73. void thread();
  74. void errorZuKlient(const char* nachricht) const; // sendet eine Fehlernachricht zum Klient
  75. };
  76. class MSKlientSSL : public Thread
  77. {
  78. private:
  79. SSLSKlient* klient;
  80. unsigned int klientNummer;
  81. MainServer* ms;
  82. public:
  83. // Konstruktor
  84. MSKlientSSL(SSLSKlient* klient, MainServer* ms);
  85. // Destruktor
  86. virtual ~MSKlientSSL();
  87. // nicht constant
  88. void thread();
  89. void errorZuKlient(const char* nachricht) const; // sendet eine Fehlernachricht zum Klient
  90. };
  91. class MSGWeiterleitung : public virtual ReferenceCounter
  92. {
  93. private:
  94. MainServer* ms;
  95. public:
  96. // Konstruktor
  97. MSGWeiterleitung(MainServer* ms);
  98. // Destruktor
  99. ~MSGWeiterleitung();
  100. // nicht constant
  101. bool patchServerKlientAbsturz(int klientId);
  102. bool registerServerKlientAbsturz(int klientId);
  103. bool loginServerKlientAbsturz(int klientId);
  104. bool informationServerKlientAbsturz(int klientId);
  105. bool chatServerKlientAbsturz(int klientId);
  106. bool anmeldungServerKlientAbsturz(int klientId);
  107. bool spielServerKlientAbsturz(int klientId);
  108. bool shopServerKlientAbsturz(int klientId);
  109. bool newsServerKlientAbsturz(int klientId);
  110. bool historieServerKlientAbsturz(int klientId);
  111. bool kartenServerKlientAbsturz(int klientId);
  112. bool editorServerKlientAbsturz(int klientId);
  113. bool minigameServerKlientAbsturz(int klientId);
  114. bool spielErstelltAbbrechen(int spielErstelltId);
  115. bool spielerLeavesGruppe(int gruppeId, int accountId);
  116. bool setGruppeAdmin(int gruppeId, int adminId);
  117. bool spielerLeavesChatroom(int chatroomId, int accountId);
  118. bool setChatroomAdmin(int chatroomId, int adminId);
  119. bool kickSpielerAusGruppe(int gruppeId);
  120. };
  121. #endif