PatchServer.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #ifndef PatchServer_H
  2. #define PatchServer_H
  3. #include "..\..\Basic\Abschnitt.h"
  4. #include "..\..\..\Netzwerk\Main\MSKlient.h"
  5. #include "..\..\..\Netzwerk\Patch\PSKlient.h"
  6. #include "..\..\..\Ressourcen\Ressourcen.h"
  7. #include <InitDatei.h>
  8. #include <Knopf.h>
  9. #include <Tabelle.h>
  10. #include <Thread.h>
  11. #include <Fortschritt.h>
  12. class AdminAccount; // Login.h
  13. class PatchServer; // PatchServer.h
  14. class PSUpdate : public Thread
  15. {
  16. private:
  17. PatchServer *zPSA;
  18. AdminAccount *account;
  19. PSKlient *psc;
  20. int gruppeAnzahl;
  21. int *gruppeId;
  22. int id;
  23. public:
  24. // Kontruktor
  25. PSUpdate( PatchServer *zPSA, AdminAccount *account );
  26. // Destruktor
  27. ~PSUpdate();
  28. // nicht constant
  29. void setServer( const char *ip, unsigned short port );
  30. void setUpdateListe( int gAnzahl, Array< int > *gId );
  31. virtual void thread();
  32. // constant
  33. };
  34. class PSDetails : public Thread
  35. {
  36. private:
  37. PatchServer *zPSA;
  38. MSKlient *mk;
  39. int id;
  40. public:
  41. // Konstruktor
  42. PSDetails( PatchServer *zPSA, MSKlient *mk );
  43. // Destruktor
  44. ~PSDetails();
  45. // nicht constant
  46. void setServerId( int id );
  47. virtual void thread();
  48. // constant
  49. };
  50. class PSSuche : public Thread
  51. {
  52. private:
  53. PatchServer *zPSA;
  54. MSKlient *mk;
  55. public:
  56. // Konstruktor
  57. PSSuche( PatchServer *zPSA, MSKlient *mk );
  58. // Destruktor
  59. ~PSSuche();
  60. // nicht constant
  61. virtual void thread();
  62. // constant
  63. };
  64. class PatchServer : public Abschnitt
  65. {
  66. private:
  67. Fenster *fenster;
  68. Fenster *liste;
  69. Fenster *details;
  70. Fenster *updateF;
  71. MSKlient *msk;
  72. InitDatei *iD;
  73. Fenster *f;
  74. AdminAccount *account;
  75. Knopf *aktualisieren;
  76. Knopf *weiter;
  77. Knopf *zurück;
  78. ObjTabelle *tabelle;
  79. ObjTabelle *updateT;
  80. PSSuche *suchen;
  81. PSDetails *getDetails;
  82. PSUpdate *updateTh;
  83. Schrift *schrift;
  84. PSKlient *psc;
  85. TextFeld *serverId;
  86. TextFeld *serverName;
  87. TextFeld *serverIp;
  88. TextFeld *serverPort;
  89. TextFeld *serverAPort;
  90. TextFeld *serverClients;
  91. TextFeld *serverMaxClients;
  92. TextFeld *maxClients;
  93. TextFeld *serverStatus;
  94. TextFeld *serverFehler;
  95. Knopf *updateStarten;
  96. Knopf *update;
  97. Knopf *pausieren;
  98. Knopf *stoppen;
  99. Knopf *beenden;
  100. Knopf *terminieren;
  101. Knopf *setMaxClients;
  102. Zeichnung *obj;
  103. int ref;
  104. public:
  105. // Konstruktor
  106. PatchServer( Schrift *s, InitDatei *d, MSKlient *msk, RessourceBild *rb, AdminAccount *acc, Bildschirm *b );
  107. // Destruktor
  108. ~PatchServer();
  109. // nicht constant
  110. virtual void setFenster( Fenster *f );
  111. virtual void setSichtbar( bool s );
  112. void addServer( int id, char *name, char *ip, int port, int adminPort, char *status );
  113. void sucheAbgeschlossen();
  114. void setServerDetails( int id, char *name, char *ip, int port, int adminPort, int clients, int maxClients, int status, Text *error );
  115. void setUpdateProzent( int prozent, int gruppe );
  116. void setUpdateFertig( bool error, int gruppe );
  117. bool aktualisierenMausEreignis( void *o, MausEreignis me );
  118. bool auswahlKnopfMausEreignis( void *o, MausEreignis me );
  119. bool weiterMausEreignis( void *o, MausEreignis me );
  120. bool zurückMausEreignis( void *o, MausEreignis me );
  121. bool updateMausEreignis( void *o, MausEreignis me );
  122. bool pausierenMausEreignis( void *o, MausEreignis me );
  123. bool stoppenMausEreignis( void *o, MausEreignis me );
  124. bool beendenMausEreignis( void *o, MausEreignis me );
  125. bool terminierenMausEreignis( void *o, MausEreignis me );
  126. bool setMaxClientsMausEreignis( void *o, MausEreignis me );
  127. bool updateStartenMausEreignis( void *o, MausEreignis me );
  128. bool maxClientsTastaturEreignis( void *o, TastaturEreignis te );
  129. // constant
  130. // Reference Counting
  131. virtual Abschnitt *getThis();
  132. virtual Abschnitt *release();
  133. };
  134. // Ereignisse
  135. bool patchServerAktualisierenMausEreignis( void *p, void *o, MausEreignis me );
  136. bool patchServerAuswahlKnopfMausEreignis( void *p, void *o, MausEreignis me );
  137. bool patchServerWeiterMausEreignis( void *p, void *o, MausEreignis me );
  138. bool patchServerZurückMausEreignis( void *p, void *o, MausEreignis me );
  139. bool patchServerUpdateMausEreignis( void *p, void *o, MausEreignis me );
  140. bool patchServerPausierenMausEreignis( void *p, void *o, MausEreignis me );
  141. bool patchServerStoppenMausEreignis( void *p, void *o, MausEreignis me );
  142. bool patchServerBeendenMausEreignis( void *p, void *o, MausEreignis me );
  143. bool patchServerTerminierenMausEreignis( void *p, void *o, MausEreignis me );
  144. bool patchServerSetMaxClientsMausEreignis( void *p, void *o, MausEreignis me );
  145. bool patchServerUpdateStartenMausEreignis( void *p, void *o, MausEreignis me );
  146. bool patchServerMaxClientsTastaturEreignis( void *p, void *o, TastaturEreignis te );
  147. #endif