Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/floodgate-2.0' into feature/1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed Jun 6, 2021
2 parents 207af5d + 632f84f commit 9568a3a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/

package org.geysermc.floodgate.util;

import lombok.Getter;
import lombok.Setter;
import java.util.Properties;

public class FloodgateGitPropertiesHolder {
@Getter
@Setter
private static Properties gitProperties;
}
33 changes: 22 additions & 11 deletions connector/src/main/java/org/geysermc/connector/dump/DumpInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.geysermc.connector.utils.FileUtils;
import org.geysermc.floodgate.util.DeviceOs;
import org.geysermc.floodgate.util.FloodgateConfigHolder;
import org.geysermc.floodgate.util.FloodgateGitPropertiesHolder;

import java.io.File;
import java.io.IOException;
Expand All @@ -60,9 +61,9 @@ public class DumpInfo {
private final DumpInfo.VersionInfo versionInfo;
private Properties gitInfo;
private final GeyserConfiguration config;
private final Object floodgateConfig;
private final HashInfo hashInfo;
private final Floodgate floodgate;
private final Object2IntMap<DeviceOs> userPlatforms;
private final HashInfo hashInfo;
private final RamInfo ramInfo;
private final BootstrapDumpInfo bootstrapInfo;

Expand All @@ -76,7 +77,7 @@ public DumpInfo() {
}

this.config = GeyserConnector.getInstance().getConfig();
this.floodgateConfig = FloodgateConfigHolder.getConfig();
this.floodgate = new Floodgate();

String md5Hash = "unknown";
String sha256Hash = "unknown";
Expand All @@ -95,7 +96,6 @@ public DumpInfo() {
e.printStackTrace();
}
}

this.hashInfo = new HashInfo(md5Hash, sha256Hash);

this.ramInfo = new DumpInfo.RamInfo();
Expand Down Expand Up @@ -135,13 +135,6 @@ public static class VersionInfo {
}
}

@AllArgsConstructor
@Getter
public static class HashInfo {
private final String md5Hash;
private final String sha256Hash;
}

@Getter
public static class NetworkInfo {
private final boolean dockerCheck;
Expand Down Expand Up @@ -185,6 +178,24 @@ public static class MCInfo {
}
}

@Getter
public static class Floodgate {
private final Properties gitInfo;
private final Object config;

Floodgate() {
this.gitInfo = FloodgateGitPropertiesHolder.getGitProperties();
this.config = FloodgateConfigHolder.getConfig();
}
}

@AllArgsConstructor
@Getter
public static class HashInfo {
private final String md5Hash;
private final String sha256Hash;
}

@Getter
public static class RamInfo {
private final long free;
Expand Down

0 comments on commit 9568a3a

Please sign in to comment.