mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] Улучшение API Client/FeaturesManager
This commit is contained in:
parent
bac794b912
commit
d0f13743ed
2 changed files with 17 additions and 1 deletions
|
@ -14,7 +14,7 @@ public FeaturesManager(LaunchServer server) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
map = new HashMap<>();
|
map = new HashMap<>();
|
||||||
addFeatureInfo("version", Version.getVersion().getVersionString());
|
addFeatureInfo("version", Version.getVersion().getVersionString());
|
||||||
|
addFeatureInfo("projectName", server.config.projectName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getMap() {
|
public Map<String, String> getMap() {
|
||||||
|
|
|
@ -32,6 +32,8 @@ public class Client {
|
||||||
|
|
||||||
public transient Map<String, Object> properties;
|
public transient Map<String, Object> properties;
|
||||||
|
|
||||||
|
public Map<String, String> serializableProperties;
|
||||||
|
|
||||||
public transient AtomicInteger refCount = new AtomicInteger(1);
|
public transient AtomicInteger refCount = new AtomicInteger(1);
|
||||||
|
|
||||||
public Client(UUID session) {
|
public Client(UUID session) {
|
||||||
|
@ -55,6 +57,7 @@ public void updateAuth(LaunchServer server) {
|
||||||
else auth = server.config.getAuthProviderPair(auth_id);
|
else auth = server.config.getAuthProviderPair(auth_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public enum Type {
|
public enum Type {
|
||||||
SERVER,
|
SERVER,
|
||||||
USER
|
USER
|
||||||
|
@ -65,6 +68,9 @@ public static class TrustLevel {
|
||||||
public boolean keyChecked;
|
public boolean keyChecked;
|
||||||
public byte[] publicKey;
|
public byte[] publicKey;
|
||||||
public HardwareReportRequest.HardwareInfo hardwareInfo;
|
public HardwareReportRequest.HardwareInfo hardwareInfo;
|
||||||
|
// May be used later
|
||||||
|
public double rating;
|
||||||
|
public long latestMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -77,4 +83,14 @@ public <T> void setProperty(String name, T object) {
|
||||||
if (properties == null) properties = new HashMap<>();
|
if (properties == null) properties = new HashMap<>();
|
||||||
properties.put(name, object);
|
properties.put(name, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSerializableProperty(String name) {
|
||||||
|
if (serializableProperties == null) serializableProperties = new HashMap<>();
|
||||||
|
return serializableProperties.get(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSerializableProperty(String name, String value) {
|
||||||
|
if (serializableProperties == null) serializableProperties = new HashMap<>();
|
||||||
|
properties.put(name, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue