Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sebimih13 committed Jan 30, 2025
1 parent b045425 commit 61473a9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions DeadZone/source/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,13 @@ void Server::ClientData::sendMessage(const std::string& messageToSend, bool& fai
failedToSendMessage = false;
// TODO: uncomment
// std::cout << "SERVER send: " << messageToSend << std::endl;
// enet_host_flush(this->peer->host);
}
else
{
failedToSendMessage = true;
std::cout << "Error: Server failed to send message" << std::endl;
}

enet_host_flush(this->peer->host);
}

void Server::ClientData::sendMessageUnsafe(const std::string& messageToSend)
Expand All @@ -102,13 +101,12 @@ void Server::ClientData::sendMessageUnsafe(const std::string& messageToSend)
this->lastTimeSentPing = GlobalClock::get().getCurrentTime();
// TODO: uncomment
// std::cout << "SERVER send: " << messageToSend << std::endl;
// enet_host_flush(this->peer->host);
}
else
{
std::cout << "Error: Server failed to send message" << std::endl;
}

enet_host_flush(this->peer->host);
}

void Server::handleReceivedPacket()
Expand Down Expand Up @@ -436,7 +434,7 @@ void Server::update()
// Update self
for (auto& connectedClient : this->connectedClients)
{
if (connectedClient.second.updateSelf)
if (connectedClient.second.updateSelf && gameMode == 1)
{
nlohmann::json jsonData;
jsonData["player"]["team"] = connectedClient.second.remotePlayerData.getTeam();
Expand Down

0 comments on commit 61473a9

Please sign in to comment.