From f1f2b605b1fc415203a7fdbcee1adc159873fa29 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 30 Mar 2017 09:32:17 +0200 Subject: [PATCH 1/2] Use protocol name instead of number in logs --- src/cclients.cpp | 4 ++-- src/cpeers.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cclients.cpp b/src/cclients.cpp index d0cc5e8..32315e5 100644 --- a/src/cclients.cpp +++ b/src/cclients.cpp @@ -85,7 +85,7 @@ void CClients::AddClient(CClient *client) // and append m_Clients.push_back(client); std::cout << "New client " << client->GetCallsign() << " at " << client->GetIp() - << " added with protocol " << client->GetProtocol() + << " added with protocol " << client->GetProtocolName() << " on module " << client->GetReflectorModule() << std::endl; // notify g_Reflector.OnClientsChanged(); @@ -106,7 +106,7 @@ void CClients::RemoveClient(CClient *client) { // remove it std::cout << "Client " << m_Clients[i]->GetCallsign() << " at " << m_Clients[i]->GetIp() - << " removed with protocol " << client->GetProtocol() + << " removed with protocol " << client->GetProtocolName() << " on module " << client->GetReflectorModule() << std::endl; delete m_Clients[i]; m_Clients.erase(m_Clients.begin()+i); diff --git a/src/cpeers.cpp b/src/cpeers.cpp index 3a27282..35c5547 100644 --- a/src/cpeers.cpp +++ b/src/cpeers.cpp @@ -85,7 +85,7 @@ void CPeers::AddPeer(CPeer *peer) // append peer to reflector peer list m_Peers.push_back(peer); std::cout << "New peer " << peer->GetCallsign() << " at " << peer->GetIp() - << " added with protocol " << peer->GetProtocol() << std::endl; + << " added with protocol " << peer->GetProtocolName() << std::endl; // and append all peer's client to reflector client list // it is double lock safe to lock Clients list after Peers list CClients *clients = g_Reflector.GetClients(); From 3e515303a1eaaf947d6bbd8d22ea8b4853234f90 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 30 Mar 2017 09:33:24 +0200 Subject: [PATCH 2/2] Rename protocols --- src/cdextraclient.h | 2 +- src/cdplusclient.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cdextraclient.h b/src/cdextraclient.h index 757aad5..2b42b65 100644 --- a/src/cdextraclient.h +++ b/src/cdextraclient.h @@ -48,7 +48,7 @@ public: // identity int GetProtocol(void) const { return PROTOCOL_DEXTRA; } int GetProtocolRevision(void) const { return m_ProtRev; } - const char *GetProtocolName(void) const { return "Dextra"; } + const char *GetProtocolName(void) const { return "DExtra"; } bool IsNode(void) const { return true; } // status diff --git a/src/cdplusclient.h b/src/cdplusclient.h index 389a228..c8ed9e1 100644 --- a/src/cdplusclient.h +++ b/src/cdplusclient.h @@ -47,7 +47,7 @@ public: // identity int GetProtocol(void) const { return PROTOCOL_DPLUS; } - const char *GetProtocolName(void) const { return "Dplus"; } + const char *GetProtocolName(void) const { return "DPlus"; } bool IsNode(void) const { return true; } bool IsDextraDongle(void) const { return m_bDextraDongle; } void SetDextraDongle(void) { m_bDextraDongle = true; }