Jetpack documentation 1.0.0
Loading...
Searching...
No Matches
Jetpack.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** jetpack
4** File description:
5** The Jetpack.hpp
6*/
13#ifndef FTP_HPP_
14 #define FTP_HPP_
15
16 #define UNUSED __attribute__((unused))
17 #define ENDL "\n"
18 #define MAX_CLIENTS 100
19 #define MAX_RESPONSE_SIZE 1024
20
21 #include "utils/Socket.hpp"
22 #include "utils/Cwd.hpp"
23
24namespace Jetpack {
25 #define TRAP_LIST "elm"
26
27 /* Threads */
28
29 //#define UPDATE_VAR(mutex) std::lock_guard<std::mutex> lock(mutex);
30 // Manual lock and unlock
31 //std::unique_lock<std::mutex> lock(mutex);
32 //lock.unlock();
33
34
35
36 /* Protocol */
37
38 #define CODE_OK 200
39 #define CODE_ERROR 500
40
41 enum CmdCode {
42 CODE_GAME = 1,
43 CODE_CLIENTS = 2,
44 CODE_PERSONNAL = 3,
45 };
46
47 enum CmdID {
48 CMD_ID_NOT_FOUND = -1,
49 CMD_ID_ID = 0,
50 CMD_MAP_ID = 1,
51 CMD_PSEUDO_ID = 2,
52 CMD_MOVE_ID = 3,
53 CMD_CLIENTS_NB_ID = 4,
54 CMD_CLIENTS_STATS_ID = 5,
55 CMD_CLIENTS_POSITIONS_ID = 6,
56 };
57
58 const std::array<std::string, 7> CMD_ID_STR = {
59 "ID",
60 "MAP",
61 "PSEUDO",
62 "MOVE",
63 "CLIENTS_NB",
64 "CLIENTS_STATS",
65 "CLIENTS_POSITIONS"
66 };
67
68
69
70 /* Global functions */
71
78 void closeJetpack(int signal);
79
86 std::vector<std::string> stringToVector(std::string str, std::string delimiters);
87}
88
89#endif /* FTP_HPP_ */
The Cwd.hpp.
void closeJetpack(int signal)
Closes the jetpack client.
std::vector< std::string > stringToVector(std::string str, std::string delimiters)
Converts a string to a vector of strings.
Definition Jetpack.cpp:22
The Socket.hpp.