mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 16:13:54 -07:00
protobuf client->server communication almost working
This commit is contained in:
parent
4eb9dfc5bf
commit
314f17091d
96 changed files with 1633 additions and 860 deletions
|
|
@ -2,9 +2,11 @@
|
|||
#define ABSTRACTCLIENT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
#include <google/protobuf/message.h>
|
||||
#include "protocol_datastructures.h"
|
||||
|
||||
class Command;
|
||||
class PendingCommand;
|
||||
class CommandContainer;
|
||||
class ProtocolItem;
|
||||
class ProtocolResponse;
|
||||
|
|
@ -56,20 +58,27 @@ signals:
|
|||
void userInfoChanged(ServerInfo_User *userInfo);
|
||||
void buddyListReceived(const QList<ServerInfo_User *> &buddyList);
|
||||
void ignoreListReceived(const QList<ServerInfo_User *> &ignoreList);
|
||||
private:
|
||||
int nextCmdId;
|
||||
protected slots:
|
||||
void processProtocolItem(ProtocolItem *item);
|
||||
protected:
|
||||
QMap<int, CommandContainer *> pendingCommands;
|
||||
QMap<int, PendingCommand *> pendingCommands;
|
||||
ClientStatus status;
|
||||
QString userName, password;
|
||||
void setStatus(ClientStatus _status);
|
||||
virtual void sendCommandContainer(const CommandContainer &cont) = 0;
|
||||
public:
|
||||
AbstractClient(QObject *parent = 0);
|
||||
~AbstractClient();
|
||||
|
||||
ClientStatus getStatus() const { return status; }
|
||||
virtual void sendCommand(Command *cmd);
|
||||
virtual void sendCommandContainer(CommandContainer *cont) = 0;
|
||||
void sendCommand(const CommandContainer &cont);
|
||||
void sendCommand(PendingCommand *pend);
|
||||
|
||||
PendingCommand *prepareSessionCommand(const ::google::protobuf::Message &cmd);
|
||||
PendingCommand *prepareModeratorCommand(const ::google::protobuf::Message &cmd);
|
||||
PendingCommand *prepareAdminCommand(const ::google::protobuf::Message &cmd);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue