Mesen/Core/GameServer.h
Souryo 48409ae82b -Rewrote entire GUI in .NET
-Several other fixes (bugfixes, refactoring, etc.)
-Added a few more features to debugger
2015-07-01 23:17:14 -04:00

36 lines
710 B
C++

#pragma once
#include "stdafx.h"
#include <thread>
#include "GameServerConnection.h"
#include "INotificationListener.h"
using std::thread;
class GameServer : public IGameBroadcaster
{
private:
static unique_ptr<GameServer> Instance;
unique_ptr<thread> _serverThread;
atomic<bool> _stop;
unique_ptr<Socket> _listener;
uint16_t _port;
list<shared_ptr<GameServerConnection>> _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);
};