3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-08 17:20:20 +01:00

Change version in query to use a more informative string (#1635)

* Change version in query to use a more informative string

* Fix removal of string

* Cleaner implementation of version

* Fix build

* Make more explicit what we're replacing

Co-authored-by: Camotoy <20743703+DoctorMacc@users.noreply.github.com>
Dieser Commit ist enthalten in:
rtm516 2020-12-09 20:14:12 +00:00 committet von GitHub
Ursprung 2a44874458
Commit 91cdda95db
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 14 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -230,8 +230,12 @@
</includes> </includes>
<replacements> <replacements>
<replacement> <replacement>
<token>VERSION = ".*"</token> <token>String VERSION = ".*"</token>
<value>VERSION = "${project.version} (git-${git.branch}-${git.commit.id.abbrev})"</value> <value>String VERSION = "${project.version} (" + GIT_VERSION + ")"</value>
</replacement>
<replacement>
<token>String GIT_VERSION = ".*"</token>
<value>String GIT_VERSION = "git-${git.branch}-${git.commit.id.abbrev}"</value>
</replacement> </replacement>
</replacements> </replacements>
</configuration> </configuration>
@ -249,8 +253,12 @@
</includes> </includes>
<replacements> <replacements>
<replacement> <replacement>
<token>VERSION = ".*"</token> <token>String VERSION = ".*"</token>
<value>VERSION = "DEV"</value> <value>String VERSION = "DEV"</value>
</replacement>
<replacement>
<token>String GIT_VERSION = ".*"</token>
<value>String GIT_VERSION = "DEV"</value>
</replacement> </replacement>
</replacements> </replacements>
</configuration> </configuration>

Datei anzeigen

@ -86,6 +86,7 @@ public class GeyserConnector {
.enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES); .enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES);
public static final String NAME = "Geyser"; public static final String NAME = "Geyser";
public static final String GIT_VERSION = "DEV"; // A fallback for running in IDEs
public static final String VERSION = "DEV"; // A fallback for running in IDEs public static final String VERSION = "DEV"; // A fallback for running in IDEs
private static final String IP_REGEX = "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b"; private static final String IP_REGEX = "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b";

Datei anzeigen

@ -174,7 +174,7 @@ public class QueryPacketHandler {
gameData.put("hostname", motd); gameData.put("hostname", motd);
gameData.put("gametype", "SMP"); gameData.put("gametype", "SMP");
gameData.put("game_id", "MINECRAFT"); gameData.put("game_id", "MINECRAFT");
gameData.put("version", BedrockProtocol.DEFAULT_BEDROCK_CODEC.getMinecraftVersion()); gameData.put("version", GeyserConnector.NAME + " (" + GeyserConnector.GIT_VERSION + ") " + BedrockProtocol.DEFAULT_BEDROCK_CODEC.getMinecraftVersion());
gameData.put("plugins", ""); gameData.put("plugins", "");
gameData.put("map", map); gameData.put("map", map);
gameData.put("numplayers", currentPlayerCount); gameData.put("numplayers", currentPlayerCount);