Skip to content

Commit

Permalink
Merge branch 'the-merge' of github.com:X-R-G-B/R-Bus into the-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
romainpanno committed Nov 5, 2023
2 parents 9fab871 + 30f7b28 commit 9c9da26
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Client/Systems/Events/EventsSystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ namespace Systems {
{
constexpr std::size_t secondBeforeEnd = 5;
static std::size_t clockId = Registry::getInstance().getClock().create(false);
static bool restart = false;
static bool restart = false;
std::size_t elapsedSeconds = Registry::getInstance().getClock().elapsedSecondsSince(clockId);
std::string seconds = std::to_string(secondBeforeEnd - elapsedSeconds);
std::string endGameMessage;
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Systems/Menus/Menu/MenuSystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
#include "B-luga-physics/ECSCustomTypes.hpp"
#include "B-luga/Maths/Maths.hpp"
#include "B-luga/SceneManager.hpp"
#include "GameCustomTypes.hpp"
#include "Menu.hpp"
#include "NitworkClient.hpp"
#include "Parallax.hpp"
#include "ResourcesManager.hpp"
#include "GameCustomTypes.hpp"
#include "SelectLobbySystems.hpp"
#include "init.hpp"

Expand Down
6 changes: 3 additions & 3 deletions src/Game/GameCustomTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ namespace Types {
void reset()
{
_remainingEnemies.clear();
_waveId = 0;
_waveId = 0;
_isFirstEnemyCreated = false;
_waitingForNextWave = false;
_clockId = Registry::getInstance().getClock().create(false);
_waitingForNextWave = false;
_clockId = Registry::getInstance().getClock().create(false);
}

private:
Expand Down
3 changes: 2 additions & 1 deletion src/Nitwork/NitworkMainServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ namespace Nitwork {
it->second.first(it->second.second, header);
}

void NitworkMainServer::handleLobbyPidMsg(const std::any &data, boost::asio::ip::udp::endpoint &endpoint)
void
NitworkMainServer::handleLobbyPidMsg(const std::any &data, boost::asio::ip::udp::endpoint &endpoint)
{
const struct msgReplaceLobbyPid_s &msg = std::any_cast<struct msgReplaceLobbyPid_s>(data);

Expand Down
12 changes: 9 additions & 3 deletions src/Nitwork/NitworkServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,9 @@ namespace Nitwork {
Logger::error("Error: execl failed");
}
} else {
sendLobbyPid(boost::asio::ip::udp::endpoint(
boost::asio::ip::address::from_string(ownerIp), ownerPort), c_pid);
sendLobbyPid(
boost::asio::ip::udp::endpoint(boost::asio::ip::address::from_string(ownerIp), ownerPort),
c_pid);
}
#endif
}
Expand All @@ -369,7 +370,12 @@ namespace Nitwork {
Logger::error("Invalid name: " + name);
return;
}
forkProcessAndCreateLobby(maxNbPlayer, gameType, name, _serverInfos.ownerInfos.ip, _serverInfos.ownerInfos.port);
forkProcessAndCreateLobby(
maxNbPlayer,
gameType,
name,
_serverInfos.ownerInfos.ip,
_serverInfos.ownerInfos.port);
}

void NitworkServer::sendLobbyPid(const boost::asio::ip::udp::endpoint &endpoint, pid_t pid)
Expand Down
5 changes: 1 addition & 4 deletions src/Nitwork/NitworkServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,7 @@ namespace Nitwork {
* @param name The name of the lobby
* @param gameType The type of the game
*/
void recreateLobby(
unsigned int maxNbPlayer,
const std::string &name,
enum gameType_e gameType);
void recreateLobby(unsigned int maxNbPlayer, const std::string &name, enum gameType_e gameType);

/**
* @brief A map that contain the endpoint of the clients and their infos
Expand Down

0 comments on commit 9c9da26

Please sign in to comment.