summaryrefslogtreecommitdiffstats
path: root/src/CRSMSession.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CRSMSession.hpp')
-rw-r--r--src/CRSMSession.hpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/CRSMSession.hpp b/src/CRSMSession.hpp
new file mode 100644
index 0000000..5c9a72e
--- /dev/null
+++ b/src/CRSMSession.hpp
@@ -0,0 +1,51 @@
+#pragma once
+#include "qt-config/ConfigBase.hpp"
+#include "ClientInfo.hpp"
+
+class CRSM;
+
+class ScenarioSettings {
+public:
+ QString name;
+ ClientInfo wishClient;
+ bool league = false;
+ bool randomLeague = false;
+
+ ScenarioSettings(const QString& name, bool league = false) : name(name), league(league) {}
+ ScenarioSettings(const QString& name, const ClientInfo& client, bool league = false) : name(name), wishClient(client), league(league) {}
+ ScenarioSettings() {}
+ inline bool operator ==(const ScenarioSettings& other) const
+ {
+ return name == other.name && league == other.league && randomLeague == other.randomLeague && wishClient == other.wishClient;
+ }
+};
+
+struct CRSMSession : public ConfigBase {
+ enum SessionState {None = -1, Lobby = 0, Loading = 1, Running = 2};
+
+ Boolean League = false;
+ SessionState State = None;
+ Boolean UserWish = false;
+ Boolean AfkAdmin = false;
+ Integer CountDown = -1;
+ ScenarioSettings Scenario;
+
+
+ struct {
+ ClientInfo Admin;
+ Map(String, ClientInfo) Clients;
+ ClientInfo Server;
+ QMap<ClientInfo, QDateTime> LeaveAdmins;
+ } Clonk;
+
+ struct {
+ ClientInfo Admin;
+ Boolean UseIngameChat = false;
+ } IRC;
+
+ void clear();
+
+ CRSMSession();
+
+ CRSMSession(CRSM* crsm);
+};