2015-01-27 21:31:07 +00:00
|
|
|
#pragma once
|
2015-02-09 00:51:14 +00:00
|
|
|
#include "BaseInstance.h"
|
|
|
|
#include "minecraft/Mod.h"
|
2015-07-21 01:38:15 +01:00
|
|
|
#include <QProcess>
|
2015-02-04 20:10:10 +00:00
|
|
|
|
2015-09-05 17:46:57 +01:00
|
|
|
#include "multimc_logic_export.h"
|
|
|
|
|
2015-02-04 20:10:10 +00:00
|
|
|
class ModList;
|
2015-08-19 00:10:17 +01:00
|
|
|
class WorldList;
|
2015-01-27 21:31:07 +00:00
|
|
|
|
2015-09-05 17:46:57 +01:00
|
|
|
class MULTIMC_LOGIC_EXPORT MinecraftInstance: public BaseInstance
|
2015-01-27 21:31:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-02-01 02:08:25 +00:00
|
|
|
MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir);
|
2015-01-27 21:31:07 +00:00
|
|
|
virtual ~MinecraftInstance() {};
|
|
|
|
|
|
|
|
/// Path to the instance's minecraft directory.
|
|
|
|
QString minecraftRoot() const;
|
|
|
|
|
|
|
|
////// Mod Lists //////
|
|
|
|
virtual std::shared_ptr<ModList> resourcePackList() const
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
virtual std::shared_ptr<ModList> texturePackList() const
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
2015-08-19 00:10:17 +01:00
|
|
|
virtual std::shared_ptr<WorldList> worldList() const
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
2015-01-27 21:31:07 +00:00
|
|
|
/// get all jar mods applicable to this instance's jar
|
|
|
|
virtual QList<Mod> getJarMods() const
|
|
|
|
{
|
|
|
|
return QList<Mod>();
|
|
|
|
}
|
2015-07-21 01:38:15 +01:00
|
|
|
|
|
|
|
//FIXME: nuke?
|
2015-09-26 03:04:09 +01:00
|
|
|
virtual std::shared_ptr<BaseVersionList> versionList() const override;
|
2015-07-21 01:38:15 +01:00
|
|
|
|
|
|
|
/// get arguments passed to java
|
|
|
|
QStringList javaArguments() const;
|
|
|
|
|
|
|
|
/// get variables for launch command variable substitution/environment
|
|
|
|
virtual QMap<QString, QString> getVariables() const override;
|
|
|
|
|
|
|
|
/// create an environment for launching processes
|
|
|
|
virtual QProcessEnvironment createEnvironment() override;
|
2015-07-22 08:01:04 +01:00
|
|
|
|
|
|
|
/// guess log level from a line of minecraft log
|
2015-09-26 03:04:09 +01:00
|
|
|
virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level) override;
|
2015-08-16 01:17:50 +01:00
|
|
|
|
2015-08-18 01:25:24 +01:00
|
|
|
virtual IPathMatcher::Ptr getLogFileMatcher() override;
|
|
|
|
|
2015-08-19 01:04:56 +01:00
|
|
|
virtual QString getLogFileRoot() override;
|
|
|
|
|
2015-09-22 00:06:45 +01:00
|
|
|
virtual QString getStatusbarDescription() override;
|
|
|
|
|
2015-08-16 01:17:50 +01:00
|
|
|
protected:
|
|
|
|
QMap<QString, QString> createCensorFilterFromSession(AuthSessionPtr session);
|
2015-09-22 00:06:45 +01:00
|
|
|
private:
|
|
|
|
QString prettifyTimeDuration(int64_t duration);
|
2015-01-27 21:31:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::shared_ptr<MinecraftInstance> MinecraftInstancePtr;
|