Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/JSON-RPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Parameters:

| Name | Type | Description |
| --- | --- | --- |
| params | object | No parameters (empty object). |
| params.secret | string | The preshared secret key. |

Results:

Expand Down Expand Up @@ -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). |


Expand Down
2 changes: 1 addition & 1 deletion src/rpcserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions src/serverrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) },
Comment thread
pljones marked this conversation as resolved.
};
response["result"] = result;
Expand Down