Skip to content

Commit

Permalink
Update robots-server.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
eerio authored Aug 4, 2023
1 parent 2d6bb17 commit 0de64c6
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions robots-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ class Server {
std::scoped_lock lock {mutex_clients};
streamable_buffer sbuffer;
for (auto& [key, client] : clients) {
// std::visit(
// [&sbuffer] (auto&&x) { sbuffer << x; },
// msg
// );
sbuffer << msg;
try {
send(sbuffer, *client.sock);
Expand Down Expand Up @@ -238,11 +234,6 @@ class Server {
}

void send_past_turns(tcp::endpoint client_endpoint) {
// lock so that broadcast doesn't send anything
//std::scoped_lock lock {mutex_clients, mutex_turns};
println("Ktos sie spoznil - wyslij stare kolejki");
return;

auto it = clients.find(client_endpoint);
assert(it != clients.end());
ClientInfo& client = it->second;
Expand Down Expand Up @@ -412,7 +403,6 @@ class Server {
// whole map and here we modify something that only this thread accesses
// also, do it before client_connected, because afterwise writes may
// occur to this socket in another thread
// println("send hello. game length:", hello.game_length);
streamable_buffer sbuffer;
sbuffer << hello;
try {
Expand Down Expand Up @@ -441,7 +431,6 @@ class Server {
try {
sbuffer >> msg;
} catch (const boost::system::system_error& e) {
// if (e.code() == boost::asio::error::eof) {
std::cerr << "Error: unable to read from client" << std::endl;
client_disconnected(client_endpoint);
return;
Expand All @@ -450,7 +439,6 @@ class Server {
client_disconnected(client_endpoint);
return;
}
// println("Read input from:", client_endpoint);

if (std::holds_alternative<ClientMessageMove>(msg)) {
if (std::get<ClientMessageMove>(msg).direction > 3) {
Expand Down

0 comments on commit 0de64c6

Please sign in to comment.