Coverage report for server


src/
File: src/commands/gui/plv.c
Date: 2024-06-25 10:57:05
Lines:
7/10
70.0%
Functions:
1/1
100.0%
Branches:
3/6
50.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2024
3 ** zappy
4 ** File description:
5 ** plv.c
6 */
7
8 #include "server.h"
9
10 1 void plv(client_t *client, server_t *server)
11 {
12 client_list_t *player;
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(player, &server->clients, entries) {
19
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (player->client->id == atoi(client->commands[1])) {
20 1 dprintf(client->fd, "plv %d %zu\n", player->client->id,
21 1 player->client->level);
22 1 return;
23 }
24 }
25 dprintf(client->fd, "sbp\n");
26 }
27