network improvements and fixes

This commit is contained in:
milek7
2019-02-06 00:03:48 +01:00
parent 5a0bb610db
commit 6962e25042
15 changed files with 152 additions and 62 deletions

View File

@@ -1,5 +1,4 @@
#pragma once
#include <asio.hpp>
#include <memory>
#include "network/network.h"
#include "command.h"
@@ -17,21 +16,19 @@ namespace network
void push_delta(double dt, double sync, const command_queue::commands_map &commands);
command_queue::commands_map pop_commands();
void create_server(asio::io_context &ctx, const std::string &host, uint32_t port);
void create_server(const std::string &backend, const std::string &conf);
};
class manager
{
asio::io_context io_context;
public:
manager();
std::optional<server_manager> servers;
std::shared_ptr<network::client> client;
void create_server(const std::string &host, uint32_t port);
void connect(const std::string &host, uint32_t port);
void create_server(const std::string &backend, const std::string &conf);
void connect(const std::string &backend, const std::string &conf);
void update();
};
}