mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-21 14:23:54 -07:00
Added chat history to a room that is displayed on join.
With this update a new chat history definition is added on a per room bases which allows operators to specify the number of chat messages to store and present to the user on join. Please see the sample ini for room definitions.
This commit is contained in:
parent
f97a7e8370
commit
87a64da1bc
23 changed files with 141 additions and 16 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include <QReadWriteLock>
|
||||
#include "serverinfo_user_container.h"
|
||||
#include "pb/response.pb.h"
|
||||
#include "pb/serverinfo_chat_message.pb.h"
|
||||
|
||||
class Server_DatabaseInterface;
|
||||
class Server_ProtocolHandler;
|
||||
|
|
@ -30,6 +31,7 @@ signals:
|
|||
void gameListChanged(const ServerInfo_Game &gameInfo);
|
||||
private:
|
||||
int id;
|
||||
int chatHistorySize;
|
||||
QString name;
|
||||
QString description;
|
||||
QString permissionLevel;
|
||||
|
|
@ -45,7 +47,8 @@ private slots:
|
|||
public:
|
||||
mutable QReadWriteLock usersLock;
|
||||
mutable QReadWriteLock gamesLock;
|
||||
Server_Room(int _id, const QString &_name, const QString &_description, const QString &_permissionLevel, bool _autoJoin, const QString &_joinMessage, const QStringList &_gameTypes, Server *parent);
|
||||
QList<ServerInfo_ChatMessage> chatHistory;
|
||||
Server_Room(int _id, int _chatHistorySize, const QString &_name, const QString &_description, const QString &_permissionLevel, bool _autoJoin, const QString &_joinMessage, const QStringList &_gameTypes, Server *parent );
|
||||
~Server_Room();
|
||||
int getId() const { return id; }
|
||||
QString getName() const { return name; }
|
||||
|
|
@ -60,6 +63,7 @@ public:
|
|||
const ServerInfo_Room &getInfo(ServerInfo_Room &result, bool complete, bool showGameTypes = false, bool includeExternalData = true) const;
|
||||
int getGamesCreatedByUser(const QString &name) const;
|
||||
QList<ServerInfo_Game> getGamesOfUser(const QString &name) const;
|
||||
QList<ServerInfo_ChatMessage> getChatHistory() { return chatHistory; }
|
||||
|
||||
void addClient(Server_ProtocolHandler *client);
|
||||
void removeClient(Server_ProtocolHandler *client);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue