server console input

This commit is contained in:
2023-08-13 13:44:05 +02:00
parent ddbba997e5
commit d529c79150
4 changed files with 104 additions and 28 deletions

View File

@@ -63,13 +63,16 @@ private:
std::thread m_Thread;
bool m_ServerRunning;
public:
Server(const std::string& worldFilePath);
Server();
virtual ~Server();
bool Start(std::uint16_t port);
bool Start(std::uint16_t port, bool blocking);
void Stop(); // force the server to stop
void Close(); // at the end of a game
bool LoadMap(const std::string& worldFilePath);
bool IsMapLoaded();
void RemoveConnexion(std::uint8_t connexionID);
void BroadcastPacket(const protocol::Packet* packet);
@@ -95,6 +98,7 @@ private:
void Clean();
void StartThread();
void StopThread();
void ServerLoop();
void Tick(std::uint64_t delta);
void OnPlayerJoin(std::uint8_t id);