GPR5100 - Rollback
Loading...
Searching...
No Matches
server.h
1#pragma once
2#include <memory>
3
4#include "packet_type.h"
5#include "engine/system.h"
6#include "game/game_globals.h"
7#include "game/game_manager.h"
8
9namespace game
10{
15{
16protected:
17
18 virtual void SpawnNewPlayer(ClientId clientId, PlayerNumber playerNumber) = 0;
23 virtual void ReceivePacket(std::unique_ptr<Packet> packet);
24
25 //Server game manager
26 GameManager gameManager_;
27 PlayerNumber lastPlayerNumber_ = 0;
28 std::array<ClientId, maxPlayerNmb> clientMap_{};
29
30};
31}
SystemInterface is an interface to a game system that needs to begin, update and end by the Engine....
Definition: system.h:13
GameManager is a class which manages the state of the game. It is shared between the client and the s...
Definition: game_manager.h:27
PacketSenderInterface is a interface for any Server or Client who wants to send and receive packets.
Definition: packet_type.h:363
Server is an interface to a network or simulated server. It owns a simple GameManager.
Definition: server.h:15
virtual void ReceivePacket(std::unique_ptr< Packet > packet)
ReceiveNetPacket is a method that is called when the Server receives a Packet from a Client.
Definition: server.cpp:14
ClientId
ClientId is a type used to define the client identification. It is given by the server to clients.
Definition: game_globals.h:31
std::uint8_t PlayerNumber
PlayerNumber is a type used to define the number of the player. Starting from 0 to maxPlayerNmb.
Definition: game_globals.h:22