Skip to content

Commit b7d7a14

Browse files
ann0seesoftins
andauthored
Re-add ids
Co-authored-by: Tony Mountifield <tony@mountifield.org>
1 parent 3c89fe5 commit b7d7a14

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

docs/JSON-RPC.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,11 @@ Results:
163163
| result.id | number | The channel ID. |
164164
| result.name | string | The musician’s name. |
165165
| result.skillLevel | string | The musician’s skill level (beginner, intermediate, expert, or null). |
166+
| result.countryId | number | The musician’s country ID (see QLocale::Country). |
166167
| result.country | string | The musician’s country. |
167168
| result.city | string | The musician’s city. |
168-
| result.instrument | number | The musician’s instrument. |
169+
| result.instrumentId | number | The musician’s instrument ID (see CInstPictures::GetTable). |
170+
| result.instrument | string | The musician’s instrument. |
169171
| result.skillLevel | string | Your skill level (beginner, intermediate, expert, or null). |
170172

171173

@@ -461,8 +463,10 @@ Parameters:
461463
| params.clients[*].id | number | The channel ID. |
462464
| params.clients[*].name | string | The musician’s name. |
463465
| params.clients[*].skillLevel | string | The musician’s skill level (beginner, intermediate, expert, or null). |
466+
| params.clients[*].countryId | number | The musician’s country ID (see QLocale::Country). |
464467
| params.clients[*].country | string | The musician’s country. |
465468
| params.clients[*].city | string | The musician’s city. |
469+
| params.clients[*].instrumentId | number | The musician’s instrument ID (see CInstPictures::GetTable). |
466470
| params.clients[*].instrument | string | The musician’s instrument. |
467471

468472

@@ -490,7 +494,7 @@ Parameters:
490494

491495
### jamulusclient/recorderState
492496

493-
Emitted when the client is connected to a server who's recorder state changes.
497+
Emitted when the client is connected to a server whose recorder state changes.
494498

495499
Parameters:
496500

@@ -523,6 +527,7 @@ Parameters:
523527
| params.servers | array | The server list. |
524528
| params.servers[*].address | string | Socket address (ip_address:port) |
525529
| params.servers[*].name | string | Server name |
530+
| params.servers[*].countryId | number | Server country ID (see QLocale::Country). |
526531
| params.servers[*].country | string | Server country |
527532
| params.servers[*].city | string | Server city |
528533

src/clientrpc.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer, QObject* pare
5353
/// @param {number} params.clients[*].id - The channel ID.
5454
/// @param {string} params.clients[*].name - The musician’s name.
5555
/// @param {string} params.clients[*].skillLevel - The musician’s skill level (beginner, intermediate, expert, or null).
56+
/// @param {number} params.clients[*].countryId - The musician’s country ID (see QLocale::Country).
5657
/// @param {string} params.clients[*].country - The musician’s country.
5758
/// @param {string} params.clients[*].city - The musician’s city.
59+
/// @param {number} params.clients[*].instrumentId - The musician’s instrument ID (see CInstPictures::GetTable).
5860
/// @param {string} params.clients[*].instrument - The musician’s instrument.
5961
connect ( pClient, &CClient::ConClientListMesReceived, [=] ( CVector<CChannelInfo> vecChanInfo ) {
6062
QJsonArray arrChanInfo;
@@ -64,8 +66,10 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer, QObject* pare
6466
{ "id", chanInfo.iChanID },
6567
{ "name", chanInfo.strName },
6668
{ "skillLevel", SerializeSkillLevel ( chanInfo.eSkillLevel ) },
69+
{ "countryId", chanInfo.eCountry },
6770
{ "country", QLocale::countryToString ( chanInfo.eCountry ) },
6871
{ "city", chanInfo.strCity },
72+
{ "instrumentId", chanInfo.iInstrument },
6973
{ "instrument", CInstPictures::GetName ( chanInfo.iInstrument ) },
7074
};
7175
arrChanInfo.append ( objChanInfo );
@@ -99,6 +103,7 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer, QObject* pare
99103
/// @param {array} params.servers - The server list.
100104
/// @param {string} params.servers[*].address - Socket address (ip_address:port)
101105
/// @param {string} params.servers[*].name - Server name
106+
/// @param {number} params.servers[*].countryId - Server country ID (see QLocale::Country).
102107
/// @param {string} params.servers[*].country - Server country
103108
/// @param {string} params.servers[*].city - Server city
104109
connect ( pClient->getConnLessProtocol(),
@@ -110,6 +115,7 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer, QObject* pare
110115
QJsonObject objServerInfo{
111116
{ "address", serverInfo.HostAddr.toString() },
112117
{ "name", serverInfo.strName },
118+
{ "countryId", serverInfo.eCountry },
113119
{ "country", QLocale::countryToString ( serverInfo.eCountry ) },
114120
{ "city", serverInfo.strCity },
115121
};
@@ -199,16 +205,20 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer, QObject* pare
199205
/// @result {number} result.id - The channel ID.
200206
/// @result {string} result.name - The musician’s name.
201207
/// @result {string} result.skillLevel - The musician’s skill level (beginner, intermediate, expert, or null).
208+
/// @result {number} result.countryId - The musician’s country ID (see QLocale::Country).
202209
/// @result {string} result.country - The musician’s country.
203210
/// @result {string} result.city - The musician’s city.
211+
/// @result {number} result.instrumentId - The musician’s instrument ID (see CInstPictures::GetTable).
204212
/// @result {number} result.instrument - The musician’s instrument.
205213
/// @result {string} result.skillLevel - Your skill level (beginner, intermediate, expert, or null).
206214
pRpcServer->HandleMethod ( "jamulusclient/getChannelInfo", [=] ( const QJsonObject& params, QJsonObject& response ) {
207215
QJsonObject result{
208216
// TODO: We cannot include "id" here is pClient->ChannelInfo is a CChannelCoreInfo which lacks that field.
209217
{ "name", pClient->ChannelInfo.strName },
218+
{ "countryId", pClient->ChannelInfo.eCountry },
210219
{ "country", QLocale::countryToString ( pClient->ChannelInfo.eCountry ) },
211220
{ "city", pClient->ChannelInfo.strCity },
221+
{ "instrumentId", pClient->ChannelInfo.iInstrument },
212222
{ "instrument", CInstPictures::GetName ( pClient->ChannelInfo.iInstrument ) },
213223
{ "skillLevel", SerializeSkillLevel ( pClient->ChannelInfo.eSkillLevel ) },
214224
};

0 commit comments

Comments
 (0)