X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fnet%2FServer.hpp;h=a6d509b6974052855e2272574bf8c13a1db7fa9f;hb=ae5a7e7d8517fac406a88e9bf98fd3d5bb1728b9;hp=b6a72a91b8b30e327f410e3eed793d11691320dd;hpb=9ebe2c320fd9f94266ab93fa2f9d9908a0a284d3;p=blank.git diff --git a/src/net/Server.hpp b/src/net/Server.hpp index b6a72a9..a6d509b 100644 --- a/src/net/Server.hpp +++ b/src/net/Server.hpp @@ -7,7 +7,7 @@ namespace blank { -class Connection; +class ClientConnection; class World; class Server { @@ -25,18 +25,20 @@ public: void Update(int dt); + UDPsocket &GetSocket() noexcept { return serv_sock; } + UDPpacket &GetPacket() noexcept { return serv_pack; } + + World &GetWorld() noexcept { return world; } + private: void HandlePacket(const UDPpacket &); - Connection &GetClient(const IPaddress &); - - void OnConnect(Connection &); - void OnDisconnect(Connection &); + ClientConnection &GetClient(const IPaddress &); private: UDPsocket serv_sock; UDPpacket serv_pack; - std::list clients; + std::list clients; World &world;