-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ZAP-98-en-tant-que-graphic-je-veux-recevoir-les-eveneme…
…nts' into SERVER-various-fix
- Loading branch information
Showing
65 changed files
with
1,671 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1007,3 +1007,5 @@ vgcore.* | |
!src/GUI/.clang-format | ||
*.vscode/ | ||
*.idea | ||
*.gcno | ||
*.gcda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* | ||
** EPITECH PROJECT, 2023 | ||
** ZappyCulteur | ||
** File description: | ||
** broadcast_events | ||
*/ | ||
|
||
#ifndef BROADCAST_EVENTS_H_ | ||
#define BROADCAST_EVENTS_H_ | ||
|
||
/** | ||
** @brief broadcast event pnw (new player) | ||
** @param zappy | ||
** @param cl | ||
** @return bool | ||
**/ | ||
bool cmd_pnw(ntw_t *ntw, ntw_client_t *cl); | ||
|
||
/** | ||
** @brief broadcast event pex (player expulse) | ||
** @param ntw | ||
** @param cl | ||
** @return bool | ||
**/ | ||
bool cmd_pex(ntw_t *ntw, ntw_client_t *cl, trantorien_t *tr); | ||
|
||
/** | ||
** @brief broadcast event pbc (player broadcast) | ||
** @param ntw | ||
** @param cl | ||
** @param action | ||
** @return bool | ||
**/ | ||
bool cmd_pbc(ntw_t *ntw, ntw_client_t *cl, action_t *action); | ||
|
||
/** | ||
** @brief broadcast event pfk (player fork) | ||
** @param ntw | ||
** @param cl | ||
** @return bool | ||
**/ | ||
bool cmd_pfk(ntw_t *ntw, ntw_client_t *cl); | ||
|
||
/** | ||
** @brief broadcast event pdr (player drop ressource) | ||
** @param ntw | ||
** @param cl | ||
** @param action | ||
** @return bool | ||
**/ | ||
bool cmd_pdr(ntw_t *ntw, ntw_client_t *cl, action_t *action); | ||
|
||
/** | ||
* @brief broadcast event pgt (player take ressource) | ||
* @param ntw | ||
* @param cl | ||
* @param action | ||
* @return | ||
*/ | ||
bool cmd_pgt(ntw_t *ntw, ntw_client_t *cl, action_t *action); | ||
|
||
/** | ||
** @brief broadcast event pdi (player died) | ||
** @param ntw | ||
** @param id | ||
** @return | ||
**/ | ||
bool cmd_pdi(ntw_t *ntw, int id); | ||
|
||
/** | ||
** @brief broadcast event enw (new egg) | ||
** @param ntw | ||
** @param tr (trantorien) | ||
** @param parent (parent trantorien) | ||
** @return bool | ||
**/ | ||
bool cmd_enw(ntw_t *ntw, trantorien_t *tr, trantorien_t *parent); | ||
|
||
/** | ||
** @brief broadcast event eht (egg hatched) | ||
** @param ntw | ||
** @param cl | ||
** @return | ||
**/ | ||
bool cmd_ebo(ntw_t *ntw, ntw_client_t *cl); | ||
|
||
/** | ||
** @brief broadcast event edi (egg died) | ||
** @param ntw | ||
** @param id | ||
** @return | ||
**/ | ||
bool cmd_edi(ntw_t *ntw, int id); | ||
|
||
/** | ||
** @brief broadcast event smg (server message) | ||
** @param ntw | ||
** @param smg | ||
** @return | ||
**/ | ||
bool cmd_smg(ntw_t *ntw, const char *smg); | ||
|
||
/** | ||
** @brief broadcast event seg (end game) | ||
** @param ntw | ||
** @param cl | ||
** @return | ||
**/ | ||
bool cmd_seg(ntw_t *ntw, client_t *cl); | ||
|
||
/** | ||
** @brief broadcast event suc (success) | ||
** @param cl | ||
** @return | ||
**/ | ||
bool cmd_suc(ntw_client_t *cl); | ||
|
||
/** | ||
** @brief broadcast event sbp (error) | ||
** @param cl | ||
** @return | ||
**/ | ||
bool cmd_sbp(ntw_client_t *cl); | ||
|
||
#endif // BROADCAST_EVENTS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
** EPITECH PROJECT, 2023 | ||
** ZappyCulteur | ||
** File description: | ||
** cmd_ebo | ||
*/ | ||
|
||
#include <stdbool.h> | ||
#include <stdio.h> | ||
#include "ntw.h" | ||
#include "map.h" | ||
#include "internal.h" | ||
#include "client.h" | ||
|
||
bool cmd_ebo(ntw_t *ntw, ntw_client_t *cl) | ||
{ | ||
char buff[512] = {0}; | ||
client_t *client = NULL; | ||
|
||
if (ntw == NULL || cl == NULL) { | ||
return false; | ||
} | ||
client = L_DATA(cl); | ||
snprintf(buff, 511, "ebo %d\n", client->id); | ||
broadcast_graphic(ntw, buff); | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
** EPITECH PROJECT, 2023 | ||
** ZappyCulteur | ||
** File description: | ||
** cmd_edi | ||
*/ | ||
|
||
#include <stdbool.h> | ||
#include <stdio.h> | ||
#include "ntw.h" | ||
#include "map.h" | ||
#include "internal.h" | ||
#include "client.h" | ||
|
||
bool cmd_edi(ntw_t *ntw, int id) | ||
{ | ||
char buff[512] = {0}; | ||
|
||
if (ntw == NULL) { | ||
return false; | ||
} | ||
snprintf(buff, 511, "edi %d\n", id); | ||
broadcast_graphic(ntw, buff); | ||
return true; | ||
} |
Oops, something went wrong.