Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
** EPITECH PROJECT, 2024 |
3 |
|
|
** zappy |
4 |
|
|
** File description: |
5 |
|
|
** pin.c |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
#include "server.h" |
9 |
|
|
|
10 |
|
1 |
void pin(client_t *client, server_t *server) |
11 |
|
|
{ |
12 |
|
|
client_list_t *c; |
13 |
|
|
|
14 |
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
|
1 |
if (!client->commands[1]) { |
15 |
|
✗ |
dprintf(client->fd, "sbp\n"); |
16 |
|
✗ |
return; |
17 |
|
|
} |
18 |
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
|
1 |
TAILQ_FOREACH(c, &server->clients, entries) { |
19 |
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 |
if (c->client->id == atoi(client->commands[1])) { |
20 |
|
1 |
dprintf(client->fd, "pin %d %u %u %u %u %u %u %u %u %u\n", |
21 |
|
1 |
c->client->id, c->client->x, c->client->y, |
22 |
|
|
c->client->inventory.food, c->client->inventory.linemate, |
23 |
|
|
c->client->inventory.deraumere, c->client->inventory.sibur, |
24 |
|
|
c->client->inventory.mendiane, c->client->inventory.phiras, |
25 |
|
1 |
c->client->inventory.thystame |
26 |
|
|
); |
27 |
|
1 |
return; |
28 |
|
|
} |
29 |
|
|
} |
30 |
|
✗ |
dprintf(client->fd, "sbp\n"); |
31 |
|
|
} |
32 |
|
|
|