MSKlient.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef MSKlient_H
  2. #define MSKlient_H
  3. #include <Klient.h>
  4. #include <Text.h>
  5. #include <Array.h>
  6. using namespace Network;
  7. using namespace Framework;
  8. struct ServerData
  9. {
  10. int id;
  11. Text name;
  12. Text ip;
  13. unsigned short port;
  14. unsigned short adminPort;
  15. Text status;
  16. };
  17. struct ServerDetails
  18. {
  19. Text name;
  20. Text ip;
  21. unsigned short port;
  22. unsigned short adminPort;
  23. int tasks;
  24. int maxTasks;
  25. };
  26. class MSKlient
  27. {
  28. private:
  29. SSLKlient *k;
  30. CRITICAL_SECTION cs;
  31. Text *fehler;
  32. Text *ip;
  33. int port;
  34. bool verbunden;
  35. bool eingeloggt;
  36. int ref;
  37. public:
  38. // Konstruktor
  39. MSKlient( const char *ip, int port );
  40. // Destruktor
  41. ~MSKlient();
  42. // nicht constant
  43. void lock();
  44. void unlock();
  45. bool verbinden();
  46. bool login( const char *name, const char *passwort );
  47. bool logout();
  48. int getStatus();
  49. bool pause();
  50. bool fortsetzen();
  51. bool beenden();
  52. bool terminieren();
  53. bool getPatchServerListe( Array< ServerData* > *list );
  54. bool getPatchServerDetails( int id, ServerDetails *details );
  55. bool trenne();
  56. // constant
  57. bool istVerbunden() const;
  58. bool istEingeloggt() const;
  59. const char *getLetzterFehler() const;
  60. // Reference Counting
  61. MSKlient *getThis();
  62. MSKlient *release();
  63. };
  64. #endif