# HG changeset patch # User sheepluva # Date 1319872744 -7200 # Node ID 505643d4c23d7d3353ff0df9df6ba432516fed66 # Parent cc3eb9b7230fdb041597bd16ee40a0d47d8556a9 disconnect when going back from lobby page (regression fix) fix some indentations diff -r cc3eb9b7230f -r 505643d4c23d QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Fri Oct 28 19:20:35 2011 +0400 +++ b/QTfrontend/hwform.cpp Sat Oct 29 09:19:04 2011 +0200 @@ -997,6 +997,9 @@ delete pnetserver; pnetserver = 0; } + + if(hwnet) + hwnet->Disconnect(); } void HWForm::ForcedDisconnect(const QString & reason) @@ -1166,7 +1169,7 @@ ui.pageNetGame->pGameCFG->WeaponsName->currentIndex() ).toString(); - CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo); + CreateGame(ui.pageNetGame->pGameCFG, ui.pageNetGame->pNetTeamsWidget, ammo); connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &))); connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &))); diff -r cc3eb9b7230f -r 505643d4c23d QTfrontend/hwform.h --- a/QTfrontend/hwform.h Fri Oct 28 19:20:35 2011 +0400 +++ b/QTfrontend/hwform.h Sat Oct 29 09:19:04 2011 +0200 @@ -157,11 +157,11 @@ ID_PAGE_DRAWMAP = 20, ID_PAGE_DATADOWNLOAD = 21 }; - QPointer game; - QPointer pnetserver; - QPointer pRegisterServer; - QPointer editedTeam; - QPointer hwnet; + QPointer game; + QPointer pnetserver; + QPointer pRegisterServer; + QPointer editedTeam; + QPointer hwnet; HWNamegen * namegen; AmmoSchemeModel * ammoSchemeModel; QStack PagesStack; diff -r cc3eb9b7230f -r 505643d4c23d QTfrontend/team.cpp --- a/QTfrontend/team.cpp Fri Oct 28 19:20:35 2011 +0400 +++ b/QTfrontend/team.cpp Sat Oct 29 09:19:04 2011 +0200 @@ -28,10 +28,10 @@ #include "hats.h" HWTeam::HWTeam(const QString & teamname) : - QObject(0) - , m_difficulty(0) - , m_numHedgehogs(4) - , m_isNetTeam(false) + QObject(0) + , m_difficulty(0) + , m_numHedgehogs(4) + , m_isNetTeam(false) { m_name = teamname; OldTeamName = m_name; @@ -55,9 +55,9 @@ } HWTeam::HWTeam(const QStringList& strLst) : - QObject(0) - , m_numHedgehogs(4) - , m_isNetTeam(true) + QObject(0) + , m_numHedgehogs(4) + , m_isNetTeam(true) { // net teams are configured from QStringList if(strLst.size() != 23) throw HWTeamConstructException(); @@ -82,7 +82,7 @@ } HWTeam::HWTeam() : - QObject(0) + QObject(0) , m_difficulty(0) , m_numHedgehogs(4) , m_isNetTeam(false) @@ -110,51 +110,51 @@ } HWTeam::HWTeam(const HWTeam & other) : - QObject(0) - , OldTeamName(other.OldTeamName) - , m_name(other.m_name) - , m_grave(other.m_grave) - , m_fort(other.m_fort) - , m_flag(other.m_flag) - , m_voicepack(other.m_voicepack) - , m_hedgehogs(other.m_hedgehogs) - , m_difficulty(other.m_difficulty) - , m_binds(other.m_binds) - , m_numHedgehogs(other.m_numHedgehogs) - , m_color(other.m_color) - , m_isNetTeam(other.m_isNetTeam) - , m_owner(other.m_owner) - , m_campaignProgress(other.m_campaignProgress) - , m_rounds(other.m_rounds) - , m_wins(other.m_wins) -// , AchievementProgress(other.AchievementProgress) + QObject(0) + , OldTeamName(other.OldTeamName) + , m_name(other.m_name) + , m_grave(other.m_grave) + , m_fort(other.m_fort) + , m_flag(other.m_flag) + , m_voicepack(other.m_voicepack) + , m_hedgehogs(other.m_hedgehogs) + , m_difficulty(other.m_difficulty) + , m_binds(other.m_binds) + , m_numHedgehogs(other.m_numHedgehogs) + , m_color(other.m_color) + , m_isNetTeam(other.m_isNetTeam) + , m_owner(other.m_owner) + , m_campaignProgress(other.m_campaignProgress) + , m_rounds(other.m_rounds) + , m_wins(other.m_wins) +// , AchievementProgress(other.AchievementProgress) { } HWTeam & HWTeam::operator = (const HWTeam & other) { - if(this != &other) - { - OldTeamName = other.OldTeamName; - m_name = other.m_name; - m_grave = other.m_grave; - m_fort = other.m_fort; - m_flag = other.m_flag; - m_voicepack = other.m_voicepack; -// m_hedgehogs = other.m_hedgehogs; - m_difficulty = other.m_difficulty; -// m_binds = other.m_binds; - m_numHedgehogs = other.m_numHedgehogs; - m_color = other.m_color; - m_isNetTeam = other.m_isNetTeam; - m_owner = other.m_owner; - m_campaignProgress = other.m_campaignProgress; - m_rounds = other.m_rounds; - m_wins = other.m_wins; - } + if(this != &other) + { + OldTeamName = other.OldTeamName; + m_name = other.m_name; + m_grave = other.m_grave; + m_fort = other.m_fort; + m_flag = other.m_flag; + m_voicepack = other.m_voicepack; +// m_hedgehogs = other.m_hedgehogs; + m_difficulty = other.m_difficulty; +// m_binds = other.m_binds; + m_numHedgehogs = other.m_numHedgehogs; + m_color = other.m_color; + m_isNetTeam = other.m_isNetTeam; + m_owner = other.m_owner; + m_campaignProgress = other.m_campaignProgress; + m_rounds = other.m_rounds; + m_wins = other.m_wins; + } - return *this; + return *this; } bool HWTeam::loadFromFile() diff -r cc3eb9b7230f -r 505643d4c23d QTfrontend/team.h --- a/QTfrontend/team.h Fri Oct 28 19:20:35 2011 +0400 +++ b/QTfrontend/team.h Sat Oct 29 09:19:04 2011 +0200 @@ -44,7 +44,7 @@ // class representing a team class HWTeam : public QObject { - Q_OBJECT + Q_OBJECT public: @@ -52,7 +52,7 @@ HWTeam(const QString & teamname); HWTeam(const QStringList& strLst); HWTeam(); - HWTeam(const HWTeam & other); + HWTeam(const HWTeam & other); // file operations static HWTeam loadFromFile(const QString & teamName); @@ -96,9 +96,9 @@ QStringList teamGameConfig(quint32 InitHealth) const; // comparison operators - bool operator == (const HWTeam& t1) const; - bool operator < (const HWTeam& t1) const; - HWTeam & operator = (const HWTeam & other); + bool operator == (const HWTeam& t1) const; + bool operator < (const HWTeam& t1) const; + HWTeam & operator = (const HWTeam & other); private: @@ -112,11 +112,11 @@ QString m_flag; QString m_voicepack; HWHog m_hedgehogs[HEDGEHOGS_PER_TEAM]; - quint8 m_difficulty; + quint8 m_difficulty; BindAction m_binds[BINDS_NUMBER]; // class members that contain info for the current game setup - quint8 m_numHedgehogs; + quint8 m_numHedgehogs; QColor m_color; bool m_isNetTeam; QString m_owner;