#pragma once #include #include #ifdef _WINDOWS #include #else #include #endif #include #include #include "Game.h" using namespace Framework; using namespace Network; class FCKlient; class GameClient; class FactoryCraftServer : virtual public ReferenceCounter { private: SSLServer* sslServer; Server* server; InitDatei* ini; CRITICAL_SECTION cs; RCArray* klients; int runningThreads; int id; public: // Konstruktor FactoryCraftServer(InitDatei* zIni); // Destruktor virtual ~FactoryCraftServer(); // nicht constant void run(); void close(); bool removeKlient(FCKlient* zKlient); bool hatClients() const; int getUnencryptedPort() const; }; class FCKlient : public Thread { private: Network::SSLSKlient* klient; Network::SKlient* background; Network::SKlient* foreground; FactoryCraftServer* ls; GameClient* zGameClient; NetworkReader* backgroundReader; NetworkReader* foregroundReader; NetworkWriter* backgroundWriter; NetworkWriter* foregroundWriter; Critical cs; bool backgroundRunning; bool foregroundRunning; Framework::Text authKey; Framework::Text name; public: // Konstruktor FCKlient(Network::SSLSKlient* klient, FactoryCraftServer* ls); // Destruktor virtual ~FCKlient(); void setForegroundClient(Network::SKlient* foreground); void setBackgroundClient(Network::SKlient* background); // nicht constant void absturz(); void thread(); // constant NetworkWriter* zBackgroundWriter() const; NetworkWriter* zForegroundWriter() const; bool matchAuthKey(char* key, int len) const; };