QTfrontend/netclient.cpp
changeset 84 0f6669da2fcb
parent 37 2b7f2a43b999
child 85 44d9045b26ff
equal deleted inserted replaced
83:207c85fbef51 84:0f6669da2fcb
    33 
    33 
    34 #include <QMessageBox>
    34 #include <QMessageBox>
    35 #include "netclient.h"
    35 #include "netclient.h"
    36 #include "game.h"
    36 #include "game.h"
    37 
    37 
    38 HWNet::HWNet(int Resolution, bool Fullscreen)
    38 HWNet::HWNet(GameConfig * config)
    39 	: QObject()
    39 	: QObject()
    40 {
    40 {
    41 	gameResolution = Resolution;
    41 	this->config = config;
    42 	gameFullscreen = Fullscreen;
       
    43 	state = nsDisconnected;
    42 	state = nsDisconnected;
    44 	IRCmsg_cmd_text = new QRegExp("^[A-Z]+ :.+$");
    43 	IRCmsg_cmd_text = new QRegExp("^[A-Z]+ :.+$");
    45 	IRCmsg_number_param = new QRegExp("^:\\S+ [0-9]{3} .+$");
    44 	IRCmsg_number_param = new QRegExp("^:\\S+ [0-9]{3} .+$");
    46 	IRCmsg_who_cmd_target = new QRegExp("^:\\S+ [A-Z]+ \\S+$"); // last \\S should mean 'the 1st char is not ":"'
    45 	IRCmsg_who_cmd_target = new QRegExp("^:\\S+ [A-Z]+ \\S+$"); // last \\S should mean 'the 1st char is not ":"'
    47 	IRCmsg_who_cmd_text = new QRegExp("^:\\S+ [A-Z]+ :.+$");
    46 	IRCmsg_who_cmd_text = new QRegExp("^:\\S+ [A-Z]+ :.+$");
   491 	hwp_chanmsg(mynick, msg);
   490 	hwp_chanmsg(mynick, msg);
   492 }
   491 }
   493 
   492 
   494 void HWNet::RunGame(const QString & seed)
   493 void HWNet::RunGame(const QString & seed)
   495 {
   494 {
   496 	HWGame * game = new HWGame(gameResolution, gameFullscreen);
   495 	HWGame * game = new HWGame(config);
   497 	connect(game, SIGNAL(SendNet(const QByteArray &)), this, SLOT(SendNet(const QByteArray &)));
   496 	connect(game, SIGNAL(SendNet(const QByteArray &)), this, SLOT(SendNet(const QByteArray &)));
   498 	connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)));
   497 	connect(this, SIGNAL(FromNet(const QByteArray &)), game, SLOT(FromNet(const QByteArray &)));
   499 	connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &)));
   498 	connect(this, SIGNAL(LocalCFG(const QString &)), game, SLOT(LocalCFG(const QString &)));
   500 	game->StartNet(seed);
   499 	game->StartNet(seed);
   501 }
   500 }