From df43572fd5a2997b4b8ffcedc026fb400c990161 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Tue, 22 Sep 2015 20:18:41 +0200 Subject: Code cleanup Add empty() and clear() to ClientInfo and use it when needed. Move session-specific members into Session-struct --- src/crsm.hpp | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'src/crsm.hpp') 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 Clients; + QMap LeaveAdmins; + } Clonk; + + struct { + ClientInfo Admin; + } IRC; + + void clear() + { + *this = CRSMSession(); + } + } Session; + QList userlist; QList autolist; QList nextAutoScens; @@ -135,14 +147,9 @@ private: QTextStream *qout; QTextStream *qin; bool finish; - CRSMSession Session; - QMap clients; IrcConnection *connection = 0; bool autoHost = true; QSignalMapper greetMapper; - ClientInfo sessionAdmin; - ClientInfo ircAdmin; - QMap leaveAdmins; QFile *logfile; QTextStream logstream; QTextCodec *codec; -- cgit v1.2.3-54-g00ecf