From cb6521bca70644a9d48df386b958d676d03c88a9 Mon Sep 17 00:00:00 2001 From: Xavier Mitault Date: Wed, 22 Nov 2023 15:26:32 +0100 Subject: [PATCH 1/4] CLIENT-GAME: Fix redsource on windows --- src/Game/ResourcesManager.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Game/ResourcesManager.hpp b/src/Game/ResourcesManager.hpp index 6e3ef564..9c72102d 100644 --- a/src/Game/ResourcesManager.hpp +++ b/src/Game/ResourcesManager.hpp @@ -185,8 +185,13 @@ class ResourcesManager { if (!ResourcesManager::isExists(path_tmp.string(), "share") || !ResourcesManager::isExists(path_tmp.string(), "bin")) { - Logger::fatal("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string()); - return ResourcesManager::getRessourcePathNormal(pathFolderInit); + Logger::warn("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string()); + path_tmp = path_tmp.parent_path(); + if (!ResourcesManager::isExists(path_tmp.string(), "share") + || !ResourcesManager::isExists(path_tmp.string(), "bin")) { + Logger::warn("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string()); + return ResourcesManager::getRessourcePathNormal(pathFolderInit); + } } return path_tmp.string(); } @@ -196,7 +201,12 @@ class ResourcesManager { boost::filesystem::path path_tmp = pathFolderInit; if (!ResourcesManager::isExists(path_tmp.string(), "assets")) { - Logger::fatal("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string()); + Logger::warn("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string()); + path_tmp = path_tmp.parent_path(); + if (!ResourcesManager::isExists(path_tmp.string(), "assets")) { + Logger::warn("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string()); + return ""; + } return ""; } return path_tmp.string(); From b1e43129a142d545fab5f455821326968d6e99cf Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 22 Nov 2023 15:01:57 +0000 Subject: [PATCH 2/4] FORMAT-AUTO: automatic format on pull request #144 --- src/Client/Systems/Menus/Menu/MenuSystems.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Client/Systems/Menus/Menu/MenuSystems.cpp b/src/Client/Systems/Menus/Menu/MenuSystems.cpp index 2f60047a..5a93b529 100644 --- a/src/Client/Systems/Menus/Menu/MenuSystems.cpp +++ b/src/Client/Systems/Menus/Menu/MenuSystems.cpp @@ -236,13 +236,22 @@ namespace Systems { } Registry::getInstance().getClock().restart(clockId); switch (Scene::SceneManager::getInstance().getCurrentScene()) { - case MENU: Logger::fatal("in menu"); Scene::SceneManager::getInstance().stop(); break; + case MENU: + Logger::fatal("in menu"); + Scene::SceneManager::getInstance().stop(); + break; case CREATE_LOBBY_SCENE: Logger::fatal("in select create lobby"); Scene::SceneManager::getInstance().changeScene(SELECT_LOBBY); break; - case SELECT_LOBBY: Logger::fatal("in select lobby"); Scene::SceneManager::getInstance().changeScene(MENU); break; - case CREATE_SERVER_SCENE: Logger::fatal("in create server"); Scene::SceneManager::getInstance().changeScene(MENU); break; + case SELECT_LOBBY: + Logger::fatal("in select lobby"); + Scene::SceneManager::getInstance().changeScene(MENU); + break; + case CREATE_SERVER_SCENE: + Logger::fatal("in create server"); + Scene::SceneManager::getInstance().changeScene(MENU); + break; case GAME: Logger::fatal("in game"); Nitwork::NitworkClient::getInstance().disconnectLobby(); From d0bf623cfa9ba83a5a908e5e4d347082e4d32eba Mon Sep 17 00:00:00 2001 From: Xavier Mitault Date: Wed, 22 Nov 2023 16:12:14 +0100 Subject: [PATCH 3/4] CLIENT: Remove logger fatal wtf --- src/Client/Systems/Menus/Menu/MenuSystems.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Client/Systems/Menus/Menu/MenuSystems.cpp b/src/Client/Systems/Menus/Menu/MenuSystems.cpp index 2f60047a..c6b5b165 100644 --- a/src/Client/Systems/Menus/Menu/MenuSystems.cpp +++ b/src/Client/Systems/Menus/Menu/MenuSystems.cpp @@ -236,20 +236,26 @@ namespace Systems { } Registry::getInstance().getClock().restart(clockId); switch (Scene::SceneManager::getInstance().getCurrentScene()) { - case MENU: Logger::fatal("in menu"); Scene::SceneManager::getInstance().stop(); break; + case MENU: + Scene::SceneManager::getInstance().stop(); + break; case CREATE_LOBBY_SCENE: - Logger::fatal("in select create lobby"); Scene::SceneManager::getInstance().changeScene(SELECT_LOBBY); break; - case SELECT_LOBBY: Logger::fatal("in select lobby"); Scene::SceneManager::getInstance().changeScene(MENU); break; - case CREATE_SERVER_SCENE: Logger::fatal("in create server"); Scene::SceneManager::getInstance().changeScene(MENU); break; + case SELECT_LOBBY: + Scene::SceneManager::getInstance().changeScene(MENU); + break; + case CREATE_SERVER_SCENE: + Scene::SceneManager::getInstance().changeScene(MENU); + break; case GAME: - Logger::fatal("in game"); Nitwork::NitworkClient::getInstance().disconnectLobby(); Types::WaveInfos::getInstance().reset(); Scene::SceneManager::getInstance().changeScene(SELECT_LOBBY); break; - case LOADING_SCREEN: Scene::SceneManager::getInstance().stop(); break; + case LOADING_SCREEN: + Scene::SceneManager::getInstance().stop(); + break; } } } From 1ecff808e4fdff39a109007bf757405fe6034c0c Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 22 Nov 2023 15:19:31 +0000 Subject: [PATCH 4/4] FORMAT-AUTO: automatic format on pull request #144 --- src/Client/Systems/Menus/Menu/MenuSystems.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Client/Systems/Menus/Menu/MenuSystems.cpp b/src/Client/Systems/Menus/Menu/MenuSystems.cpp index c6b5b165..fe737e0f 100644 --- a/src/Client/Systems/Menus/Menu/MenuSystems.cpp +++ b/src/Client/Systems/Menus/Menu/MenuSystems.cpp @@ -236,26 +236,18 @@ namespace Systems { } Registry::getInstance().getClock().restart(clockId); switch (Scene::SceneManager::getInstance().getCurrentScene()) { - case MENU: - Scene::SceneManager::getInstance().stop(); - break; + case MENU: Scene::SceneManager::getInstance().stop(); break; case CREATE_LOBBY_SCENE: Scene::SceneManager::getInstance().changeScene(SELECT_LOBBY); break; - case SELECT_LOBBY: - Scene::SceneManager::getInstance().changeScene(MENU); - break; - case CREATE_SERVER_SCENE: - Scene::SceneManager::getInstance().changeScene(MENU); - break; + case SELECT_LOBBY: Scene::SceneManager::getInstance().changeScene(MENU); break; + case CREATE_SERVER_SCENE: Scene::SceneManager::getInstance().changeScene(MENU); break; case GAME: Nitwork::NitworkClient::getInstance().disconnectLobby(); Types::WaveInfos::getInstance().reset(); Scene::SceneManager::getInstance().changeScene(SELECT_LOBBY); break; - case LOADING_SCREEN: - Scene::SceneManager::getInstance().stop(); - break; + case LOADING_SCREEN: Scene::SceneManager::getInstance().stop(); break; } } }