8#ifndef RTYPE_GAME_GAMEMANAGER_HPP_
9 #define RTYPE_GAME_GAMEMANAGER_HPP_
27 #include "Systems/NetworkSyncSystem.hpp"
194 const std::vector<uint32_t>& sessions);
Logger declaration with support for multiple log levels.
Represents an entity in the ECS (Entity-Component-System) architecture.
Network packet with header and serializable body.
Manages game state, rooms, and player interactions on the server side.
void handlePing(uint32_t sessionId, const net::Packet &packet)
std::unique_ptr< RoomSystem > _roomSystem
Room system for handling room management.
std::unique_ptr< MovementSystem > _movementSystem
Movement system for updating entity positions.
void handlePlayerDisconnect(uint32_t sessionId)
Handle a player disconnection.
void handleJoinRoom(uint32_t sessionId, const net::Packet &packet)
Handle a generic incoming packet from a player.
std::unique_ptr< PlayerMouvementSystem > _playerMouvementSystem
Player movement system for handling player-specific movement logic.
std::unique_ptr< NetworkSyncSystem > _networkSyncSystem
Server network system for handling network-related ECS operations.
std::unique_ptr< EnemyAISystem > _enemyAISystem
Enemy AI system for movement patterns.
std::unique_ptr< BoomerangSystem > _boomerangSystem
Boomerang system for boomerang projectiles.
uint32_t _serverTick
Current server tick for synchronization.
std::mutex _mutex
Mutex for thread-safe operations.
void handleRoomChatSended(uint32_t sessionId, const net::Packet &packet)
Handle a generic incoming packet from a player.
void handleListRooms(uint32_t sessionId)
Handle a request to list available rooms.
void gameLoop(void)
Main game loop.
std::unique_ptr< EnemyShootSystem > _enemyShootSystem
Enemy shooting system.
void handleLeaveRoom(uint32_t sessionId, const net::Packet &packet)
Handle a generic incoming packet from a player.
void handleCreateRoom(uint32_t sessionId, const net::Packet &packet)
Handle a generic incoming packet from a player.
void sendRoomEntitySpawnsToSession(uint32_t roomId, uint32_t sessionId)
bool handleChatCommand(PlayerPtr player, const std::string &message)
void processNetworkEvents(void)
Process incoming network events with OpCode handling.
~GameManager()
Destructor for GameManager.
std::unique_ptr< LevelSystem > _levelSystem
Level system for timed spawns.
std::unique_ptr< CollisionSystem > _collisionSystem
Collision system for pickups/obstacles.
float _gameSpeed
Global game speed multiplier.
std::unique_ptr< HomingSystem > _homingSystem
Homing system for tracker bullets.
ServerNetwork & _networkManager
Reference to the ServerNetwork instance.
std::unique_ptr< PlayerSystem > _playerSystem
Player system for handling player-related operations.
void sendSystemMessageToRoom(uint32_t roomId, const std::string &message)
void handlePacket(uint32_t sessionId, const net::Packet &packet)
Handle an incoming packet from a player.
bool _gamePaused
Global game pause flag.
void handlePlayerLoginAuth(uint32_t sessionId, const net::Packet &packet)
Handle player login with provided username if successful then join the lobby.
void handleUpdateSelectedWeapon(uint32_t sessionId, const net::Packet &packet)
Handle an update to the selected weapon sent by client.
ecs::Registry _registry
ECS Registry for managing entities and components.
void handleSetReady(uint32_t sessionId, const net::Packet &packet)
Handle a generic incoming packet from a player.
void startGame(Room &room)
Start a game in the specified room.
void handlePlayerRegisterAuth(uint32_t sessionId, const net::Packet &packet)
Handle player registration with provided username.
void sendChatToSession(uint32_t sessionId, const std::string &message)
std::unique_ptr< PlayerShootSystem > _playerShootSystem
Player shooting system for handling bullets.
std::unique_ptr< BulletCleanupSystem > _bulletCleanupSystem
Bullet cleanup system.
std::unique_ptr< EntitySystem > _entitySystem
Entity system for handling entity-related operations.
void handlePlayerConnect(uint32_t sessionId)
Handle a new player connection.
void sendEntitySpawnToSessions(const ecs::Entity &entity, const std::vector< uint32_t > &sessions)
std::unique_ptr< AuthSystem > _authSystem
Authentication system for handling player logins.
Represents a game room in the server.
Implementation ASIO du serveur réseau (TCP + UDP)
File : GameManager.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue....
std::shared_ptr< Player > PlayerPtr
Shared pointer type for Player.