#pragma once #include #include #include #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 absturzKlient(int accountId); bool removeKlient(FCKlient* zKlient); bool hatClients() const; int getUnencryptedPort() const; }; class FCKlient : public Thread { private: SSLSKlient* klient; SKlient* background; SKlient* foreground; unsigned int accountId; FactoryCraftServer* ls; GameClient* zGameClient; NetworkReader* backgroundReader; NetworkReader* foregroundReader; NetworkWriter* backgroundWriter; NetworkWriter* foregroundWriter; char* authKey; int authKeyLen; public: // Konstruktor FCKlient(SSLSKlient* klient, FactoryCraftServer* ls); // Destruktor virtual ~FCKlient(); void setForegroundClient(SKlient* foreground); void setBackgroundClient(SKlient* background); // nicht constant void absturz(); void thread(); // constant int getAccountId() const; NetworkWriter* zBackgroundWriter() const; NetworkWriter* zForegroundWriter() const; bool matchAuthKey(char* key, int len) const; };