Add logging to LocalClient (#5827)

This commit is contained in:
RickyRister 2025-04-14 18:25:17 -07:00 committed by GitHub
parent ac1ae4fed5
commit ae90b6c93f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View file

@ -27,6 +27,7 @@
# servers_settings = false
# shortcuts_settings = false
# local_client = false
# remote_client = false
# player = false

View file

@ -1,5 +1,6 @@
#include "local_client.h"
#include "debug_pb_message.h"
#include "local_server_interface.h"
#include "pb/session_commands.pb.h"
@ -11,6 +12,8 @@ LocalClient::LocalClient(LocalServerInterface *_lsi,
{
connect(lsi, SIGNAL(itemToClient(const ServerMessage &)), this, SLOT(itemFromServer(const ServerMessage &)));
userName = _playerName;
Command_Login loginCmd;
loginCmd.set_user_name(_playerName.toStdString());
loginCmd.set_clientid(_clientId.toStdString());
@ -27,10 +30,14 @@ LocalClient::~LocalClient()
void LocalClient::sendCommandContainer(const CommandContainer &cont)
{
qCDebug(LocalClientLog).noquote() << userName << "OUT" << getSafeDebugString(cont);
lsi->itemFromClient(cont);
}
void LocalClient::itemFromServer(const ServerMessage &item)
{
qCDebug(LocalClientLog).noquote() << userName << "IN" << getSafeDebugString(item);
processProtocolItem(item);
}

View file

@ -3,6 +3,10 @@
#include "../client/game_logic/abstract_client.h"
#include <QLoggingCategory>
inline Q_LOGGING_CATEGORY(LocalClientLog, "local_client");
class LocalServerInterface;
class LocalClient : public AbstractClient