mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
chat code
This commit is contained in:
parent
8daa81e462
commit
5d32bb8bc4
14 changed files with 85 additions and 28 deletions
|
|
@ -27,7 +27,7 @@
|
|||
#include <QSettings>
|
||||
|
||||
Server::Server(QObject *parent)
|
||||
: QTcpServer(parent), nextGameId(0)
|
||||
: QTcpServer(parent), nextGameId(0)
|
||||
{
|
||||
rng = new RNG_Qt(this);
|
||||
|
||||
|
|
@ -37,11 +37,20 @@ Server::Server(QObject *parent)
|
|||
if (dbType == "mysql")
|
||||
openDatabase();
|
||||
|
||||
chatChannelList << new ChatChannel("channel1", "testchannel 1");
|
||||
chatChannelList << new ChatChannel("channel2", "testchannel 2");
|
||||
int size = settings->beginReadArray("chatchannels");
|
||||
for (int i = 0; i < size; ++i) {
|
||||
settings->setArrayIndex(i);
|
||||
chatChannelList << new ChatChannel(settings->value("name").toString(),
|
||||
settings->value("description").toString(),
|
||||
settings->value("autojoin").toBool(),
|
||||
settings->value("joinmessage").toStringList());
|
||||
}
|
||||
settings->endArray();
|
||||
|
||||
for (int i = 0; i < chatChannelList.size(); ++i)
|
||||
connect(chatChannelList[i], SIGNAL(channelInfoChanged()), this, SLOT(broadcastChannelUpdate()));
|
||||
|
||||
loginMessage = settings->value("messages/login").toStringList();
|
||||
}
|
||||
|
||||
Server::~Server()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue