Added missing files
This commit is contained in:
parent
f0b8905a5d
commit
e79dcf3303
7 changed files with 60 additions and 14 deletions
34
Core/GameConnection.h
Normal file
34
Core/GameConnection.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "NetMessage.h"
|
||||
#include "../Utilities/Socket.h"
|
||||
#include "../Utilities/SimpleLock.h"
|
||||
|
||||
class GameConnection
|
||||
{
|
||||
protected:
|
||||
shared_ptr<Socket> _socket;
|
||||
char _readBuffer[0x40000];
|
||||
char _messageBuffer[0x40000];
|
||||
int _readPosition = 0;
|
||||
SimpleLock _socketLock;
|
||||
|
||||
private:
|
||||
void ReadSocket();
|
||||
|
||||
bool ExtractMessage(char *buffer, uint32_t &messageLength);
|
||||
NetMessage* ReadMessage();
|
||||
|
||||
virtual void ProcessMessage(NetMessage* message) = 0;
|
||||
|
||||
protected:
|
||||
void SendNetMessage(NetMessage &message);
|
||||
|
||||
public:
|
||||
GameConnection(shared_ptr<Socket> socket);
|
||||
|
||||
bool ConnectionError();
|
||||
|
||||
void ProcessMessages();
|
||||
|
||||
};
|
24
Core/VirtualController.h
Normal file
24
Core/VirtualController.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "IControlDevice.h"
|
||||
#include "../Utilities/SimpleLock.h"
|
||||
|
||||
class VirtualController : public IControlDevice
|
||||
{
|
||||
list<uint8_t> _inputData;
|
||||
bool _paused = false;
|
||||
atomic<uint32_t> _queueSize;
|
||||
atomic<bool> _waiting;
|
||||
atomic<bool> _shutdown;
|
||||
SimpleLock _writeLock;
|
||||
uint8_t _port;
|
||||
uint32_t _minimumBuffer = 3;
|
||||
|
||||
public:
|
||||
VirtualController(uint8_t port);
|
||||
~VirtualController();
|
||||
|
||||
ButtonState GetButtonState();
|
||||
void PushState(uint8_t state);
|
||||
};
|
|
@ -119,7 +119,6 @@
|
|||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="SoundManager.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="MainWindow.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
<ClInclude Include="stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="MainWindow.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#include <SDKDDKVer.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
// Windows Header Files:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#include <SDKDDKVer.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
// Including SDKDDKVer.h defines the highest available Windows platform.
|
||||
|
||||
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
|
||||
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
|
||||
|
||||
#include <SDKDDKVer.h>
|
Loading…
Add table
Reference in a new issue