2015-04-19 22:33:33 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../RWGame.hpp"
|
|
|
|
#include <engine/GameWorld.hpp>
|
|
|
|
|
|
|
|
#include <SFML/Network/TcpListener.hpp>
|
|
|
|
#ifdef SFML_SYSTEM_WINDOWS
|
|
|
|
#include <winsock2.h>
|
|
|
|
#else
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class HttpServer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
HttpServer(RWGame* game, GameWorld* world);
|
|
|
|
void run();
|
|
|
|
|
2015-07-03 03:52:43 +02:00
|
|
|
void handleBreakpoint(const SCMBreakpoint& bp);
|
2015-04-19 22:33:33 +02:00
|
|
|
private:
|
2015-07-07 04:48:32 +02:00
|
|
|
sf::TcpListener listener;
|
2015-04-19 22:33:33 +02:00
|
|
|
RWGame* game;
|
|
|
|
GameWorld* world;
|
2015-07-03 03:52:43 +02:00
|
|
|
bool paused;
|
2015-07-07 04:48:32 +02:00
|
|
|
const SCMBreakpoint* lastBreakpoint;
|
2015-04-24 22:59:10 +02:00
|
|
|
|
2015-07-03 03:52:43 +02:00
|
|
|
std::string dispatch(std::string method, std::string path);
|
|
|
|
std::string getState() const;
|
2015-04-19 22:33:33 +02:00
|
|
|
};
|