mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-11 17:58:29 +12:00
Add /status command in http server
This commit is contained in:
parent
c8f4d41b47
commit
37188edc3b
2 changed files with 70 additions and 27 deletions
|
@ -1,7 +1,9 @@
|
|||
#ifdef PANDA3DS_ENABLE_HTTP_SERVER
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
|
||||
#include "helpers.hpp"
|
||||
|
@ -16,7 +18,19 @@ struct HttpServer {
|
|||
std::mutex actionMutex = {};
|
||||
u32 pendingKey = 0;
|
||||
|
||||
HttpServer();
|
||||
|
||||
void startHttpServer();
|
||||
std::string status();
|
||||
|
||||
private:
|
||||
std::map<std::string, std::pair<u32, bool>> keyMap;
|
||||
std::array<bool, 12> pressedKeys = {};
|
||||
bool paused = false;
|
||||
|
||||
u32 stringToKey(const std::string& key_name);
|
||||
bool getKeyState(const std::string& key_name);
|
||||
void setKeyState(const std::string& key_name, bool state);
|
||||
};
|
||||
|
||||
#endif // PANDA3DS_ENABLE_HTTP_SERVER
|
Loading…
Add table
Add a link
Reference in a new issue