RTYPE TECHNICAL DOCUMENTATION
  • Introduction
  • Classes
    • utils::InputMap
    • utils::Window
    • utils::constant::ButtonValue
    • network::Client
    • network::LockedQueue
    • network::Server
    • ecs::EnemyFactory
    • ecs::Engine
    • ecs::Entity
    • ecs::Event
    • ecs::Registry
    • ecs::SparseArray
    • ecs::World
    • ecs::WorldManager
    • ecs::component::Activable
    • ecs::component::Animated
    • ecs::component::Animated::AnimFrame
    • ecs::component::AttackAI
    • ecs::component::AttackAI::Action
    • ecs::component::AttackAI::AI
    • ecs::component::AttackAI::AI::Pattern
    • ecs::component::Controllable
    • ecs::component::Direction
    • ecs::component::Drawable
    • ecs::component::EntityType
    • ecs::component::Faction
    • ecs::component::FollowEntity
    • ecs::component::Health
    • ecs::component::Hitbox
    • ecs::component::MovementAI
    • ecs::component::MovementAI::AI
    • ecs::component::NetworkId
    • ecs::component::Parallax
    • ecs::component::Position
    • ecs::component::Projectile
    • ecs::component::Score
    • ecs::component::Shootable
    • ecs::component::Size
    • ecs::component::Text
    • ecs::component::textColor
    • ecs::component::Velocity
    • ecs::component::Weapon
    • audio::AudioManager
    • asset::AssetLoader
    • anim::Animation
  • Namespaces
    • utils
    • utils::constant
    • network
    • ecs
    • ecs::component
    • ecs::systems
    • audio
    • asset
    • anim
  • Modules
    • Input
  • Files
    • src
    • src/client
    • Animation.cpp
    • Animation.hpp
    • AssetLoader.cpp
    • AssetLoader.hpp
    • AudioManager.cpp
    • AudioManager.hpp
    • entrypoint.cpp
    • GetWorld.cpp
    • GetWorld.hpp
    • NetworkClient.cpp
    • NetworkClient.hpp
    • src/ecs
    • src/ecs/components
    • src/ecs/components/client
    • Activable.hpp
    • Animated.hpp
    • Controllable.hpp
    • Drawable.hpp
    • Hitbox.hpp
    • Parallax.hpp
    • Shootable.hpp
    • Text.hpp
    • src/ecs/components/server
    • AttackAI.cpp
    • AttackAI.hpp
    • FollowEntity.hpp
    • Projectile.hpp
    • Direction.hpp
    • EntityType.hpp
    • Faction.hpp
    • Health.hpp
    • MovementAI.cpp
    • MovementAI.hpp
    • NetworkId.hpp
    • Position.hpp
    • Score.hpp
    • Size.hpp
    • Velocity.hpp
    • Weapon.hpp
    • src/ecs/systems
    • src/ecs/systems/client
    • Animate.hpp
    • Draw.hpp
    • ExecuteOnce.hpp
    • HandleIncomingMessages.hpp
    • HandleParallaxBounds.hpp
    • HandleSFMLEvents.hpp
    • HandleSFMLKeys.hpp
    • HealthBar.hpp
    • MenuSelect.hpp
    • ScoreUpdate.hpp
    • SendDirection.hpp
    • src/ecs/systems/server
    • DeathUpdate.hpp
    • FollowEntitySystem.hpp
    • HandleIncomingMessage.hpp
    • PlayerHealthUpdate.hpp
    • PositionUpdate.hpp
    • ProjectileCollision.hpp
    • RunAttackAI.hpp
    • Waves.hpp
    • ManageClientEvents.hpp
    • Movement.hpp
    • PositionLogger.hpp
    • RunMovementAI.hpp
    • EnemyFactory.cpp
    • EnemyFactory.hpp
    • Engine.hpp
    • Entity.hpp
    • Event.hpp
    • LockedQueue.hpp
    • Registry.hpp
    • SparseArray.hpp
    • World.hpp
    • WorldManager.cpp
    • WorldManager.hpp
    • src/server
    • entrypoint.cpp
    • Server.cpp
    • Server.hpp
    • src/utils
    • Constant.hpp
    • InputMap.cpp
    • InputMap.hpp
    • Window.cpp
    • README.md
  • Pages
    • deprecated
  • GitHub
Powered by GitBook
On this page
  • Public Functions
  • Public Functions Documentation
  • function ~Server
  • function hasMessages
  • function sendToClient
  • function sendToAll
  • function getClientCount
  • function getClientIdByIndex
  • function start
  • function getOutgoingMessages
  • function GetReceivedMessages
  1. Classes

network::Server

#include <Server.hpp>

Public Functions

Name

bool

void

void

size_t

uint32_t

void

Public Functions Documentation

function ~Server

inline ~Server()

Default destructor of the server Class, stopping the ioService & make all the threads join

function hasMessages

static inline bool hasMessages()

Return: true if there are messages

This function allows us to check if the server has received messages

function sendToClient

static inline void sendToClient(
    const Message & message,
    uint32_t clientID
)

Parameters:

  • message The message you want to send

  • clientID The id of the client you want to communicate with

Used to send a message to a client given as parameter

function sendToAll

static inline void sendToAll(
    const Message & message
)

Parameters:

  • message The message you want to send

Used to send a message to every available clients

function getClientCount

static inline size_t getClientCount()

Return: Amount of connected clients

Get the amount of clients that are connected

function getClientIdByIndex

static inline uint32_t getClientIdByIndex(
    size_t index
)

Parameters:

  • index the index for the array

Return: client ID of client n

Get the ID of client from the clients array

function start

static inline void start(
    unsigned short localPort
)

function getOutgoingMessages

static inline LockedQueue< ServerMessage > & getOutgoingMessages()

function GetReceivedMessages

static inline LockedQueue< ClientMessage > & GetReceivedMessages()

Updated on 2022-11-13 at 17:21:37 +0100

Previousnetwork::LockedQueueNextecs::EnemyFactory

Last updated 2 years ago

()

()

(const & message, uint32_t clientID)

(const & message)

()

(size_t index)

(unsigned short localPort)

< > &

()

< > &

()

Getters & Setters of the Class

Server
~Server
hasMessages
sendToClient
Message
sendToAll
Message
getClientCount
getClientIdByIndex
start
LockedQueue
ServerMessage
getOutgoingMessages
LockedQueue
ClientMessage
GetReceivedMessages