Permalink
Browse files

Debugger: Add version event for future proofing.

Game isn't precisely right, but it's close enough.
  • Loading branch information...
unknownbrackets committed Apr 22, 2018
1 parent 05c560b commit b756d921399e728d9f4669c8becdf3ca7d536525
@@ -38,6 +38,10 @@
// - "message": A string describing what happened.
// - "level": Integer severity level. (1 = NOTICE, 2 = ERROR, 3 = WARN, 4 = INFO, 5 = DEBUG, 6 = VERBOSE)
// - "ticket": Optional, present if in response to an event with a "ticket" field, simply repeats that value.
//
// At start, please send a "version" event. See WebSocket/GameSubscriber.cpp for more details.
//
// For other events, look inside Core/Debugger/WebSocket/ for details on each event.
#include "Core/Debugger/WebSocket/GameBroadcaster.h"
#include "Core/Debugger/WebSocket/LogBroadcaster.h"
@@ -22,6 +22,7 @@
void *WebSocketGameInit(DebuggerEventHandlerMap &map) {
map["game.status"] = &WebSocketGameStatus;
map["version"] = &WebSocketVersion;
return nullptr;
}
@@ -49,3 +50,18 @@ void WebSocketGameStatus(DebuggerRequest &req) {
}
json.writeBool("paused", GetUIState() == UISTATE_PAUSEMENU);
}
// Notify debugger version info (version)
//
// Parameters:
// - name: string indicating name of app or tool.
// - version: string version.
//
// Response (same event name):
// - name: string, "PPSSPP" unless some special build.
// - version: string, typically starts with "v" and may have git build info.
void WebSocketVersion(DebuggerRequest &req) {
JsonWriter &json = req.Respond();
json.writeString("name", "PPSSPP");
json.writeString("version", PPSSPP_GIT_VERSION);
}
@@ -22,3 +22,4 @@
void *WebSocketGameInit(DebuggerEventHandlerMap &map);
void WebSocketGameStatus(DebuggerRequest &req);
void WebSocketVersion(DebuggerRequest &req);

0 comments on commit b756d92

Please sign in to comment.