aboutsummaryrefslogtreecommitdiff
path: root/api/logic/BaseInstance.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/BaseInstance.h')
-rw-r--r--api/logic/BaseInstance.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/api/logic/BaseInstance.h b/api/logic/BaseInstance.h
index 04788eb7..d250e03e 100644
--- a/api/logic/BaseInstance.h
+++ b/api/logic/BaseInstance.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2018 MultiMC Contributors
+/* Copyright 2013-2021 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,8 @@
#include "multimc_logic_export.h"
+#include "minecraft/launch/MinecraftServerTarget.h"
+
class QDir;
class Task;
class LaunchTask;
@@ -85,6 +87,7 @@ public:
void setRunning(bool running);
bool isRunning() const;
int64_t totalTimePlayed() const;
+ int64_t lastTimePlayed() const;
void resetTimePlayed();
/// get the type of this instance
@@ -134,8 +137,6 @@ public:
/// Sets the last launched time to 'val' milliseconds since epoch
void setLastLaunch(qint64 val = QDateTime::currentMSecsSinceEpoch());
- InstancePtr getSharedPtr();
-
/*!
* \brief Gets this instance's settings object.
* This settings object stores instance-specific settings.
@@ -147,10 +148,11 @@ public:
virtual shared_qobject_ptr<Task> createUpdateTask(Net::Mode mode) = 0;
/// returns a valid launcher (task container)
- virtual std::shared_ptr<LaunchTask> createLaunchTask(AuthSessionPtr account) = 0;
+ virtual shared_qobject_ptr<LaunchTask> createLaunchTask(
+ AuthSessionPtr account, MinecraftServerTargetPtr serverToJoin) = 0;
/// returns the current launch task (if any)
- std::shared_ptr<LaunchTask> getLaunchTask();
+ shared_qobject_ptr<LaunchTask> getLaunchTask();
/*!
* Create envrironment variables for running the instance
@@ -223,9 +225,9 @@ public:
bool reloadSettings();
/**
- * 'print' a verbose desription of the instance into a QStringList
+ * 'print' a verbose description of the instance into a QStringList
*/
- virtual QStringList verboseDescription(AuthSessionPtr session) = 0;
+ virtual QStringList verboseDescription(AuthSessionPtr session, MinecraftServerTargetPtr serverToJoin) = 0;
Status currentStatus() const;
@@ -241,7 +243,7 @@ signals:
*/
void propertiesChanged(BaseInstance *inst);
- void launchTaskChanged(std::shared_ptr<LaunchTask>);
+ void launchTaskChanged(shared_qobject_ptr<LaunchTask>);
void runningStatusChanged(bool running);
@@ -255,7 +257,7 @@ protected: /* data */
SettingsObjectPtr m_settings;
// InstanceFlags m_flags;
bool m_isRunning = false;
- std::shared_ptr<LaunchTask> m_launchProcess;
+ shared_qobject_ptr<LaunchTask> m_launchProcess;
QDateTime m_timeStarted;
private: /* data */
@@ -265,6 +267,6 @@ private: /* data */
bool m_hasBrokenVersion = false;
};
-Q_DECLARE_METATYPE(std::shared_ptr<BaseInstance>)
+Q_DECLARE_METATYPE(shared_qobject_ptr<BaseInstance>)
//Q_DECLARE_METATYPE(BaseInstance::InstanceFlag)
//Q_DECLARE_OPERATORS_FOR_FLAGS(BaseInstance::InstanceFlags)