diff --git a/assets/Json/playerData.json b/assets/Json/playerData.json index f73de677..b71e0ba9 100644 --- a/assets/Json/playerData.json +++ b/assets/Json/playerData.json @@ -2,7 +2,7 @@ "player": { "spritePath": "assets/R-TypeSheet/spaceship.png", "damage": 10.0, - "health": 10.0, + "health": 2.0, "deadTime": 1000, "width": 350, "height" : 350, diff --git a/src/Client/Systems/Events/EventsSystems.cpp b/src/Client/Systems/Events/EventsSystems.cpp index f96c1b09..92d4faf9 100644 --- a/src/Client/Systems/Events/EventsSystems.cpp +++ b/src/Client/Systems/Events/EventsSystems.cpp @@ -238,7 +238,8 @@ namespace Systems { { bool found = false; const Raylib::Vector2 pos = {0, 2}; - constexpr std::size_t fontSize = 2; + const int fontSize = 2; + Types::FontSize fsz = {fontSize}; const std::string textKeywordWaveEnd = "WaveText"; const std::string textKeyWordGameEnd = "endGameText"; @@ -265,6 +266,7 @@ namespace Systems { Raylib::Color(Raylib::ColorDef::White), textKeyWordGameEnd); Registry::getInstance().getComponents().insertBack(endGameText); + Registry::getInstance().getComponents().insertBack(fsz); } } diff --git a/src/Game/GameCustomTypes.cpp b/src/Game/GameCustomTypes.cpp index df3caaa8..e8e96537 100644 --- a/src/Game/GameCustomTypes.cpp +++ b/src/Game/GameCustomTypes.cpp @@ -8,6 +8,7 @@ #include "GameCustomTypes.hpp" #ifdef CLIENT #include "B-luga-graphics/Raylib/Raylib.hpp" + #include "B-luga-graphics/GraphicsCustomTypes.hpp" #endif unsigned int Types::Enemy::_enemyNb = 0; @@ -43,6 +44,7 @@ namespace Types { } else { unsigned int previousWave = getWaveId(); const std::string text = "Wave " + std::to_string(previousWave) + " survived"; + Types::FontSize fsz = {fontSize}; for (auto &id : ids) { if (arrCol[id]->getKeyword() == textKeyword) { @@ -58,6 +60,7 @@ namespace Types { Raylib::Color(Raylib::ColorDef::White), textKeyword); Registry::getInstance().getComponents().insertBack(endWaveText); + Registry::getInstance().getComponents().insertBack(fsz); } #endif _waitingForNextWave = value; diff --git a/src/Nitwork/NitworkServer.cpp b/src/Nitwork/NitworkServer.cpp index 740d5822..eccfce49 100644 --- a/src/Nitwork/NitworkServer.cpp +++ b/src/Nitwork/NitworkServer.cpp @@ -7,6 +7,8 @@ #if defined(_WIN32) #define _CRT_SECURE_NO_WARNINGS + #include + #include #endif #include "NitworkServer.hpp" #include @@ -326,7 +328,9 @@ namespace Nitwork { return; } free(cmd); - _lobbyPids.emplace_back(pi.dwProcessId); + sendLobbyPid( + boost::asio::ip::udp::endpoint(boost::asio::ip::address::from_string(ownerIp), ownerPort), + pi.dwProcessId); #else pid_t c_pid = fork(); @@ -378,7 +382,7 @@ namespace Nitwork { _serverInfos.ownerInfos.port); } - void NitworkServer::sendLobbyPid(const boost::asio::ip::udp::endpoint &endpoint, pid_t pid) + void NitworkServer::sendLobbyPid(const boost::asio::ip::udp::endpoint &endpoint, int pid) { struct packetReplaceLobbyPid_s packetLobbyPid = { .header = {0, 0, 0, 0, 1, 0}, diff --git a/src/Nitwork/NitworkServer.hpp b/src/Nitwork/NitworkServer.hpp index 1be8223b..a18a2392 100644 --- a/src/Nitwork/NitworkServer.hpp +++ b/src/Nitwork/NitworkServer.hpp @@ -7,6 +7,9 @@ #pragma once +#if defined(_WIN32) + #include +#endif #include "ANitwork.hpp" #include "ServerNetwork.hpp" @@ -223,7 +226,7 @@ namespace Nitwork { * @param endpoint The endpoint of the client that sent the packet * @param pid The pid of the lobby */ - void sendLobbyPid(const boost::asio::ip::udp::endpoint &endpoint, pid_t pid); + void sendLobbyPid(const boost::asio::ip::udp::endpoint &endpoint, int pid); /** * @brief A map that contain the endpoint of the clients and their infos