mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
Updated pingClockTimeout to account for adjustments in client keep alive settings value.
Changed the default value for the client keep alive variable back to 1 (since that is what the setting is if the value is not found in the configuration ini file).
This commit is contained in:
parent
8c7301b19f
commit
eb9ca58fd0
5 changed files with 102 additions and 92 deletions
|
|
@ -47,15 +47,16 @@ public:
|
|||
AuthenticationResult loginUser(Server_ProtocolHandler *session, QString &name, const QString &password, QString &reason, int &secondsLeft);
|
||||
|
||||
const QMap<int, Server_Room *> &getRooms() { return rooms; }
|
||||
|
||||
|
||||
Server_AbstractUserInterface *findUser(const QString &userName) const;
|
||||
const QMap<QString, Server_ProtocolHandler *> &getUsers() const { return users; }
|
||||
const QMap<qint64, Server_ProtocolHandler *> &getUsersBySessionId() const { return usersBySessionId; }
|
||||
void addClient(Server_ProtocolHandler *player);
|
||||
void removeClient(Server_ProtocolHandler *player);
|
||||
virtual QString getLoginMessage() const { return QString(); }
|
||||
|
||||
|
||||
virtual bool getGameShouldPing() const { return false; }
|
||||
virtual int getPingClockInterval() const { return 0; }
|
||||
virtual int getMaxGameInactivityTime() const { return 9999999; }
|
||||
virtual int getMaxPlayerInactivityTime() const { return 9999999; }
|
||||
virtual int getMessageCountingInterval() const { return 0; }
|
||||
|
|
@ -69,18 +70,18 @@ public:
|
|||
|
||||
Server_DatabaseInterface *getDatabaseInterface() const;
|
||||
int getNextLocalGameId() { QMutexLocker locker(&nextLocalGameIdMutex); return ++nextLocalGameId; }
|
||||
|
||||
|
||||
void sendIsl_Response(const Response &item, int serverId = -1, qint64 sessionId = -1);
|
||||
void sendIsl_SessionEvent(const SessionEvent &item, int serverId = -1, qint64 sessionId = -1);
|
||||
void sendIsl_GameEventContainer(const GameEventContainer &item, int serverId = -1, qint64 sessionId = -1);
|
||||
void sendIsl_RoomEvent(const RoomEvent &item, int serverId = -1, qint64 sessionId = -1);
|
||||
void sendIsl_GameCommand(const CommandContainer &item, int serverId, qint64 sessionId, int roomId, int playerId);
|
||||
void sendIsl_RoomCommand(const CommandContainer &item, int serverId, qint64 sessionId, int roomId);
|
||||
|
||||
|
||||
void addExternalUser(const ServerInfo_User &userInfo);
|
||||
void removeExternalUser(const QString &userName);
|
||||
const QMap<QString, Server_AbstractUserInterface *> &getExternalUsers() const { return externalUsers; }
|
||||
|
||||
|
||||
void addPersistentPlayer(const QString &userName, int roomId, int gameId, int playerId);
|
||||
void removePersistentPlayer(const QString &userName, int roomId, int gameId, int playerId);
|
||||
QList<PlayerReference> getPersistentPlayerReferences(const QString &userName) const;
|
||||
|
|
@ -90,7 +91,7 @@ private:
|
|||
mutable QReadWriteLock persistentPlayersLock;
|
||||
int nextLocalGameId;
|
||||
QMutex nextLocalGameIdMutex;
|
||||
protected slots:
|
||||
protected slots:
|
||||
void externalUserJoined(const ServerInfo_User &userInfo);
|
||||
void externalUserLeft(const QString &userName);
|
||||
void externalRoomUserJoined(int roomId, const ServerInfo_User &userInfo);
|
||||
|
|
@ -101,7 +102,7 @@ protected slots:
|
|||
void externalGameCommandContainerReceived(const CommandContainer &cont, int playerId, int serverId, qint64 sessionId);
|
||||
void externalGameEventContainerReceived(const GameEventContainer &cont, qint64 sessionId);
|
||||
void externalResponseReceived(const Response &resp, qint64 sessionId);
|
||||
|
||||
|
||||
virtual void doSendIslMessage(const IslMessage & /* msg */, int /* serverId */) { }
|
||||
protected:
|
||||
void prepareDestroy();
|
||||
|
|
@ -113,7 +114,7 @@ protected:
|
|||
QMap<QString, Server_AbstractUserInterface *> externalUsers;
|
||||
QMap<int, Server_Room *> rooms;
|
||||
QMap<QThread *, Server_DatabaseInterface *> databaseInterfaces;
|
||||
|
||||
|
||||
int getUsersCount() const;
|
||||
int getGamesCount() const;
|
||||
void addRoom(Server_Room *newRoom);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue