123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #ifndef PatchServer_H
- #define PatchServer_H
- #include <Server.h>
- #include <Thread.h>
- #include <Datei.h>
- #include <Text.h>
- #include <InitDatei.h>
- #include "Datenbank.h"
- using namespace Framework;
- using namespace Network;
- class PSKlient;
- class PatchServer : public Thread
- {
- private:
- Server* server;
- SSLServer* aServer;
- InitDatei* ini;
- PSDatenbank* db;
- CRITICAL_SECTION cs;
- RCArray< PSKlient >* klients;
- Text* fehler;
- int id;
- bool nichtPausiert;
- int empfangen;
- int gesendet;
- int updateAnzahl;
- Array< int >* updateGruppe;
- bool end;
- public:
- // Konstruktor
- PatchServer(InitDatei* zIni);
- // Destruktor
- virtual ~PatchServer();
- // nicht constant
- void runn();
- void thread();
- void close();
- bool serverStarten();
- bool serverPause();
- bool serverFortsetzen();
- bool serverBeenden();
- bool setMaxKlients(int mc);
- bool absturzKlient(int klientId);
- bool removeKlient(PSKlient* zKlient);
- void addGesendet(int bytes);
- void addEmpfangen(int bytes);
- bool beginnUpdate(int gruppe);
- void endUpdate(int gruppe);
- void updateAbbruch(int gruppe);
- // conatant
- bool istAn() const;
- Server* zServer() const;
- PSDatenbank* zDB() const;
- bool hatClients() const;
- int getId() const;
- const char* getLetzterFehler() const;
- bool proveVersion(int gruppe) const;
- bool proveVersion() const;
- };
- class PSAKlient : public Thread
- {
- private:
- SSLSKlient* klient;
- Text* name;
- Text* passwort;
- int adminId;
- PatchServer* ps;
- int updateGruppe;
- Text* gruppeN;
- InitDatei* ini;
- public:
- // Konstruktor
- PSAKlient(SSLSKlient* klient, PatchServer* ps, InitDatei* ini);
- // Destruktor
- virtual ~PSAKlient();
- // nicht constant
- void thread();
- void errorZuKlient(const char* nachricht) const; // sendet eine Fehlernachricht zum AKlient
- };
- class PSKlient : public Thread
- {
- private:
- SKlient* klient;
- unsigned int klientNummer;
- char system;
- PatchServer* ps;
- InitDatei* ini;
- bool encrypted;
- public:
- // Konstruktor
- PSKlient(SKlient* klient, PatchServer* ps, InitDatei* ini);
- // Destruktor
- virtual ~PSKlient();
- // nicht constant
- void absturz();
- void thread();
- // constant
- bool errorZuKlient(const char* nachricht) const; // sendet eine Fehlernachricht zum Klient
- int getKlientNummer() const; // gibt die KlientId zurück
- };
- #endif
|