forked from BLOCKFANTASY/LOOHP-Limbo
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 27aae24015 | |||
| baf75608a3 | |||
| 3993df3017 | |||
| b386d97e7c | |||
| 0c625a2592 | |||
| 2a089bf5aa | |||
| ad284544e5 | |||
| bde2c04127 | |||
| 9beae66898 | |||
| 68a97ec670 | |||
| 835caf7d71 | |||
| 8ec2d34a60 | |||
| 952adcfe87 | |||
| 28d735c912 | |||
| 33dacf02db | |||
| df47c40998 | |||
| 4939d2f9a9 | |||
| 0c7a78924c | |||
| 5a366404ea | |||
| 4f5262620a | |||
| d7e25e82d9 | |||
| a7e53115ab | |||
| 44f89d1021 | |||
| 65ba35997f | |||
| 17c2f58069 | |||
| 292f974681 | |||
| 9cdfbfcfdc | |||
| e63226f05c | |||
| 69d0270925 | |||
| 38f3c41bf5 | |||
| d8d7307fcb | |||
| 75191a83f7 | |||
| 04ed353ab9 | |||
| 502aa78c3b | |||
| 7d9ef7f927 |
@@ -1,8 +1,9 @@
|
||||
# Limbo
|
||||
[](http://ci.loohpjames.com/job/Limbo/)
|
||||
## Standalone Limbo Minecraft Server (Currently 1.21.8)
|
||||
# Limbo
|
||||
## Standalone Limbo Minecraft Server (Currently 26.1.2)
|
||||
|
||||
https://www.spigotmc.org/resources/82468/
|
||||
https://www.spigotmc.org/resources/82468/<br>
|
||||
https://modrinth.com/mod/limbo-server
|
||||
|
||||
### Starting the server
|
||||
Use the following command lines to start the limbo server just like any other Minecraft server
|
||||
@@ -18,7 +19,7 @@ IP: mc.loohpjames.com
|
||||
```
|
||||

|
||||
***
|
||||
### Downloads (1.17.1-1.21.8)
|
||||
### Downloads (1.17.1-26.1.2)
|
||||
- [Jenkins](http://ci.loohpjames.com/job/Limbo/)
|
||||
***
|
||||
### Offical Plugins
|
||||
@@ -52,4 +53,4 @@ It also **supports my development**, take it as an alternative way to donate whi
|
||||
|
||||
**https://www.bisecthosting.com/loohp**
|
||||
|
||||

|
||||
[](https://www.bisecthosting.com/loohp)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
~ This file is part of Limbo.
|
||||
~
|
||||
~ Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
~ Copyright (C) 2022. Contributors
|
||||
~ Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
~ Copyright (C) 2026. Contributors
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
@@ -24,7 +24,7 @@
|
||||
<groupId>com.loohp</groupId>
|
||||
<artifactId>Limbo</artifactId>
|
||||
<name>Limbo</name>
|
||||
<version>0.7.15-ALPHA</version>
|
||||
<version>2026.0.1-ALPHA</version>
|
||||
|
||||
<description>Standalone Limbo Minecraft Server.</description>
|
||||
<url>https://github.com/LOOHP/Limbo</url>
|
||||
@@ -34,8 +34,8 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.build.number></project.build.number>
|
||||
<project.fullVersion>${project.version}</project.fullVersion>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@@ -91,17 +91,17 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.14.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>21</source>
|
||||
<target>21</target>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<version>3.11.2</version>
|
||||
<configuration>
|
||||
<failOnError>false</failOnError>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
@@ -124,7 +124,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<version>3.3.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
@@ -136,7 +136,7 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}-${project.version}-1.21.8</finalName>
|
||||
<finalName>${project.artifactId}-${project.version}-26.1.2</finalName>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
@@ -170,7 +170,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<version>3.3.1</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
@@ -187,7 +187,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<version>3.11.2</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
@@ -206,47 +206,39 @@
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype-oss-snapshots1</id>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>bungeecord-repo</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>maven_central</id>
|
||||
<name>Maven Central</name>
|
||||
<url>https://repo.maven.apache.org/maven2/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.14.0</version>
|
||||
<version>3.18.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.Querz</groupId>
|
||||
<artifactId>NBT</artifactId>
|
||||
<version>5.5</version>
|
||||
<version>6.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.10.1</version>
|
||||
<version>2.13.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>2.3</version>
|
||||
<version>2.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -258,58 +250,58 @@
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-chat</artifactId>
|
||||
<version>1.18-R0.1-SNAPSHOT</version>
|
||||
<version>1.21-R0.3</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-serializer</artifactId>
|
||||
<version>1.21-R0.3</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-text-serializer-gson</artifactId>
|
||||
<version>4.23.0</version>
|
||||
<version>4.26.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-text-serializer-legacy</artifactId>
|
||||
<version>4.23.0</version>
|
||||
<version>4.26.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-text-serializer-plain</artifactId>
|
||||
<version>4.23.0</version>
|
||||
<version>4.26.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-api</artifactId>
|
||||
<version>4.23.0</version>
|
||||
<version>4.26.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-nbt</artifactId>
|
||||
<version>4.23.0</version>
|
||||
<version>4.26.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.fusesource.jansi</groupId>
|
||||
<artifactId>jansi</artifactId>
|
||||
<version>1.18</version>
|
||||
<version>2.4.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline</artifactId>
|
||||
<version>3.16.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jline</groupId>
|
||||
<artifactId>jline</artifactId>
|
||||
<version>2.11</version>
|
||||
<version>3.30.5</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,6 @@ package com.loohp.limbo;
|
||||
import com.loohp.limbo.commands.CommandSender;
|
||||
import com.loohp.limbo.consolegui.ConsoleTextOutput;
|
||||
import com.loohp.limbo.utils.CustomStringUtils;
|
||||
import jline.console.ConsoleReader;
|
||||
import net.kyori.adventure.audience.MessageType;
|
||||
import net.kyori.adventure.bossbar.BossBar;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
@@ -45,6 +44,7 @@ import org.jline.reader.LineReader.SuggestionType;
|
||||
import org.jline.reader.LineReaderBuilder;
|
||||
import org.jline.reader.ParsedLine;
|
||||
import org.jline.reader.UserInterruptException;
|
||||
import org.jline.terminal.Size;
|
||||
import org.jline.terminal.Terminal;
|
||||
import org.jline.terminal.TerminalBuilder;
|
||||
|
||||
@@ -76,7 +76,6 @@ public class Console implements CommandSender {
|
||||
|
||||
private final Terminal terminal;
|
||||
private final LineReader tabReader;
|
||||
private final ConsoleReader reader;
|
||||
|
||||
private final InputStream in;
|
||||
@SuppressWarnings("unused")
|
||||
@@ -86,7 +85,7 @@ public class Console implements CommandSender {
|
||||
protected final PrintStream logs;
|
||||
|
||||
public Console(InputStream in, PrintStream out, PrintStream err) throws IOException {
|
||||
String fileName = new SimpleDateFormat("yyyy'-'MM'-'dd'_'HH'-'mm'-'ss'_'zzz'.log'").format(new Date());
|
||||
String fileName = new SimpleDateFormat("yyyy'-'MM'-'dd'_'HH'-'mm'-'ss'_'zzz'.log'").format(new Date()).replace(":", "");
|
||||
File dir = new File("logs");
|
||||
dir.mkdirs();
|
||||
File logs = new File(dir, fileName);
|
||||
@@ -114,11 +113,7 @@ public class Console implements CommandSender {
|
||||
}) : err, this.logs));
|
||||
this.err = System.err;
|
||||
|
||||
reader = new ConsoleReader(in, out);
|
||||
reader.setExpandEvents(false);
|
||||
reader.setHandleUserInterrupt(false);
|
||||
|
||||
terminal = TerminalBuilder.builder().streams(in, out).system(true).jansi(true).build();
|
||||
terminal = TerminalBuilder.builder().streams(in, out).jansi(true).build();
|
||||
tabReader = LineReaderBuilder.builder().terminal(terminal).completer(new Completer() {
|
||||
@Override
|
||||
public void complete(LineReader reader, ParsedLine line, List<Candidate> candidates) {
|
||||
@@ -129,7 +124,13 @@ public class Console implements CommandSender {
|
||||
}
|
||||
}
|
||||
}).build();
|
||||
tabReader.unsetOpt(LineReader.Option.INSERT_TAB);
|
||||
tabReader.setVariable(LineReader.SECONDARY_PROMPT_PATTERN, "");
|
||||
tabReader.setAutosuggestion(SuggestionType.NONE);
|
||||
|
||||
if (terminal.getWidth() <= 0 || terminal.getHeight() <= 0) {
|
||||
terminal.setSize(new Size(80, 24));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -242,12 +243,8 @@ public class Console implements CommandSender {
|
||||
String date = new SimpleDateFormat("HH':'mm':'ss").format(new Date());
|
||||
ConsoleTextOutput.appendText(ChatColor.stripColor("[" + date + " Info] " + message), true);
|
||||
logs.println(ChatColor.stripColor("[" + date + " Info] " + message));
|
||||
try {
|
||||
reader.getOutput().append("[" + date + " Info] " + translateToConsole(message) + "\n");
|
||||
reader.getOutput().flush();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
terminal.writer().append("[").append(date).append(" Info] ").append(translateToConsole(message)).append("\n");
|
||||
terminal.writer().flush();
|
||||
unstashLine();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -132,8 +132,8 @@ public final class Limbo {
|
||||
|
||||
//===========================
|
||||
|
||||
public final String SERVER_IMPLEMENTATION_VERSION = "1.21.8";
|
||||
public final int SERVER_IMPLEMENTATION_PROTOCOL = 772;
|
||||
public final String SERVER_IMPLEMENTATION_VERSION = "26.1.2";
|
||||
public final int SERVER_IMPLEMENTATION_PROTOCOL = 775;
|
||||
public final String LIMBO_IMPLEMENTATION_VERSION;
|
||||
|
||||
private final AtomicBoolean isRunning;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -85,6 +85,7 @@ public class Unsafe {
|
||||
public void a(Player player) {
|
||||
instance.playersByName.put(player.getName(), player);
|
||||
instance.playersByUUID.put(player.getUniqueId(), player);
|
||||
instance.getMetrics().updatePlayersCount();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,12 +21,12 @@ package com.loohp.limbo.consolegui;
|
||||
|
||||
import com.loohp.limbo.Limbo;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class SystemInfo {
|
||||
|
||||
@SuppressWarnings("InfiniteLoopStatement")
|
||||
public static void printInfo() {
|
||||
if (!Limbo.noGui) {
|
||||
while (true) {
|
||||
@@ -47,11 +47,11 @@ public class SystemInfo {
|
||||
|
||||
try {
|
||||
@SuppressWarnings("restriction")
|
||||
com.sun.management.OperatingSystemMXBean operatingSystemMXBean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
|
||||
com.sun.management.OperatingSystemMXBean operatingSystemMXBean = (com.sun.management.OperatingSystemMXBean) java.lang.management.ManagementFactory.getOperatingSystemMXBean();
|
||||
@SuppressWarnings("restriction")
|
||||
double processLoad = operatingSystemMXBean.getProcessCpuLoad();
|
||||
@SuppressWarnings("restriction")
|
||||
double systemLoad = operatingSystemMXBean.getSystemCpuLoad();
|
||||
double systemLoad = operatingSystemMXBean.getCpuLoad();
|
||||
int processors = runtime.availableProcessors();
|
||||
|
||||
sb.append("Available Processors: ").append(processors).append("\n");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2023. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2023. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.loohp.limbo.inventory;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.loohp.limbo.inventory;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.loohp.limbo.inventory;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.loohp.limbo.location;
|
||||
|
||||
import com.loohp.limbo.world.BlockPosition;
|
||||
import com.loohp.limbo.world.World;
|
||||
|
||||
public class GlobalPos {
|
||||
|
||||
private final World world;
|
||||
private final BlockPosition pos;
|
||||
|
||||
public GlobalPos(World world, BlockPosition pos) {
|
||||
this.world = world;
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
public BlockPosition getPos() {
|
||||
return pos;
|
||||
}
|
||||
|
||||
public static GlobalPos from(Location location) {
|
||||
return new GlobalPos(location.getWorld(), BlockPosition.from(location));
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,6 +39,7 @@ import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
/**
|
||||
@@ -49,6 +50,9 @@ import java.util.zip.GZIPOutputStream;
|
||||
@SuppressWarnings("unchecked")
|
||||
public class Metrics {
|
||||
|
||||
// The name of the server software
|
||||
private static final String SERVER_SOFTWARE = "Limbo";
|
||||
|
||||
// The version of this bStats class
|
||||
public static final int B_STATS_VERSION = 1;
|
||||
|
||||
@@ -58,29 +62,15 @@ public class Metrics {
|
||||
// Should failed requests be logged?
|
||||
private static boolean logFailedRequests = false;
|
||||
|
||||
// The name of the server software
|
||||
private final String name;
|
||||
|
||||
// The uuid of the server
|
||||
private final String serverUUID;
|
||||
|
||||
private final String limboVersion;
|
||||
|
||||
// A list with all custom charts
|
||||
private final List<CustomChart> charts = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param name The name of the server software.
|
||||
* @param serverUUID The uuid of the server.
|
||||
* @param logFailedRequests Whether failed requests should be logged or not.
|
||||
* @param logger The logger for the failed requests.
|
||||
* @throws IOException
|
||||
*/
|
||||
public Metrics() throws IOException {
|
||||
name = "Limbo";
|
||||
private final AtomicInteger maxPlayerCountInPeriod = new AtomicInteger(0);
|
||||
|
||||
public Metrics() throws IOException {
|
||||
// Get the config file
|
||||
File configFile = new File("plugins/bStats", "config.yml");
|
||||
FileConfiguration config = new FileConfiguration(configFile);
|
||||
@@ -109,8 +99,6 @@ public class Metrics {
|
||||
}
|
||||
}
|
||||
|
||||
limboVersion = Limbo.getInstance().LIMBO_IMPLEMENTATION_VERSION;
|
||||
|
||||
// Load the data
|
||||
serverUUID = config.get("serverUuid", String.class);
|
||||
logFailedRequests = config.get("logFailedRequests", Boolean.class);
|
||||
@@ -118,26 +106,16 @@ public class Metrics {
|
||||
startSubmitting();
|
||||
}
|
||||
|
||||
addCustomChart(new Metrics.SingleLineChart("players", new Callable<Integer>() {
|
||||
@Override
|
||||
public Integer call() throws Exception {
|
||||
return Limbo.getInstance().getPlayers().size();
|
||||
addCustomChart(new Metrics.SingleLineChart("players", () -> maxPlayerCountInPeriod.getAndSet(0)));
|
||||
addCustomChart(new Metrics.SimplePie("limbo_version", () -> Limbo.getInstance().LIMBO_IMPLEMENTATION_VERSION));
|
||||
addCustomChart(new Metrics.SimplePie("minecraftVersion", () -> Limbo.getInstance().SERVER_IMPLEMENTATION_VERSION));
|
||||
}
|
||||
}));
|
||||
|
||||
addCustomChart(new Metrics.SimplePie("limbo_version", new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return limboVersion;
|
||||
}
|
||||
}));
|
||||
|
||||
addCustomChart(new Metrics.SimplePie("minecraftVersion", new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return Limbo.getInstance().SERVER_IMPLEMENTATION_VERSION;
|
||||
}
|
||||
}));
|
||||
/**
|
||||
* Record the max player count for the last update period.
|
||||
*/
|
||||
public void updatePlayersCount() {
|
||||
maxPlayerCountInPeriod.getAndUpdate(i -> Math.max(i, Limbo.getInstance().getPlayers().size()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,7 +154,7 @@ public class Metrics {
|
||||
private JSONObject getPluginData() {
|
||||
JSONObject data = new JSONObject();
|
||||
|
||||
data.put("pluginName", name); // Append the name of the server software
|
||||
data.put("pluginName", SERVER_SOFTWARE); // Append the name of the server software
|
||||
JSONArray customCharts = new JSONArray();
|
||||
for (CustomChart customChart : charts) {
|
||||
// Add the data of the custom charts
|
||||
@@ -232,7 +210,7 @@ public class Metrics {
|
||||
} catch (Exception e) {
|
||||
// Something went wrong! :(
|
||||
if (logFailedRequests) {
|
||||
Limbo.getInstance().getConsole().sendMessage("Could not submit stats of " + name + "\n" + e);
|
||||
Limbo.getInstance().getConsole().sendMessage("Could not submit stats of " + SERVER_SOFTWARE + "\n" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,9 +40,11 @@ import com.loohp.limbo.file.ServerProperties;
|
||||
import com.loohp.limbo.inventory.AnvilInventory;
|
||||
import com.loohp.limbo.inventory.Inventory;
|
||||
import com.loohp.limbo.inventory.ItemStack;
|
||||
import com.loohp.limbo.location.GlobalPos;
|
||||
import com.loohp.limbo.location.Location;
|
||||
import com.loohp.limbo.network.protocol.packets.ClientboundFinishConfigurationPacket;
|
||||
import com.loohp.limbo.network.protocol.packets.ClientboundRegistryDataPacket;
|
||||
import com.loohp.limbo.network.protocol.packets.ClientboundUpdateTagsPacket;
|
||||
import com.loohp.limbo.network.protocol.packets.PacketHandshakingIn;
|
||||
import com.loohp.limbo.network.protocol.packets.PacketIn;
|
||||
import com.loohp.limbo.network.protocol.packets.PacketLoginInLoginStart;
|
||||
@@ -110,7 +112,6 @@ import com.loohp.limbo.utils.GameMode;
|
||||
import com.loohp.limbo.utils.InventoryClickUtils;
|
||||
import com.loohp.limbo.utils.MojangAPIUtils;
|
||||
import com.loohp.limbo.utils.MojangAPIUtils.SkinResponse;
|
||||
import com.loohp.limbo.world.BlockPosition;
|
||||
import com.loohp.limbo.world.BlockState;
|
||||
import com.loohp.limbo.world.World;
|
||||
import net.kyori.adventure.key.Key;
|
||||
@@ -149,23 +150,28 @@ import java.util.TimerTask;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ClientConnection extends Thread {
|
||||
public class ClientConnection implements Runnable {
|
||||
|
||||
private static final Key DEFAULT_HANDLER_NAMESPACE = Key.key("default");
|
||||
private static final String BRAND_ANNOUNCE_CHANNEL = Key.key("brand").toString();
|
||||
|
||||
private final Random random = new Random();
|
||||
private final Socket clientSocket;
|
||||
private final Lock packetSendLock = new ReentrantLock();
|
||||
protected Channel channel;
|
||||
private boolean running;
|
||||
private volatile ClientState state;
|
||||
|
||||
private final AtomicLong lastPacketTimestamp;
|
||||
private final AtomicLong lastKeepAlivePayLoad;
|
||||
private final AtomicLong lastKeepAliveResponse;
|
||||
|
||||
private Player player;
|
||||
private TimerTask keepAliveTask;
|
||||
private AtomicLong lastPacketTimestamp;
|
||||
private AtomicLong lastKeepAlivePayLoad;
|
||||
private InetAddress inetAddress;
|
||||
private boolean ready;
|
||||
|
||||
@@ -174,6 +180,7 @@ public class ClientConnection extends Thread {
|
||||
this.inetAddress = clientSocket.getInetAddress();
|
||||
this.lastPacketTimestamp = new AtomicLong(-1);
|
||||
this.lastKeepAlivePayLoad = new AtomicLong(-1);
|
||||
this.lastKeepAliveResponse = new AtomicLong(-1);
|
||||
this.channel = null;
|
||||
this.running = false;
|
||||
this.ready = false;
|
||||
@@ -191,6 +198,10 @@ public class ClientConnection extends Thread {
|
||||
this.lastKeepAlivePayLoad.set(payLoad);
|
||||
}
|
||||
|
||||
public long getLastKeepAliveResponse() {
|
||||
return lastKeepAliveResponse.get();
|
||||
}
|
||||
|
||||
public long getLastPacketTimestamp() {
|
||||
return lastPacketTimestamp.get();
|
||||
}
|
||||
@@ -232,10 +243,15 @@ public class ClientConnection extends Thread {
|
||||
sendPacket(packet);
|
||||
}
|
||||
|
||||
public synchronized void sendPacket(PacketOut packet) throws IOException {
|
||||
public void sendPacket(PacketOut packet) throws IOException {
|
||||
packetSendLock.lock();
|
||||
try {
|
||||
if (channel.writePacket(packet)) {
|
||||
setLastPacketTimestamp(System.currentTimeMillis());
|
||||
}
|
||||
} finally {
|
||||
packetSendLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public void disconnect(BaseComponent[] reason) {
|
||||
@@ -249,6 +265,9 @@ public class ClientConnection extends Thread {
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
try {
|
||||
ServerProperties properties = Limbo.getInstance().getServerProperties();
|
||||
String str = (properties.isLogPlayerIPAddresses() ? inetAddress.getHostName() : "<ip address withheld>") + ":" + clientSocket.getPort();
|
||||
Limbo.getInstance().getConsole().sendMessage("[/" + str + "] <-> Player disconnected with the reason " + PlainTextComponentSerializer.plainText().serialize(reason));
|
||||
clientSocket.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
@@ -556,6 +575,9 @@ public class ClientConnection extends Thread {
|
||||
sendPacket(registryDataPacket);
|
||||
}
|
||||
|
||||
ClientboundUpdateTagsPacket updateTagsPacket = new ClientboundUpdateTagsPacket(RegistryCustom.getRegistries());
|
||||
sendPacket(updateTagsPacket);
|
||||
|
||||
ClientboundFinishConfigurationPacket clientboundFinishConfigurationPacket = new ClientboundFinishConfigurationPacket();
|
||||
sendPacket(clientboundFinishConfigurationPacket);
|
||||
|
||||
@@ -609,7 +631,7 @@ public class ClientConnection extends Thread {
|
||||
sendPacket(declare);
|
||||
}
|
||||
|
||||
PacketPlayOutSpawnPosition spawnPos = new PacketPlayOutSpawnPosition(BlockPosition.from(worldSpawn), worldSpawn.getPitch());
|
||||
PacketPlayOutSpawnPosition spawnPos = new PacketPlayOutSpawnPosition(GlobalPos.from(worldSpawn), worldSpawn.getYaw(), worldSpawn.getPitch());
|
||||
sendPacket(spawnPos);
|
||||
|
||||
PacketPlayOutPositionAndLook positionLook = new PacketPlayOutPositionAndLook(worldSpawn.getX(), worldSpawn.getY(), worldSpawn.getZ(), worldSpawn.getYaw(), worldSpawn.getPitch(), 1);
|
||||
@@ -648,22 +670,21 @@ public class ClientConnection extends Thread {
|
||||
keepAliveTask = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (state.equals(ClientState.DISCONNECTED)) {
|
||||
if (state != ClientState.PLAY || !ready) {
|
||||
this.cancel();
|
||||
} else if (ready && state.equals(ClientState.PLAY)) {
|
||||
}
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
if (now - getLastPacketTimestamp() > 15000) {
|
||||
PacketPlayOutKeepAlive keepAlivePacket = new PacketPlayOutKeepAlive(now);
|
||||
PacketPlayOutKeepAlive keepAlive = new PacketPlayOutKeepAlive(now);
|
||||
try {
|
||||
sendPacket(keepAlivePacket);
|
||||
sendPacket(keepAlive);
|
||||
setLastKeepAlivePayLoad(now);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
};
|
||||
new Timer().schedule(keepAliveTask, 5000, 10000);
|
||||
new Timer().schedule(keepAliveTask, 0, 10000);
|
||||
|
||||
while (clientSocket.isConnected()) {
|
||||
try {
|
||||
@@ -715,12 +736,12 @@ public class ClientConnection extends Thread {
|
||||
processMoveEvent.consume(event, to);
|
||||
}
|
||||
} else if (packetIn instanceof PacketPlayInKeepAlive) {
|
||||
long lastPayload = getLastKeepAlivePayLoad();
|
||||
PacketPlayInKeepAlive alive = (PacketPlayInKeepAlive) packetIn;
|
||||
if (lastPayload == -1) {
|
||||
Limbo.getInstance().getConsole().sendMessage("Unsolicited KeepAlive packet for player " + player.getName());
|
||||
} else if (alive.getPayload() != lastPayload) {
|
||||
Limbo.getInstance().getConsole().sendMessage("Incorrect Payload received in KeepAlive packet for player " + player.getName());
|
||||
|
||||
if (alive.getPayload() == getLastKeepAlivePayLoad()) {
|
||||
lastKeepAliveResponse.set(System.currentTimeMillis());
|
||||
} else {
|
||||
disconnect(Component.text("Bad Keepalive Payload"));
|
||||
break;
|
||||
}
|
||||
} else if (packetIn instanceof PacketPlayInTabComplete) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,23 +27,29 @@ import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class ServerConnection extends Thread {
|
||||
|
||||
private final String ip;
|
||||
private final int port;
|
||||
private final boolean silent;
|
||||
private final ExecutorService executorService;
|
||||
private final List<ClientConnection> clients;
|
||||
|
||||
private ServerSocket serverSocket;
|
||||
private List<ClientConnection> clients;
|
||||
|
||||
public ServerConnection(String ip, int port, boolean silent) {
|
||||
this.clients = new ArrayList<>();
|
||||
this.ip = ip;
|
||||
this.port = port;
|
||||
this.silent = silent;
|
||||
this.executorService = Executors.newVirtualThreadPerTaskExecutor();
|
||||
start();
|
||||
}
|
||||
|
||||
@SuppressWarnings("InfiniteLoopStatement")
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
@@ -53,11 +59,11 @@ public class ServerConnection extends Thread {
|
||||
}
|
||||
while (true) {
|
||||
Socket connection = serverSocket.accept();
|
||||
ClientConnection sc = new ClientConnection(connection);
|
||||
clients.add(sc);
|
||||
sc.start();
|
||||
ClientConnection clientTask = new ClientConnection(connection);
|
||||
clients.add(clientTask);
|
||||
executorService.submit(clientTask);
|
||||
}
|
||||
} catch(IOException e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2023. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2023. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+4
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -146,6 +146,7 @@ public class ClientboundLevelChunkWithLightPacket extends PacketOut {
|
||||
}
|
||||
}
|
||||
dataOut.writeShort(counter);
|
||||
dataOut.writeShort(0);
|
||||
|
||||
int newBits = 32 - Integer.numberOfLeadingZeros(section.getPalette().size() - 1);
|
||||
newBits = Math.max(newBits, 4);
|
||||
@@ -223,6 +224,7 @@ public class ClientboundLevelChunkWithLightPacket extends PacketOut {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dataOut.writeShort(0);
|
||||
dataOut.writeShort(0);
|
||||
dataOut.writeByte(0);
|
||||
DataTypeIO.writeVarInt(dataOut, 0);
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2023. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2023. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.loohp.limbo.network.protocol.packets;
|
||||
|
||||
import com.loohp.limbo.registry.PacketRegistry;
|
||||
import com.loohp.limbo.registry.RegistryCustom;
|
||||
import com.loohp.limbo.utils.DataTypeIO;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.kyori.adventure.key.Key;
|
||||
|
||||
public class ClientboundUpdateTagsPacket extends PacketOut {
|
||||
|
||||
private final Collection<RegistryCustom> registries;
|
||||
|
||||
public ClientboundUpdateTagsPacket(Collection<RegistryCustom> registries) {
|
||||
this.registries = registries;
|
||||
}
|
||||
|
||||
public Collection<RegistryCustom> getRegistries() {
|
||||
return registries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] serializePacket() throws IOException {
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
|
||||
DataOutputStream output = new DataOutputStream(buffer);
|
||||
output.writeByte(PacketRegistry.getPacketId(getClass()));
|
||||
|
||||
DataTypeIO.writeVarInt(output, registries.size());
|
||||
for (RegistryCustom registry : registries) {
|
||||
DataTypeIO.writeString(output, registry.getIdentifier().asString(), StandardCharsets.UTF_8);
|
||||
DataTypeIO.writeVarInt(output, registry.getTags().size());
|
||||
for (Map.Entry<Key, List<RegistryCustom.Tag>> entry : registry.getTags().entrySet()) {
|
||||
DataTypeIO.writeString(output, entry.getKey().asString(), StandardCharsets.UTF_8);
|
||||
List<Integer> tagIds = transformTags(registry, entry.getValue());
|
||||
DataTypeIO.writeVarInt(output, tagIds.size());
|
||||
for (int value : tagIds) {
|
||||
DataTypeIO.writeVarInt(output, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return buffer.toByteArray();
|
||||
}
|
||||
|
||||
private static List<Integer> transformTags(RegistryCustom registry, List<RegistryCustom.Tag> tags) {
|
||||
List<Integer> tagIds = new ArrayList<>();
|
||||
for (RegistryCustom.Tag value : tags) {
|
||||
if (value.isReference()) {
|
||||
List<RegistryCustom.Tag> referencedTags = registry.getTags().get(value.key());
|
||||
if (referencedTags != null) {
|
||||
tagIds.addAll(transformTags(registry, referencedTags));
|
||||
}
|
||||
} else {
|
||||
int index = registry.indexOf(value.key());
|
||||
if (index >= 0) {
|
||||
tagIds.add(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tagIds;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This file is part of Limbo.
|
||||
*
|
||||
* Copyright (C) 2022. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2022. Contributors
|
||||
* Copyright (C) 2026. LoohpJames <jamesloohp@gmail.com>
|
||||
* Copyright (C) 2026. Contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user