1 #include "ServerState.hpp"
3 #include "Environment.hpp"
4 #include "TextureIndex.hpp"
5 #include "../net/io.hpp"
12 ServerState::ServerState(
13 HeadlessEnvironment &env,
14 const World::Config &wc,
16 const Server::Config &sc
20 , world(block_types, wc, ws)
23 TextureIndex tex_index;
24 env.loader.LoadBlockTypes("default", block_types, tex_index);
28 std::cout << "listening on UDP port " << sc.port << std::endl;
32 void ServerState::Handle(const SDL_Event &event) {
33 if (event.type == SDL_QUIT) {
39 void ServerState::Update(int dt) {
40 push_timer.Update(dt);
43 if (push_timer.Hit()) {
49 void ServerState::Render(Viewport &viewport) {