]> git.localhorst.tv Git - blank.git/blobdiff - src/server/Server.hpp
transmit player input from client to server
[blank.git] / src / server / Server.hpp
index 8bbb778a91b358a51cbb3d836cf64423fd4952a5..1a4c0b4f44b9c84de2cda7530737db6c1acdc80d 100644 (file)
@@ -1,27 +1,27 @@
 #ifndef BLANK_SERVER_SERVER_HPP
 #define BLANK_SERVER_SERVER_HPP
 
+#include "../app/Config.hpp"
+#include "../world/WorldManipulator.hpp"
+
 #include <list>
 #include <SDL_net.h>
 
 
 namespace blank {
 
+class CompositeModel;
 class World;
 
 namespace server {
 
 class ClientConnection;
 
-class Server {
-
-public:
-       struct Config {
-               Uint16 port = 12354;
-       };
+class Server
+: public WorldManipulator {
 
 public:
-       Server(const Config &, World &);
+       Server(const Config::Network &, World &);
        ~Server();
 
        void Handle();
@@ -33,6 +33,12 @@ public:
 
        World &GetWorld() noexcept { return world; }
 
+       void SetPlayerModel(const CompositeModel &) noexcept;
+       bool HasPlayerModel() const noexcept;
+       const CompositeModel &GetPlayerModel() const noexcept;
+
+       void SetBlock(Chunk &, int, const Block &) override;
+
 private:
        void HandlePacket(const UDPpacket &);
 
@@ -44,6 +50,7 @@ private:
        std::list<ClientConnection> clients;
 
        World &world;
+       const CompositeModel *player_model;
 
 };