123456789101112131415161718192021222324252627282930313233 |
- #pragma once
- #include <Network.h>
- #include <Klient.h>
- #include <Text.h>
- #include <Thread.h>
- #include <Critical.h>
- class FactoryClient : public Framework::ReferenceCounter
- {
- private:
- Network::SSLKlient* client;
- Network::Klient* foreground;
- Network::Klient* background;
- Network::NetworkReader* foregroundReader;
- Network::NetworkReader* backgroundReader;
- Framework::Critical cs;
- int bgReaderUsage;
- int fgReaderUsage;
- void disconnect();
- public:
- FactoryClient();
- ~FactoryClient();
- bool connect(Text ip, short port, int accountId, Text secret);
- Network::NetworkReader* getNextForegroundMessage();
- Network::NetworkReader* getNextBackgroundMessage();
- void endMessageReading(bool bg);
- void sendPlayerAction(char* data, unsigned short length);
- void entityAPIRequest(int entityId, char* message, unsigned short length);
- };
|