123456789101112131415161718192021222324252627282930313233343536 |
- #ifndef GAMESERVER_H
- #define GAMESERVER_H
- #include "commands/CommandManager.h"
- #include "common/world/World.h"
- #include "gaming-core/memory/UniquePointer.h"
- #include "gaming-core/network/Packet.h"
- #include "gaming-core/utils/Clock.h"
- #include "gaming-core/utils/List.h"
- #include "raw-terminal/RawReader.h"
- #include "server/commands/ServerState.h"
- class GameServer final {
- ServerState state;
- Clock tps;
- RawReader<256, 10> reader;
- CommandManager commandManager;
- BlockRegistry blocks;
- List<UniquePointer<World>> worlds;
- public:
- GameServer(Server& server);
- void tick();
- void onConnect(Server::Client& client);
- void onDisconnect(Server::Client& client);
- void onPacket(Server::Client& client, InPacket& in);
- bool isRunning() const;
- private:
- void handleCommands();
- };
- #endif
|