mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
network improvements and fixes
This commit is contained in:
@@ -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();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user