Class ServerTextFilter
java.lang.Object
net.minecraft.server.network.ServerTextFilter
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
LegacyTextFilter, PlayerSafetyServiceTextFilter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceprotected static interfaceprotected classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ServerTextFilter.MessageEncoderprivate final URLprivate final ServerTextFilter.IgnoreStrategyprotected static final org.slf4j.Loggerprivate static final ThreadFactoryprivate static final AtomicIntegerprivate final ExecutorService -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedServerTextFilter(URL chatEndpoint, ServerTextFilter.MessageEncoder chatEncoder, ServerTextFilter.IgnoreStrategy chatIgnoreStrategy, ExecutorService workerPool) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected intcreateContext(com.mojang.authlib.GameProfile gameProfile) static @Nullable ServerTextFilterprotected static ExecutorServicecreateWorkerPool(int maxConcurrentRequests) protected voiddrainStream(InputStream input) protected abstract FilteredTextfilterText(String message, ServerTextFilter.IgnoreStrategy ignoreStrategy, JsonObject result) protected static URLgetEndpoint(URI host, @Nullable JsonObject source, String id, String def) protected static StringgetEndpointFromConfig(@Nullable JsonObject source, String id, String def) protected HttpURLConnectiongetURLConnection(URL url) protected HttpURLConnectionmakeRequest(JsonObject payload, URL url) protected FilterMaskparseMask(String message, JsonArray removedChars, ServerTextFilter.IgnoreStrategy ignoreStrategy) private JsonObjectprocessRequestResponse(JsonObject payload, URL url) protected CompletableFuture<FilteredText> requestMessageProcessing(com.mojang.authlib.GameProfile sender, String message, ServerTextFilter.IgnoreStrategy ignoreStrategy, Executor executor) protected abstract voidsetAuthorizationProperty(HttpURLConnection connection)
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
WORKER_COUNT
-
THREAD_FACTORY
-
chatEndpoint
-
chatEncoder
-
chatIgnoreStrategy
-
workerPool
-
-
Constructor Details
-
ServerTextFilter
protected ServerTextFilter(URL chatEndpoint, ServerTextFilter.MessageEncoder chatEncoder, ServerTextFilter.IgnoreStrategy chatIgnoreStrategy, ExecutorService workerPool)
-
-
Method Details
-
createWorkerPool
-
getEndpoint
protected static URL getEndpoint(URI host, @Nullable JsonObject source, String id, String def) throws MalformedURLException - Throws:
MalformedURLException
-
getEndpointFromConfig
-
createFromConfig
-
requestMessageProcessing
protected CompletableFuture<FilteredText> requestMessageProcessing(com.mojang.authlib.GameProfile sender, String message, ServerTextFilter.IgnoreStrategy ignoreStrategy, Executor executor) -
filterText
protected abstract FilteredText filterText(String message, ServerTextFilter.IgnoreStrategy ignoreStrategy, JsonObject result) -
parseMask
protected FilterMask parseMask(String message, JsonArray removedChars, ServerTextFilter.IgnoreStrategy ignoreStrategy) -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
drainStream
- Throws:
IOException
-
processRequestResponse
- Throws:
IOException
-
makeRequest
- Throws:
IOException
-
setAuthorizationProperty
-
connectionReadTimeout
protected int connectionReadTimeout() -
getURLConnection
- Throws:
IOException
-
createContext
-