QTfrontend/netclient.cpp
changeset 127 ca70467bd0a8
parent 125 0532e70b1ce4
child 183 57c2ef19f719
equal deleted inserted replaced
126:93df479aa1b9 127:ca70467bd0a8
     1 /*
     1 /*
     2  * Hedgewars, a worms-like game
     2  * Hedgewars, a worms-like game
     3  * Copyright (c) 2005 Andrey Korotaev <unC0Rr@gmail.com>
     3  * Copyright (c) 2005, 2006 Andrey Korotaev <unC0Rr@gmail.com>
     4  *
     4  *
     5  * Distributed under the terms of the BSD-modified licence:
     5  * Distributed under the terms of the BSD-modified licence:
     6  *
     6  *
     7  * Permission is hereby granted, free of charge, to any person obtaining a copy
     7  * Permission is hereby granted, free of charge, to any person obtaining a copy
     8  * of this software and associated documentation files (the "Software"), to deal
     8  * of this software and associated documentation files (the "Software"), to deal
    30  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
    30  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
    31  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    32  */
    32  */
    33 
    33 
    34 #include <QMessageBox>
    34 #include <QMessageBox>
       
    35 #include <QUuid>
    35 #include "netclient.h"
    36 #include "netclient.h"
    36 #include "game.h"
    37 #include "game.h"
       
    38 #include "gameuiconfig.h"
    37 
    39 
    38 HWNet::HWNet(GameUIConfig * config)
    40 HWNet::HWNet(GameUIConfig * config)
    39 	: QObject()
    41 	: QObject()
    40 {
    42 {
    41 	this->config = config;
    43 	this->config = config;
   363 							}
   365 							}
   364 		{
   366 		{
   365 			QByteArray cache;
   367 			QByteArray cache;
   366 			ADD("eseed " + seed);
   368 			ADD("eseed " + seed);
   367 			ADD("e$gmflags 0");
   369 			ADD("e$gmflags 0");
   368 			ADD("etheme steel");
   370 			ADD(QString("etheme %1").arg(config->GetRandomTheme()));
   369 			QString _msg = MAGIC_CHAR MAGIC_CHAR + QString(cache.toBase64());
   371 			QString _msg = MAGIC_CHAR MAGIC_CHAR + QString(cache.toBase64());
   370 			RawSendNet(QString("PRIVMSG %1 :%2").arg(channel, _msg));
   372 			RawSendNet(QString("PRIVMSG %1 :%2").arg(channel, _msg));
   371 			hwp_chanmsg(mynick, _msg);
   373 			hwp_chanmsg(mynick, _msg);
   372 		}
   374 		}
   373 		for (int i = 0; i < teamsCount; i++)
   375 		for (int i = 0; i < teamsCount; i++)
   492 		}
   494 		}
   493 	}
   495 	}
   494 	playerscnt = players.size();
   496 	playerscnt = players.size();
   495 	configasks = 0;
   497 	configasks = 0;
   496 
   498 
   497 	seedgen.GenRNDStr(seed, 10);
   499 	seed = QUuid::createUuid().toString();
   498 	QString msg = QString(MAGIC_CHAR"Start!");
   500 	QString msg = QString(MAGIC_CHAR"Start!");
   499 	RawSendNet(QString("PRIVMSG %1 :%2").arg(channel, msg));
   501 	RawSendNet(QString("PRIVMSG %1 :%2").arg(channel, msg));
   500 	hwp_chanmsg(mynick, msg);
   502 	hwp_chanmsg(mynick, msg);
   501 }
   503 }
   502 
   504