7#ifndef ABSTRACTCLIENT_H
8#define ABSTRACTCLIENT_H
12#include <QElapsedTimer>
13#include <QLoggingCategory>
16#include <libcockatrice/protocol/pb/response.pb.h>
17#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
ClientStatus
Definition abstract_client.h:42
@ StatusLoggingIn
Definition abstract_client.h:48
@ StatusLoggedIn
Definition abstract_client.h:49
@ StatusActivating
Definition abstract_client.h:47
@ StatusRequestingForgotPassword
Definition abstract_client.h:50
@ StatusConnecting
Definition abstract_client.h:45
@ StatusDisconnecting
Definition abstract_client.h:44
@ StatusDisconnected
Definition abstract_client.h:43
@ StatusSubmitForgotPasswordReset
Definition abstract_client.h:51
@ StatusSubmitForgotPasswordChallenge
Definition abstract_client.h:52
@ StatusGettingPasswordSalt
Definition abstract_client.h:53
@ StatusRegistering
Definition abstract_client.h:46
Q_LOGGING_CATEGORY(AbstractClientLog, "abstract_client")
void roomEventReceived(const RoomEvent &event)
void userMessageEventReceived(const Event_UserMessage &event)
static PendingCommand * prepareAdminCommand(const ::google::protobuf::Message &cmd)
Definition abstract_client.cpp:249
void addToListEventReceived(const Event_AddToList &event)
QString email
Definition abstract_client.h:118
void clearLatencyStats()
Drops all recorded round-trip samples and resets the stats emission throttle, emitting zeroed stats s...
Definition abstract_client.cpp:217
void removeFromListEventReceived(const Event_RemoveFromList &event)
void gameEventContainerReceived(const GameEventContainer &event)
void serverMessageEventReceived(const Event_ServerMessage &event)
void gameJoinedEventReceived(const Event_GameJoined &event)
void notifyUserEventReceived(const Event_NotifyUser &event)
QMap< QString, bool > clientFeatures
Definition abstract_client.h:177
bool getServerSupportsPasswordHash() const
Definition abstract_client.h:149
void ignoreListReceived(const QList< ServerInfo_User > &ignoreList)
void processProtocolItem(const ServerMessage &item)
Definition abstract_client.cpp:63
bool serverSupportsPasswordHash
Definition abstract_client.h:119
~AbstractClient() override
Definition abstract_client.cpp:59
QString userName
Definition abstract_client.h:118
QString realName
Definition abstract_client.h:118
LatencyTracker latencyTracker
Definition abstract_client.h:106
void sendCommand(const CommandContainer &cont)
Definition abstract_client.cpp:149
virtual QString serverName() const
Returns the server address configured for the current connection.
Definition abstract_client.h:163
void buddyListReceived(const QList< ServerInfo_User > &buddyList)
void serverIdentificationEventReceived(const Event_ServerIdentification &event)
int nextCmdId
Definition abstract_client.h:103
QString token
Definition abstract_client.h:118
void connectionClosedEventReceived(const Event_ConnectionClosed &event)
int getNewCmdId()
Definition abstract_client.h:121
void maxPingTime(int seconds, int maxSeconds)
static PendingCommand * prepareModeratorCommand(const ::google::protobuf::Message &cmd)
Definition abstract_client.cpp:241
QMutex clientMutex
Definition abstract_client.h:104
QString country
Definition abstract_client.h:118
void replayAddedEventReceived(const Event_ReplayAdded &event)
void listRoomsEventReceived(const Event_ListRooms &event)
void statusChanged(ClientStatus _status)
void userInfoChanged(const ServerInfo_User &userInfo)
void setStatus(ClientStatus _status)
Definition abstract_client.cpp:140
void pingStatsUpdated(const LatencyTracker::Stats &stats, const QList< int > &samplesMs)
Aggregated round-trip statistics and a chronological snapshot of the rolling window,...
AbstractClient(QObject *parent=nullptr)
Definition abstract_client.cpp:24
void sigQueuePendingCommand(PendingCommand *pend)
QString password
Definition abstract_client.h:118
bool statsEmitClockStarted
Definition abstract_client.h:108
ClientStatus getStatus() const
Definition abstract_client.h:131
QElapsedTimer statsEmitClock
Definition abstract_client.h:107
const QString & getUserName() const
Definition abstract_client.h:153
QMap< int, PendingCommand * > pendingCommands
Definition abstract_client.h:117
virtual void sendCommandContainer(const CommandContainer &cont)=0
virtual quint16 serverPort() const
Definition abstract_client.h:167
ClientStatus status
Definition abstract_client.h:105
void serverShutdownEventReceived(const Event_ServerShutdown &event)
void registerAcceptedNeedsActivate()
void queuePendingCommand(PendingCommand *pend)
Definition abstract_client.cpp:160
void userJoinedEventReceived(const Event_UserJoined &event)
static PendingCommand * prepareRoomCommand(const ::google::protobuf::Message &cmd, int roomId)
Definition abstract_client.cpp:232
void recordLatency(PendingCommand &pend)
Definition abstract_client.cpp:180
void userLeftEventReceived(const Event_UserLeft &event)
static PendingCommand * prepareSessionCommand(const ::google::protobuf::Message &cmd)
Definition abstract_client.cpp:224
Definition featureset.h:9
Fixed-capacity rolling window of network round-trip time samples.
Definition latency_tracker.h:22
Definition pending_command.h:16
Definition commands.proto:7
Definition event_add_to_list.proto:4
Definition event_connection_closed.proto:3
Definition event_game_joined.proto:5
Definition event_list_rooms.proto:4
Definition event_notify_user.proto:3
Definition event_remove_from_list.proto:3
Definition event_replay_added.proto:4
Definition event_server_identification.proto:3
Definition event_server_message.proto:3
Definition event_server_shutdown.proto:3
Definition event_user_joined.proto:4
Definition event_user_left.proto:3
Definition event_user_message.proto:3
Definition game_event_container.proto:4
Definition latency_tracker.h:27
Definition room_event.proto:2
Definition serverinfo_user.proto:2
Definition server_message.proto:6