rewrite proxy server to support multiple clients and integration with game server

This commit is contained in:
Martin Michelsen
2022-03-27 18:14:23 -07:00
parent d977cf0608
commit 2597da95bc
24 changed files with 1370 additions and 992 deletions
+9
View File
@@ -18,6 +18,9 @@
// Forwawrd declaration due to reference cycle
class ProxyServer;
struct PortConfiguration {
uint16_t port;
GameVersion version;
@@ -51,6 +54,8 @@ struct ServerState {
std::vector<MenuItem> main_menu;
std::shared_ptr<std::vector<MenuItem>> information_menu;
std::shared_ptr<std::vector<std::u16string>> information_contents;
std::vector<MenuItem> proxy_destinations_menu;
std::vector<std::pair<std::string, uint16_t>> proxy_destinations;
std::u16string welcome_message;
std::map<int64_t, std::shared_ptr<Lobby>> id_to_lobby;
@@ -62,6 +67,10 @@ struct ServerState {
uint32_t local_address;
uint32_t external_address;
// TODO: This is only here because the menu selection handler has to call
// delete_session on it. Find a cleaner way to do this.
std::shared_ptr<ProxyServer> proxy_server;
ServerState();
void add_client_to_available_lobby(std::shared_ptr<Client> c);