Skip to content

Commit

Permalink
fix: removed blank line
Browse files Browse the repository at this point in the history
  • Loading branch information
AxelF44 committed Jun 22, 2024
1 parent 5a414d4 commit 8715465
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
6 changes: 3 additions & 3 deletions gui/src/GUIUpdater/GUIUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ void Gui::GUIUpdater::update(const std::string &command, const std::vector<std::
for (auto &iterator : _updateMap) {
if (iterator.first == command) {
std::cerr << STR_GREEN << "[GUIUpdater] " << STR_BLUE << command << STR_GREEN << " command received with data: " << STR_BLUE;
for (auto &d : data)
std::cerr << d << " ";
for (auto &d : data)
std::cerr << d << " ";
std::cerr << STR_RESET << std::endl;
iterator.second(data);
}
Expand Down Expand Up @@ -411,7 +411,7 @@ void Gui::GUIUpdater::updatePlayerRessourceCollecting(const std::vector<std::str
for (auto &player : team.getPlayers()) {
if (player.getId() == args[0]) {
player.setState(Gui::Player::PlayerState::COLLECT);
_network.get()->sendMessageServer("pin " + std::to_string(player.getId()) + "\n");

_gameData.get()->getTile(player.getPosition().first, player.getPosition().second).inventory.removeResource(args[1], 1);
return;
}
Expand Down
1 change: 0 additions & 1 deletion server/src/game/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ void spawn_ressources(app_t *app)
if (time_elapsed(&app->game->start_food) >= (20.0 / app->game->freq)) {
fill_ressources(app);
gettimeofday(&app->game->start_food, NULL);

send_mct(app);
}
}
Expand Down
11 changes: 0 additions & 11 deletions server/src/server/read/read_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,6 @@ bool server_data_handler(app_t *app, size_t fd)
if (its_client(app, fd)) {
client_handler(app, fd, line);
} else {
if (strcmp("buffer", line) == 0) {

list_node_t *tmp_message = app->gui_list->first->data.gui->list_messages->first;
printf("Message GUI:\n");
while (tmp_message) {
printf("message: [%s]\n", tmp_message->data.message);
tmp_message = tmp_message->next;
}
printf("\n");
return true;
}
handle_request(app, fd, line);
free(line);
}
Expand Down
5 changes: 1 addition & 4 deletions server/src/server/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,8 @@ void handle_client_write(app_t *app, int fd)
if (FD_ISSET(fd, &app->server->write_fds)) {
gui = find_gui(app, fd);
ai = find_ia(app, fd);
if (gui != NULL) {
if (gui->list_messages->len > 0)
printf("WRITE: [%s]\n", gui->list_messages->first->data.message);
if (gui != NULL)
write_message(app, gui->list_messages, gui->fd);
}
if (ai != NULL)
write_message(app, ai->list_messages, ai->fd);
}
Expand Down

0 comments on commit 8715465

Please sign in to comment.