#pragma once #include #include #include #include #include #include "Datenbank.h" using namespace Framework; using namespace Network; class FCKlient; class FactoryCraftServer : public Thread { private: Server *server; SSLServer *aServer; InitDatei *ini; LSDatenbank *db; CRITICAL_SECTION cs; RCArray< FCKlient > *klients; Text *fehler; int klientAnzahl; int id; bool nichtPausiert; int empfangen; int gesendet; bool end; public: // Konstruktor FactoryCraftServer( InitDatei *zIni ); // Destruktor virtual ~FactoryCraftServer(); // 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( FCKlient *zKlient ); void addGesendet( int bytes ); void addEmpfangen( int bytes ); // conatant bool istAn() const; Server *zServer() const; LSDatenbank *zDB() const; bool hatClients() const; int getId() const; char *getLetzterFehler() const; }; class FCAKlient : public Thread { private: SSLSKlient *klient; Text *name; Text *passwort; int adminId; FactoryCraftServer *ls; int version; public: // Konstruktor FCAKlient( SSLSKlient *klient, FactoryCraftServer *ls ); // Destruktor virtual ~FCAKlient(); // nicht constant void thread(); void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum AKlient }; class FCKlient : public Thread { private: SKlient *klient; unsigned int klientNummer; FactoryCraftServer *ls; public: // Konstruktor FCKlient( SKlient *klient, FactoryCraftServer *ls ); // Destruktor virtual ~FCKlient(); // nicht constant void absturz(); void thread(); // constant void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum Klient int getKlientNummer() const; }; class MSGWeiterleitung : public virtual ReferenceCounter { private: FactoryCraftServer *ls; public: // Konstruktor MSGWeiterleitung( FactoryCraftServer *ls ); // Destruktor ~MSGWeiterleitung(); };