mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Add logging to LocalClient (#5827)
This commit is contained in:
parent
2187741a17
commit
ddd10fff60
3 changed files with 12 additions and 0 deletions
|
|
@ -27,6 +27,7 @@
|
||||||
# servers_settings = false
|
# servers_settings = false
|
||||||
# shortcuts_settings = false
|
# shortcuts_settings = false
|
||||||
|
|
||||||
|
# local_client = false
|
||||||
# remote_client = false
|
# remote_client = false
|
||||||
|
|
||||||
# player = false
|
# player = false
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include "local_client.h"
|
#include "local_client.h"
|
||||||
|
|
||||||
|
#include "debug_pb_message.h"
|
||||||
#include "local_server_interface.h"
|
#include "local_server_interface.h"
|
||||||
#include "pb/session_commands.pb.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 &)));
|
connect(lsi, SIGNAL(itemToClient(const ServerMessage &)), this, SLOT(itemFromServer(const ServerMessage &)));
|
||||||
|
|
||||||
|
userName = _playerName;
|
||||||
|
|
||||||
Command_Login loginCmd;
|
Command_Login loginCmd;
|
||||||
loginCmd.set_user_name(_playerName.toStdString());
|
loginCmd.set_user_name(_playerName.toStdString());
|
||||||
loginCmd.set_clientid(_clientId.toStdString());
|
loginCmd.set_clientid(_clientId.toStdString());
|
||||||
|
|
@ -27,10 +30,14 @@ LocalClient::~LocalClient()
|
||||||
|
|
||||||
void LocalClient::sendCommandContainer(const CommandContainer &cont)
|
void LocalClient::sendCommandContainer(const CommandContainer &cont)
|
||||||
{
|
{
|
||||||
|
qCDebug(LocalClientLog).noquote() << userName << "OUT" << getSafeDebugString(cont);
|
||||||
|
|
||||||
lsi->itemFromClient(cont);
|
lsi->itemFromClient(cont);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalClient::itemFromServer(const ServerMessage &item)
|
void LocalClient::itemFromServer(const ServerMessage &item)
|
||||||
{
|
{
|
||||||
|
qCDebug(LocalClientLog).noquote() << userName << "IN" << getSafeDebugString(item);
|
||||||
|
|
||||||
processProtocolItem(item);
|
processProtocolItem(item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
#include "../client/game_logic/abstract_client.h"
|
#include "../client/game_logic/abstract_client.h"
|
||||||
|
|
||||||
|
#include <QLoggingCategory>
|
||||||
|
|
||||||
|
inline Q_LOGGING_CATEGORY(LocalClientLog, "local_client");
|
||||||
|
|
||||||
class LocalServerInterface;
|
class LocalServerInterface;
|
||||||
|
|
||||||
class LocalClient : public AbstractClient
|
class LocalClient : public AbstractClient
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue