mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 15:59:18 +02:00
milek7/sim branch network code import
This commit is contained in:
34
network/manager.h
Normal file
34
network/manager.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include "network/network.h"
|
||||
#include "command.h"
|
||||
|
||||
namespace network
|
||||
{
|
||||
class server_manager
|
||||
{
|
||||
private:
|
||||
std::vector<std::shared_ptr<server>> servers;
|
||||
std::shared_ptr<std::fstream> backbuffer;
|
||||
|
||||
public:
|
||||
server_manager();
|
||||
|
||||
void push_delta(double render_dt, double dt, double sync, const command_queue::commands_map &commands);
|
||||
command_queue::commands_map pop_commands();
|
||||
void create_server(const std::string &backend, const std::string &conf);
|
||||
};
|
||||
|
||||
class manager
|
||||
{
|
||||
public:
|
||||
manager();
|
||||
|
||||
std::optional<server_manager> servers;
|
||||
std::shared_ptr<network::client> client;
|
||||
|
||||
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