-
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: pull request #101 from G-Epitech/73-server-add-world-lifecycle
feat(server): add world lifecycle
- Loading branch information
Showing
45 changed files
with
753 additions
and
139 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
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
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,7 @@ | ||
target_sources(zappy_server_core PRIVATE | ||
unknown/handler.c | ||
unknown/promote_graphic.c | ||
unknown/promote_player.c | ||
player/handler.c | ||
graphic/handler.c | ||
) |
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,15 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** zappy_server | ||
** File description: | ||
** handler.c | ||
*/ | ||
|
||
#include <string.h> | ||
#include "app.h" | ||
|
||
void app_handle_graphic_request(app_t *app, controller_t *controller, | ||
request_t *request) | ||
{ | ||
request->status = REQ_FINISHED; | ||
} |
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,15 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** zappy_server | ||
** File description: | ||
** handler.c | ||
*/ | ||
|
||
#include <string.h> | ||
#include "app.h" | ||
|
||
void app_handle_player_request(app_t *app, controller_t *controller, | ||
request_t *request) | ||
{ | ||
request->status = REQ_FINISHED; | ||
} |
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,26 @@ | ||
/* | ||
** EPITECH PROJECT, 2024 | ||
** zappy_server | ||
** File description: | ||
** handler.c | ||
*/ | ||
|
||
#include <string.h> | ||
#include <stdio.h> | ||
#include "app.h" | ||
|
||
void app_handle_unknown_request(app_t *app, controller_t *controller, | ||
request_t *request) | ||
{ | ||
size_t token_size = request_get_first_token_size(request); | ||
|
||
if (token_size == STR_STRICT_SIZEOF("GRAPHIC") && | ||
memcmp(request->buffer, "GRAPHIC", token_size) == 0 | ||
) { | ||
app_try_promote_controller_to_graphic(app, controller); | ||
} else { | ||
app_try_promote_controller_to_player(app, controller, request, | ||
token_size); | ||
} | ||
request->status = REQ_FINISHED; | ||
} |
Oops, something went wrong.