1 #ifndef BLANK_SERVER_SERVER_HPP
2 #define BLANK_SERVER_SERVER_HPP
4 #include "../app/Config.hpp"
5 #include "../world/World.hpp"
6 #include "../world/WorldManipulator.hpp"
21 class ClientConnection;
24 : public WorldManipulator {
27 Server(const Config::Network &, World &, const World::Config &, const WorldSave &);
34 UDPsocket &GetSocket() noexcept { return serv_sock; }
35 UDPpacket &GetPacket() noexcept { return serv_pack; }
37 World &GetWorld() noexcept { return world; }
38 const WorldSave &GetWorldSave() noexcept { return save; }
40 void SetPlayerModel(const CompositeModel &) noexcept;
41 bool HasPlayerModel() const noexcept;
42 const CompositeModel &GetPlayerModel() const noexcept;
44 Player *JoinPlayer(const std::string &name);
46 void SetBlock(Chunk &, int, const Block &) override;
49 void HandlePacket(const UDPpacket &);
51 ClientConnection &GetClient(const IPaddress &);
56 std::list<ClientConnection> clients;
59 ChunkIndex &spawn_index;
60 const WorldSave &save;
61 const CompositeModel *player_model;