1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 18:32:44 +01:00
openrw/rwgame/debug/HttpServer.hpp

30 lines
572 B
C++
Raw Normal View History

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();
void handleBreakpoint(const SCMBreakpoint& bp);
2015-04-19 22:33:33 +02:00
private:
sf::TcpListener listener;
2015-04-19 22:33:33 +02:00
RWGame* game;
GameWorld* world;
bool paused;
const SCMBreakpoint* lastBreakpoint;
std::string dispatch(std::string method, std::string path);
std::string getState() const;
2015-04-19 22:33:33 +02:00
};