mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 03:28:49 -07:00
improved code for automatic joining of persistent games; disconnecting + reconnecting works as it should with ISL
This commit is contained in:
parent
5db0fcd6ae
commit
af8e357487
13 changed files with 215 additions and 135 deletions
|
|
@ -4,9 +4,11 @@
|
|||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QMap>
|
||||
#include <QMultiMap>
|
||||
#include <QMutex>
|
||||
#include <QReadWriteLock>
|
||||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "server_player_reference.h"
|
||||
|
||||
class Server_Game;
|
||||
class Server_Room;
|
||||
|
|
@ -77,6 +79,13 @@ public:
|
|||
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;
|
||||
private:
|
||||
QMultiMap<QString, PlayerReference> persistentPlayers;
|
||||
mutable QReadWriteLock persistentPlayersLock;
|
||||
protected slots:
|
||||
void externalUserJoined(const ServerInfo_User &userInfo);
|
||||
void externalUserLeft(const QString &userName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue