summaryrefslogtreecommitdiffstats
path: root/src/crsm.hpp
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2015-09-22 20:18:41 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2015-09-22 20:18:41 +0200
commitdf43572fd5a2997b4b8ffcedc026fb400c990161 (patch)
tree24a80e2c81ae7041cb36bc14beb84abfea86fb20 /src/crsm.hpp
parent1f5f2defd78714354e628cf1889235a6340f5625 (diff)
downloadmanager-df43572fd5a2997b4b8ffcedc026fb400c990161.tar.gz
manager-df43572fd5a2997b4b8ffcedc026fb400c990161.zip
Code cleanup
Add empty() and clear() to ClientInfo and use it when needed. Move session-specific members into Session-struct
Diffstat (limited to 'src/crsm.hpp')
-rw-r--r--src/crsm.hpp47
1 files changed, 27 insertions, 20 deletions
diff --git a/src/crsm.hpp b/src/crsm.hpp
index fc4ee1e..117df9d 100644
--- a/src/crsm.hpp
+++ b/src/crsm.hpp
@@ -50,21 +50,6 @@ public:
ScenarioSettings(const QString& name, const ClientInfo& client, bool league = false) : name(name), league(league), wishClient(client) {}
};
-struct CRSMSession {
- bool IrcUseIngameChat = false;
- bool League = false;
- bool Running = false;
- bool UserWish = false;
- int CountDown = -1;
- bool Hosting = false;
- QString ScenarioName = "";
-
- void clear()
- {
- *this = CRSMSession();
- }
-};
-
class CRSM : public QObject
{
private:
@@ -120,6 +105,33 @@ private slots:
private:
CRSMConfig Config;
+
+ struct CRSMSession {
+ bool IrcUseIngameChat = false;
+ bool League = false;
+ bool Running = false;
+ bool UserWish = false;
+ int CountDown = -1;
+ bool Hosting = false;
+ QString ScenarioName = "";
+
+
+ struct {
+ ClientInfo Admin;
+ QMap<QString, ClientInfo> Clients;
+ QMap<ClientInfo, QDateTime> LeaveAdmins;
+ } Clonk;
+
+ struct {
+ ClientInfo Admin;
+ } IRC;
+
+ void clear()
+ {
+ *this = CRSMSession();
+ }
+ } Session;
+
QList<ScenarioSettings> userlist;
QList<ScenarioSettings> autolist;
QList<ScenarioSettings> nextAutoScens;
@@ -135,14 +147,9 @@ private:
QTextStream *qout;
QTextStream *qin;
bool finish;
- CRSMSession Session;
- QMap<QString, ClientInfo> clients;
IrcConnection *connection = 0;
bool autoHost = true;
QSignalMapper greetMapper;
- ClientInfo sessionAdmin;
- ClientInfo ircAdmin;
- QMap<ClientInfo, QDateTime> leaveAdmins;
QFile *logfile;
QTextStream logstream;
QTextCodec *codec;