#pragma once #include "stdafx.h" #include #include "GameServerConnection.h" #include "INotificationListener.h" using std::thread; class GameServer : public IGameBroadcaster { private: static unique_ptr Instance; unique_ptr _serverThread; atomic _stop; unique_ptr _listener; uint16_t _port; list> _openConnections; bool _initialized = false; void AcceptConnections(); void UpdateConnections(); void Exec(); void Stop(); public: GameServer(); ~GameServer(); static void StartServer(uint16_t port); static void StopServer(); static bool Started(); virtual void BroadcastInput(uint8_t inputData, uint8_t port); };