mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-02 16:19:09 +02:00
add Server.RPCVersion method
This commit is contained in:
parent
0472f78b60
commit
9e314056b6
1 changed files with 11 additions and 6 deletions
|
@ -114,11 +114,7 @@ void StreamServer::ProcessRequest(const jsonrpcpp::request_ptr request, jsonrpcp
|
|||
|
||||
Json result;
|
||||
|
||||
if (request->method.find("JSONRPC.") == 0)
|
||||
{
|
||||
//TODO: JSONRPC.Version, JSONRPC.Ping
|
||||
}
|
||||
else if (request->method.find("Client.") == 0)
|
||||
if (request->method.find("Client.") == 0)
|
||||
{
|
||||
ClientInfoPtr clientInfo = Config::instance().getClientInfo(request->params.get("id"));
|
||||
if (clientInfo == nullptr)
|
||||
|
@ -306,7 +302,16 @@ void StreamServer::ProcessRequest(const jsonrpcpp::request_ptr request, jsonrpcp
|
|||
}
|
||||
else if (request->method.find("Server.") == 0)
|
||||
{
|
||||
if (request->method == "Server.GetStatus")
|
||||
if (request->method.find("Server.RPCVersion") == 0)
|
||||
{
|
||||
// <major>: backwards incompatible change
|
||||
result["major"] = 2;
|
||||
// <minor>: feature addition to the API
|
||||
result["minor"] = 0;
|
||||
// <patch>: bugfix release
|
||||
result["patch"] = 0;
|
||||
}
|
||||
else if (request->method == "Server.GetStatus")
|
||||
{
|
||||
result = Config::instance().getServerStatus(streamManager_->toJson());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue