mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 19:13:55 -07:00
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check * 2/3 Run clang-format * 3/3 Fix compilation problems due to include reordering * 3bis/3 AfterControlStatement: false
This commit is contained in:
parent
8dbdd24c8e
commit
b29bd9e070
272 changed files with 13378 additions and 9535 deletions
|
|
@ -1,11 +1,11 @@
|
|||
#ifndef ABSTRACTCLIENT_H
|
||||
#define ABSTRACTCLIENT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
#include <QMutex>
|
||||
#include "pb/response.pb.h"
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
|
||||
class PendingCommand;
|
||||
class CommandContainer;
|
||||
|
|
@ -27,7 +27,8 @@ class Event_ServerShutdown;
|
|||
class Event_ReplayAdded;
|
||||
class FeatureSet;
|
||||
|
||||
enum ClientStatus {
|
||||
enum ClientStatus
|
||||
{
|
||||
StatusDisconnected,
|
||||
StatusDisconnecting,
|
||||
StatusConnecting,
|
||||
|
|
@ -40,11 +41,12 @@ enum ClientStatus {
|
|||
StatusSubmitForgotPasswordChallenge,
|
||||
};
|
||||
|
||||
class AbstractClient : public QObject {
|
||||
class AbstractClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void statusChanged(ClientStatus _status);
|
||||
|
||||
|
||||
// Room events
|
||||
void roomEventReceived(const RoomEvent &event);
|
||||
// Game events
|
||||
|
|
@ -69,8 +71,9 @@ signals:
|
|||
void registerAccepted();
|
||||
void registerAcceptedNeedsActivate();
|
||||
void activateAccepted();
|
||||
|
||||
|
||||
void sigQueuePendingCommand(PendingCommand *pend);
|
||||
|
||||
private:
|
||||
int nextCmdId;
|
||||
mutable QMutex clientMutex;
|
||||
|
|
@ -79,23 +82,35 @@ private slots:
|
|||
void queuePendingCommand(PendingCommand *pend);
|
||||
protected slots:
|
||||
void processProtocolItem(const ServerMessage &item);
|
||||
|
||||
protected:
|
||||
QMap<int, PendingCommand *> pendingCommands;
|
||||
QString userName, password, email, country, realName, token;
|
||||
int gender;
|
||||
void setStatus(ClientStatus _status);
|
||||
int getNewCmdId() { return nextCmdId++; }
|
||||
int getNewCmdId()
|
||||
{
|
||||
return nextCmdId++;
|
||||
}
|
||||
virtual void sendCommandContainer(const CommandContainer &cont) = 0;
|
||||
|
||||
public:
|
||||
AbstractClient(QObject *parent = 0);
|
||||
~AbstractClient();
|
||||
|
||||
ClientStatus getStatus() const { QMutexLocker locker(&clientMutex); return status; }
|
||||
|
||||
ClientStatus getStatus() const
|
||||
{
|
||||
QMutexLocker locker(&clientMutex);
|
||||
return status;
|
||||
}
|
||||
void sendCommand(const CommandContainer &cont);
|
||||
void sendCommand(PendingCommand *pend);
|
||||
|
||||
const QString getUserName() {return userName;}
|
||||
|
||||
const QString getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
static PendingCommand *prepareSessionCommand(const ::google::protobuf::Message &cmd);
|
||||
static PendingCommand *prepareRoomCommand(const ::google::protobuf::Message &cmd, int roomId);
|
||||
static PendingCommand *prepareModeratorCommand(const ::google::protobuf::Message &cmd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue