![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
#include <abstract_client.h>
Public Member Functions | |
| AbstractClient (QObject *parent=nullptr) | |
| ~AbstractClient () override | |
| ClientStatus | getStatus () const |
| void | sendCommand (const CommandContainer &cont) |
| void | sendCommand (PendingCommand *pend) |
| void | clearLatencyStats () |
| Drops all recorded round-trip samples and resets the stats emission throttle, emitting zeroed stats so that UI listeners can clear their display. | |
| bool | getServerSupportsPasswordHash () const |
| bool | getServerSupportsChallengeResponse () const |
| const QString & | getUserName () const |
| virtual QString | serverName () const |
| Returns the server address configured for the current connection. | |
| virtual quint16 | serverPort () const |
Static Public Member Functions | |
| 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) |
| static PendingCommand * | prepareAdminCommand (const ::google::protobuf::Message &cmd) |
| static PendingCommand * | prepareDeveloperCommand (const ::google::protobuf::Message &cmd) |
Public Attributes | |
| QMap< QString, bool > | clientFeatures |
Protected Slots | |
| void | processProtocolItem (const ServerMessage &item) |
Protected Member Functions | |
| void | setStatus (ClientStatus _status) |
| int | getNewCmdId () |
| virtual void | sendCommandContainer (const CommandContainer &cont)=0 |
Protected Attributes | |
| QMap< int, PendingCommand * > | pendingCommands |
| QString | userName |
| QString | password |
| QString | |
| QString | country |
| QString | realName |
| QString | token |
| bool | serverSupportsPasswordHash |
| bool | serverSupportsChallengeResponse |
Private Slots | |
| void | queuePendingCommand (PendingCommand *pend) |
Private Member Functions | |
| void | recordLatency (PendingCommand &pend) |
Private Attributes | |
| int | nextCmdId |
| QMutex | clientMutex |
| ClientStatus | status |
| LatencyTracker | latencyTracker |
| QElapsedTimer | statsEmitClock |
| bool | statsEmitClockStarted = false |
|
explicit |
|
override |
|
signal |
|
signal |
|
signal |
| void AbstractClient::clearLatencyStats | ( | ) |
Drops all recorded round-trip samples and resets the stats emission throttle, emitting zeroed stats so that UI listeners can clear their display.
Must be called from the client thread (as RemoteClient's disconnect path does). The tracker is deliberately lock-free.
|
signal |
|
signal |
|
signal |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
Aggregated round-trip statistics and a chronological snapshot of the rolling window, emitted at most once per second.
All values in the stats struct are in milliseconds; sampleCount is the number of samples currently in the rolling window. The samples list is ordered oldest first so graphs can redraw without polling the tracker across threads. Emitted from the client thread. The connection to UI objects is automatically queued across threads.
|
static |
|
static |
|
static |
|
static |
|
static |
|
protectedslot |
|
privateslot |
|
private |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
| void AbstractClient::sendCommand | ( | const CommandContainer & | cont | ) |
| void AbstractClient::sendCommand | ( | PendingCommand * | pend | ) |
|
protectedpure virtual |
Implemented in LocalClient.
|
signal |
|
signal |
|
inlinevirtual |
Returns the server address configured for the current connection.
May be empty for clients that have no server counterpart (e.g. local test clients).
Reimplemented in RemoteClient.
|
inlinevirtual |
|
signal |
|
protected |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
| QMap<QString, bool> AbstractClient::clientFeatures |
|
mutableprivate |
|
protected |
|
protected |
|
private |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
|
private |
|
protected |
|
protected |