From d0f13743edb12e588996c0fd9b8deef9dab7ac09 Mon Sep 17 00:00:00 2001 From: Gravita Date: Sun, 7 Feb 2021 21:42:04 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=D0=A3=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20API=20Client/FeaturesManager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launchserver/manangers/FeaturesManager.java | 2 +- .../pro/gravit/launchserver/socket/Client.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/FeaturesManager.java b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/FeaturesManager.java index da1d15c8..99201fbe 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/FeaturesManager.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/manangers/FeaturesManager.java @@ -14,7 +14,7 @@ public FeaturesManager(LaunchServer server) { this.server = server; map = new HashMap<>(); addFeatureInfo("version", Version.getVersion().getVersionString()); - + addFeatureInfo("projectName", server.config.projectName); } public Map getMap() { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java index 57113f14..5998aca9 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/Client.java @@ -32,6 +32,8 @@ public class Client { public transient Map properties; + public Map serializableProperties; + public transient AtomicInteger refCount = new AtomicInteger(1); public Client(UUID session) { @@ -55,6 +57,7 @@ public void updateAuth(LaunchServer server) { else auth = server.config.getAuthProviderPair(auth_id); } + @Deprecated public enum Type { SERVER, USER @@ -65,6 +68,9 @@ public static class TrustLevel { public boolean keyChecked; public byte[] publicKey; public HardwareReportRequest.HardwareInfo hardwareInfo; + // May be used later + public double rating; + public long latestMillis; } @SuppressWarnings("unchecked") @@ -77,4 +83,14 @@ public void setProperty(String name, T object) { if (properties == null) properties = new HashMap<>(); 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); + } }