Add support for getting runelite launcher version
Propagate RuneLite launcher version to client via system property and add this property to RuneLite properties file. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -27,10 +27,9 @@ package net.runelite.client;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -43,13 +42,15 @@ public class RuneLiteProperties
|
|||||||
private static final String DISCORD_INVITE = "runelite.discord.invite";
|
private static final String DISCORD_INVITE = "runelite.discord.invite";
|
||||||
private static final String GITHUB_LINK = "runelite.github.link";
|
private static final String GITHUB_LINK = "runelite.github.link";
|
||||||
private static final String PATREON_LINK = "runelite.patreon.link";
|
private static final String PATREON_LINK = "runelite.patreon.link";
|
||||||
|
private static final String LAUNCHER_VERSION_PROPERTY = "runelite.launcher.version";
|
||||||
|
|
||||||
private final Properties properties = new Properties();
|
private final Properties properties = new Properties();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RuneLiteProperties()
|
public RuneLiteProperties()
|
||||||
{
|
{
|
||||||
InputStream in = getClass().getResourceAsStream("runelite.properties");
|
final InputStream in = getClass().getResourceAsStream("runelite.properties");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
properties.load(in);
|
properties.load(in);
|
||||||
@@ -94,4 +95,9 @@ public class RuneLiteProperties
|
|||||||
{
|
{
|
||||||
return properties.getProperty(PATREON_LINK);
|
return properties.getProperty(PATREON_LINK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLauncherVersion()
|
||||||
|
{
|
||||||
|
return System.getProperty(LAUNCHER_VERSION_PROPERTY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user