-
Notifications
You must be signed in to change notification settings - Fork 2
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 #106 from TEAM-AAAAAAAAAAAAAAAA/feat/client/connec…
…tion_hub Feat/client/connection hub
- Loading branch information
Showing
32 changed files
with
1,036 additions
and
326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
** EPITECH PROJECT, by hourcadettej on 11/12/22. | ||
** rtype | ||
** File description: | ||
** rtype | ||
*/ | ||
|
||
#pragma once | ||
#include "../../../../src/client/NetworkClient.hpp" | ||
|
||
namespace ecs::component { | ||
struct Connection { | ||
|
||
Connection(int port = 8000, const std::string &host = "localhost") : _port(std::to_string(port)), _host(host), _isSet(false) {} | ||
|
||
void setPort(int port) { | ||
_port = std::to_string(port); | ||
_isSet = true; | ||
} | ||
inline std::string getPort() const {return _port;} | ||
inline void setHost(const std::string &host) {_host = host;} | ||
inline std::string getHost() const {return _host;} | ||
inline bool getIsSet() const {return _isSet;} | ||
inline void setIsSet(bool isSet) {_isSet = isSet;} | ||
void setClientConnection() { | ||
network::Message msg; | ||
msg.fill(0); | ||
network::Client::setHost(_host); | ||
network::Client::setPort(_port); | ||
network::Client::connect(); | ||
network::Client::getOutgoingMessages().push(msg); | ||
} | ||
private: | ||
std::string _port; | ||
std::string _host; | ||
bool _isSet; | ||
}; | ||
} |
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,16 @@ | ||
/* | ||
** EPITECH PROJECT, 2022 | ||
** RTYPE | ||
** File description: | ||
** ServerId | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace ecs::component | ||
{ | ||
struct ServerId { | ||
ServerId(char id) : id(id) {} | ||
char id; | ||
}; | ||
} // namespace ecs::component |
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
Oops, something went wrong.