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
TTENSHII committed Nov 5, 2023
2 parents 214ed82 + e5f869a commit 7695032
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Client/Systems/Menus/Menu/ButtonCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ namespace Menu {
{
auto idsButton = Registry::getInstance().getEntitiesByComponents({typeid(Types::Button)});

Logger::error("!!!!!!!!!!!sendReadyPacket!!!!!!");
Nitwork::NitworkClient::getInstance().addReadyMsg();
for (auto &id : idsButton) {
Registry::getInstance().removeEntity(id);
Expand Down
9 changes: 9 additions & 0 deletions src/Nitwork/NitworkClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ namespace Nitwork {
},
.msg = {.magick = MAGICK_DISCONNECT_LOBBY},
};
Logger::error("------------------------------------ Sending disconnect lobby msg: " + std::to_string(DISCONNECT_LOBBY) + " " + std::to_string(MAGICK_DISCONNECT_LOBBY));
Packet packet(
packetDisconnectLobby.action.magick,
std::make_any<struct packetDisconnectLobby_s>(packetDisconnectLobby),
Expand All @@ -171,6 +172,7 @@ namespace Nitwork {
},
.msgInit = {.magick = MAGICK_INIT}
};
Logger::error("------------------------------------ Sending init msg: " + std::to_string(INIT) + " " + std::to_string(MAGICK_INIT));
Packet packet(
packetMsgInit.action.magick,
std::make_any<struct packetMsgInit_s>(packetMsgInit),
Expand All @@ -186,6 +188,7 @@ namespace Nitwork {
.action = {.magick = READY},
.msgReady = {.magick = MAGICK_READY}
};
Logger::error("------------------------------------ Sending ready msg: " + std::to_string(READY) + " " + std::to_string(MAGICK_READY));
Packet packet(
packetMsgReady.action.magick,
std::make_any<struct packetMsgReady_s>(packetMsgReady),
Expand Down Expand Up @@ -281,6 +284,7 @@ namespace Nitwork {
.life = life,
},
};
Logger::error("------------------------------------ Sending life update msg: " + std::to_string(playerId) + " " + std::to_string(MAGICK_LIFE_UPDATE));
Packet packet(
packetLifeUpdate.action.magick,
std::make_any<struct packetLifeUpdate_s>(packetLifeUpdate),
Expand Down Expand Up @@ -344,6 +348,7 @@ namespace Nitwork {
.missileId = id,
},
};
Logger::error("------------------------------------ Sending missile death msg: " + std::to_string(MISSILE_DEATH) + " " + std::to_string(MAGICK_MISSILE_DEATH));
Packet packet(
packetMissileDeath.action.magick,
std::make_any<struct packetMissileDeath_s>(packetMissileDeath),
Expand All @@ -361,6 +366,7 @@ namespace Nitwork {
},
.msg = {.magick = MAGICK_REQUEST_LIST_LOBBY},
};
Logger::error("------------------------------------ Sending list lobby msg: " + std::to_string(LIST_LOBBY) + " " + std::to_string(MAGICK_REQUEST_LIST_LOBBY));
Packet packet(
packetListLobby.action.magick,
std::make_any<struct packetRequestListLobby_s>(packetListLobby),
Expand All @@ -387,6 +393,7 @@ namespace Nitwork {
.maxNbPlayer = maxNbPlayer,
.ownerInfos = {.ip = "", .port = _mainServerEndpoint.port()}}
};
Logger::error("------------------------------------ Sending create lobby msg: " + std::to_string(CREATE_LOBBY) + " " + std::to_string(MAGICK_CREATE_LOBBY));
std::strcpy(packetCreateLobby.msg.name, (name.size() > 32 ? name.substr(0, 32) : name).c_str());
std::strcpy(
packetCreateLobby.msg.ownerInfos.ip,
Expand All @@ -412,6 +419,7 @@ namespace Nitwork {
},
.msg = {.magick = MAGICK_CONNECT_MAIN_SERVER},
};
Logger::error("------------------------------------ Sending connect main server msg: " + std::to_string(CONNECT_MAIN_SERVER) + " " + std::to_string(MAGICK_CONNECT_MAIN_SERVER));
Packet packet(
packetConnectMainServer.action.magick,
std::make_any<struct packetConnectMainServer_s>(packetConnectMainServer),
Expand All @@ -430,6 +438,7 @@ namespace Nitwork {
},
.msg = {.magick = MAGICK_CONNECT_LOBBY},
};
Logger::error("------------------------------------ Sending connect lobby msg: " + std::to_string(CONNECT_LOBBY) + " " + std::to_string(MAGICK_CONNECT_LOBBY));
Packet packet(
packetConnectLobby.action.magick,
std::make_any<struct packetConnectLobby_s>(packetConnectLobby),
Expand Down
1 change: 1 addition & 0 deletions src/Nitwork/NitworkServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ namespace Nitwork {
Logger::error("Client already connected");
return;
}
Logger::error("WTF WTF ICI");
_endpoints.emplace_back(endpoint);
auto playerId = static_cast<n_id_t>(_endpoints.size() - 1);
auto &jsonInstance = Json::getInstance();
Expand Down

0 comments on commit 7695032

Please sign in to comment.