From 5ae9122a6c8ee94e79b04db14cbb0c2bf29a1b92 Mon Sep 17 00:00:00 2001 From: hourcadettej Date: Sun, 13 Nov 2022 22:01:26 +0100 Subject: [PATCH] feat: implement getServerInfo in entrypoint client --- src/client/entrypoint.cpp | 6 +++--- src/ecs/components/client/Connection.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/entrypoint.cpp b/src/client/entrypoint.cpp index b0472800..02b8235f 100644 --- a/src/client/entrypoint.cpp +++ b/src/client/entrypoint.cpp @@ -21,12 +21,12 @@ int main() ecs::Engine engine; network::Message msg; - network::Client::setHost("localhost"); - network::Client::setPort("8000"); + asset::AssetLoader::LoadIniFile(asset::AssetLoader::smartPath("assets", "config.ini")); + network::Client::setHost(asset::AssetLoader::GetServerInfo("host")); + network::Client::setPort(asset::AssetLoader::GetServerInfo("port")); msg.fill(0); network::Client::connect(); network::Client::getOutgoingMessages().push(msg); - asset::AssetLoader::LoadIniFile(asset::AssetLoader::smartPath("assets", "config.ini")); audio::AudioManager::playSFX("splash_screen"); ecs::WorldManager::setWaitingWorld(getMenuWorld); audio::AudioManager::setBGMVolume(50); diff --git a/src/ecs/components/client/Connection.hpp b/src/ecs/components/client/Connection.hpp index 7402d4da..8c47a0be 100644 --- a/src/ecs/components/client/Connection.hpp +++ b/src/ecs/components/client/Connection.hpp @@ -11,7 +11,7 @@ namespace ecs::component { struct Connection { - Connection() : _port(asset::AssetLoader::GetServerInfo("port")), _host(asset::AssetLoader::GetServerInfo("host")), _isSet(false) {} + Connection() : _port("8001"), _host(asset::AssetLoader::GetServerInfo("host")), _isSet(false) {} void setPort(int port) { _port = std::to_string(port);