R-Type
|
#include <RTypeServer.hpp>
Public Member Functions | |
RTypeServer (unsigned short port=8080) | |
~RTypeServer () | |
void | gameLoop () |
GameLoop to run the game. More... | |
void | handleEvent () |
Function that will handle every event from the udp server. More... | |
void | handleConnexion (struct RType::Event event) |
Function that will handle the connexion of a client. More... | |
void | handleMove (struct RType::Protocol::MoveData moveInfo) |
Function that will handle the move from a client. More... | |
void | handleDestroy (struct RType::Event event) |
Function that will handle the disconnexion of a client. More... | |
void | startNetwork (bool &isRunning) |
Function that will start the Network in a thread. More... | |
void | handleShoot (struct RType::Protocol::ShootData shootInfo) |
void | spawnMob (std::chrono::steady_clock::time_point &now) |
void | broadcastInformation () |
void | handlingDamage (std::size_t entityId, std::size_t i, SparseArray< GameEngine::CollisionComponent > &collisions) |
void | destroyEntityCallback (const std::size_t &entityId, SparseArray< GameEngine::CollisionComponent > &collisions, SparseArray< GameEngine::TransformComponent > &transforms) |
void | playerCollisionCallback (const std::size_t &entityId, SparseArray< GameEngine::CollisionComponent > &collisions, SparseArray< GameEngine::TransformComponent > &transforms) |
void | playerDamageCallback (const std::size_t &entityId, SparseArray< GameEngine::CollisionComponent > &collisions, SparseArray< GameEngine::TransformComponent > &transforms) |
void | broadcastTransformComponent () |
void | sendTransformComponent (uint16_t id, GameEngine::Vector2< float > position, GameEngine::Vector2< float > velocity, asio::ip::udp::endpoint &endpoint) |
void | broadcastCollisionComponent () |
void | sendCollisionComponent (uint16_t id, GameEngine::Rectf collider, std::size_t layer, asio::ip::udp::endpoint &endpoint) |
void | broadcastTextureComponent () |
void | sendTextureComponent (uint16_t id, std::size_t index, GameEngine::TextureComponent &texture, asio::ip::udp::endpoint &endpoint) |
void | handleTextureResponse (struct RType::Event event) |
void | handleCollisionResponse (struct RType::Event event) |
void | handleInput (struct RType::Event event) |
componentList | setEntitiesComponent () |
void | broadcastEntityInformation (const GameEngine::Entity &entity) |
void | checkSendingTexture (std::vector< bool > listDisplayTexture, const GameEngine::Entity &entity, asio::ip::udp::endpoint &endpoint) |
void | setGameEngineComponent () |
void | setPrefab () |
void | setGameEngineSystem () |
void | setGameEngine () |
void | setupGame () |
void | handlingTimers () |
void | handlingEndGame () |
void | setTimers () |
std::size_t | findEntity (const std::size_t &networkId) |
bool | searchEntity (const std::size_t &networkId) |
void | sendControllableInformation (GameEngine::Entity &entity, unsigned short port) |
void | checkCollisionComponent (GameEngine::CollisionComponent &collision, std::size_t i) |
void | handleShootType (const std::string &typeShootString, struct RType::Protocol::ShootData shootData, RType::TextureType typeShoot) |
void | updateComponentInformation (GameEngine::Entity &entity, RType::TextureType entityType) |
void | handlingLifePoint (std::size_t entityId, std::size_t id) |
GameEngine::Vector2< float > | handlingMovement (GameEngine::TransformComponent &transform, struct RType::Protocol::InputData inputInfo) |
void | handleDestroyCallback (std::size_t &id) |
void | setDestroyCallback () |
void | setGameEngineCallback () |
void | spawnEntityMob (const std::string &mob, RType::TextureType mobType) |
void | handleImmunity (std::chrono::steady_clock::time_point &now) |
void | sendScore (unsigned short port) |
void | setImmunity (std::chrono::duration< float > timerInvincibility, std::pair< const uint16_t, std::pair< bool, std::chrono::steady_clock::time_point >> playerTimer, std::chrono::steady_clock::time_point &now) |
void | sendDestroyInfo (struct RType::Protocol::EntityIdData entity) |
void | saveHighScore () |
RType::Server::RTypeServer::RTypeServer | ( | unsigned short | port = 8080 | ) |
RType::Server::RTypeServer::~RTypeServer | ( | ) |
void RType::Server::RTypeServer::broadcastCollisionComponent | ( | ) |
void RType::Server::RTypeServer::broadcastEntityInformation | ( | const GameEngine::Entity & | entity | ) |
void RType::Server::RTypeServer::broadcastInformation | ( | ) |
void RType::Server::RTypeServer::broadcastTextureComponent | ( | ) |
void RType::Server::RTypeServer::broadcastTransformComponent | ( | ) |
void RType::Server::RTypeServer::checkCollisionComponent | ( | GameEngine::CollisionComponent & | collision, |
std::size_t | i | ||
) |
void RType::Server::RTypeServer::checkSendingTexture | ( | std::vector< bool > | listDisplayTexture, |
const GameEngine::Entity & | entity, | ||
asio::ip::udp::endpoint & | endpoint | ||
) |
void RType::Server::RTypeServer::destroyEntityCallback | ( | const std::size_t & | entityId, |
SparseArray< GameEngine::CollisionComponent > & | collisions, | ||
SparseArray< GameEngine::TransformComponent > & | transforms | ||
) |
std::size_t RType::Server::RTypeServer::findEntity | ( | const std::size_t & | networkId | ) |
void RType::Server::RTypeServer::gameLoop | ( | ) |
GameLoop to run the game.
void RType::Server::RTypeServer::handleCollisionResponse | ( | struct RType::Event | event | ) |
void RType::Server::RTypeServer::handleConnexion | ( | struct RType::Event | event | ) |
Function that will handle the connexion of a client.
void RType::Server::RTypeServer::handleDestroy | ( | struct RType::Event | event | ) |
Function that will handle the disconnexion of a client.
event | struct that contain the data (information about the client) |
void RType::Server::RTypeServer::handleDestroyCallback | ( | std::size_t & | id | ) |
void RType::Server::RTypeServer::handleEvent | ( | ) |
Function that will handle every event from the udp server.
void RType::Server::RTypeServer::handleImmunity | ( | std::chrono::steady_clock::time_point & | now | ) |
void RType::Server::RTypeServer::handleInput | ( | struct RType::Event | event | ) |
void RType::Server::RTypeServer::handleMove | ( | struct RType::Protocol::MoveData | moveInfo | ) |
Function that will handle the move from a client.
event | struct that contain the data (Information about the move) |
void RType::Server::RTypeServer::handleShoot | ( | struct RType::Protocol::ShootData | shootInfo | ) |
void RType::Server::RTypeServer::handleShootType | ( | const std::string & | typeShootString, |
struct RType::Protocol::ShootData | shootData, | ||
RType::TextureType | typeShoot | ||
) |
void RType::Server::RTypeServer::handleTextureResponse | ( | struct RType::Event | event | ) |
void RType::Server::RTypeServer::handlingDamage | ( | std::size_t | entityId, |
std::size_t | i, | ||
SparseArray< GameEngine::CollisionComponent > & | collisions | ||
) |
void RType::Server::RTypeServer::handlingEndGame | ( | ) |
void RType::Server::RTypeServer::handlingLifePoint | ( | std::size_t | entityId, |
std::size_t | id | ||
) |
GameEngine::Vector2< float > RType::Server::RTypeServer::handlingMovement | ( | GameEngine::TransformComponent & | transform, |
struct RType::Protocol::InputData | inputInfo | ||
) |
void RType::Server::RTypeServer::handlingTimers | ( | ) |
void RType::Server::RTypeServer::playerCollisionCallback | ( | const std::size_t & | entityId, |
SparseArray< GameEngine::CollisionComponent > & | collisions, | ||
SparseArray< GameEngine::TransformComponent > & | transforms | ||
) |
void RType::Server::RTypeServer::playerDamageCallback | ( | const std::size_t & | entityId, |
SparseArray< GameEngine::CollisionComponent > & | collisions, | ||
SparseArray< GameEngine::TransformComponent > & | transforms | ||
) |
void RType::Server::RTypeServer::saveHighScore | ( | ) |
bool RType::Server::RTypeServer::searchEntity | ( | const std::size_t & | networkId | ) |
void RType::Server::RTypeServer::sendCollisionComponent | ( | uint16_t | id, |
GameEngine::Rectf | collider, | ||
std::size_t | layer, | ||
asio::ip::udp::endpoint & | endpoint | ||
) |
void RType::Server::RTypeServer::sendControllableInformation | ( | GameEngine::Entity & | entity, |
unsigned short | port | ||
) |
void RType::Server::RTypeServer::sendDestroyInfo | ( | struct RType::Protocol::EntityIdData | entity | ) |
void RType::Server::RTypeServer::sendScore | ( | unsigned short | port | ) |
void RType::Server::RTypeServer::sendTextureComponent | ( | uint16_t | id, |
std::size_t | index, | ||
GameEngine::TextureComponent & | texture, | ||
asio::ip::udp::endpoint & | endpoint | ||
) |
void RType::Server::RTypeServer::sendTransformComponent | ( | uint16_t | id, |
GameEngine::Vector2< float > | position, | ||
GameEngine::Vector2< float > | velocity, | ||
asio::ip::udp::endpoint & | endpoint | ||
) |
void RType::Server::RTypeServer::setDestroyCallback | ( | ) |
componentList RType::Server::RTypeServer::setEntitiesComponent | ( | ) |
void RType::Server::RTypeServer::setGameEngine | ( | ) |
void RType::Server::RTypeServer::setGameEngineCallback | ( | ) |
void RType::Server::RTypeServer::setGameEngineComponent | ( | ) |
void RType::Server::RTypeServer::setGameEngineSystem | ( | ) |
void RType::Server::RTypeServer::setImmunity | ( | std::chrono::duration< float > | timerInvincibility, |
std::pair< const uint16_t, std::pair< bool, std::chrono::steady_clock::time_point >> | playerTimer, | ||
std::chrono::steady_clock::time_point & | now | ||
) |
void RType::Server::RTypeServer::setPrefab | ( | ) |
void RType::Server::RTypeServer::setTimers | ( | ) |
void RType::Server::RTypeServer::setupGame | ( | ) |
void RType::Server::RTypeServer::spawnEntityMob | ( | const std::string & | mob, |
RType::TextureType | mobType | ||
) |
void RType::Server::RTypeServer::spawnMob | ( | std::chrono::steady_clock::time_point & | now | ) |
void RType::Server::RTypeServer::startNetwork | ( | bool & | isRunning | ) |
Function that will start the Network in a thread.
isRunning | boolean to know if the server is down |
void RType::Server::RTypeServer::updateComponentInformation | ( | GameEngine::Entity & | entity, |
RType::TextureType | entityType | ||
) |