initial commit for rooms

This commit is contained in:
Max-Wilhelm Bruker 2010-12-24 02:21:00 +01:00
parent 76a13be3c3
commit d8d4563292
22 changed files with 428 additions and 452 deletions

View file

@ -27,7 +27,7 @@ HEADERS += src/servatrice.h \
../common/server_arrow.h \
../common/server_card.h \
../common/server_cardzone.h \
../common/server_chatchannel.h \
../common/server_room.h \
../common/server_counter.h \
../common/server_game.h \
../common/server_player.h \
@ -48,7 +48,7 @@ SOURCES += src/main.cpp \
../common/server.cpp \
../common/server_card.cpp \
../common/server_cardzone.cpp \
../common/server_chatchannel.cpp \
../common/server_room.cpp \
../common/server_game.cpp \
../common/server_player.cpp \
../common/server_protocolhandler.cpp

View file

@ -22,7 +22,7 @@
#include <QDebug>
#include <iostream>
#include "servatrice.h"
#include "server_chatchannel.h"
#include "server_room.h"
#include "serversocketinterface.h"
#include "protocol.h"
@ -49,16 +49,18 @@ Servatrice::Servatrice(QObject *parent)
if (dbType == "mysql")
openDatabase();
int size = settings->beginReadArray("chatchannels");
int size = settings->beginReadArray("rooms");
for (int i = 0; i < size; ++i) {
settings->setArrayIndex(i);
Server_ChatChannel *newChannel = new Server_ChatChannel(
Server_Room *newRoom = new Server_Room(
i,
settings->value("name").toString(),
settings->value("description").toString(),
settings->value("autojoin").toBool(),
settings->value("joinmessage").toString()
settings->value("joinmessage").toString(),
this
);
addChatChannel(newChannel);
addRoom(newRoom);
}
settings->endArray();