mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Allow Disabling of Command Logging
By: md_5 <git@md-5.net>
This commit is contained in:
parent
135df938cc
commit
0eed728812
@ -959,12 +959,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1564,8 +2066,122 @@
|
||||
}
|
||||
|
||||
@@ -1566,6 +2068,121 @@
|
||||
return false;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
+ // CraftBukkit start - add method
|
||||
+ public void chat(String s, PlayerChatMessage original, boolean async) {
|
||||
+ if (s.isEmpty() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) {
|
||||
@ -1049,10 +1047,11 @@
|
||||
+ this.server.console.sendMessage(s);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ private void handleCommand(String s) {
|
||||
+ org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot
|
||||
+ if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
|
||||
+ this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
|
||||
+
|
||||
+ CraftPlayer player = this.getCraftPlayer();
|
||||
@ -1082,7 +1081,7 @@
|
||||
private PlayerChatMessage getSignedMessage(ServerboundChatPacket packet, LastSeenMessages lastSeenMessages) throws SignedMessageChain.DecodeException {
|
||||
SignedMessageBody signedmessagebody = new SignedMessageBody(packet.message(), packet.timeStamp(), packet.salt(), lastSeenMessages);
|
||||
|
||||
@@ -1573,13 +2189,33 @@
|
||||
@@ -1573,13 +2190,33 @@
|
||||
}
|
||||
|
||||
private void broadcastChatMessage(PlayerChatMessage message) {
|
||||
@ -1119,7 +1118,7 @@
|
||||
this.disconnect((Component) Component.translatable("disconnect.spam"));
|
||||
}
|
||||
|
||||
@@ -1601,7 +2237,33 @@
|
||||
@@ -1601,7 +2238,33 @@
|
||||
@Override
|
||||
public void handleAnimate(ServerboundSwingPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -1153,7 +1152,7 @@
|
||||
this.player.swing(packet.getHand());
|
||||
}
|
||||
|
||||
@@ -1609,6 +2271,29 @@
|
||||
@@ -1609,6 +2272,29 @@
|
||||
public void handlePlayerCommand(ServerboundPlayerCommandPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
if (this.player.hasClientLoaded()) {
|
||||
@ -1183,7 +1182,7 @@
|
||||
this.player.resetLastActionTime();
|
||||
Entity entity;
|
||||
PlayerRideableJumping ijumpable;
|
||||
@@ -1691,6 +2376,12 @@
|
||||
@@ -1691,6 +2377,12 @@
|
||||
}
|
||||
|
||||
public void sendPlayerChatMessage(PlayerChatMessage message, ChatType.Bound params) {
|
||||
@ -1196,7 +1195,7 @@
|
||||
this.send(new ClientboundPlayerChatPacket(message.link().sender(), message.link().index(), message.signature(), message.signedBody().pack(this.messageSignatureCache), message.unsignedContent(), message.filterMask(), params));
|
||||
this.addPendingMessage(message);
|
||||
}
|
||||
@@ -1718,6 +2409,7 @@
|
||||
@@ -1718,6 +2410,7 @@
|
||||
@Override
|
||||
public void handleInteract(ServerboundInteractPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -1204,7 +1203,7 @@
|
||||
if (this.player.hasClientLoaded()) {
|
||||
final ServerLevel worldserver = this.player.serverLevel();
|
||||
final Entity entity = packet.getTarget(worldserver);
|
||||
@@ -1733,20 +2425,58 @@
|
||||
@@ -1733,20 +2426,58 @@
|
||||
|
||||
if (this.player.canInteractWithEntity(axisalignedbb, 3.0D)) {
|
||||
packet.dispatch(new ServerboundInteractPacket.Handler() {
|
||||
@ -1267,7 +1266,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1755,19 +2485,20 @@
|
||||
@@ -1755,19 +2486,20 @@
|
||||
|
||||
@Override
|
||||
public void onInteraction(InteractionHand hand) {
|
||||
@ -1291,7 +1290,7 @@
|
||||
label23:
|
||||
{
|
||||
if (entity instanceof AbstractArrow) {
|
||||
@@ -1785,6 +2516,11 @@
|
||||
@@ -1785,6 +2517,11 @@
|
||||
}
|
||||
|
||||
ServerGamePacketListenerImpl.this.player.attack(entity);
|
||||
@ -1303,7 +1302,7 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1809,7 +2545,7 @@
|
||||
@@ -1809,7 +2546,7 @@
|
||||
case PERFORM_RESPAWN:
|
||||
if (this.player.wonGame) {
|
||||
this.player.wonGame = false;
|
||||
@ -1312,7 +1311,7 @@
|
||||
this.resetPosition();
|
||||
CriteriaTriggers.CHANGED_DIMENSION.trigger(this.player, Level.END, Level.OVERWORLD);
|
||||
} else {
|
||||
@@ -1817,11 +2553,11 @@
|
||||
@@ -1817,11 +2554,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1326,7 +1325,7 @@
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1834,15 +2570,21 @@
|
||||
@@ -1834,15 +2571,21 @@
|
||||
@Override
|
||||
public void handleContainerClose(ServerboundContainerClosePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -1350,7 +1349,7 @@
|
||||
this.player.containerMenu.sendAllDataToRemote();
|
||||
} else if (!this.player.containerMenu.stillValid(this.player)) {
|
||||
ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
|
||||
@@ -1855,7 +2597,284 @@
|
||||
@@ -1855,7 +2598,284 @@
|
||||
boolean flag = packet.getStateId() != this.player.containerMenu.getStateId();
|
||||
|
||||
this.player.containerMenu.suppressRemoteUpdates();
|
||||
@ -1636,7 +1635,7 @@
|
||||
ObjectIterator objectiterator = Int2ObjectMaps.fastIterable(packet.getChangedSlots()).iterator();
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
@@ -1901,8 +2920,22 @@
|
||||
@@ -1901,8 +2921,22 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1660,7 +1659,7 @@
|
||||
if (containerrecipebook_a == RecipeBookMenu.PostPlaceAction.PLACE_GHOST_RECIPE) {
|
||||
this.player.connection.send(new ClientboundPlaceGhostRecipePacket(this.player.containerMenu.containerId, craftingmanager_d.display().display()));
|
||||
}
|
||||
@@ -1917,6 +2950,7 @@
|
||||
@@ -1917,6 +2951,7 @@
|
||||
@Override
|
||||
public void handleContainerButtonClick(ServerboundContainerButtonClickPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -1668,7 +1667,7 @@
|
||||
this.player.resetLastActionTime();
|
||||
if (this.player.containerMenu.containerId == packet.containerId() && !this.player.isSpectator()) {
|
||||
if (!this.player.containerMenu.stillValid(this.player)) {
|
||||
@@ -1945,7 +2979,44 @@
|
||||
@@ -1945,7 +2980,44 @@
|
||||
|
||||
boolean flag1 = packet.slotNum() >= 1 && packet.slotNum() <= 45;
|
||||
boolean flag2 = itemstack.isEmpty() || itemstack.getCount() <= itemstack.getMaxStackSize();
|
||||
@ -1713,7 +1712,7 @@
|
||||
if (flag1 && flag2) {
|
||||
this.player.inventoryMenu.getSlot(packet.slotNum()).setByPlayer(itemstack);
|
||||
this.player.inventoryMenu.setRemoteSlot(packet.slotNum(), itemstack);
|
||||
@@ -1972,6 +3043,7 @@
|
||||
@@ -1972,6 +3044,7 @@
|
||||
}
|
||||
|
||||
private void updateSignText(ServerboundSignUpdatePacket packet, List<FilteredText> signText) {
|
||||
@ -1721,7 +1720,7 @@
|
||||
this.player.resetLastActionTime();
|
||||
ServerLevel worldserver = this.player.serverLevel();
|
||||
BlockPos blockposition = packet.getPos();
|
||||
@@ -1993,7 +3065,17 @@
|
||||
@@ -1993,7 +3066,17 @@
|
||||
@Override
|
||||
public void handlePlayerAbilities(ServerboundPlayerAbilitiesPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@ -1740,7 +1739,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2058,7 +3140,7 @@
|
||||
@@ -2058,7 +3141,7 @@
|
||||
if (!this.waitingForSwitchToConfig) {
|
||||
throw new IllegalStateException("Client acknowledged config, but none was requested");
|
||||
} else {
|
||||
@ -1749,7 +1748,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2083,8 +3165,10 @@
|
||||
@@ -2083,8 +3166,10 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -150,4 +150,10 @@ public class SpigotConfig
|
||||
SpigotConfig.config.addDefault( path, def );
|
||||
return SpigotConfig.config.getDouble( path, SpigotConfig.config.getDouble( path ) );
|
||||
}
|
||||
|
||||
public static boolean logCommands;
|
||||
private static void logCommands()
|
||||
{
|
||||
SpigotConfig.logCommands = SpigotConfig.getBoolean( "commands.log", true );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user