mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 11:22:01 +01:00
Change the reserved channel check to be sensible (#1610)
This commit is contained in:
parent
5145db07be
commit
c9340dc439
@ -39,4 +39,5 @@ willies952002 <admin@domnian.com>
|
||||
MicleBrick <miclebrick@outlook.com>
|
||||
Trigary <trigary0@gmail.com>
|
||||
rickyboy320 <rickw320@hotmail.com>
|
||||
DoNotSpamPls <7570108+DoNotSpamPls@users.noreply.github.com>
|
||||
```
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: DoNotSpamPls <7570108+DoNotSpamPls@users.noreply.github.com>
|
||||
Date: Tue, 23 Oct 2018 19:32:55 +0300
|
||||
Subject: [PATCH] Change the reserved channel check to be sensible
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java
|
||||
index f21cae72..865028d3 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java
|
||||
@@ -0,0 +0,0 @@ public class StandardMessenger implements Messenger {
|
||||
public boolean isReservedChannel(String channel) {
|
||||
channel = validateAndCorrectChannel(channel);
|
||||
|
||||
- return channel.contains("minecraft") && !channel.equals("minecraft:brand");
|
||||
+ return channel.equals("minecraft:register") || channel.equals("minecraft:unregister"); // Paper
|
||||
}
|
||||
|
||||
public void registerOutgoingPluginChannel(Plugin plugin, String channel) {
|
||||
diff --git a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java
|
||||
index c15fa003..31ff2f61 100644
|
||||
--- a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java
|
||||
+++ b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java
|
||||
@@ -0,0 +0,0 @@ public class StandardMessengerTest {
|
||||
assertTrue(messenger.isReservedChannel("minecraft:register"));
|
||||
assertFalse(messenger.isReservedChannel("test:register"));
|
||||
assertTrue(messenger.isReservedChannel("minecraft:unregister"));
|
||||
- assertFalse(messenger.isReservedChannel("test:nregister"));
|
||||
- assertTrue(messenger.isReservedChannel("minecraft:something"));
|
||||
+ assertFalse(messenger.isReservedChannel("test:unregister")); // Paper - fix typo
|
||||
+ assertFalse(messenger.isReservedChannel("minecraft:something")); // Paper - now less strict
|
||||
assertFalse(messenger.isReservedChannel("minecraft:brand"));
|
||||
}
|
||||
|
||||
--
|
@ -7,28 +7,28 @@ Mojang was sleeping even if we had no more requests to go after
|
||||
the current one finished, resulting in 100ms lost per profile lookup
|
||||
|
||||
diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
index 26a743722..6ed3199c3 100644
|
||||
index 71e48e87b..23f1447cf 100644
|
||||
--- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
+++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
@@ -0,0 +0,0 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository {
|
||||
}
|
||||
|
||||
final int page = 0;
|
||||
}
|
||||
|
||||
final int page = 0;
|
||||
+ boolean hasRequested = false; // Paper
|
||||
|
||||
for (final List<String> request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) {
|
||||
int failCount = 0;
|
||||
|
||||
for (final List<String> request : Iterables.partition(criteria, ENTRIES_PER_PAGE)) {
|
||||
int failCount = 0;
|
||||
@@ -0,0 +0,0 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository {
|
||||
LOGGER.debug("Couldn't find profile {}", name);
|
||||
callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile"));
|
||||
}
|
||||
LOGGER.debug("Couldn't find profile {}", name);
|
||||
callback.onProfileLookupFailed(new GameProfile(null, name), new ProfileNotFoundException("Server did not find the requested profile"));
|
||||
}
|
||||
+ // Paper start
|
||||
+ if (!hasRequested) {
|
||||
+ hasRequested = true;
|
||||
+ continue;
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
try {
|
||||
Thread.sleep(DELAY_BETWEEN_PAGES);
|
||||
|
||||
try {
|
||||
Thread.sleep(DELAY_BETWEEN_PAGES);
|
||||
--
|
Loading…
Reference in New Issue
Block a user