PatchServer.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. };
  33. class PSDetails : public Thread
  34. {
  35. private:
  36. PatchServer *zPSA;
  37. MSKlient *mk;
  38. int id;
  39. public:
  40. // Konstruktor
  41. PSDetails( PatchServer *zPSA, MSKlient *mk );
  42. // Destruktor
  43. ~PSDetails();
  44. // nicht constant
  45. void setServerId( int id );
  46. virtual void thread();
  47. };
  48. class PSSuche : public Thread
  49. {
  50. private:
  51. PatchServer *zPSA;
  52. MSKlient *mk;
  53. public:
  54. // Konstruktor
  55. PSSuche( PatchServer *zPSA, MSKlient *mk );
  56. // Destruktor
  57. ~PSSuche();
  58. // nicht constant
  59. virtual void thread();
  60. };
  61. class PatchServer : public Abschnitt
  62. {
  63. private:
  64. Fenster *fenster;
  65. Fenster *liste;
  66. Fenster *details;
  67. Fenster *updateF;
  68. MSKlient *msk;
  69. InitDatei *iD;
  70. Fenster *f;
  71. AdminAccount *account;
  72. Knopf *aktualisieren;
  73. Knopf *weiter;
  74. Knopf *zurück;
  75. ObjTabelle *tabelle;
  76. ObjTabelle *updateT;
  77. PSSuche *suchen;
  78. PSDetails *getDetails;
  79. PSUpdate *updateTh;
  80. Schrift *schrift;
  81. PSKlient *psc;
  82. TextFeld *serverId;
  83. TextFeld *serverName;
  84. TextFeld *serverIp;
  85. TextFeld *serverPort;
  86. TextFeld *serverAPort;
  87. TextFeld *serverClients;
  88. TextFeld *serverMaxClients;
  89. TextFeld *maxClients;
  90. TextFeld *serverStatus;
  91. TextFeld *serverFehler;
  92. Knopf *updateStarten;
  93. Knopf *update;
  94. Knopf *pausieren;
  95. Knopf *stoppen;
  96. Knopf *beenden;
  97. Knopf *terminieren;
  98. Knopf *setMaxClients;
  99. Zeichnung *obj;
  100. public:
  101. // Konstruktor
  102. PatchServer( Schrift *s, InitDatei *d, MSKlient *msk, RessourceBild *rb, AdminAccount *acc, Bildschirm *b );
  103. // Destruktor
  104. ~PatchServer();
  105. // nicht constant
  106. virtual void setFenster( Fenster *f );
  107. virtual void setSichtbar( bool s );
  108. void addServer( int id, char *name, char *ip, int port, int adminPort, char *status );
  109. void sucheAbgeschlossen();
  110. void setServerDetails( int id, char *name, char *ip, int port, int adminPort, int clients, int maxClients, int status, Text *error );
  111. void setUpdateProzent( int prozent, int gruppe );
  112. void setUpdateFertig( bool error, int gruppe );
  113. bool aktualisierenMausEreignis( void *o, MausEreignis me );
  114. bool auswahlKnopfMausEreignis( void *o, MausEreignis me );
  115. bool weiterMausEreignis( void *o, MausEreignis me );
  116. bool zurückMausEreignis( void *o, MausEreignis me );
  117. bool updateMausEreignis( void *o, MausEreignis me );
  118. bool pausierenMausEreignis( void *o, MausEreignis me );
  119. bool stoppenMausEreignis( void *o, MausEreignis me );
  120. bool beendenMausEreignis( void *o, MausEreignis me );
  121. bool terminierenMausEreignis( void *o, MausEreignis me );
  122. bool setMaxClientsMausEreignis( void *o, MausEreignis me );
  123. bool updateStartenMausEreignis( void *o, MausEreignis me );
  124. bool maxClientsTastaturEreignis( void *o, TastaturEreignis te );
  125. void updateAll();
  126. };
  127. // Ereignisse
  128. bool patchServerAktualisierenMausEreignis( void *p, void *o, MausEreignis me );
  129. bool patchServerAuswahlKnopfMausEreignis( void *p, void *o, MausEreignis me );
  130. bool patchServerWeiterMausEreignis( void *p, void *o, MausEreignis me );
  131. bool patchServerZurückMausEreignis( void *p, void *o, MausEreignis me );
  132. bool patchServerUpdateMausEreignis( void *p, void *o, MausEreignis me );
  133. bool patchServerPausierenMausEreignis( void *p, void *o, MausEreignis me );
  134. bool patchServerStoppenMausEreignis( void *p, void *o, MausEreignis me );
  135. bool patchServerBeendenMausEreignis( void *p, void *o, MausEreignis me );
  136. bool patchServerTerminierenMausEreignis( void *p, void *o, MausEreignis me );
  137. bool patchServerSetMaxClientsMausEreignis( void *p, void *o, MausEreignis me );
  138. bool patchServerUpdateStartenMausEreignis( void *p, void *o, MausEreignis me );
  139. bool patchServerMaxClientsTastaturEreignis( void *p, void *o, TastaturEreignis te );
  140. #endif