Package net.minecraft.server.network
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 interface
protected static interface
protected class
protected static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ServerTextFilter.MessageEncoder
private final URL
(package private) final ServerTextFilter.IgnoreStrategy
protected static final org.slf4j.Logger
private static final ThreadFactory
private static final AtomicInteger
(package private) final ExecutorService
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ServerTextFilter
(URL pChatEndpoint, ServerTextFilter.MessageEncoder pChatEncoder, ServerTextFilter.IgnoreStrategy pChatIgnoreStrategy, ExecutorService pWorkerPool) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected int
createContext
(com.mojang.authlib.GameProfile pProfile) static ServerTextFilter
protected static ExecutorService
createWorkerPool
(int pSize) protected void
drainStream
(InputStream pStream) protected abstract FilteredText
filterText
(String pText, ServerTextFilter.IgnoreStrategy pIgnoreStrategy, JsonObject pResponse) protected static URL
getEndpoint
(URI pApiServer, JsonObject pJson, String pKey, String pFallback) protected static String
getEndpointFromConfig
(JsonObject pJson, String pKey, String pFallback) protected HttpURLConnection
getURLConnection
(URL pUrl) protected HttpURLConnection
makeRequest
(JsonObject pRequest, URL pEndpoint) protected FilterMask
parseMask
(String pText, JsonArray pHashes, ServerTextFilter.IgnoreStrategy pIgnoreStrategy) private JsonObject
processRequestResponse
(JsonObject pRequest, URL pEndpoint) protected CompletableFuture
<FilteredText> requestMessageProcessing
(com.mojang.authlib.GameProfile pProfile, String pFilter, ServerTextFilter.IgnoreStrategy pChatIgnoreStrategy, Executor pStreamExecutor) protected abstract void
setAuthorizationProperty
(HttpURLConnection pConnection)
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
WORKER_COUNT
-
THREAD_FACTORY
-
chatEndpoint
-
chatEncoder
-
chatIgnoreStrategy
-
workerPool
-
-
Constructor Details
-
ServerTextFilter
protected ServerTextFilter(URL pChatEndpoint, ServerTextFilter.MessageEncoder pChatEncoder, ServerTextFilter.IgnoreStrategy pChatIgnoreStrategy, ExecutorService pWorkerPool)
-
-
Method Details
-
createWorkerPool
-
getEndpoint
protected static URL getEndpoint(URI pApiServer, @Nullable JsonObject pJson, String pKey, String pFallback) throws MalformedURLException - Throws:
MalformedURLException
-
getEndpointFromConfig
protected static String getEndpointFromConfig(@Nullable JsonObject pJson, String pKey, String pFallback) -
createFromConfig
-
requestMessageProcessing
protected CompletableFuture<FilteredText> requestMessageProcessing(com.mojang.authlib.GameProfile pProfile, String pFilter, ServerTextFilter.IgnoreStrategy pChatIgnoreStrategy, Executor pStreamExecutor) -
filterText
protected abstract FilteredText filterText(String pText, ServerTextFilter.IgnoreStrategy pIgnoreStrategy, JsonObject pResponse) -
parseMask
protected FilterMask parseMask(String pText, JsonArray pHashes, ServerTextFilter.IgnoreStrategy pIgnoreStrategy) -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
drainStream
- Throws:
IOException
-
processRequestResponse
- Throws:
IOException
-
makeRequest
- Throws:
IOException
-
setAuthorizationProperty
-
connectionReadTimeout
protected int connectionReadTimeout() -
getURLConnection
- Throws:
IOException
-
createContext
-