16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 22:09:19 +02:00

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

@@ -16,7 +16,7 @@ namespace network
friend class client;
private:
const int CATCHUP_PACKETS = 100;
const int CATCHUP_PACKETS = 500;
/*
std::queue<
@@ -97,5 +97,21 @@ namespace network
void update();
std::tuple<double, double, command_queue::commands_map> get_next_delta();
void send_commands(command_queue::commands_map commands);
int get_frame_counter() {
return resume_frame_counter;
}
int get_awaiting_frames() {
return delta_queue.size();
}
};
class backend_manager
{
public:
virtual std::shared_ptr<server> create_server(std::shared_ptr<std::fstream>, const std::string &conf) = 0;
virtual std::shared_ptr<client> create_client(const std::string &conf) = 0;
virtual void update() = 0;
};
extern std::unordered_map<std::string, backend_manager*> backend_list;
}