From d46a584bf81d42e90da0b942580d771a6e924639 Mon Sep 17 00:00:00 2001 From: Rob-NY Date: Sun, 13 Mar 2022 10:42:54 -0400 Subject: [PATCH 1/3] JSON-RPC: Correct doc string for apiAuth call --- src/rpcserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index fff8e2e2bd..ceefc1ccd8 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -226,7 +226,7 @@ void CRpcServer::ProcessMessage ( QTcpSocket* pSocket, QJsonObject message, QJso { /// @rpc_method jamulus/apiAuth /// @brief Authenticates the connection which is a requirement for calling further methods. - /// @param {object} params - No parameters (empty object). + /// @param {string} params.secret - The preshared secret key. /// @result {string} result - "ok" on success HandleApiAuth ( pSocket, params, response ); return; From b2fe7ee2c157c9e5853e80b16ee443fc988c3253 Mon Sep 17 00:00:00 2001 From: Rob-NY Date: Sun, 13 Mar 2022 11:47:14 -0400 Subject: [PATCH 2/3] JSON-RPC: Extend getServerProfile to include directory server name --- src/serverrpc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/serverrpc.cpp b/src/serverrpc.cpp index 397b4ed24b..807abd6865 100644 --- a/src/serverrpc.cpp +++ b/src/serverrpc.cpp @@ -106,13 +106,20 @@ CServerRpc::CServerRpc ( CServer* pServer, CRpcServer* pRpcServer, QObject* pare /// @result {string} result.city - The server city. /// @result {number} result.countryId - The server country ID (see QLocale::Country). /// @result {string} result.welcomeMessage - The server welcome message. + /// @result {string} result.directoryServer - The directory server to which this server requested registration, or blank if none. /// @result {string} result.registrationStatus - The server registration status as string (see ESvrRegStatus and SerializeRegistrationStatus). pRpcServer->HandleMethod ( "jamulusserver/getServerProfile", [=] ( const QJsonObject& params, QJsonObject& response ) { + QString dsName = ""; + + if ( AT_NONE != pServer->GetDirectoryType() ) + dsName = NetworkUtil::GetDirectoryAddress ( pServer->GetDirectoryType(), pServer->GetDirectoryAddress() ); + QJsonObject result{ { "name", pServer->GetServerName() }, { "city", pServer->GetServerCity() }, { "countryId", pServer->GetServerCountry() }, { "welcomeMessage", pServer->GetWelcomeMessage() }, + { "directoryServer", dsName }, { "registrationStatus", SerializeRegistrationStatus ( pServer->GetSvrRegStatus() ) }, }; response["result"] = result; From 5200702c209c743ae7dcc0bc6bfb8bcfb904bf71 Mon Sep 17 00:00:00 2001 From: Rob-NY Date: Sun, 13 Mar 2022 11:49:02 -0400 Subject: [PATCH 3/3] JSON-RPC: Regenerate docs for directoryServer name change --- docs/JSON-RPC.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/JSON-RPC.md b/docs/JSON-RPC.md index 19f57478ad..be38082d5e 100644 --- a/docs/JSON-RPC.md +++ b/docs/JSON-RPC.md @@ -65,7 +65,7 @@ Parameters: | Name | Type | Description | | --- | --- | --- | -| params | object | No parameters (empty object). | +| params.secret | string | The preshared secret key. | Results: @@ -276,6 +276,7 @@ Results: | result.city | string | The server city. | | result.countryId | number | The server country ID (see QLocale::Country). | | result.welcomeMessage | string | The server welcome message. | +| result.directoryServer | string | The directory server to which this server requested registration, or blank if none. | | result.registrationStatus | string | The server registration status as string (see ESvrRegStatus and SerializeRegistrationStatus). |