123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #pragma once
- #include <Critical.h>
- #include <Either.h>
- #include <Klient.h>
- #include <Network.h>
- #include <Punkt.h>
- #include <Text.h>
- #include <Thread.h>
- #include <VecN.h>
- #include "Entity.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;
- Framework::Text ip;
- int bgReaderUsage;
- int fgReaderUsage;
- void disconnect();
- void loadServerInfo();
- public:
- FactoryClient();
- ~FactoryClient();
- bool connect(Framework::Text ip, unsigned short sslPort);
- int ping();
- int status(Framework::Text name, Framework::Text secret);
- int join(
- Framework::Text name, Framework::Text& secret, unsigned short port);
- Network::NetworkReader* getNextForegroundMessage();
- Network::NetworkReader* getNextBackgroundMessage();
- void endMessageReading(bool bg);
- void sendPlayerAction(const char* data, unsigned short length);
- void sendPlayerMovement(MovementFrame& frame);
- void entityAPIRequest(
- int entityId, const char* message, unsigned short length);
- void blockAPIRequest(
- Vec3<int> pos, const char* message, unsigned short length);
- void blockAPIRequest(int dimensionId,
- Vec3<int> pos,
- const char* message,
- unsigned short length);
- void chunkAPIRequest(
- Framework::Punkt center, const char* message, unsigned short length);
- void dimensionAPIRequest(const char* message, unsigned short length);
- void inventoryAPIRequest(
- Framework::Either<int, Framework::VecN<int, 4>> target,
- const char* message,
- unsigned short length);
- void uiRequest(
- Framework::Text dialogId, const char* message, unsigned short length);
- void craftingUIMLRequest(int itemTypeId);
- void sendChatMessage(Framework::Text message);
- void chatAPIRequest(const char* data, unsigned short length);
- bool isConnected();
- void leaveGame();
- };
|