Skip to content

Commit

Permalink
Rename FormatSkillLevel to CClientRpc::SerializeSkillLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Sep 2, 2021
1 parent e50d459 commit 8f7c096
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/clientrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#include "clientrpc.h"

static QJsonValue FormatSkillLevel ( ESkillLevel skillLevel );

CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer )
{
connect ( pClient, &CClient::ChatTextReceived, [=] ( QString strChatText ) {
Expand All @@ -43,7 +41,7 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer )
{
QJsonObject objChanInfo{ { "id", chanInfo.iChanID },
{ "name", chanInfo.strName },
{ "skillLevel", FormatSkillLevel ( chanInfo.eSkillLevel ) },
{ "skillLevel", SerializeSkillLevel ( chanInfo.eSkillLevel ) },
{ "countryId", chanInfo.eCountry },
{ "city", chanInfo.strCity },
{ "instrumentId", chanInfo.iInstrument } };
Expand All @@ -70,7 +68,7 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer )
} );

pRpcServer->HandleMethod ( "jamulusclient/getChannelInfo", [=] ( const QJsonObject& params, QJsonObject& response ) {
QJsonObject result{ { "name", pClient->ChannelInfo.strName }, { "skillLevel", FormatSkillLevel ( pClient->ChannelInfo.eSkillLevel ) } };
QJsonObject result{ { "name", pClient->ChannelInfo.strName }, { "skillLevel", SerializeSkillLevel ( pClient->ChannelInfo.eSkillLevel ) } };
response["result"] = result;
} );

Expand Down Expand Up @@ -147,7 +145,7 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer )

CClientRpc::~CClientRpc() {}

static QJsonValue FormatSkillLevel ( ESkillLevel eSkillLevel )
QJsonValue CClientRpc::SerializeSkillLevel ( ESkillLevel eSkillLevel )
{
switch ( eSkillLevel )
{
Expand Down
4 changes: 3 additions & 1 deletion src/clientrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ class CClientRpc : public QObject
CClientRpc ( CClient* pClient, CRpcServer* pRpcServer );
virtual ~CClientRpc();

QJsonArray arrStoredChanInfo;
private:
QJsonArray arrStoredChanInfo;
static QJsonValue SerializeSkillLevel ( ESkillLevel skillLevel );
};

0 comments on commit 8f7c096

Please sign in to comment.