#ifndef ShopServer_H #define ShopServer_H #include #include #include #include #include #include "Datenbank.h" #include "Updater.h" using namespace Framework; using namespace Network; class ShSKlient; class ShopServer : public Thread { private: Server *server; Server *aServer; InitDatei *ini; ShSDatenbank *db; CRITICAL_SECTION cs; RCArray< ShSKlient > *klients; Text *fehler; Updater *updater; int klientAnzahl; int id; bool nichtPausiert; int empfangen; int gesendet; bool end; int ref; public: // Konstruktor ShopServer( InitDatei *zIni ); // Destruktor virtual ~ShopServer(); // nicht constant void runn(); void thread(); void close(); bool serverStarten(); bool serverPause(); bool serverFortsetzen(); bool serverBeenden(); bool setMaxKarten( int mk ); bool absturzKlient( int klientId ); bool removeKlient( ShSKlient *zKlient ); void addGesendet( int bytes ); void addEmpfangen( int bytes ); // conatant bool istAn() const; Server *zServer() const; ShSDatenbank *zDB() const; InitDatei *zInit() const; bool hatClients() const; int getId() const; char *getLetzterFehler() const; // Reference Counting ShopServer *getThis(); ShopServer *release(); }; class ShSAKlient : public Thread { private: SKlient *klient; Text *name; Text *passwort; int adminId; ShopServer *shs; public: // Konstruktor ShSAKlient( SKlient *klient, ShopServer *shs ); // Destruktor virtual ~ShSAKlient(); // nicht constant void thread(); void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum AKlient }; class ShSKlient : public Thread { private: SKlient *klient; unsigned int klientNummer; ShopServer *shs; int ref; public: // Konstruktor ShSKlient( SKlient *klient, ShopServer *shs ); // Destruktor virtual ~ShSKlient(); // nicht constant void absturz(); void thread(); // constant void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum Klient int getKlientNummer() const; // Reference Counting ShSKlient *getThis(); ShSKlient *release(); }; #endif