Remove Spigot timings

This commit is contained in:
Aikar
2016-03-03 04:00:11 -06:00
parent a371d5fefe
commit 770ee3eebd
19 changed files with 475 additions and 926 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -54,11 +54,23 @@
@@ -54,11 +54,22 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.GameType;
@@ -15,7 +15,6 @@
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.io.IoBuilder;
+import org.bukkit.command.CommandSender;
+import org.bukkit.craftbukkit.SpigotTimings; // Spigot
+import org.bukkit.craftbukkit.util.TerminalCompletionHandler;
+import org.bukkit.craftbukkit.util.TerminalConsoleWriterThread;
+import org.bukkit.event.server.ServerCommandEvent;
@@ -25,7 +24,7 @@
public class DedicatedServer extends MinecraftServer implements ServerInterface {
static final Logger LOGGER = LogUtils.getLogger();
@@ -67,7 +79,7 @@
@@ -67,7 +78,7 @@
private final List<ConsoleInput> consoleInput = Collections.synchronizedList(Lists.newArrayList());
@Nullable
private QueryThreadGs4 queryThreadGs4;
@@ -34,7 +33,7 @@
@Nullable
private RconThread rconThread;
public DedicatedServerSettings settings;
@@ -81,33 +93,99 @@
@@ -81,33 +92,99 @@
private DebugSampleSubscriptionTracker debugSampleSubscriptionTracker;
public ServerLinks serverLinks;
@@ -143,7 +142,7 @@
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
thread.start();
@@ -126,13 +204,25 @@
@@ -126,13 +203,25 @@
this.setPreventProxyConnections(dedicatedserverproperties.preventProxyConnections);
this.setLocalIp(dedicatedserverproperties.serverIp);
}
@@ -170,7 +169,7 @@
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
InetAddress inetaddress = null;
@@ -156,10 +246,23 @@
@@ -156,10 +245,23 @@
return false;
}
@@ -195,7 +194,7 @@
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
}
@@ -170,7 +273,7 @@
@@ -170,7 +272,7 @@
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
return false;
} else {
@@ -204,7 +203,7 @@
this.debugSampleSubscriptionTracker = new DebugSampleSubscriptionTracker(this.getPlayerList());
this.tickTimeLogger = new RemoteSampleLogger(TpsDebugDimensions.values().length, this.debugSampleSubscriptionTracker, RemoteDebugSampleType.TICK_TIME);
long i = Util.getNanos();
@@ -178,13 +281,13 @@
@@ -178,13 +280,13 @@
SkullBlockEntity.setup(this.services, this);
GameProfileCache.setUsesAuthentication(this.usesAuthentication());
DedicatedServer.LOGGER.info("Preparing level \"{}\"", this.getLevelIdName());
@@ -220,7 +219,7 @@
}
if (dedicatedserverproperties.enableQuery) {
@@ -197,7 +300,7 @@
@@ -197,7 +299,7 @@
this.rconThread = RconThread.create(this);
}
@@ -229,20 +228,21 @@
Thread thread1 = new Thread(new ServerWatchdog(this));
thread1.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandlerWithName(DedicatedServer.LOGGER));
@@ -215,6 +318,12 @@
}
}
@@ -213,7 +315,13 @@
return true;
}
+ }
+
+ // Paper start
+ public java.io.File getPluginsFolder() {
+ return (java.io.File) this.options.valueOf("plugins");
+ }
}
+ // Paper end
+
@Override
public boolean isSpawningMonsters() {
return this.settings.getProperties().spawnMonsters && super.isSpawningMonsters();
@@ -293,6 +402,7 @@
@@ -293,6 +401,7 @@
this.queryThreadGs4.stop();
}
@@ -250,7 +250,7 @@
}
@Override
@@ -302,8 +412,8 @@
@@ -302,8 +411,8 @@
}
@Override
@@ -261,11 +261,7 @@
}
public void handleConsoleInput(String command, CommandSourceStack commandSource) {
@@ -311,12 +421,22 @@
}
public void handleConsoleInputs() {
+ SpigotTimings.serverCommandTimer.startTiming(); // Spigot
@@ -314,7 +423,15 @@
while (!this.consoleInput.isEmpty()) {
ConsoleInput servercommand = (ConsoleInput) this.consoleInput.remove(0);
@@ -281,11 +277,8 @@
+ // CraftBukkit end
}
+ SpigotTimings.serverCommandTimer.stopTiming(); // Spigot
}
@Override
@@ -383,7 +503,7 @@
@@ -383,7 +500,7 @@
@Override
public boolean isUnderSpawnProtection(ServerLevel world, BlockPos pos, Player player) {
@@ -294,7 +287,7 @@
return false;
} else if (this.getPlayerList().getOps().isEmpty()) {
return false;
@@ -541,16 +661,52 @@
@@ -541,16 +658,52 @@
@Override
public String getPluginNames() {
@@ -351,7 +344,7 @@
}
public void storeUsingWhiteList(boolean useWhitelist) {
@@ -660,4 +816,15 @@
@@ -660,4 +813,15 @@
}
}
}